@import url('https://fonts.googleapis.com/css2?family=Sarabun:wght@300;400;500;600;700&display=swap');

/* Custom Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: Sarabun, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

body, button, input, select, textarea {
    font-family: Sarabun, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif !important;
    line-height: 1.6;
    background: #FFFFFF;
}

/* Swiper Customization */
.swiper-button-next,
.swiper-button-prev {
    color: #3f8429 !important;
    background: white;
    width: 40px !important;
    height: 40px !important;
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.swiper-button-next:after,
.swiper-button-prev:after {
    font-size: 16px !important;
    font-weight: bold;
}

.swiper-pagination-bullet {
    width: 16px !important;
    height: 4px !important;
    border-radius: 2px !important;
    background: #3f8429 !important;
    opacity: 0.3 !important;
    transition: width 0.3s ease, opacity 0.3s ease !important;
}

.swiper-pagination-bullet-active {
    width: 32px !important;
    opacity: 1 !important;
}

/* Banner Section & Swiper Fixed Height (背景色 #ededed，仅中部区域滚动) */
.banner-section {
    background-color: #ededed;
    width: 100%;
}

.banner-swiper {
    max-width: 1400px;
    width: 100%;
    margin: 0 auto;
    aspect-ratio: 1600 / 700;
    max-height: 700px;
    background-color: #ededed;
    position: relative;
}

.banner-swiper .swiper-slide {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #ededed;
}

.banner-swiper .swiper-slide img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
}

/* Banner Swiper Pill Pagination (长条形页脚，灰色填充指示器) */
.banner-swiper .swiper-pagination {
    position: absolute !important;
    bottom: 24px !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    width: auto !important;
    background: #ffffff;
    padding: 8px 18px;
    border-radius: 9999px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12), 0 1px 4px rgba(0, 0, 0, 0.06);
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    gap: 10px;
    z-index: 20;
    pointer-events: auto;
}

.banner-swiper .swiper-pagination-bullet {
    width: 9px !important;
    height: 9px !important;
    border-radius: 50% !important;
    background: #c8cbd0 !important;
    opacity: 1 !important;
    margin: 0 !important;
    transition: all 0.25s ease !important;
    cursor: pointer;
}

.banner-swiper .swiper-pagination-bullet:hover {
    background: #9ca3af !important;
}

.banner-swiper .swiper-pagination-bullet-active {
    width: 9px !important;
    height: 9px !important;
    background: #6b7280 !important;
    opacity: 1 !important;
}

.banner-swiper .swiper-button-prev {
    left: 20px !important;
}

.banner-swiper .swiper-button-next {
    right: 20px !important;
}

@media (max-width: 640px) {
    .banner-swiper .swiper-pagination {
        bottom: 12px !important;
        padding: 6px 14px;
        gap: 8px;
    }
    .banner-swiper .swiper-pagination-bullet {
        width: 8px !important;
        height: 8px !important;
    }
    .banner-swiper .swiper-pagination-bullet-active {
        width: 8px !important;
        height: 8px !important;
    }
    .banner-swiper .swiper-button-prev,
    .banner-swiper .swiper-button-next {
        display: none !important;
    }
}

/* Product Card Hover Effects */
.product-card {
    border-radius: 0.75rem;
    border: 1px solid #e5e7eb;
    transition: all 0.2s ease;
    overflow: hidden;
}

.product-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

.product-card img {
    transition: transform 0.3s ease;
}

.product-card:hover img {
    transform: scale(1.02);
}

/* Ensure 1:1 aspect ratio for product images */
.product-card .aspect-square {
    aspect-ratio: 1 / 1;
}

/* Product Card Compact Add to Cart Button (弱化加购物车按钮：保留icon与背景，置于价格右侧) */
.product-card .add-to-cart-btn {
    width: 32px !important;
    height: 32px !important;
    min-width: 32px !important;
    min-height: 32px !important;
    padding: 0 !important;
    border-radius: 9999px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    background-color: #3f8429 !important;
    color: #ffffff !important;
    box-shadow: none !important;
    transition: background-color 0.2s ease, opacity 0.2s ease !important;
    cursor: pointer;
}

.product-card .add-to-cart-btn:hover {
    background-color: #346c22 !important;
    transform: none !important;
    box-shadow: none !important;
    opacity: 0.92;
}

.product-card .add-to-cart-btn:active {
    transform: scale(0.96) !important;
    opacity: 1;
}

.product-card .add-to-cart-btn i {
    font-size: 15px !important;
    margin: 0 !important;
    line-height: 1 !important;
}

@media (max-width: 640px) {
    .product-card .add-to-cart-btn {
        width: 28px !important;
        height: 28px !important;
        min-width: 28px !important;
        min-height: 28px !important;
    }
    
    .product-card .add-to-cart-btn i {
        font-size: 12px !important;
    }
}

/* Button Hover Effects */
.btn-primary {
    background: #3f8429;
    color: white;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    background: #346c22;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(63, 132, 41, 0.3);
}

.btn-secondary {
    border: 1px solid #3f8429;
    color: #3f8429;
    background: white;
    transition: all 0.3s ease;
}

.btn-secondary:hover {
    background: #3f8429;
    color: white;
    transform: translateY(-1px);
}

/* Cart Drawer Animation */
#cart-drawer.show #cart-content {
    transform: translateX(0);
}

/* Mobile Navigation */
.mobile-menu {
    transform: translateX(-100%);
    transition: transform 0.3s ease;
}

.mobile-menu.show {
    transform: translateX(0);
}

/* Toast Animation */
.toast-show {
    transform: translateX(0) !important;
    opacity: 1 !important;
    pointer-events: auto !important;
    visibility: visible !important;
}

/* Global Toast Style - differentiate from primary theme color */
#toast {
    background-color: #111827 !important; /* gray-900 */
    color: #ffffff !important;
    opacity: 0;
    pointer-events: none;
    visibility: hidden;
    transition: transform 0.3s ease, opacity 0.3s ease, visibility 0.3s ease;
}

/* Fade In Animation */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    /* animation: fadeIn 0.6s ease-out; */
}

/* Loading Spinner */
.spinner {
    border: 3px solid #f3f3f3;
    border-top: 3px solid #3f8429;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    animation: spin 1s linear infinite;
}

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

/* Form Styles */
.form-input {
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.form-input:focus {
    border-color: #3f8429;
    box-shadow: 0 0 0 3px rgba(63, 132, 41, 0.1);
}

/* Quantity Selector */
.quantity-selector {
    display: inline-block;
    align-items: center;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    overflow: hidden;
}

.quantity-selector button {
    background: #f9fafb;
    border: none;
    padding: 8px 12px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.quantity-selector button:hover {
    background: #e5e7eb;
}

.quantity-selector input {
    border: none;
    text-align: center;
    width: 60px;
    padding: 8px 4px;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .swiper-button-next,
    .swiper-button-prev {
        display: none;
    }
    
    /* Mobile product list spacing */
    .grid-view #products-grid {
        gap: 0.75rem !important;
    }
    
    .list-view #products-grid {
        gap: 0.5rem !important;
    }
    
    /* Mobile product card adjustments */
    .product-card {
        margin-bottom: 0.75rem;
    }
    
    /* Mobile grid view card padding and spacing */
    .grid-view .product-card .p-3 {
        padding: 0.5rem !important;
    }
    
    .grid-view .product-card h3 {
        font-size: 0.75rem !important;
        line-height: 1.2 !important;
        margin-bottom: 0.125rem !important;
    }
    
    .grid-view .product-card .flex.items-center.mb-2 {
        margin-bottom: 0.125rem !important;
    }
    
    .grid-view .product-card .flex.items-center.justify-between.mb-2 {
        margin-bottom: 0.125rem !important;
    }
    
    .grid-view .product-card .text-base {
        font-size: 0.75rem !important;
    }
    
    .grid-view .product-card .text-xs {
        font-size: 0.625rem !important;
    }
    
    .grid-view .product-card button {
        padding: 0.125rem 0.375rem !important;
        font-size: 0.625rem !important;
    }
    
    /* Mobile list view card padding and spacing */
    .list-view .product-card .p-4 {
        padding: 0.125rem !important;
    }
    
    .list-view .product-card h3 {
        font-size: 0.75rem !important;
        line-height: 1.2 !important;
        margin-bottom: 0.125rem !important;
    }
    
    .list-view .product-card .flex.items-center.mb-2 {
        margin-bottom: 0.125rem !important;
    }
    
    .list-view .product-card .text-gray-600.mb-2 {
        font-size: 0.625rem !important;
        line-height: 1.2 !important;
        margin-bottom: 0.125rem !important;
    }
    
    .list-view .product-card .text-lg {
        font-size: 0.75rem !important;
    }
    
    .list-view .product-card .text-sm {
        font-size: 0.625rem !important;
    }
    
    .list-view .product-card button {
        padding: 0.125rem 0.375rem !important;
        font-size: 0.625rem !important;
    }
    
    /* Mobile wishlist button sizing */
    .wishlist-btn {
        width: 1.5rem !important;
        height: 1.5rem !important;
        top: 0.25rem !important;
        right: 0.25rem !important;
    }
    
    .wishlist-btn i {
        font-size: 0.625rem !important;
    }
    
    /* Mobile wishlist page spacing */
    .wishlist-item {
        margin-bottom: 0.5rem !important;
    }
    
    .wishlist-item .mt-2 {
        margin-top: 0.25rem !important;
        padding: 0 0.5rem !important;
    }
    
    .wishlist-item button {
        font-size: 0.625rem !important;
        padding: 0.125rem 0.25rem !important;
    }
    
    /* Mobile swiper product cards spacing */
    .swiper-slide .product-card {
        margin-bottom: 0.75rem !important;
    }
    
    .swiper-slide .product-card .p-3 {
        padding: 0.5rem !important;
    }
    
    .swiper-slide .product-card h3 {
        font-size: 0.75rem !important;
        line-height: 1.2 !important;
        margin-bottom: 0.25rem !important;
    }
    
    .swiper-slide .product-card .flex.items-center.mb-2 {
        margin-bottom: 0.25rem !important;
    }
    
    .swiper-slide .product-card .flex.items-center.justify-between.mb-2 {
        margin-bottom: 0.25rem !important;
    }
    
    .swiper-slide .product-card .text-base {
        font-size: 0.75rem !important;
    }
    
    .swiper-slide .product-card .text-xs {
        font-size: 0.625rem !important;
    }
    
    .swiper-slide .product-card button {
        padding: 0.25rem 0.5rem !important;
        font-size: 0.625rem !important;
    }
    
    .swiper-slide .wishlist-btn {
        width: 1.5rem !important;
        height: 1.5rem !important;
        top: 0.25rem !important;
        right: 0.25rem !important;
    }
    
    .swiper-slide .wishlist-btn i {
        font-size: 0.625rem !important;
    }
    
    /* Mobile related products spacing */
    .related-products-swiper .swiper-slide .product-card {
        margin-bottom: 0.75rem !important;
    }
    
    .related-products-swiper .swiper-slide .product-card .p-3 {
        padding: 0.5rem !important;
    }
    
    .related-products-swiper .swiper-slide .product-card h3 {
        font-size: 0.75rem !important;
        line-height: 1.2 !important;
        margin-bottom: 0.25rem !important;
    }
    
    .related-products-swiper .swiper-slide .product-card .flex.items-center.mb-2 {
        margin-bottom: 0.25rem !important;
    }
    
    .related-products-swiper .swiper-slide .product-card .flex.items-center.justify-between.mb-2 {
        margin-bottom: 0.25rem !important;
    }
    
    .related-products-swiper .swiper-slide .product-card .text-base {
        font-size: 0.75rem !important;
    }
    
    .related-products-swiper .swiper-slide .product-card .text-xs {
        font-size: 0.625rem !important;
    }
    
    .related-products-swiper .swiper-slide .product-card button {
        padding: 0.25rem 0.5rem !important;
        font-size: 0.625rem !important;
    }
    
    .related-products-swiper .swiper-slide .wishlist-btn {
        width: 1.5rem !important;
        height: 1.5rem !important;
        top: 0.25rem !important;
        right: 0.25rem !important;
    }
    
    .related-products-swiper .swiper-slide .wishlist-btn i {
        font-size: 0.625rem !important;
    }
    
    /* Mobile product list spacing for all containers */
    
    /* Homepage coupon section */
    .grid.gap-6 {
        gap: 0.75rem !important;
    }
    
    /* Shop page product grid */
    #products-grid {
        gap: 0.75rem !important;
    }
    
    /* Wishlist page spacing */
    .space-y-6 {
        gap: 0.75rem !important;
    }
    
    /* Product detail page spacing */
    .grid.gap-12 {
        gap: 1rem !important;
    }
    
    .space-y-4 {
        gap: 0.5rem !important;
    }
    
    /* Swiper spacing adjustments */
    .swiper-slide {
        /* margin-right: 0.5rem !important; */
    }
    
    /* Mobile swiper spacing overrides */
    .new-products-swiper .swiper-slide,
    .popular-products-swiper .swiper-slide,
    .related-products-swiper .swiper-slide {
        margin-right: 0.5rem !important;
    }

    .banner-swiper .swiper-slide {
        margin-right: 0rem !important;
    }
    
    /* Additional mobile spacing for specific containers */
    .coupon-item {
        margin-bottom: 0.5rem;
    }
    
    /* Mobile form spacing */
    .space-y-8 {
        gap: 1rem !important;
    }
    
    .space-y-2 {
        gap: 0.25rem !important;
    }
    
    /* Mobile section spacing adjustments */
    .py-16 {
        padding-top: 2rem !important;
        padding-bottom: 2rem !important;
    }
    
    .py-8 {
        padding-top: 1rem !important;
        padding-bottom: 1rem !important;
    }
    
    .py-12 {
        padding-top: 1.5rem !important;
        padding-bottom: 1.5rem !important;
    }
    
    /* Mobile margin adjustments for sections */
    .mb-12 {
        margin-bottom: 1.5rem !important;
    }
    
    .mb-16 {
        margin-bottom: 2rem !important;
    }
    
    .mb-8 {
        margin-bottom: 1rem !important;
    }
    
    /* Mobile page-specific section spacing */
    
    /* Shop page section spacing */
    .shop-page .py-8 {
        padding-top: 1rem !important;
        padding-bottom: 1rem !important;
    }
    
    /* Product detail page section spacing */
    .product-page .py-8 {
        padding-top: 1rem !important;
        padding-bottom: 1rem !important;
    }
    
    .product-page .mb-16 {
        margin-bottom: 2rem !important;
    }
    
    /* Wishlist page section spacing */
    .wishlist-page .py-8 {
        padding-top: 1rem !important;
        padding-bottom: 1rem !important;
    }
    
    /* About page section spacing */
    .about-page .py-8 {
        padding-top: 1rem !important;
        padding-bottom: 1rem !important;
    }
    
    /* Contact page section spacing */
    .contact-page .py-8 {
        padding-top: 1rem !important;
        padding-bottom: 1rem !important;
    }
    
    /* Checkout page section spacing */
    .checkout-page .py-8 {
        padding-top: 1rem !important;
        padding-bottom: 1rem !important;
    }
    
    /* Order success page section spacing */
    .order-success-page .py-16 {
        padding-top: 2rem !important;
        padding-bottom: 2rem !important;
    }
    
    /* Terms, Privacy, Returns pages section spacing */
    .legal-page .py-8 {
        padding-top: 1rem !important;
        padding-bottom: 1rem !important;
    }
    
    /* Mobile wishlist list-view optimizations */
    .wishlist-item {
        margin-bottom: 0.75rem !important;
    }
    
    .wishlist-item .product-card {
        margin-bottom: 0 !important;
    }
    
    /* Mobile wishlist image sizing - 1:1 ratio */
    .wishlist-item .product-card .aspect-square {
        height: 100px !important;
        width: 100px !important;
    }
    
    /* Mobile wishlist content width optimization */
    .wishlist-item .product-card .flex-1 {
        min-width: 0 !important;
        flex: 1 1 0% !important;
    }
    
    /* Mobile wishlist list-view specific adjustments */
    .wishlist-item .product-card .flex {
        flex-direction: row !important;
        /* align-items: stretch !important; */
    }
    
    .wishlist-item .product-card .relative {
        flex-shrink: 0 !important;
        margin: auto 0;
    }
    
    .wishlist-item .product-card .relative .discount-badge,
    .wishlist-item .product-card .relative .discount-tag,
    .wishlist-item .product-card .relative .discount-tag-banner {
        display: none;
    }
    
    .wishlist-item .product-card .flex-1 {
        display: flex !important;
        flex-direction: column !important;
        justify-content: space-between !important;
        padding: 0.5rem !important;
    }
    
    /* Mobile wishlist text sizing */
    .wishlist-item .product-card h3 {
        font-size: 0.75rem !important;
        line-height: 1.2 !important;
        margin-bottom: 0.125rem !important;
    }
    
    .wishlist-item .product-card .text-gray-600 {
        font-size: 0.625rem !important;
        line-height: 1.2 !important;
        margin-bottom: 0.125rem !important;
    }
    
    .wishlist-item .product-card .text-lg {
        font-size: 0.75rem !important;
    }
    
    .wishlist-item .product-card .text-sm {
        font-size: 0.625rem !important;
    }
    
    /* Mobile wishlist button sizing */
    .wishlist-item .product-card button {
        padding: 0.125rem 0.375rem !important;
        font-size: 0.625rem !important;
    }
    
    .wishlist-item .product-card .wishlist-btn,
    .wishlist-item .product-card .delete-btn {
        width: 1.5rem !important;
        height: 1.5rem !important;
    }
    
    .wishlist-item .product-card .wishlist-btn i,
    .wishlist-item .product-card .delete-btn i {
        font-size: 0.625rem !important;
    }
    
    /* Mobile delete button styling */
    .wishlist-item .product-card .delete-btn {
        background-color: #ef4444 !important;
        /* border-radius: 50% !important; */
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
    }
}

/* Grid Layout Toggle */
.grid-view .product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

.list-view .product-grid {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.list-view .product-card {
    display: flex;
    align-items: center;
    padding: 1rem;
}

.list-view .product-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Discount Banner (Reference Style) */
.discount-tag-banner {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 44px;
    background: #ff1f26;
    padding: 3px 3px 6px 3px;
    clip-path: polygon(0 0, 100% 0, 100% calc(100% - 7px), 50% 100%, 0 calc(100% - 7px));
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.18));
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: 10;
    pointer-events: none;
    user-select: none;
    box-sizing: border-box;
}

.discount-tag-banner .tag-top-box {
    width: 100%;
    background: #ffffff;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 3px 1px 2px 1px;
    position: relative;
    box-sizing: border-box;
}

.discount-tag-banner .tag-top-box::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 4px solid #ffffff;
    z-index: 2;
}

.discount-tag-banner .tag-percent {
    font-size: 13px;
    font-weight: 500;
    line-height: 1.1;
    color: #ff1f26;
    font-family: Sarabun, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.discount-tag-banner .tag-bottom-box {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding-top: 5px;
    padding-bottom: 7px;
}

.discount-tag-banner .tag-off {
    color: #ffffff;
    font-size: 11px;
    font-weight: 500;
    line-height: 1;
    letter-spacing: 0.5px;
    font-family: Sarabun, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* New Arrival Corner Ribbon Badge (商品图左上角斜角标签) */
.corner-ribbon-wrapper {
    position: absolute;
    top: 0;
    left: 0;
    width: 96px;
    height: 96px;
    overflow: hidden;
    pointer-events: none;
    z-index: 10;
}

.corner-ribbon {
    position: absolute;
    top: 22px;
    left: -32px;
    width: 136px;
    transform: rotate(-45deg);
    background: #c00004;
    color: #ffffff;
    font-family: Sarabun, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.75px;
    text-transform: uppercase;
    text-align: center;
    line-height: 20px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.22);
    user-select: none;
}

@media (max-width: 640px) {
    .corner-ribbon-wrapper {
        width: 76px;
        height: 76px;
    }
    
    .corner-ribbon {
        top: 16px;
        left: -28px;
        width: 110px;
        font-size: 8px;
        line-height: 17px;
        letter-spacing: 0.5px;
    }
}

/* Wishlist Heart Animation */
.wishlist-btn {
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
}

.wishlist-btn.active {
    color: #3f8429;
    transform: scale(1.1);
}

/* Search Bar */
.search-container {
    position: relative;
}

.search-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #e5e7eb;
    border-top: none;
    border-radius: 0 0 6px 6px;
    max-height: 300px;
    overflow-y: auto;
    z-index: 1000;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.search-suggestion-item {
    padding: 12px 16px;
    cursor: pointer;
    border-bottom: 1px solid #f3f4f6;
    transition: background-color 0.3s ease;
}

.search-suggestion-item:hover {
    background: #f9fafb;
}

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

/* Banner Slide Entry Animations */
@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translate3d(-40px, 0, 0);
    }
    to {
        opacity: 1;
        transform: translate3d(0, 0, 0);
    }
}

.swiper-slide-active .animate-fade-in-left {
    animation: fadeInLeft 0.8s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.swiper-slide:not(.swiper-slide-active) .animate-fade-in-left {
    opacity: 0;
}

.delay-100 {
    animation-delay: 150ms !important;
}

.delay-200 {
    animation-delay: 300ms !important;
}

/* Sticky Header Entrance Animation (Top to Bottom Fade In) */
@keyframes slideDownFade {
    0% {
        opacity: 0;
        transform: translateY(-100%);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

.header-sticky {
    position: fixed !important;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    z-index: 40 !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    animation: slideDownFade 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Ensure drawers always overlay above sticky header */
#cart-drawer, #mobile-filter-drawer {
    z-index: 1000 !important;
}

/* Category Dropdown Menu Animation */
@keyframes dropdownFadeSlide {
    0% {
        opacity: 0;
        transform: translateY(6px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

.group:hover .category-dropdown-menu {
    display: block !important;
    animation: dropdownFadeSlide 0.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* ==========================================================================
   Coupon Claiming Section (优惠券领取板块 - 淡绿底色与圆形按钮)
   ========================================================================== */
.coupon-section {
    background-color: #eef6ed; /* 优惠券专属淡绿色背景底色 */
    border-top: 1px solid #dfede0;
    border-bottom: 1px solid #dfede0;
}

.coupon-card {
    position: relative;
    display: flex;
    align-items: stretch;
    background-color: #ffffff; /* 清爽白色票券卡片 */
    border: 1px solid #cde8ca;
    border-radius: 8px; /* 小圆角 */
    min-height: 116px;
    box-shadow: 0 3px 12px rgba(63, 132, 41, 0.08);
    transition: all 0.25s ease;
}

.coupon-card:hover {
    box-shadow: 0 6px 20px rgba(63, 132, 41, 0.15);
    transform: translateY(-2px);
}

/* Coupon Card Left & Right Rounded Serrated Edges (左右两边圆角锯齿边缘) */
.coupon-card::before,
.coupon-card::after {
    content: '';
    position: absolute;
    top: 8px;
    bottom: 8px;
    width: 10px;
    z-index: 3;
    pointer-events: none;
    background-size: 10px 15px;
    background-repeat: repeat-y;
}

.coupon-card::before {
    left: -1px;
    background-image: radial-gradient(circle at 0 7.5px, #eef6ed 4.8px, #cde8ca 5.4px 6px, transparent 6.6px);
    background-position: left center;
}

.coupon-card::after {
    right: -1px;
    background-image: radial-gradient(circle at 10px 7.5px, #eef6ed 4.8px, #cde8ca 5.4px 6px, transparent 6.6px);
    background-position: right center;
}

/* Coupon Left Area (Brand / Voucher Icon) */
.coupon-left {
    width: 32%;
    min-width: 104px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px 8px 10px 14px;
    background: transparent;
}

.coupon-icon-box {
    display: flex;
    align-items: center;
    justify-content: center;
}

.coupon-icon-img,
.coupon-icon-svg {
    width: 62px;
    height: 62px;
    object-fit: contain;
    display: block;
    filter: drop-shadow(0 3px 6px rgba(63, 132, 41, 0.22));
}

/* Coupon Divider with Top & Bottom Circular Cutouts */
.coupon-divider {
    position: relative;
    width: 0;
    border-left: 1px dashed #bddfba;
    margin: 0;
}

.coupon-notch {
    position: absolute;
    width: 14px;
    height: 14px;
    background-color: #eef6ed; /* 与板块淡绿底色完全一致，形成真实冲压打孔缺口 */
    border: 1px solid #cde8ca;
    border-radius: 50%;
    left: -7px;
    z-index: 3;
    box-sizing: border-box;
}

.coupon-notch-top {
    top: -8px;
    clip-path: polygon(0 50%, 100% 50%, 100% 100%, 0 100%);
}

.coupon-notch-bottom {
    bottom: -8px;
    clip-path: polygon(0 0, 100% 0, 100% 50%, 0 50%);
}

/* Coupon Right Area (Info & Action) */
.coupon-right {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 24px 12px 14px;
    min-width: 0;
    gap: 8px;
}

.coupon-info-col {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.coupon-amount-title {
    display: flex;
    align-items: baseline;
    gap: 3px;
    line-height: 1.1;
    margin-bottom: 2px;
}

.coupon-prefix {
    font-size: 1.1rem;
    font-weight: 700;
    color: #276915;
}

.coupon-currency {
    font-size: 1.1rem;
    font-weight: 700;
    color: #276915;
}

.coupon-value {
    font-size: 1.55rem;
    font-weight: 800;
    color: #276915;
    letter-spacing: -0.5px;
    font-family: Sarabun, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.coupon-condition {
    font-size: 12px;
    color: #4b5563;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 5px;
    line-height: 1.3;
    margin-bottom: 3px;
}

.coupon-tc {
    font-size: 10.5px;
    color: #6b7280;
    text-decoration: underline;
    cursor: default;
}

.coupon-subnote {
    font-size: 11px;
    color: #6b7280;
    font-weight: 400;
}

/* Circular Button on Right (右侧圆形按钮) */
.coupon-btn-col {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 4px;
}

.coupon-circle-btn {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: #5aa345;
    color: #ffffff;
    border: none;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(63, 132, 41, 0.18);
    transition: all 0.2s ease;
    padding: 0;
    text-align: center;
    flex-shrink: 0;
}

.coupon-circle-btn:hover {
    background: #4f943a;
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(63, 132, 41, 0.25);
}

.coupon-circle-btn:active {
    transform: translateY(0);
}

.coupon-circle-btn .btn-line-1 {
    font-size: 12px;
    font-weight: 600;
    line-height: 1.1;
}

.coupon-circle-btn .btn-line-2 {
    font-size: 10px;
    font-weight: 500;
    opacity: 0.92;
    line-height: 1.1;
    margin-top: 1px;
}

.coupon-circle-btn i {
    font-size: 18px;
    line-height: 1;
}

/* Claimed State */
.coupon-card.is-claimed {
    background-color: #fafdfa;
    border-color: #dceada;
}

.coupon-card.is-claimed::before {
    background-image: radial-gradient(circle at 0 7.5px, #eef6ed 4.8px, #dceada 5.4px 6px, transparent 6.6px);
}

.coupon-card.is-claimed::after {
    background-image: radial-gradient(circle at 10px 7.5px, #eef6ed 4.8px, #dceada 5.4px 6px, transparent 6.6px);
}

.coupon-card.is-claimed .coupon-icon-img,
.coupon-card.is-claimed .coupon-icon-svg {
    filter: grayscale(0.2) opacity(0.75);
}

.coupon-card.is-claimed .coupon-prefix,
.coupon-card.is-claimed .coupon-currency,
.coupon-card.is-claimed .coupon-value {
    color: #6b8c64;
}

.coupon-card.is-claimed .coupon-circle-btn {
    background: #e3eee1 !important;
    color: #53754b !important;
    box-shadow: 0 0 0 1px #d0e4ce !important;
    cursor: default !important;
    pointer-events: none !important;
    transform: none !important;
}

/* Responsive adjustments */
@media (max-width: 640px) {
    .coupon-card {
        min-height: 106px;
    }
    .coupon-left {
        width: 32%;
        min-width: 96px;
        padding: 10px 4px 10px 12px;
    }
    .coupon-icon-img,
    .coupon-icon-svg {
        width: 52px;
        height: 52px;
    }
    .coupon-right {
        padding: 10px 18px 10px 8px;
        gap: 6px;
    }
    .coupon-btn-col {
        margin-right: 2px;
    }
    .coupon-value {
        font-size: 1.35rem;
    }
    .coupon-prefix,
    .coupon-currency {
        font-size: 1rem;
    }
    .coupon-circle-btn {
        width: 48px;
        height: 48px;
    }
    .coupon-circle-btn .btn-line-1 {
        font-size: 11px;
    }
    .coupon-circle-btn .btn-line-2 {
        font-size: 9px;
    }
}
