body {
    font-family: "Poppins", sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f8f5f0;
}
header {
    position: sticky;
    top: 0;
    z-index: 9999;
}
.container {
    margin-top: 20px;
    background-color: #f8f9fa;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}
.product-card {
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    overflow: visible;
    position: relative;
    transition: transform 0.3s, box-shadow 0.3s;
    background-color: #f8f9fa;
}
.product-card:hover {
    transform: scale(1.05);
    box-shadow: 0 0 15px rgba(216, 64, 64, 0.4);
}
.product-image {
    position: relative;
    width: 100%;
    padding-bottom: 100%;
    overflow: hidden;
    border-radius: 10px 10px 0 0;
}
.product-img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 1;
}
.product-details {
    position: relative;
    padding: 10px;
    z-index: 5;
}
.product-title {
    background-color: #643805;
    padding: 8px 10px;
    border-radius: 5px;
    color: #ffffff;
    margin: 0 0 10px;
    text-align: center;
    font-size: 1rem;
    font-weight: 700;
}
.add-cart-btn {
    background-color: #c75b12;
    border: 2px solid #c75b12;
    color: #ffffff;
    border-radius: 5px;
    padding: 10px 20px;
    transition: background-color 0.3s, color 0.3s;
    width: 100%;
    font-weight: 800;
    align-items: center;
}
.add-cart-btn:hover {
    background-color: #b71c1c;
}
/* ===== Top Right - Regular Price (Strike) ===== */
.offer-badge {
    position: absolute;
    top: 0;
    right: 0;
    background-color: #8b0000;
    color: #ffd700;
    padding: 3px 7px;
    border-top-right-radius: 10px;
    border-radius: 5px;
    font-size: 13px;
    font-weight: bold;
    z-index: 5;
    text-decoration: line-through;
}
/* ===== Bottom Left - Offer Price ===== */
.final-price-badge {
    position: absolute;
    bottom: 0;
    left: 0;
    background-color: #2e7d32;
    color: #ffffff;
    font-weight: bold;
    padding: 3px 7px;
    border-bottom-left-radius: 10px;
    border-top-right-radius: 8px;
    font-size: 13px;
    z-index: 10;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
    line-height: 1.2;
}
/* ===== Quantity Control ===== */
.quantity-control {
    display: flex;
    align-items: center;
    width: 100%;
    background: #fffef5;
    border: 2px solid #654321;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(101, 67, 33, 0.08);
    overflow: hidden;
    height: 50px;
}
.quantity-control button {
    flex: 1;
    background: linear-gradient(135deg, #654321, #8b5a2b);
    color: #fffef5;
    border: none;
    font-size: 22px;
    font-weight: 600;
    padding: 18px 0;
    cursor: pointer;
    transition: background 0.3s ease, transform 0.3s ease;
}
.quantity-control button:hover {
    background: linear-gradient(135deg, #4a2f15, #654321);
    transform: scale(1.02);
}
.quantity-control span {
    flex: 1;
    background: #fffef5;
    color: #654321;
    text-align: center;
    font-size: 22px;
    font-weight: 600;
    display: flex;
    justify-content: center;
    align-items: center;
    border-left: 1px solid #f7ece1;
    border-right: 1px solid #f7ece1;
}
.product-card.out-of-stock {
    opacity: 0.72;
}
.product-card.out-of-stock .product-img {
    filter: grayscale(20%);
}
.product-card.out-of-stock .add-cart-btn,
.add-cart-btn.out-of-stock-btn {
    background: #8b0000 !important;
    border-color: #9ca3af !important;
    color: #FFD700 !important;
    cursor: not-allowed !important;
    pointer-events: none;
}
/* ===== Custom Dropdown ===== */
.custom-select-wrapper {
    width: 100%;
    position: relative;
    z-index: 50;
}
.custom-select {
    position: relative;
    width: 100%;
}
.custom-select-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.90rem;
    font-weight: 700;
    color: #1d1616;
    background-color: #ffffff;
    border: 2px solid #d4a017;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.25s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    height: 38px;
    padding: 0 10px;
}
.custom-select-trigger .selected-text {
    flex: 1;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.custom-select-trigger:hover {
    border-color: #b8860b;
    background-color: #fffef5;
}
.custom-select.open .custom-select-trigger {
    border-color: #d4a017;
    box-shadow: 0 0 0 3px rgba(212, 160, 23, 0.25);
}
.custom-select-trigger .arrow {
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 6px solid #d4a017;
    transition: transform 0.25s ease;
    flex-shrink: 0;
}
.custom-select.open .custom-select-trigger .arrow {
    transform: rotate(180deg);
}
.custom-options {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: #fffef5;
    color: #643805;
    border: 2px solid #d4a017;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
    z-index: 9999;
    display: none;
    max-height: 220px;
    overflow-y: auto;
}
.custom-select.open .custom-options {
    display: block !important;
}
.custom-option {
    display: block !important;
    padding: 10px 12px;
    font-size: 0.88rem;
    font-weight: 700;
    color: #1d1616;
    cursor: pointer;
    transition: background 0.15s ease;
    border-bottom: 1px solid #f0e6d0;
    text-align: center;
    background: #ffffff;
    line-height: 1.3;
}
.custom-option:last-child {
    border-bottom: none;
}
.custom-option:hover {
    background-color: #fff8e1;
}
.custom-option.selected {
    background-color: #fef3c7;
    color: #92400e;
    font-weight: 700;
}
/* ===== Variant + Stock side by side ===== */
.variant-stock-row {
    display: flex;
    gap: 8px;
    margin: 8px 0 12px;
    align-items: stretch;
}
.variant-stock-row .custom-select-wrapper {
    flex: 1;
    min-width: 0;
    margin: 0;
}
.stock-urgency {
    flex: 0 0 46%;
    max-width: 46%;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.82rem;
    font-weight: 800;
    
    border: none;
    border-radius: 8px;
    white-space: nowrap;
    letter-spacing: 0.3px;
    transition: background-color 0.25s ease;
}
/* ===== Countdown ===== */
.countdown {
    color: #b8860b;
    font-weight: bold;
    font-size: 0.9rem;
    text-align: center;
    padding: 5px;
    background-color: #fff8e1;
    border-radius: 5px;
}
/* =====================================================
   MEDIA QUERIES
   ===================================================== */
/* ≤ 360px */
@media (max-width: 360px) {
    body { padding: 15px; }
    .container {
        padding: 18px;
        margin-top: 12px;
        box-shadow: none;
    }
    .product-image { height: 150px; width: 100%; }
    .offer-badge,
    .final-price-badge {
        font-size: 11px;
        padding: 2px 5px;
    }
    .product-title { font-size: 0.70rem; padding: 2px 3px; }
    .product-details h4 { font-size: 0.85rem; margin: 0; }
    .product-card {
        width: 100%;
        margin: 0 auto 10px;
        border-radius: 10px;
    }
    .add-cart-btn {
        padding: 2px 3px;
        height: 30px;
        font-size: 0.85rem;
    }
    .quantity-control { height: 30px; }
    .quantity-control button { font-size: 12px; padding: 6px 0; }
    .quantity-control span { font-size: 12px; }
    .custom-select-trigger {
        height: 30px;
        font-size: 0.72rem;
        padding: 0 6px;
    }
    .custom-option {
        padding: 8px 8px;
        font-size: 0.72rem;
    }
    .stock-urgency {
        height: 30px;
        font-size: 0.72rem;
        flex: 0 0 44%;
        max-width: 44%;
    }
    .variant-stock-row { gap: 6px; margin: 6px 0 8px; }
}
/* 361px – 414px */
@media (min-width: 361px) and (max-width: 414px) {
    body { padding: 15px; }
    .container {
        padding: 20px;
        margin-top: 15px;
        box-shadow: none;
    }
    .product-image { height: 150px; width: 100%; }
    .offer-badge,
    .final-price-badge {
        font-size: 12px;
        padding: 3px 6px;
    }
    .product-title { font-size: 0.75rem; padding: 2px 3px; }
    .product-details h4 { font-size: 0.80rem; margin: 0; }
    .product-card {
        width: 100%;
        margin: 0 auto 15px;
        border-radius: 10px;
    }
    .add-cart-btn { padding: 2px 10px; height: 32px; }
    .quantity-control { height: 32px; }
    .quantity-control button { font-size: 1rem; padding: 8px 0; }
    .quantity-control span { font-size: 1rem; }
    .custom-select-trigger {
        height: 32px;
        font-size: 0.72rem;
        padding: 0 6px;
    }
    .custom-option {
        padding: 0px 6px;
        font-size: 0.72rem;
    }
    .stock-urgency {
        height: 32px;
        font-size: 0.72rem;
    }
}
/* 415px – 480px */
@media (min-width: 415px) and (max-width: 480px) {
    body { padding: 15px; }
    .container {
        padding: 20px;
        margin-top: 15px;
        box-shadow: none;
    }
    .product-image { height: 180px; width: 100%; }
    .offer-badge,
    .final-price-badge {
        font-size: 12px;
        padding: 3px 6px;
    }
    .product-title { font-size: 0.80rem; padding: 4px 6px; }
    .product-details h4 { font-size: 0.85rem; margin: 0; }
    .product-card {
        width: 100%;
        margin: 0 auto 20px;
        border-radius: 10px;
    }
    .add-cart-btn { padding: 6px 10px; height: 35px; }
    .quantity-control { height: 35px; }
    .quantity-control button { font-size: 16px; padding: 8px 0; }
    .quantity-control span { font-size: 16px; }
    .custom-select-trigger {
        height: 35px;
        font-size: 0.80rem;
    }
    .custom-option {
        padding: 9px 10px;
        font-size: 0.80rem;
    }
    .stock-urgency {
        height: 35px;
        font-size: 0.78rem;
    }
}
/* 481px – 720px */
@media (min-width: 481px) and (max-width: 720px) {
    body { padding: 20px; }
    .container {
        padding: 25px;
        margin-top: 20px;
        box-shadow: none;
    }
    .product-image { height: 220px; width: 100%; }
    .offer-badge,
    .final-price-badge {
        font-size: 13px;
        padding: 3px 6px;
    }
    .product-title { font-size: 0.92rem; padding: 4px 6px; }
    .product-details h4 { font-size: 1rem; margin: 0; }
    .product-card {
        width: 100%;
        margin: 0 auto 30px;
        border-radius: 12px;
    }
    .add-cart-btn { padding: 2px 12px; height: 40px; }
    .quantity-control { height: 40px; }
    .quantity-control button { font-size: 20px; padding: 10px 0; }
    .quantity-control span { font-size: 20px; }
    .custom-select-trigger {
        
        font-size: 0.88rem;
    }
    .custom-option {
        padding: 10px 12px;
        font-size: 0.85rem;
        height: 40px;
    }
    .stock-urgency {
        height: 40px;
        font-size: 0.82rem;
    }
}
/* 721px – 900px */
@media (min-width: 721px) and (max-width: 900px) {
    body { padding: 20px; }
    .container {
        padding: 30px;
        margin-top: 20px;
        box-shadow: 0 0 10px rgba(26, 49, 44, 0.08);
    }
    .product-image { height: 220px; width: 100%; }
    .offer-badge,
    .final-price-badge {
        font-size: 13px;
        padding: 3px 7px;
    }
    .product-title { font-size: 1rem; padding: 4px 6px; }
    .product-details h4 { font-size: 1rem; margin: 5px 0; }
    .product-card {
        width: 100%;
        margin: 0 auto 20px;
        border-radius: 12px;
        box-shadow: 0 5px 15px rgba(26, 49, 44, 0.1);
    }
    .add-cart-btn { padding: 10px 15px; height: 40px; }
    .quantity-control { height: 40px; }
    .quantity-control button { font-size: 18px; padding: 12px 0; }
    .quantity-control span { font-size: 18px; }
    .custom-select-trigger {
        height: 40px;
        font-size: 0.92rem;
        padding: 0 12px;
    }
    .custom-option {
        padding: 12px 14px;
        font-size: 0.90rem;
    }
    .stock-urgency {
        height: 40px;
        font-size: 0.85rem;
    }
}
/* 901px – 1280px */
@media (min-width: 901px) and (max-width: 1280px) {
    body { padding: 25px; }
    .container {
        padding: 30px;
        margin-top: 25px;
        box-shadow: 0 0 15px rgba(26, 49, 44, 0.08);
    }
    .product-image { height: 220px; width: 100%; }
    .offer-badge,
    .final-price-badge {
        font-size: 13px;
        padding: 3px 7px;
    }
    .product-title { font-size: 1rem; padding: 5px; }
    .product-details h4 { font-size: 1rem; margin: 5px 0; }
    .product-card {
        width: 100%;
        margin: 0 auto 20px;
        border-radius: 12px;
        box-shadow: 0 5px 20px rgba(26, 49, 44, 0.1);
    }
    .add-cart-btn {
        padding: 10px 15px;
        height: 40px;
        font-size: 1rem;
    }
    .quantity-control { height: 40px; }
    .quantity-control button { font-size: 18px; padding: 10px 0; }
    .quantity-control span { font-size: 18px; }
    .custom-select-trigger {
        height: 40px;
        font-size: 0.92rem;
        padding: 0 12px;
    }
    .custom-option {
        padding: 12px 14px;
        font-size: 0.90rem;
    }
    .stock-urgency {
        height: 40px;
        font-size: 0.85rem;
    }
}
/* 1281px and above */
@media (min-width: 1281px) {
    body { padding: 25px; }
    .container {
        padding: 30px;
        margin-top: 25px;
        box-shadow: 0 0 15px rgba(26, 49, 44, 0.08);
    }
    .product-image { height: 220px; width: 100%; }
    .offer-badge,
    .final-price-badge {
        font-size: 14px;
        padding: 3px 7px;
    }
    .product-title { font-size: 1rem; padding: 5px; }
    .product-details h4 { font-size: 1rem; margin: 5px 0; }
    .product-card {
        width: 100%;
        margin: 0 auto 20px;
        border-radius: 12px;
        box-shadow: 0 5px 20px rgba(26, 49, 44, 0.1);
    }
    .add-cart-btn {
        padding: 10px 15px;
        height: 40px;
        font-size: 1rem;
    }
    .quantity-control { height: 40px; }
    .quantity-control button { font-size: 18px; padding: 10px 0; }
    .quantity-control span { font-size: 18px; }
    .custom-select-trigger {
        height: 40px;
        font-size: 0.92rem;
        padding: 0 12px;
    }
    .custom-option {
        padding: 12px 14px;
        font-size: 0.90rem;
    }
    .stock-urgency {
        height: 40px;
        font-size: 0.85rem;
    }
}
@media (min-width: 768px) {
    .product-title { font-size: 18px; }
}
/* ===== Category Section ===== */
.category-section {
    margin: 10px 0;
    padding: 5px 0;
    text-align: center;
    background-color: #ffffff;
    width: 100%;
    position: sticky;
    top: 0;
    will-change: transform;
    z-index: 1010;
    transition: transform 0.28s ease, opacity 0.28s ease;
    backface-visibility: hidden;
}
.category-section.hide-on-scroll {
    transform: translate3d(0, -110%, 0);
    opacity: 0;
    pointer-events: none;
}
.category-slider {
    display: flex;
    overflow-x: auto;
    white-space: nowrap;
    padding: 5px 10px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: #d4a017 #f8f5f0;
    gap: 10px;
    width: 100%;
}
.category-slider::-webkit-scrollbar { height: 8px; }
.category-slider::-webkit-scrollbar-track { background-color: #f8f5f0; border-radius: 5px; }
.category-slider::-webkit-scrollbar-thumb { background: #d4a017; border-radius: 5px; }
.category-btn {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    background-color: #f8f5f0;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 50px;
    flex-shrink: 0;
}
.category-btn:hover,
.category-btn.active {
    background-color: #e8f5e9;
    transform: translateY(-3px);
}
.category-image {
    width: 70px;
    height: 70px;
    object-fit: cover;
    border-radius: 50%;
    margin-bottom: 6px;
}
.category-name {
    font-size: 14px;
    font-weight: 600;
    text-transform: capitalize;
}
.subcategory-slider {
    display: flex;
    overflow-x: auto;
    white-space: nowrap;
    padding: 5px 10px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: #d4a017 #f8f5f0;
    gap: 10px;
    width: 100%;
    background-color: #f1f8e9;
    border-top: 1px solid #c8e6c9;
    margin-top: 5px;
    display: none;
}
.subcategory-btn {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    background-color: #f8f5f0;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 50px;
    flex-shrink: 0;
}
.subcategory-btn:hover,
.subcategory-btn.active {
    background-color: #d4a017;
    color: white;
    transform: translateY(-3px);
}
@media (max-width: 576px) {
    .category-image { width: 50px; height: 50px; margin-bottom: 4px; }
    .category-name { font-size: 12px; }
    .category-slider,
    .subcategory-slider { padding: 4px; gap: 6px; }
    .category-btn,
    .subcategory-btn { min-width: 40px; }
}
@media (max-width: 360px) {
    .category-image { width: 40px; height: 40px; margin-bottom: 3px; }
    .category-name { font-size: 10px; }
    .category-slider,
    .subcategory-slider { padding: 2px; gap: 4px; }
    .category-btn,
    .subcategory-btn { min-width: 35px; }
}