:root {
  /* Colors */
  --color-primary: #000;
  --color-secondary: #fff;
  --color-accent: gray;
  --color-text: #333;
  --color-text-light: #666;
  
  /* Spacing */
  --spacing-xs: 8px;
  --spacing-sm: 16px;
  --spacing-md: 24px;
  --spacing-lg: 32px;
  
  /* Shadows */
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.15);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.2);
  
  /* Transitions */
  --transition-speed: 0.3s;
}

/* Home page specific styles */
/* Styles for the hero image and shop now button START */
.hero-image {
    width: 100%;
    height: 85vh;
    object-fit: cover;
    display: block;
    margin: 0 auto;
    position: relative;
}

.mobile-cart-link,
.mobile-shop-link {
    display: none;
}

/* animation of fallback image */
.hero-image {
    transition: opacity 0.5s ease-in-out;
}

.opacity-0 {
    opacity: 0;
}

.boixy-slogan {
    position: absolute;
    top: 20%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 3rem;
    font-weight: bold;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.7);
    z-index: 5; /* Ensure it appears above the image */
}

.shop-now-btn {
    all: unset;
    position: absolute;
    top: 80%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: black;
    border: 5px solid #E5E7EB;
    border-radius: 15%;
    padding: 0.5rem;
    font-size: 2rem;
    font-weight: bold;
    text-decoration: none;
    cursor: pointer;
    transition: font-size 0.4s ease-in-out, background-color 0.3s ease, color 0.3s ease;
}

.shop-now-btn:hover {
    background-color: lightgrey;
}

/* Responsive adjustments for mobile */
@media (max-width: 35em) {
    .primary-header {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        z-index: 1001;
    }

    .hero-image {
        z-index: 1;
        height: 90vh;
    }

    .mobile-cart-link,
    .mobile-shop-link {
        display: block;
        position: absolute;
        top: 2rem;
        width: 1.7rem;
        height: 1.7rem;
    }

    .mobile-cart-link {
        right: 4rem;
    }

    .mobile-shop-link {
        right: 7rem;
    }

    .mobile-cart-link img,
    .mobile-shop-link img {
        width: 100%;
        height: 100%;
        object-fit: contain;
    }

    .shop-now-btn {
        all: unset;
        position: absolute;
        top: 75%;
        left: 50%;
        transform: translate(-50%, -50%);
        color: black;
        border: 5px solid #E5E7EB;
        border-radius: 15%;
        padding: 0.4rem;
        font-size: 1.4rem;
        font-weight: bold;
        text-decoration: none;
        cursor: pointer;
        transition: font-size 0.4s ease-in-out, background-color 0.3s ease, color 0.3s ease;
        z-index: 5; /* Above header, change if any overlay issues */
    }

    .shop-now-btn:hover {
        background-color: lightgrey;
    }

    .boixy-slogan {
        font-size: 1.5rem;
        top: 54%;
    }

    .top-label {
        position: fixed;
        left: 5%;
       transform: translateY(-0.7rem);
        top: 0;
        visibility: visible;
        z-index: 1000;
    }
}

@media (min-width: 35em) {
    .top-label {
        position: fixed;
        top: 0;
        left: 50%;
        transform: translateX(-50%) translateY(-1rem);
        visibility: visible;
        z-index: 1002;
        pointer-events: none;
    }
}
/* Styles for the hero image and shop now button  END */

/* Styles for the best sellers section START */

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 2rem;
}

.best-sellers {
    font-size: 1.4rem;
    margin: 0; /* Remove default margin, begin: 2rem */
    font-weight: bold;
}

.view-all-btn {
    color: gray;
    text-decoration: none;
    cursor: pointer;
    transition: color 0.4s ease-in-out;
}

.view-all-btn:hover {
    color: black;
}

/* Styles for the best sellers section END */

/* Product cards styles start*/

/* product layout for mobile */
@media (max-width: 35em) {
   .products-grid {
        display: flex;
        gap: 12px;
        overflow-x: auto;
        overflow-y: hidden;
        padding: 16px;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
    }

    .product-card {
        min-width: calc(55vw - 12px); /* Sweet spot: shows 1.5 cards */
        max-width: calc(55vw - 12px);
        flex-shrink: 0;
        scroll-snap-align: start;
        background: white;
        border-radius: 12px;
        overflow: hidden;
    }

    .product-image-wrapper {
        position: relative;
        width: 100%;
        aspect-ratio: 1 / 1; /* Square images */
        overflow: hidden;
        background: #f0f0f0;
    }

    .product-image {
        width: 100%;
        height: 100%;
        object-fit: cover;
        transition: transform 0.3s;
    }

    .product-info {
        padding: 12px;
        display: flex;
        flex-direction: column;
        gap: 6px; /* Consistent spacing */
    }

    .product-name {
        font-size: 0.95rem;
        margin-bottom: 0;
        line-height: 1.2;
    }

    .product-price {
        font-size: 1rem;
        margin-bottom: 0;
        gap: 6px;
    }

    .price-original {
        font-size: 0.8rem;
    }

    .add-to-cart-btn {
        padding: 10px;
        font-size: 0.75rem;
        letter-spacing: 0.5px;
    }

    /* Hide badge on mobile if space is tight */
    .product-badge {
        font-size: 0.65rem;
        padding: 2px 8px;
        top: 8px;
        right: 8px;
    }

}

.products-grid {
    display: flex;
    gap: 20px;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 20px 0;  /* Vertical padding only */
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    max-width: 100vw;
}

.product-card {
    min-width: calc(50% - 10px);
    max-width: calc(50% - 10px);
    flex-shrink: 0;
    scroll-snap-align: start;
    background: white;
    border-radius: 8px;
    overflow: hidden;
}

.products-grid::-webkit-scrollbar {
    height: 8px;
}

.products-grid::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.products-grid::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 10px;
}

.products-grid::-webkit-scrollbar-thumb:hover {
    background: #555;
}

.product-card:first-child {
    margin-left: 20px;
}

.product-card:last-child {
    margin-right: 20px;
}

.product-card:hover {
    transform: scale(1.02);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

.product-image-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 3 / 4;
    overflow: hidden;
    background: #f0f0f0;
}

.product-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.product-card:hover .product-image {
    transform: scale(1.05);
}

.product-badge {
    position: absolute;
    top: 16px;  /* Fixed value instead of variable */
    right: 16px;
    background: #ff0000;
    color: white;
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
}

.product-info {
    padding: 24px;  /* Fixed value */
    display: flex;
    flex-direction: column;
}

.product-name {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 12px;
    color: #333;
}

.product-price {
    display: flex;
    align-items: center;
    margin-bottom: 16px;
    font-size: 1.2rem;
    font-weight: 700;
    gap: 8px;
}

.price-current {
    color: #000;
}

.price-original {
    color: #666;
    text-decoration: line-through;
    font-size: 0.9rem;
    font-weight: 400;
}

/* style for add btn start */
.add-to-cart-btn {
    width: 100%;
    padding: 16px;
    background: #000;
    color: #fff;
    font-weight: 600;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    transition: all 0.3s;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 0.9rem;
}

.add-to-cart-btn:hover {
    background: gray;
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.add-to-cart-btn:active {
    transform: translateY(0);
}

.add-to-cart-btn.added {
    background: #22c55e;
}

/*style for add to cart button end */

.footer-end {
    display: flex;
    justify-content: center;
    padding: 5%;
}

/* ===== PRODUCT DIALOG MODAL STYLES ===== */

.product-dialog {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.product-dialog.active {
    display: flex;
}

/* Overlay/Backdrop */
.dialog-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
}

/* Dialog Content Container */
.dialog-content {
    position: relative;
    background: white;
    border-radius: 16px;
    max-width: 700px;
    width: 95%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Close Button */
.dialog-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 40px;
    height: 40px;
    background: white;
    border: none;
    border-radius: 50%;
    font-size: 2rem;
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    transition: all 0.2s ease;
    color: #333;
    line-height: 1;
}

.dialog-close:hover {
    background: #f5f5f5;
    transform: scale(1.1);
}

/* Dialog Body - Two Column Layout */
.dialog-body {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    padding: 2rem;
}

/* Desktop: Two columns */
@media (min-width: 768px) {
    .dialog-body {
        grid-template-columns: 1fr 1fr;
        padding: 3rem;
    }
}

/* LEFT SIDE: IMAGES */

.dialog-images {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.main-image-wrapper {
    width: 100%;
    aspect-ratio: 3 / 4;
    background: #f0f0f0;
    border-radius: 12px;
    overflow: hidden;
}

.main-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Thumbnail Images */
.thumbnail-images {
    display: flex;
    gap: 0.75rem;
    overflow-x: auto;
    padding: 0.25rem;
}

.thumbnail-images::-webkit-scrollbar {
    height: 4px;
}

.thumbnail-images::-webkit-scrollbar-thumb {
    background: #ddd;
    border-radius: 4px;
}

.thumbnail-item {
    flex-shrink: 0;
    width: 80px;
    height: 80px;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.2s ease;
}

.thumbnail-item:hover {
    border-color: #999;
}

.thumbnail-item.active {
    border-color: #000;
}

.thumbnail-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* RIGHT SIDE: PRODUCT INFO */

.dialog-info {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.dialog-product-name {
    font-size: 1.75rem;
    font-weight: 700;
    color: #111;
    line-height: 1.2;
}

.dialog-product-category {
    font-size: 0.9rem;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
}

.dialog-price {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.dialog-price-current {
    font-size: 2rem;
    font-weight: 700;
    color: #000;
}

.dialog-price-original {
    font-size: 1.25rem;
    color: #999;
    text-decoration: line-through;
}

.dialog-description {
    color: #666;
    line-height: 1.6;
    font-size: 0.95rem;
}

/* SIZE SELECTOR */

.size-selector {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.size-label {
    font-weight: 600;
    font-size: 0.95rem;
    color: #333;
}

.size-options {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.size-btn {
    padding: 0.75rem 1.25rem;
    border: 2px solid #ddd;
    background: white;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.2s ease;
    min-width: 60px;
    text-align: center;
}

.size-btn:hover {
    border-color: #999;
}

.size-btn.active {
    border-color: #000;
    background: #000;
    color: white;
}

.size-btn.out-of-stock {
    opacity: 0.3;
    cursor: not-allowed;
}

.size-btn.out-of-stock:hover {
    border-color: #ddd;
}

/* ADD TO CART BUTTON */

.dialog-add-to-cart {
    width: 100%;
    padding: 1.25rem;
    background: #000;
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: auto;
}

.dialog-add-to-cart:hover {
    background: #333;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

.dialog-add-to-cart:active {
    transform: translateY(0);
}

.dialog-add-to-cart:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

/* MOBILE OPTIMIZATIONS */

@media (max-width: 767px) {
    .dialog-content {
        max-width: 90vw;
        max-height: 85vh;
        border-radius: 16px;
    }
    
    .dialog-body {
        padding: 1.5rem;
        gap: 1.5rem;
    }
    
    .dialog-product-name {
        font-size: 1.5rem;
    }
    
    .dialog-price-current {
        font-size: 1.5rem;
    }
    
    .dialog-close {
        top: 0.75rem;
        right: 0.75rem;
    }
    
    .thumbnail-item {
        width: 70px;
        height: 70px;
    }
}

/* Prevent body scroll when dialog is open */
body.dialog-open {
    overflow: hidden;
}