/* =========================================================
   好物推薦網 — main.css
   全站共用樣式：變數、Reset、Navbar、Offcanvas、Section 共用、
   Footer、ScrollTop、Toast、Utilities、Responsive 基礎
   ========================================================= */

/* ===== BOTANICAL GARDEN DESIGN SYSTEM ===== */
:root {
    --color-primary: #4a7c59;
    --color-primary-dark: #3a6347;
    --color-primary-light: #6b9e7a;
    --color-secondary: #8ab598;
    --color-cta: #f9a620;
    --color-cta-dark: #e08f10;
    --color-accent: #b7472a;
    --color-bg: #f5f3ed;
    --color-text: #2d2a26;
    --color-text-muted: #7a7468;
    --color-success: #4a7c59;
    --color-surface: #FFFFFF;
    --color-border: #e4dfd5;
    --font-heading: 'DM Serif Display', 'Noto Sans TC', serif;
    --font-body: 'Noto Sans TC', sans-serif;
    --shadow-sm: 0 1px 3px rgba(45, 42, 38, 0.06);
    --shadow-md: 0 4px 14px rgba(45, 42, 38, 0.08);
    --shadow-lg: 0 8px 30px rgba(45, 42, 38, 0.1);
    --radius: 12px;
    --radius-lg: 16px;
}

/* ===== RESET ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-body);
    background-color: var(--color-bg);
    color: var(--color-text);
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-heading);
    font-weight: 400;
    color: var(--color-text);
}

a {
    text-decoration: none;
    transition: color 0.2s ease;
}

/* ===== SECTION DIVIDER ===== */
.section-divider {
    display: block;
    margin: 0 auto;
    height: 3px;
    border: none;
    background: linear-gradient(90deg, transparent, var(--color-primary-light), var(--color-cta), var(--color-primary-light), transparent);
    opacity: 0.35;
}

/* ===== NAVBAR ===== */
.navbar {
    background: var(--color-bg);
    border-bottom: 1px solid var(--color-border);
    padding: 0.75rem 0;
    transition: box-shadow 0.3s ease;
}

@media (min-width: 992px) {
    .navbar {
        background: rgba(245, 243, 237, 0.92);
        backdrop-filter: blur(12px);
        -webkit-backdrop-filter: blur(12px);
    }
}

.navbar.scrolled {
    box-shadow: var(--shadow-md);
}

.navbar-brand {
    font-family: var(--font-heading);
    font-weight: 400;
    font-size: 1.4rem;
    color: var(--color-primary) !important;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.navbar-brand .brand-icon {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--color-primary), var(--color-primary-light));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1rem;
}

.nav-link {
    font-weight: 500;
    color: var(--color-text) !important;
    padding: 0.5rem 1rem !important;
    border-radius: 8px;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.nav-link:hover {
    background-color: rgba(74, 124, 89, 0.08);
    color: var(--color-primary) !important;
}

.nav-link i {
    font-size: 1rem;
    vertical-align: -1px;
}

.btn-cta-nav {
    background: var(--color-cta);
    color: #fff !important;
    border: none;
    padding: 0.5rem 1.25rem !important;
    border-radius: 50px;
    font-weight: 600;
    transition: background-color 0.2s ease, transform 0.2s ease;
    cursor: pointer;
}

.btn-cta-nav:hover {
    background: var(--color-cta-dark);
    color: #fff !important;
    transform: translateY(-1px);
}

.btn-cta-nav:active,
.btn-cta-nav:focus {
    background: var(--color-cta-dark) !important;
    color: #fff !important;
}

.btn-cta-nav {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
}

/* ===== OFFCANVAS (Mobile — below lg) ===== */
@media (max-width: 991.98px) {
    #mainMenu {
        max-width: 300px;
        border-right: none;
        box-shadow: var(--shadow-lg);
    }

    .offcanvas-header {
        background: linear-gradient(135deg, var(--color-primary-dark), var(--color-primary));
        color: #fff;
        padding: 1.25rem 1.5rem;
    }

    .offcanvas-header .btn-close {
        filter: brightness(0) invert(1);
        opacity: 0.8;
    }

    .offcanvas-header .btn-close:hover {
        opacity: 1;
    }

    .offcanvas-title {
        font-family: var(--font-heading);
        font-weight: 400;
        font-size: 1.2rem;
        display: flex;
        align-items: center;
        gap: 0.5rem;
    }

    .offcanvas-body {
        padding: 1rem 0;
    }

    .offcanvas-body .nav-link {
        padding: 0.85rem 1.5rem !important;
        border-radius: 0;
        font-size: 1rem;
        border-bottom: 1px solid var(--color-border);
        display: flex;
        align-items: center;
        gap: 0.75rem;
    }

    .offcanvas-body .nav-item:last-child .nav-link,
    .offcanvas-body .btn-cta-nav {
        border-bottom: none;
    }

    .offcanvas-body .nav-link i {
        font-size: 1.2rem;
        color: var(--color-primary);
        width: 24px;
        text-align: center;
    }

    .offcanvas-body .nav-link:hover {
        background-color: rgba(74, 124, 89, 0.06);
        border-radius: 0;
    }

    .offcanvas-body .btn-cta-nav {
        display: block;
        text-align: center;
        margin: 1rem 1.5rem;
        width: auto;
    }
}

/* ===== SECTION COMMON ===== */
.section {
    padding: 4.5rem 0;
}

.section-header {
    text-align: center;
    margin-bottom: 3rem;
}

.section-header h2 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.section-header p {
    color: var(--color-text-muted);
    font-size: 1.05rem;
    max-width: 560px;
    margin: 0 auto;
}

.section-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: rgba(74, 124, 89, 0.1);
    color: var(--color-primary);
    font-weight: 600;
    font-size: 0.78rem;
    padding: 0.35rem 1rem;
    border-radius: 50px;
    margin-bottom: 0.75rem;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.section-badge i {
    font-size: 0.85rem;
}

/* ===== FOOTER ===== */
.footer {
    background: #1e3329;
    color: #b8c9be;
    padding: 3.5rem 0 0;
}

.footer h6 {
    color: #fff;
    font-family: var(--font-heading);
    font-weight: 400;
    font-size: 1.05rem;
    margin-bottom: 1.25rem;
}

.footer-brand {
    color: #fff;
    font-family: var(--font-heading);
    font-weight: 400;
    font-size: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.footer-brand .brand-icon {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, var(--color-primary), var(--color-primary-light));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    color: #fff;
}

.footer-desc {
    font-size: 0.88rem;
    line-height: 1.7;
    max-width: 300px;
}

.footer-links {
    list-style: none;
    padding: 0;
}

.footer-links li {
    margin-bottom: 0.6rem;
}

.footer-links a {
    color: #8fa898;
    font-size: 0.88rem;
    transition: color 0.2s ease, padding-left 0.2s ease;
    cursor: pointer;
}

.footer-links a:hover {
    color: #fff;
    padding-left: 4px;
}

.footer-social {
    display: flex;
    gap: 0.75rem;
    margin-top: 1rem;
}

.footer-social a {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.07);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #8fa898;
    font-size: 1.1rem;
    transition: background 0.2s ease, color 0.2s ease;
    cursor: pointer;
}

.footer-social a:hover {
    background: var(--color-primary);
    color: #fff;
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding: 1.25rem 0;
    margin-top: 2.5rem;
    text-align: center;
    font-size: 0.82rem;
    color: #5e7a68;
}

/* ===== SCROLL TO TOP ===== */
.btn-scroll-top {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--color-primary);
    color: #fff;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    box-shadow: var(--shadow-md);
    cursor: pointer;
    transition: opacity 0.3s ease, transform 0.3s ease, background 0.2s ease;
    opacity: 0;
    transform: translateY(10px);
    pointer-events: none;
    z-index: 1040;
}

.btn-scroll-top.visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.btn-scroll-top:hover {
    background: var(--color-primary-dark);
    transform: translateY(-2px);
}

/* ===== TOAST ===== */
.toast-copied {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: var(--color-text);
    color: #fff;
    padding: 0.6rem 1.25rem;
    border-radius: 50px;
    font-size: 0.88rem;
    font-weight: 500;
    box-shadow: var(--shadow-lg);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease, transform 0.3s ease;
    z-index: 1050;
}

.toast-copied.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ===== UTILITIES ===== */
.text-gradient {
    background: linear-gradient(135deg, var(--color-cta), #fcd34d);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.btn-outline-botanical {
    color: var(--color-primary);
    border: 2px solid var(--color-primary);
    background: transparent;
    padding: 0.55rem 1.75rem;
    border-radius: 50px;
    font-weight: 600;
    font-size: 0.95rem;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-outline-botanical:hover {
    background: var(--color-primary);
    color: #fff;
    transform: translateY(-1px);
}

/* ===== RESPONSIVE (Global) ===== */
@media (max-width: 767.98px) {
    .section {
        padding: 3rem 0;
    }

    .section-header h2 {
        font-size: 1.6rem;
    }
}

/* ===== REDUCED MOTION ===== */
@media (prefers-reduced-motion: reduce) {
    * {
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
    }
}
