/* Variables */
:root {
    --primary-color: #28a745; /* Subtle Green */
    --secondary-color: #ffc107; /* Gold */
    --text-color: #333;
    --light-text-color: #666;
    --background-color: #f8f9fa;
    --white-color: #ffffff;
    --dark-color: #343a40;
    --border-color: #dee2e6;
    --font-family-base: 'Arial', sans-serif;
    --font-family-heading: 'Georgia', serif;
    --header-height: 80px;
    --topbar-height: 40px;
}

/* Basic Reset & Typography */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-family-base);
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--background-color);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.3s ease, text-decoration 0.3s ease;
}

a:hover {
    color: var(--dark-color);
    text-decoration: underline;
}

ul {
    list-style: none;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-family-heading);
    color: var(--dark-color);
    margin-bottom: 0.5em;
    line-height: 1.2;
}

p {
    margin-bottom: 1em;
}

/* Utility Classes */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

.btn {
    display: inline-block;
    padding: 10px 20px;
    border: 1px solid transparent;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    text-align: center;
    transition: all 0.3s ease;
}

.btn-primary {
    background-color: var(--primary-color);
    color: var(--white-color);
    border-color: var(--primary-color);
}

.btn-primary:hover {
    background-color: #218838; /* Darker green */
    border-color: #1e7e34;
    color: var(--white-color);
    text-decoration: none;
}

.btn-primary-outline {
    background-color: transparent;
    color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-primary-outline:hover {
    background-color: var(--primary-color);
    color: var(--white-color);
    text-decoration: none;
}

/* Header Styling */
.main-header {
    background-color: var(--white-color);
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-topbar {
    background-color: var(--dark-color);
    color: #f8f9fa;
    padding: 10px 0;
    font-size: 0.85rem;
}

.header-topbar .topbar-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-topbar .contact-info span {
    margin-right: 20px;
}

.header-topbar .contact-info i {
    margin-right: 5px;
    color: var(--secondary-color);
}

.header-topbar .social-links a {
    color: #f8f9fa;
    margin-left: 15px;
    font-size: 1rem;
}

.header-topbar .social-links a:hover {
    color: var(--secondary-color);
    text-decoration: none;
}

.header-main .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px;
}

.navbar-brand {
    display: flex;
    align-items: center;
}

.navbar-brand .logo {
    display: flex;
    align-items: center;
    font-size: 1.8rem;
    font-weight: bold;
    color: var(--dark-color);
    margin-right: 20px;
}

.navbar-brand .logo img {
    height: 50px;
    width: auto;
    margin-right: 10px;
    vertical-align: middle;
}

.navbar-brand .logo .site-name {
    color: var(--primary-color); /* Matches the logo prompt color */
    font-family: var(--font-family-heading);
}

.main-navigation {
    flex-grow: 1;
    text-align: center;
}

.nav-menu {
    display: flex;
    justify-content: center;
    gap: 25px;
    margin: 0;
    padding: 0;
}

.nav-item {
    position: relative;
}

.nav-link {
    display: block;
    padding: 10px 0;
    font-weight: 600;
    color: var(--text-color);
    transition: color 0.3s ease;
}

.nav-link:hover,
.nav-link.active {
    color: var(--primary-color);
    text-decoration: none;
}

.nav-item.has-dropdown > .nav-link i,
.nav-item.has-submenu > a i {
    margin-left: 5px;
    font-size: 0.8em;
}

.dropdown-menu, .submenu {
    position: absolute;
    top: 100%;
    left: 0;
    background-color: var(--white-color);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    min-width: 220px;
    z-index: 10;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease;
    border-radius: 5px;
    overflow: hidden;
}

.nav-item.has-dropdown:hover > .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-menu li, .submenu li {
    border-bottom: 1px solid var(--border-color);
}

.dropdown-menu li:last-child, .submenu li:last-child {
    border-bottom: none;
}

.dropdown-menu a, .submenu a {
    display: block;
    padding: 12px 18px;
    color: var(--text-color);
    white-space: nowrap;
}

.dropdown-menu a:hover, .submenu a:hover {
    background-color: var(--background-color);
    color: var(--primary-color);
    text-decoration: none;
}

.has-submenu {
    position: relative;
}

.submenu {
    left: 100%;
    top: 0;
}

.has-submenu:hover > .submenu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.menu-toggle {
    display: none; /* Hidden on desktop */
    background: none;
    border: none;
    cursor: pointer;
    padding: 10px;
    position: relative;
    z-index: 1001;
}

.menu-toggle .icon-bar {
    display: block;
    width: 25px;
    height: 3px;
    background-color: var(--dark-color);
    margin: 5px 0;
    transition: all 0.3s ease;
}

.menu-toggle.active .icon-bar:nth-child(1) {
    transform: rotate(-45deg) translate(-5px, 6px);
}
.menu-toggle.active .icon-bar:nth-child(2) {
    opacity: 0;
}
.menu-toggle.active .icon-bar:nth-child(3) {
    transform: rotate(45deg) translate(-5px, -6px);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

.search-box {
    position: relative;
}

.search-toggle {
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    color: var(--text-color);
    transition: color 0.3s ease;
}

.search-toggle:hover {
    color: var(--primary-color);
}

.search-form-wrapper {
    display: none; /* Hidden by default, toggled by JS */
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    background-color: var(--white-color);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    padding: 15px;
    border-radius: 5px;
    min-width: 280px;
    z-index: 10;
}

.search-form-wrapper.active {
    display: block;
}

.search-form {
    display: flex;
}

.search-form input[type="search"] {
    flex-grow: 1;
    padding: 10px 15px;
    border: 1px solid var(--border-color);
    border-radius: 5px 0 0 5px;
    outline: none;
    font-size: 0.95rem;
}

.search-form button {
    background-color: var(--primary-color);
    color: var(--white-color);
    border: 1px solid var(--primary-color);
    border-left: none;
    padding: 10px 15px;
    border-radius: 0 5px 5px 0;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.search-form button:hover {
    background-color: #218838;
}

/* Footer Styling */
.main-footer {
    background-color: var(--dark-color);
    color: #f8f9fa;
    padding: 50px 0 20px;
    font-size: 0.95rem;
}

.footer-widgets {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    margin-bottom: 30px;
}

.footer-widget {
    flex: 1;
    min-width: 250px;
    margin-bottom: 30px;
    padding-right: 20px;
}

.footer-widget:last-child {
    padding-right: 0;
}

.footer-widget h3 {
    color: var(--secondary-color);
    font-size: 1.3rem;
    margin-bottom: 20px;
    position: relative;
    padding-bottom: 10px;
}

.footer-widget h3::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 50px;
    height: 2px;
    background-color: var(--primary-color);
}

.footer-widget p {
    color: #ccc;
    margin-bottom: 15px;
}

.footer-widget address p {
    margin-bottom: 8px;
    display: flex;
    align-items: flex-start;
}

.footer-widget address i {
    margin-right: 10px;
    color: var(--primary-color);
    font-size: 1.1rem;
    margin-top: 3px;
}

.footer-widget a {
    color: #ccc;
}

.footer-widget a:hover {
    color: var(--primary-color);
    text-decoration: underline;
}

.footer-widget ul {
    margin: 0;
    padding: 0;
}

.footer-widget ul li {
    margin-bottom: 10px;
}

.footer-widget .social-icons a {
    display: inline-block;
    width: 38px;
    height: 38px;
    line-height: 38px;
    text-align: center;
    border-radius: 50%;
    background-color: #495057;
    color: var(--white-color);
    margin-right: 10px;
    transition: background-color 0.3s ease;
}

.footer-widget .social-icons a:hover {
    background-color: var(--primary-color);
    text-decoration: none;
}

.newsletter-form {
    display: flex;
    margin-top: 15px;
}

.newsletter-form input[type="email"] {
    flex-grow: 1;
    padding: 12px 15px;
    border: 1px solid #6c757d;
    border-radius: 5px 0 0 5px;
    background-color: #495057;
    color: var(--white-color);
    outline: none;
    font-size: 0.95rem;
}

.newsletter-form input[type="email"]::placeholder {
    color: #adb5bd;
}

.newsletter-form button {
    border-radius: 0 5px 5px 0;
    padding: 12px 18px;
    font-size: 0.9rem;
}

.payment-methods {
    margin-top: 25px;
}

.payment-methods h4 {
    color: var(--white-color);
    font-size: 1.1rem;
    margin-bottom: 10px;
}

.payment-methods img {
    margin-right: 10px;
    max-height: 28px;
    filter: grayscale(100%) brightness(150%);
    transition: filter 0.3s ease;
    vertical-align: middle;
}

.payment-methods img:hover {
    filter: grayscale(0%) brightness(100%);
}

.footer-bottom {
    border-top: 1px solid #495057;
    padding-top: 20px;
    text-align: center;
    font-size: 0.85rem;
    color: #adb5bd;
}

.footer-bottom p {
    margin-bottom: 8px;
}

.footer-bottom a {
    color: var(--primary-color);
}

/* Scroll to Top Button */
#scroll-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background-color: var(--primary-color);
    color: var(--white-color);
    width: 45px;
    height: 45px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.3s ease;
    border: none;
    z-index: 999;
}

#scroll-to-top.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

#scroll-to-top:hover {
    background-color: #218838;
}

/* Responsive Design */
@media (max-width: 992px) {
    .header-main .container {
        flex-wrap: wrap;
        justify-content: center;
    }

    .navbar-brand {
        width: 100%;
        justify-content: center;
        margin-bottom: 15px;
    }

    .header-actions {
        order: 3;
        width: 100%;
        justify-content: center;
        gap: 10px;
    }

    .menu-toggle {
        display: block;
        order: 2;
        margin-left: auto;
    }

    .main-navigation {
        display: none; /* Hide nav on smaller screens, toggle with JS */
        flex-direction: column;
        width: 100%;
        position: absolute;
        top: calc(var(--header-height) + var(--topbar-height)); /* Adjust for topbar */
        left: 0;
        background-color: var(--white-color);
        box-shadow: 0 5px 15px rgba(0,0,0,0.1);
        padding: 15px 0;
        text-align: left;
        max-height: calc(100vh - var(--header-height) - var(--topbar-height));
        overflow-y: auto;
    }

    .main-navigation.active {
        display: flex;
    }

    .nav-menu {
        flex-direction: column;
        gap: 0;
    }

    .nav-item {
        width: 100%;
        border-bottom: 1px solid var(--border-color);
    }

    .nav-item:last-child {
        border-bottom: none;
    }

    .nav-link {
        padding: 12px 20px;
    }

    .dropdown-menu, .submenu {
        position: static;
        box-shadow: none;
        transform: none;
        opacity: 1;
        visibility: visible;
        background-color: #f0f0f0;
        padding-left: 25px;
        min-width: unset;
        display: none; /* Toggle with JS */
        border-radius: 0;
    }

    .dropdown-menu.active, .submenu.active {
        display: block;
    }

    .has-dropdown > .nav-link, .has-submenu > a {
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

    .search-form-wrapper {
        width: 100%;
        right: auto;
        left: 0;
        min-width: unset;
    }

    .header-topbar .topbar-content {
        flex-direction: column;
        text-align: center;
    }
    .header-topbar .contact-info span {
        margin: 5px 0;
    }
    .header-topbar .social-links {
        margin-top: 10px;
    }

    .footer-widget {
        flex: 1 1 45%; /* Two columns */
        padding-right: 15px;
    }
    .footer-widget:nth-child(2n) {
        padding-right: 0;
    }
}

@media (max-width: 768px) {
    .header-main .container {
        padding: 10px 15px;
    }
    .navbar-brand {
        margin-bottom: 10px;
    }
    .menu-toggle {
        position: static;
        margin-left: auto;
    }

    .footer-widget {
        flex: 1 1 100%; /* Single column */
        padding-right: 0;
    }
}

/* Font Awesome */
@import url('https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/all.min.css');
/* 移动端内容区防溢出（系统追加，请勿删除） */
@media (max-width: 768px) {
  .page-content img {
    max-width: 100% !important;
    height: auto !important;
    display: block;
  }
  .page-content {
    overflow-x: hidden;
    max-width: 100%;
  }
  body {
    overflow-x: hidden;
  }
}
