/* General Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'PingFang HK', 'Helvetica Neue', Helvetica, 'Microsoft YaHei', Arial, sans-serif;
}

body {
    background-color: #f8f8f8;
    color: #333;
    line-height: 1.6;
}

a {
    text-decoration: none;
    color: inherit;
}

ul {
    list-style: none;
}

.product-link {
    color: inherit;
    display: block;
}

.product-title .product-link {
    display: inline;
}

.product-card .product-link:focus-visible {
    outline: 2px solid #2e8b57;
    outline-offset: 2px;
    border-radius: 4px;
}

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

/* Header Top */
.header-top {
    background-color: #f1f1f1;
    font-size: 13px;
    padding: 8px 0;
    color: #666;
}

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

.header-links a {
    margin-left: 15px;
    transition: color 0.3s;
}

.header-links a:hover {
    color: #2e8b57;
}

/* Header Main */
.header-main {
    background-color: #fff;
    padding: 20px 0;
    border-bottom: 1px solid #eee;
}

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

.logo a {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo img {
    max-height: 60px;
}

.site-title {
    font-size: 28px;
    font-weight: bold;
    color: #2e8b57;
    letter-spacing: 2px;
}

.search-bar {
    display: flex;
    flex: 1;
    max-width: 500px;
    margin: 0 40px;
    border: 2px solid #2e8b57;
    border-radius: 25px;
    overflow: hidden;
}

.search-bar input {
    flex: 1;
    padding: 10px 20px;
    border: none;
    outline: none;
    font-size: 14px;
}

.search-bar button {
    background-color: #2e8b57;
    color: #fff;
    border: none;
    padding: 0 20px;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.3s;
}

.search-bar button:hover {
    background-color: #246d44;
}

.header-actions .cart-icon a {
    font-size: 24px;
    color: #333;
    position: relative;
    display: flex;
    align-items: center;
}

.cart-count {
    background-color: #e74c3c;
    color: white;
    font-size: 12px;
    font-weight: bold;
    border-radius: 50%;
    padding: 2px 6px;
    position: absolute;
    top: -8px;
    right: -10px;
}

/* Header Navigation */
.header-nav {
    background-color: #fff;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    position: relative;
    z-index: 100;
}

.nav-list {
    display: flex;
    justify-content: center;
}

.nav-item {
    position: relative;
}

.nav-item > a {
    display: block;
    padding: 15px 25px;
    text-align: center;
    font-size: 16px;
    font-weight: 500;
    color: #333;
    transition: color 0.3s, background-color 0.3s;
    line-height: 1.2;
}

.nav-item > a .sub-nav {
    font-size: 12px;
    color: #888;
    font-weight: normal;
}

.nav-item:hover > a {
    color: #2e8b57;
    background-color: #f9f9f9;
}

/* Dropdown Menu */
.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background-color: #fff;
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    padding: 25px;
    display: flex;
    gap: 20px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    border-top: 3px solid #2e8b57;
    z-index: 1000;
    border-radius: 0 0 8px 8px;
    transform: translateY(10px);
}

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

.dropdown-menu.multi-column {
    width: max-content;
    max-width: 100vw;
    left: -150px; /* Adjust this to center align better relative to the nav item */
}

/* Ensure container context allows relative positioning */
.header-nav .container {
    position: relative;
}

.dropdown-menu.single-column {
    min-width: 220px;
    padding: 15px 0;
    flex-direction: column;
    left: 50%;
    transform: translateX(-50%) translateY(10px);
}

.nav-item:hover .dropdown-menu.single-column {
    transform: translateX(-50%) translateY(0);
}

.dropdown-column {
    flex: 1;
    min-width: 200px;
}

.dropdown-column h4 {
    font-size: 16px;
    color: #2e8b57;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 2px solid #f1f1f1;
    white-space: nowrap;
}

.dropdown-column h4 a {
    color: #2e8b57;
    transition: color 0.2s;
}

.dropdown-column h4 a:hover {
    color: #1e5c39;
}

.dropdown-column ul li {
    margin-bottom: 10px;
}

.dropdown-column ul li a {
    font-size: 14px;
    color: #555;
    transition: all 0.2s ease;
    white-space: nowrap;
    display: block;
}

.dropdown-column ul li a:hover {
    color: #2e8b57;
    padding-left: 8px;
    background: transparent;
}

.dropdown-menu.single-column ul li {
    margin-bottom: 0;
}

.dropdown-menu.single-column ul li a {
    padding: 10px 20px;
    display: block;
    white-space: nowrap;
    border-left: 3px solid transparent;
}

.dropdown-menu.single-column ul li a:hover {
    background-color: #f8fcf9;
    padding-left: 20px;
    border-left: 3px solid #2e8b57;
}

/* Hero Section */
.hero-banner {
    width: 100%;
    height: 630px;
    background-color: #e9ecef;
    overflow: hidden;
    position: relative;
}

.hero-slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    transition: opacity 800ms ease;
}

.hero-slide.is-active {
    opacity: 1;
}

.hero-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hero-text {
    position: absolute;
    text-align: center;
    color: #fff;
    text-shadow: 1px 1px 5px rgba(0,0,0,0.5);
}

.hero-text h1 {
    font-size: 48px;
    margin-bottom: 10px;
}

.hero-text p {
    font-size: 20px;
}

/* Main Content Area */
.main-content {
    padding: 50px 0;
}

.section-title {
    text-align: center;
    font-size: 28px;
    color: #333;
    margin-bottom: 40px;
    position: relative;
}

.section-title::after {
    content: '';
    display: block;
    width: 60px;
    height: 3px;
    background-color: #2e8b57;
    margin: 15px auto 0;
}

/* Product Grid */
.product-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 25px;
}

.product-card {
    background: #fff;
    border-radius: 8px;
    padding: 15px;
    text-align: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    transition: transform 0.3s, box-shadow 0.3s;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
}

.product-img {
    width: 100%;
    height: 200px;
    object-fit: contain;
    margin-bottom: 15px;
}

.product-category {
    font-size: 12px;
    color: #888;
    margin-bottom: 5px;
}

.product-title {
    font-size: 16px;
    color: #333;
    margin-bottom: 10px;
    height: 48px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.product-price {
    font-size: 20px;
    color: #e74c3c;
    font-weight: bold;
    margin-bottom: 15px;
}

.add-to-cart-btn {
    background-color: #2e8b57;
    color: #fff;
    border: none;
    padding: 10px 0;
    width: 100%;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.3s;
}

.add-to-cart-btn:hover {
    background-color: #246d44;
}

/* Footer */
.site-footer {
    background-color: #222;
    color: #ccc;
    padding-top: 50px;
}

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

.footer-col {
    width: 23%;
}

.footer-logo {
    max-width: 150px;
    margin-bottom: 20px;
    filter: brightness(0) invert(1);
}

.footer-desc {
    font-size: 14px;
    margin-bottom: 20px;
    line-height: 1.8;
}

.social-links a {
    display: inline-block;
    width: 36px;
    height: 36px;
    background-color: #444;
    color: #fff;
    text-align: center;
    line-height: 36px;
    border-radius: 50%;
    margin-right: 10px;
    transition: background-color 0.3s;
}

.social-links a:hover {
    background-color: #2e8b57;
}

.footer-col h3 {
    color: #fff;
    font-size: 18px;
    margin-bottom: 20px;
    position: relative;
    padding-bottom: 10px;
}

.footer-col h3::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 30px;
    height: 2px;
    background-color: #2e8b57;
}

.footer-col ul li {
    margin-bottom: 12px;
}

.footer-col ul li a {
    color: #ccc;
    font-size: 14px;
    transition: color 0.3s;
}

.footer-col ul li a:hover {
    color: #2e8b57;
    padding-left: 5px;
}

.contact-info li {
    font-size: 14px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 15px;
}

.contact-info li i {
    color: #2e8b57;
    margin-top: 4px;
}

.footer-bottom {
    background-color: #111;
    padding: 20px 0;
}

.footer-bottom-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.copyright {
    font-size: 13px;
}

.payment-methods img {
    height: 25px;
    margin-left: 10px;
    background: #fff;
    padding: 2px;
    border-radius: 2px;
}

/* Auth Modal */
.auth-modal {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: none;
}

.auth-modal.is-open {
    display: block;
}

.auth-modal__overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.45);
}

.auth-modal__dialog {
    position: relative;
    width: min(520px, calc(100vw - 30px));
    margin: 70px auto;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 18px 50px rgba(0,0,0,0.25);
    overflow: hidden;
}

.auth-modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border-bottom: 1px solid #eee;
    background: #fafafa;
}

.auth-modal__tabs {
    display: flex;
    gap: 8px;
}

.auth-tab {
    border: 1px solid #ddd;
    background: #fff;
    padding: 8px 12px;
    border-radius: 999px;
    cursor: pointer;
    font-size: 14px;
    color: #333;
}

.auth-tab.is-active {
    background: #2e8b57;
    color: #fff;
    border-color: #2e8b57;
}

.auth-modal__close {
    border: 0;
    background: transparent;
    font-size: 26px;
    line-height: 1;
    cursor: pointer;
    color: #666;
    padding: 0 6px;
}

.auth-modal__body {
    padding: 18px 18px 22px;
}

.auth-modal__title {
    font-size: 18px;
    margin-bottom: 10px;
    color: #333;
}

.auth-alert {
    display: none;
    padding: 10px 12px;
    border-radius: 8px;
    font-size: 14px;
    margin-bottom: 12px;
}

.auth-alert.is-visible {
    display: block;
}

.auth-alert.is-error {
    background: #fff1f0;
    border: 1px solid #ffccc7;
    color: #a8071a;
}

.auth-alert.is-success {
    background: #f6ffed;
    border: 1px solid #b7eb8f;
    color: #237804;
}

.auth-form {
    display: none;
    gap: 12px;
}

.auth-form.is-active {
    display: grid;
}

.auth-field label {
    display: block;
    font-size: 13px;
    color: #555;
    margin-bottom: 6px;
}

.auth-field input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 10px;
    outline: none;
    font-size: 14px;
}

.auth-field input:focus {
    border-color: #2e8b57;
    box-shadow: 0 0 0 3px rgba(46,139,87,0.15);
}

.auth-primary-btn {
    margin-top: 4px;
    background: #2e8b57;
    color: #fff;
    border: none;
    padding: 11px 12px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 14px;
}

.auth-primary-btn:hover {
    background: #246d44;
}

/* Product Detail */
.product-page {
    padding: 30px 0 60px;
}

.product-detail {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 28px;
    background: #fff;
    border-radius: 12px;
    padding: 22px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.product-gallery img {
    width: 100%;
    height: 420px;
    object-fit: contain;
    background: #fafafa;
    border-radius: 12px;
}

.product-thumbs {
    margin-top: 10px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.product-thumb {
    border: 1px solid #ddd;
    border-radius: 10px;
    padding: 0;
    width: 70px;
    height: 70px;
    overflow: hidden;
    background: #fff;
    cursor: pointer;
}

.product-thumb.is-active {
    border-color: #2e8b57;
    box-shadow: 0 0 0 3px rgba(46,139,87,0.12);
}

.product-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-info h1 {
    font-size: 24px;
    margin-bottom: 8px;
}

.product-info .product-category {
    margin-bottom: 10px;
}

.product-info .product-price {
    margin: 14px 0 16px;
    font-size: 26px;
}

.product-desc {
    color: #666;
    font-size: 14px;
    margin-bottom: 14px;
}

.product-highlights {
    padding-left: 18px;
    margin-bottom: 16px;
}

.product-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.product-actions .add-to-cart-btn {
    width: 100%;
}

.secondary-btn {
    background: #fff;
    border: 1px solid #2e8b57;
    color: #2e8b57;
    padding: 10px 0;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}

.secondary-btn:hover {
    background: #f8fcf9;
}

@media (max-width: 992px) {
    .product-detail {
        grid-template-columns: 1fr;
    }
    .product-gallery img {
        height: 360px;
    }
}

/* Responsive adjustments */
@media (max-width: 992px) {
    .product-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .footer-col {
        width: 48%;
        margin-bottom: 30px;
    }
}

@media (max-width: 768px) {
    .header-main .container {
        flex-direction: column;
        gap: 15px;
    }
    .search-bar {
        margin: 0;
        width: 100%;
    }
    .nav-list {
        flex-direction: column;
    }
    .dropdown-menu {
        position: static;
        transform: none;
        opacity: 1;
        visibility: visible;
        display: none;
        box-shadow: none;
        padding: 10px;
        min-width: 100%;
        flex-direction: column;
        gap: 15px;
    }
    .nav-item:hover .dropdown-menu {
        display: flex;
    }
    .product-grid {
        grid-template-columns: 1fr;
    }
    .footer-col {
        width: 100%;
    }
}

/* Category Page Layout */
.breadcrumb {
    padding: 20px 0;
    font-size: 14px;
    color: #666;
}

.breadcrumb a {
    color: #2e8b57;
    margin-right: 5px;
}

.breadcrumb span {
    margin: 0 5px;
}

.category-page-header {
    margin-bottom: 30px;
    padding-bottom: 10px;
    border-bottom: 2px solid #eee;
}

.category-page-header h1 {
    font-size: 24px;
    color: #333;
}

.category-layout {
    display: flex;
    gap: 30px;
    margin-bottom: 60px;
}

.sidebar {
    width: 250px;
    flex-shrink: 0;
}

.sidebar-widget {
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    margin-bottom: 20px;
}

.sidebar-widget h3 {
    font-size: 16px;
    color: #2e8b57;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

.sidebar-menu li {
    margin-bottom: 10px;
}

.sidebar-menu li a {
    font-size: 14px;
    color: #555;
    transition: color 0.3s;
}

.sidebar-menu li a:hover {
    color: #2e8b57;
    padding-left: 5px;
}

.category-main {
    flex: 1;
}

.category-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #fff;
    padding: 15px 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    margin-bottom: 20px;
}

.category-toolbar .sort-by select {
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    outline: none;
}

.category-main .product-grid {
    grid-template-columns: repeat(3, 1fr);
}

@media (max-width: 992px) {
    .category-layout {
        flex-direction: column;
    }
    .sidebar {
        width: 100%;
    }
}
@media (max-width: 768px) {
    .category-main .product-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
@media (max-width: 480px) {
    .category-main .product-grid {
        grid-template-columns: 1fr;
    }
}
