/* --- Global Styles --- */
body {
    font-family: 'Noto Serif TC', serif; /* 使用思源宋體，更具古典美感 */
    margin: 0;
    padding: 0;
    color: #333; /* 深灰色文字，避免純黑的生硬感 */
    line-height: 1.6;
    font-size: 18px; /* Increase base font size */
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

a {
    text-decoration: none;
    color: #ffffff;
    transition: color 0.3s ease;
}

a:hover {
    color: #a38a6d; /* 帶有茶色的懸停效果 */
}

h2 {
    text-align: center;
    margin-top: 2rem;
    font-weight: bold; /* 較細的字重，更顯優雅 */
}

/* --- Loader --- */
#loader-wrapper {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #fff;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

#loader-wrapper.hidden {
    opacity: 0;
    visibility: hidden;
}

.loader-logo {
    animation: fadeIn 1.5s ease-in-out;
}

.loader-logo img {
    max-width: 200px;
    height: auto;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #a38a6d;
    border-top: 4px solid transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-top: 20px;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* --- Header & Navigation --- */
header {
    padding: 1rem 2rem;
    border-bottom: 1px solid #eee;
    background-image: url('../../images/ft_bg2.png');
    background-size: cover;
    background-position: center 90%;
    position: fixed; /* Stick to the top */
    top: 0;
    left: 0;
    width: 100%;
    box-sizing: border-box;
    z-index: 10;
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
}

nav .logo img {
    height: 95px;
    width: auto;
}

nav ul {
    list-style: none;
    display: flex;
    gap: 2rem;
    margin: 0;
    padding: 0;
    flex-grow: 1;
    justify-content: center;
}

.header-icons {
    display: flex;
    gap: 1.5rem;
    align-items: center;
    margin-left: auto;
}

.header-icons a {
    color: #fff;
    font-size: 1.2rem;
    transition: color 0.3s ease;
}

.header-icons a:hover {
    color: #a38a6d;
}

.search-container {
    display: none; /* Hide by default */
    position: absolute;
    top: 100%; /* Position below the header */
    left: 0;
    width: 100%;
    background-color: rgba(0, 0, 0, 0.8); /* Semi-transparent background */
    padding: 1rem;
    box-sizing: border-box;
}

.search-container.active {
    display: block; /* Show when active */
}

.search-bar {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #fff;
    background: transparent;
    color: #fff;
    outline: none;
}

.highlight {
    background-color: yellow;
    font-weight: bold;
}

/* --- Cart Overlay --- */
.cart-overlay {
    position: fixed;
    top: 0;
    right: -100%;
    width: 300px;
    height: 100%;
    background-color: #fff;
    box-shadow: -5px 0 15px rgba(0,0,0,0.2);
    transition: right 0.3s ease;
    z-index: 20;
}

.cart-overlay.active {
    right: 0;
}

.cart-content {
    padding: 2rem;
}

.close-cart-btn {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    font-size: 2rem;
    cursor: pointer;
}

/* --- Main Content --- */
main {
    background-color: #fdfdfd;
    min-height: 70vh; /* 確保主要內容區域有足夠高度 */
}

/* --- Footer --- */
footer {
    padding: 1rem 2rem;
    border-top: 1px solid #eee;
    background-image: url('../../images/14578914_2.png');
    background-size: cover;
    background-position: center;
    font-size: 0.9rem;
    color: #fff;
    margin-top: auto;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: center; /* Center the main content block */
    align-items: center;
    position: relative; /* Needed for absolute positioning of child */
}

.footer-center-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.8rem;
}

.social-links a {
    margin: 0 0.75rem;
    font-size: 1.75rem;
}

.footer-links {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.footer-links a,
.footer-links span {
    color: #fff;
    text-decoration: none;
}

.footer-links a:hover {
    color: #a38a6d;
}

.copyright {
    margin: 0;
}

.footer-info {
    position: absolute;
    right: 0; /* Align to the right of footer-content */
    top: 50%; /* Center vertically */
    transform: translateY(-50%); /* Adjust for exact vertical centering */
    text-align: right;
}

.footer-info p {
    margin: 0.1rem 0;
    font-size: 0.8rem;
}

/* --- Hero Section & Carousel --- */
.hero {
    position: relative;
    height: 600px; /* 設定一個高度 */
    overflow: hidden;
}

.carousel {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.carousel-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 1.5s ease-in-out; /* 淡入淡出效果 */
}

.carousel-slide.active {
    opacity: 1;
}

.carousel-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* 確保圖片填滿容器且不變形 */
}

.hero-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 5;
    display: flex;
    align-items: center;
    gap: 2rem;
    max-width: 1200px;
    width: 100%;
    padding: 2rem;
    box-sizing: border-box;
}

.hero-image {
    max-width: 40%;
    height: auto;
}

.hero-text {
    color: #333;
    text-shadow: 1px 1px 10px rgba(255,255,255,0.5);
}

.hero-text h1 {
    font-size: 3rem;
    margin-bottom: 0.5rem;
}

.hero-text p {
    font-size: 1.2rem;
}


/* --- Main Carousel --- */
.main-carousel {
    height: 90vh; /* Set height to 80% of the viewport height */
}

.carousel-cell {
    width: 100%;
    height: 100%;
    background-repeat: no-repeat;
    background-size: cover;
    background-position: center 10%;
}

/* --- About Section --- */
.about-section {
    padding: 4rem 2rem;
}

.about-content {
    display: flex;
    align-items: center;
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.about-image {
    max-width: 50%;
    height: auto;
    transition: transform 0.3s ease;
    box-shadow: 0 10px 20px rgba(0,0,0,0.2);
}

.about-image:hover {
    transform: scale(1.05);
}

/* --- About Page --- */
.about-page-section {
    padding: 4rem 2rem 1rem 2rem;
}

.shop-section {
    padding: 1rem 2rem;
}

.about-page-section h1 {
    text-align: center;
    margin-bottom: 2rem;
}

.page-title {
    text-align: center;
    margin-bottom: 2rem;
    margin-top: 2rem; /* Adjusted top margin */
    font-family: 'Noto Serif TC', serif;
}

.about-content-grid {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 2rem;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
}

.about-founder-image {
    width: 100%;
    height: auto;
    box-shadow: 0 10px 20px rgba(0,0,0,0.2);
}

.about-text p,
.design-philosophy-section p {
    text-align: justify;
}

.design-philosophy-section {
    padding: 4rem 2rem;
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
}

.design-philosophy-image {
    width: 100%;
    height: auto;
    margin-top: 2rem;
    box-shadow: 0 10px 20px rgba(0,0,0,0.2);
}

/* --- News Section --- */
.news-background {
    height: 200px; /* Adjust height as needed */
    background-image: url('../../images/ft_bg.jpg');
    background-size: cover;
    background-position: center;
}

.news-section {
    padding: 4rem 2rem;
    text-align: center;
}

.news-section h2 {
    font-size: 2.5rem;
    margin-bottom: 2rem;
}

.news-carousel {
    width: 80%;
    margin: 0 auto 0 5rem; /* 移除頂部邊距並保持左邊距 */
}

.news-carousel .carousel-cell {
    width: 100%;
    height: 500px; /* Increased height to accommodate figcaption */
    margin-right: 10px;
}

.news-carousel .carousel-cell figure {
    margin: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.news-carousel .carousel-cell img {
    width: 100%;
    height: 450px; /* Set a fixed height for the image */
    object-fit: cover;
    object-position: top; /* Prioritize the top of the image */
}

.news-carousel .carousel-cell figcaption {
    text-align: center;
    padding: 10px;
    background-color: rgba(0, 0, 0, 0.5);
    color: white;
}

.news-container {
    display: flex;
    gap: 2rem;
    margin-top: 2rem;
    align-items: center;
}

.news-carousel {
    flex: 1;
}

.facebook-embed {
    flex: 1;
}

/* --- Hamburger Menu --- */
.hamburger-menu {
    display: none;
    cursor: pointer;
    font-size: 1.5rem;
    color: #fff;
}

/* --- Mobile Navigation Overlay --- */
.mobile-nav-overlay {
    height: 100%;
    width: 0;
    position: fixed;
    z-index: 15;
    top: 0;
    left: 0;
    background-image: url('../../images/texture2.png');
    background-size: cover;
    overflow-x: hidden;
    transition: 0.5s;
    box-shadow: 5px 0 15px rgba(0,0,0,0.2);
}

.mobile-nav-content {
    position: relative;
    top: 15%;
    width: 100%;
    text-align: center;
    margin-top: 0;
}

.mobile-nav-overlay a {
    padding: 8px;
    text-decoration: none;
    font-size: 36px;
    color: #818181;
    display: block;
    transition: 0.3s;
}

.mobile-nav-content a {
    border-bottom: 1px solid #ccc;
}

.mobile-nav-content > a:last-of-type {
    border-bottom: none;
}

.mobile-nav-overlay a:hover, .mobile-nav-overlay a:focus {
    color: #a38a6d;
}

.mobile-nav-overlay .close-btn {
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 60px;
}

/* --- Responsive Design --- */
@media (max-width: 768px) {
    .search-container {
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background: rgba(0,0,0,0.9);
        padding: 1rem;
        box-sizing: border-box;
        transform: translateY(-100%);
        transition: transform 0.3s ease, visibility 0.3s ease;
        visibility: hidden;
        z-index: 9;
    }

    .search-container.active {
        transform: translateY(0);
        visibility: visible;
    }

    .search-bar {
        width: 100%;
        padding: 0.5rem;
        border: 1px solid #fff;
        background: transparent;
        color: #fff;
        outline: none;
    }

    .about-content {
        flex-direction: column;
    }

    .about-image {
        max-width: 100%;
    }

    .main-carousel {
        height: 90vw;
    }

    .carousel-cell {
        background-size: contain;
        background-position: center 100%;
        background-repeat: no-repeat;
    }

    .desktop-nav {
        display: none;
    }

    .hamburger-menu {
        display: block;
        position: absolute;
        left: 2rem;
        top: 50%;
        transform: translateY(-50%);
    }

    nav {
        position: relative;
        justify-content: center;
    }

    .logo {
        position: absolute;
        left: 50%;
        transform: translateX(-50%);
    }

    .header-icons {
        margin-right: 2rem;
    }

    .search-container.active .search-bar {
        width: 100%;
    }

    header {
        padding: 2rem 0;
        background-color: rgba(255, 255, 255, 0.8); /* 在行動裝置上給予半透明背景 */
    }
    main {
        /* padding: 1rem; */
    }
    .hero {
        height: 400px;
    }
    .hero-text h1 {
        font-size: 2rem;
    }
    .home-page .main-carousel {
        margin-top: 0;
    }
    .home-page main {
        padding-top: 0;
    }
}

/* --- Dropdown Menu --- */
.dropdown {
    position: relative;
    display: inline-block;
}

.dropbtn {
    cursor: default;
}

.dropdown-content {
    display: none;
    position: absolute;
    left: 50%;
    transform: translate(-50%, -10px);
    background-image: url('../../images/ft_bg.jpg');
    background-size: cover;
    min-width: 160px;
    box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
    z-index: 1;
    border-radius: 5px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease;
}

.dropdown-content a {
    color: white;
    padding: 12px 16px;
    text-decoration: none;
    display: block;
}

.dropdown-content a:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: #a38a6d;
}

.dropdown:hover .dropdown-content {
    display: block;
    opacity: 0.9;
    visibility: visible;
    transform: translate(-50%, 0);
}

/* --- Clothing Gallery --- */
.clothing-gallery {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    padding: 2rem 0;
}

.clothing-gallery img {
    width: 100%;
    object-fit: cover;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    aspect-ratio: 1 / 1;
}

.product-gallery {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    padding: 2rem 0;
}

.product-gallery img {
    width: 100%;
    object-fit: cover;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    aspect-ratio: 1 / 1;
}

.clothing-text {
    padding: 0;
    text-align: center;
}

/* --- Tea Section --- */
.tea-section {
    display: grid;
    grid-template-columns: 1.5fr 2fr; /* Image on left, text on right */
    grid-template-areas: "image description";
    gap: 1rem;
    margin-bottom: 1rem;
    align-items: center; /* Vertically align items */
}

.tea-section img {
    grid-area: image;
    width: 100%;
    object-fit: cover;
    aspect-ratio: 1 / 1;
    box-shadow: 0 10px 20px rgba(0,0,0,0.2);
}

.tea-description {
    grid-area: description;
    padding: 1rem;
    background-color: #f9f9f9;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    text-align: left;
}

.tea-description h3 {
    margin-top: 0;
    text-align: center;
}

.tea-section.reverse {
    grid-template-areas: "description image"; /* Text on left, image on right */
    grid-template-columns: 2fr 1.5fr; /* Ensure image column has 1.5fr width */
}

@media (max-width: 768px) {
    .tea-section,
    .tea-section.reverse {
        grid-template-columns: 1fr;
        grid-template-areas:
            "image"
            "description"; /* Stack image then text on mobile */
    }
}



.ceramics-background {
    background-image: url('../../images/texture2.png');
    background-repeat: repeat-y;
    background-size: 100% auto;
}

.contact-info {
    padding: 1rem 0;
}

.contact-details a {
    color: #333;
}

.contact-entry {
    display: flex;
    gap: 2rem;
    align-items: center;
    margin-bottom: 2rem;
}

.contact-details {
    flex: 1;
}

.contact-map {
    flex: 1;
}

.section-title {
    font-size: 2.5rem;
}

/* --- Products Section --- */
.products-section {
    padding: 4rem 2rem;
    text-align: center;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    max-width: 1200px;
    margin: 2rem auto 0;
}

.product-card {
    background: #fff;
    padding: 1rem;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
    min-height: 650px; /* Increased to make the card longer */
}

.product-card:hover {
    transform: translateY(-10px);
}

.product-card img {
    width: 100%;
    height: 450px; /* Fixed height for consistency */
    object-fit: cover; /* Ensures the image covers the area, cropping if necessary */
}

.product-card h3 {
    margin: 1rem 0;
}

.product-card p {
    margin: 0.2rem 0;
}

.product-card .btn {
    margin-top: 1rem;
}

.btn {
    display: inline-block;
    padding: 0.5rem 1rem;
    background: #a38a6d;
    color: #fff; /* Changed from #333 */
    border-radius: 5px;
    text-decoration: none;
    transition: background 0.3s ease;
    font-size: 1.2rem; /* Added from submit-btn */
    border: none; /* Added from submit-btn */
    cursor: pointer; /* Added from submit-btn */
    font-weight: bold; /* Added for consistency */
}

.btn:hover {
    background: #333;
}

.home-page .main-carousel {
    margin-top: 0;
}

body:not(.home-page) main {
    padding-top: 100px;
}

.products-background {
    height: 20px;
    border-bottom: 1px solid #ccc;
    margin-bottom: 2rem;
}

/* --- Shopping Guide --- */
.shopping-guide {
    padding-left: 5rem;
    padding-right: 5rem;
}

.accordion {
    max-width: 100%;
    margin: 0 auto;
}

.accordion-item {
    border-bottom: 1px solid #ddd;
}

.accordion-button {
    width: 100%;
    background-color: transparent;
    border: none;
    text-align: left;
    padding: 1rem;
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.accordion-button h3 {
    margin: 0;
    font-family: 'Noto Serif TC', serif;
}

.accordion-button .icon {
    font-size: 1.5rem;
    transition: transform 0.3s ease;
}

.accordion-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    padding: 0 1rem;
}

/* --- Contact Form --- */
.contact-form-section {
    padding: 2rem; /* Adjusted padding */
    background-color: rgba(249, 249, 249, 0.8);
    border-radius: 10px; /* Added rounded corners */
    margin: 2rem auto; /* Center the section and add vertical margin */
    max-width: 600px; /* Reduced width for smaller margins */
}

.contact-form-section .container {
    /* max-width is now handled by .contact-form-section */
    margin: 0 auto;
    text-align: center;
}

.contact-form {
    margin-top: 2rem;
    text-align: left;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: bold;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 0.8rem;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 1rem;
    box-sizing: border-box;
}

.submit-btn {
    display: block;
    width: 100%;
    padding: 1rem;
    background-color: #a38a6d;
    color: #fff;
    border: none;
    border-radius: 5px;
    font-size: 1.2rem;
    cursor: pointer;
    transition: background-color 0.3s ease;
    box-sizing: border-box;
}

.submit-btn:hover {
    background-color: #333;
}

/* --- Back to Top Button & Social Icons --- */
#backToTopBtn {
    display: none;
    position: fixed;
    bottom: 20px;
    right: 30px;
    z-index: 99;
    border: none;
    outline: none;
    background-color: #a38a6d;
    color: white;
    cursor: pointer;
    padding: 15px;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    font-size: 20px;
    line-height: 1;
    transition: background-color 0.3s ease;
}

#backToTopBtn:hover {
    background-color: #333;
}

.social-icons-fixed {
    position: fixed;
    bottom: 80px;
    right: 30px;
    z-index: 99;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.social-icons-fixed a {
    color: #a38a6d;
    font-size: 2rem;
    background-color: white;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    display: flex;
    justify-content: center;
    align-items: center;
    text-decoration: none;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.social-icons-fixed a:hover {
    background-color: #a38a6d;
    color: white;
}

@media (max-width: 768px) {
    .about-page-section {
        padding: 2rem 1rem;
    }

    .clothing-gallery,
    .product-gallery {
        padding: 1rem 0;
    }

    .about-content {
        flex-direction: column;
    }

    .about-image {
        max-width: 100%;
    }

    .main-carousel {
        height: 90vw;
    }

    .carousel-cell {
        background-size: contain;
        background-position: center 100%;
        background-repeat: no-repeat;
    }

    .desktop-nav {
        display: none;
    }

    .hamburger-menu {
        display: block;
        position: absolute;
        left: 2rem;
        top: 50%;
        transform: translateY(-50%);
    }

    nav {
        position: relative;
        justify-content: center;
    }

    .logo {
        position: absolute;
        left: 50%;
        transform: translateX(-50%);
    }

    .header-icons {
        margin-right: 2rem;
    }

    .search-container.active .search-bar {
        width: 120px;
    }

    header {
        padding: 2rem 0;
        background-color: rgba(255, 255, 255, 0.8); /* 在行動裝置上給予半透明背景 */
    }
    main {
        /* padding: 1rem; */
    }
    .hero {
        height: 400px;
    }
    .hero-text h1 {
        font-size: 2rem;
    }
    .home-page .main-carousel {
        margin-top: 0;
    }
    .home-page main {
        padding-top: 0;
    }

    .products-grid {
        grid-template-columns: 1fr;
    }

    .news-container {
        flex-direction: column;
    }

    .news-carousel {
        width: 100%;
        margin: 0 auto;
    }

    .clothing-gallery {
        grid-template-columns: 1fr;
    }

    .footer-content {
        flex-direction: column;
        gap: 1rem;
    }

    .footer-info {
        position: static;
        transform: none;
        text-align: center;
        order: -1;
    }

    .footer-center-content {
        order: 0;
    }

    

    .tea-image {
        max-width: 100%;
    }

    .about-content-grid {
        grid-template-columns: 1fr;
    }

    .about-founder-image {
        max-width: 80%;
        margin: 0 auto;
        display: block;
    }
}
