/* Ensure discount badge is positioned correctly in More To Buy cards */
.product-card .image-container {
    position: relative;
}
.product-card .discount-badge-bottom {
    position: absolute;
    bottom: 5px;
    left: 5px;
}
/* ========== COOKIE CONSENT BANNER ========== */
.cookie-consent-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #f0f0f0;
    color: #000;
    padding: 20px;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
    z-index: 20000;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    min-height: auto;
    overflow-y: visible;
    font-size: 0.95rem;
    animation: slideUp 0.4s ease-out;
    pointer-events: auto;
}

@keyframes slideUp {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.cookie-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 25px;
    max-width: 100%;
    margin: 0 auto;
    width: 100%;
}

/* ===== VIEW MORE CARD (Hot Deals + Popular end card) ===== */
.view-more-card {
    flex: 0 0 auto;
    width: 130px;                 /* same as other cards */
    background: #fff;             /* white field */
    border: 1px solid #eee;
    border-radius: 0;
    display: flex;
    align-items: center;          /* vertical center */
    justify-content: center;      /* horizontal center */
    text-decoration: none;
    color: #111;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    cursor: pointer;
    min-height: 180px;            /* match card height feel */
}

.view-more-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(0,0,0,0.08);
    background: #fff;             /* stay white, not grey */
    color: #111;
}

.view-more-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px;
    width: 100%;
}

.arrow-circle {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: #000;            /* black circle */
    display: flex;
    align-items: center;
    justify-content: center;
}

.arrow-circle i {
    color: #fff;                 /* white arrow */
    font-size: 1rem;
}

.view-more-text {
    font-size: 0.75rem;
    font-weight: 600;
    color: #333;
    line-height: 1;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.cookie-accept {
    background: white;
    color: #000;
    border: 1px solid #ddd;
}

.cookie-accept:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    background: #fafafa;
}

.cookie-reject {
    background: #e50914;
    color: white;
    border: none;
}

.cookie-reject:hover {
    background: #c20810;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(229, 9, 20, 0.3);
}

.cookie-manage {
    background: white;
    color: #000;
    border: 1px solid #ddd;
}

.cookie-manage:hover {
    background: #fafafa;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.cookie-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 21000;
}

.cookie-modal-content {
    background: white;
    padding: 25px;
    border-radius: 10px;
    width: 90%;
    max-width: 500px;
    position: relative;
}

.cookie-modal-close {
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: #666;
    transition: color 0.3s;
}

.cookie-modal-close:hover {
    color: #000;
}

.cookie-modal-content h2 {
    margin-top: 0;
    color: #333;
    margin-bottom: 25px;
    font-size: 1.4rem;
}

.cookie-preference-group {
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.cookie-preference-group:last-of-type {
    border-bottom: none;
}

.cookie-preference-item {
    display: flex;
    align-items: flex-start;
    cursor: pointer;
    gap: 12px;
}

.cookie-preference-item input[type="checkbox"] {
    margin-top: 3px;
    cursor: pointer;
    width: 18px;
    height: 18px;
    accent-color: #e50914;
}

.cookie-preference-item input[type="checkbox"]:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.cookie-preference-item div {
    flex: 1;
}

.cookie-preference-item strong {
    display: block;
    color: #333;
    margin-bottom: 4px;
}

.cookie-preference-item p {
    color: #666;
    font-size: 0.85rem;
    margin: 0;
    line-height: 1.4;
}

.cookie-modal-buttons {
    display: flex;
    gap: 12px;
    margin-top: 25px;
    justify-content: space-between;
}

.cookie-modal-buttons .cookie-btn {
    flex: 1;
    padding: 12px 20px;
}

/* ========== RESPONSIVE COOKIE ========== */
@media (max-width: 768px) {
    .cookie-consent-banner {
        flex-direction: column;
        align-items: stretch;
        padding: 18px 15px;
        gap: 15px;
        min-height: auto;
    }

    .cookie-content {
        flex-direction: column;
        gap: 15px;
        align-items: stretch;
    }

    .cookie-text {
        flex: none;
        width: 100%;
    }

    .cookie-text h3 {
        font-size: 1rem;
        margin-bottom: 8px;
    }

    .cookie-text p {
        font-size: 0.85rem;
        margin: 6px 0;
    }

    .cookie-types {
        font-size: 0.8rem !important;
    }

    .cookie-buttons {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 10px;
        width: 100%;
    }

    .cookie-accept,
    .cookie-reject {
        grid-column: span 1;
    }

    .cookie-manage {
        grid-column: 1 / -1;
        width: 100%;
    }

    .cookie-btn {
        padding: 12px 16px;
        font-size: 0.85rem;
        width: 100%;
        text-align: center;
    }
}

/* ========== SKELETON LOADER ========== */
.skeleton-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #f0f0f0;
    overflow: hidden;
    z-index: 1;
}

.skeleton-loader {
    width: 100%;
    height: 100%;
    background: #f0f0f0;
    animation: none;
}

@keyframes skeleton-loading {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

/* ========== MIN-HEIGHT FOR EMPTY CONTAINERS ========== */
#hotDealsContainer,
#popularContainer {
    min-height: 160px;
    align-items: flex-start;
}

.hot-deal-card .image-container,
.popular-card .image-container {
    position: relative;
    width: 100%;
    height: 140px;
    overflow: hidden;
    background: #f8f9fa;
}

.product-card .image-container {
    position: relative;
    width: 100%;
    height: 200px;
    overflow: hidden;
    background: #f8f9fa;
    border-radius: 12px;
}

@media (min-width: 768px) {
    .product-card .image-container {
        height: 240px;
        border-radius: 12px;
    }
}

.hot-deal-card img,
.popular-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    background: #fff;
    display: block;
    opacity: 1 !important;
    transition: none !important;
}

.product-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    background: #fff;
    display: block;
    opacity: 1 !important;
    transition: none !important;
}

.hot-deal-card img.loaded,
.popular-card img.loaded,
.product-card img.loaded {
    opacity: 1;
}

.hot-deal-card .image-container.skeleton-done .skeleton-container,
.popular-card .image-container.skeleton-done .skeleton-container,
.product-card .image-container.skeleton-done .skeleton-container {
    display: none;
}

/* ========== GLOBAL ========== */
body {
    background: #f7f7f7;
    font-family: 'Poppins', sans-serif;
    padding: 0;
    margin: 0;
}

.container {
    max-width: 100%;
    padding: 0 5px;
    margin: 0 auto;
    background: #ffffff;
}

/* ========== MOBILE LAYOUT ========== */
.mobile-layout {
    display: block;
    margin-top: 0;
}

.mobile-top-sections {
    margin: 10px 5px;
    padding: 12px 5px 15px 5px;
    background: white;
    border-radius: 0;
}

.mobile-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    padding: 0 5px;
}

.mobile-section-header h3 {
    font-size: 1.2rem;
    color: #333;
    margin: 0;
    font-weight: 600;
}

.mobile-view-all {
    font-size: 0.85rem;
    color: #000;
    text-decoration: none;
    font-weight: 600;
}

.mobile-horizontal-scroll {
    display: flex;
    overflow-x: auto;
    gap: 8px;
    padding: 10px 3px 15px 3px;
    scrollbar-width: none;
    scroll-snap-type: x mandatory;
}

.mobile-horizontal-scroll::-webkit-scrollbar {
    display: none;
}

.section-tag {
    background: #000;
    color: #fff;
    font-size: 0.6rem;
    padding: 3px 8px;
    border-radius: 20px;
    font-weight: 600;
    white-space: nowrap;
}

.hot-deal-card,
.popular-card {
    flex: 0 0 auto;
    width: 130px;
    background: white;
    border-radius: 0 !important;
    overflow: hidden;
    box-shadow: none;
    transition: all 0.3s ease;
    text-decoration: none;
    color: #333;
    scroll-snap-align: start;
    display: flex;
    flex-direction: column;
    border: none;
    position: relative;
}

.hot-deal-card:hover,
.popular-card:hover {
    transform: translateY(-3px);
    box-shadow: none;
    text-decoration: none;
    color: #333;
}

.hot-deal-card .image-container,
.popular-card .image-container {
    width: 100%;
    height: 120px;
    overflow: hidden;
    background: #f5f5f5;
    position: relative;
}

.hot-deal-card .lazy-img,
.popular-card .lazy-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hot-deal-content,
.popular-content {
    padding: 2px 3px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.hot-deal-content h5,
.popular-content h5 {
    font-size: 0.7rem;
    font-weight: 600;
    margin: 0 0 1px 0;
    line-height: 1.1;
}

.hot-deal-content .price,
.popular-content .price,
.product-info .price {
    font-size: 0.95rem;
    font-weight: bold;
    color: #000;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 1px;
}

.discount-badge-bottom {
    position: absolute;
    bottom: 5px;
    left: 5px;
    background: #e50914;
    color: #fff;
    font-size: 0.6rem;
    padding: 3px 6px;
    border-radius: 4px;
    font-weight: 700;
    z-index: 5;
    white-space: nowrap;
    line-height: 1;
}

.skeleton-card {
    width: 130px;
    height: 180px;
    background: #f0f0f0;
    animation: pulse 1.2s infinite ease-in-out;
    border-radius: 0;
}

@keyframes pulse {
    0% { opacity: 0.7; }
    50% { opacity: 1; }
    100% { opacity: 0.7; }
}

.hot-deal-content .old-price,
.popular-content .old-price {
    display: none;
}

.hot-deal-content .badge,
.popular-content .badge {
    font-size: 0.6rem;
    margin-top: 1px;
    text-align: left;
    line-height: 1;
}

.view-more-card {
    flex: 0 0 auto;
    width: 118px;              /* a bit smaller */
    background: #fff;          /* plain white */
    border: 1px solid #eee;    /* subtle border */
    border-radius: 0;
    display: flex;
    align-items: center;       /* centered up/down */
    justify-content: center;   /* centered left/right */
    text-decoration: none;
    color: #333;
    transition: all 0.3s ease;
    cursor: pointer;
}

.view-more-card:hover {
    background: #efefef;
    transform: translateY(-2px);
    text-decoration: none;
    color: #333;
}

.view-more-content{
    padding: 10px 8px;
    gap: 6px;
}

.arrow-circle{
    width: 34px;
    height: 34px;
}

.view-more-card:hover .arrow-circle {
    transform: translate(4px);
}

.view-more-text {
    font-size: 0.7rem;
    font-weight: 600;
    white-space: nowrap;
}

.hot-deal-content .out-stock-badge,
.popular-content .out-stock-badge {
    color: #dc3545;
    font-weight: 600;
    text-align: left;
    font-size: 0.65rem;
    display: block;
}

.hot-deal-content .review-stars,
.popular-content .review-stars {
    display: none;
}

/* ========== MORE TO BUY ========== */
.more-to-buy-section {
    margin: 10px auto;
    padding: 12px 3px 15px 3px;
    background: white;
    border-radius: 8px;
    box-shadow: none;
    max-width: 100%;
}

.categories-scroll-container {
    display: flex;
    overflow-x: auto;
    gap: 2px;
    padding: 10px 3px 15px 3px;
    scrollbar-width: none;
    scroll-snap-type: x mandatory;
}

.categories-scroll-container::-webkit-scrollbar {
    display: none;
}

/* ========== PRODUCTS GRID ========== */
.products-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    padding: 0 3px;
    margin-bottom: 25px;
    width: 100%;
}

.product-card {
    background: white;
    border-radius: 12px !important;
    box-shadow: none;
    overflow: hidden;
    position: relative;
    transition: transform 0.3s ease;
    cursor: pointer;
    width: 100%;
    border: none;
    display: flex;
    flex-direction: column;
}

.product-card:hover {
    transform: translateY(-2px);
    box-shadow: none;
}

.product-info {
    padding: 6px;
}

.product-info h5 {
    font-size: 0.75rem;
    font-weight: 600;
    color: #555;
    margin-bottom: 2px;
    line-height: 1.2;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    word-break: break-word;
}

.product-info p {
    font-size: 0.75rem;
    color: #555;
    margin: 1px 0;
}

.product-price {
    color: #000 !important;
    font-weight: 700;
    display: flex;
    align-items: baseline;
    gap: 4px;
}

.product-price .currency {
    font-size: 0.65rem;
    font-weight: 600;
    color: #000 !important;
}

.product-price .amount {
    font-size: 1.1rem;
    font-weight: 800;
    color: #000 !important;
}

.star-rating {
    font-size: 0.75rem;
    color: #ffc107;
    margin: 5px 0;
    display: flex;
    align-items: center;
    gap: 2px;
}

.star-rating small {
    color: #666;
    margin-left: 5px;
    font-size: 0.7rem;
}

.icon-btn {
    position: absolute;
    background: rgba(229, 9, 20, 0.9);
    color: white;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    outline: none;
    z-index: 20;
}

.icon-btn:hover {
    background: rgba(229, 9, 20, 1);
    transform: scale(1.1);
}

.icon-btn i {
    font-size: 14px;
}

.icon-btn.disabled {
    background: rgba(128,128,128,0.7) !important;
    cursor: not-allowed;
    opacity: 0.5;
    pointer-events: none;
}

.icon-cart { top: 8px; right: 8px; }
.icon-share { bottom: 8px; right: 8px; }

/* ========== POPUP ========== */
.popup {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.8);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    padding: 5px;
}

.popup-content {
    background: #fff;
    border-radius: 16px;
    padding: 0;
    max-width: 850px;
    width: 98%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
}

.popup-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px 0;
    margin-bottom: 10px;
}

.popup-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: #e50914;
    margin: 0;
}

.close-popup {
    background: none;
    border: none;
    font-size: 1.3rem;
    color: #666;
    cursor: pointer;
    transition: color 0.3s ease;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-popup:hover {
    color: #e50914;
}

.popup-body {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 0 12px 12px;
}

/* ========== IMAGE GALLERY ========== */
.popup-product {
    position: relative;
}

.image-gallery {
    position: relative;
    width: 100%;
    height: 160px;
    overflow: hidden;
    border-radius: 12px;
}

.gallery-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: none;
    transition: opacity 0.3s ease;
    border-radius: 12px;
}

.gallery-image.active {
    display: block;
}

.image-actions {
    position: absolute;
    right: 12px;
    top: 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    z-index: 20;
    pointer-events: auto;
}

.image-action-btn {
    background: rgba(255, 255, 255, 0.95);
    border: none;
    color: #e50914;
    width: 28px;
    height: 28px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.image-action-btn:hover {
    background: #e50914;
    color: white;
    transform: scale(1.15);
    box-shadow: 0 3px 8px rgba(229, 9, 20, 0.3);
}

.image-action-btn.added {
    background: #e50914;
    color: white;
}

.image-action-btn i {
    font-weight: 700;
}

.gallery-nav {
    position: absolute;
    top: 50%;
    width: 100%;
    display: flex;
    justify-content: space-between;
    transform: translateY(-50%);
    padding: 0 8px;
    z-index: 10;
}

.gallery-btn {
    background: rgba(229, 9, 20, 0.8);
    color: white;
    border: none;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
    box-shadow: 0 3px 10px rgba(0,0,0,0.3);
}

.gallery-btn:hover {
    background: rgba(229, 9, 20, 1);
    transform: scale(1.1);
    box-shadow: 0 5px 15px rgba(0,0,0,0.4);
}

.gallery-btn:disabled {
    background: rgba(128, 128, 128, 0.5);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.gallery-indicators {
    position: absolute;
    bottom: 8px;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    gap: 5px;
    z-index: 10;
}

.gallery-indicator {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.gallery-indicator.active {
    background: #e50914;
    transform: scale(1.2);
    border-color: white;
}

.thumbnail-container {
    display: flex;
    gap: 5px;
    margin-top: 6px;
    overflow-x: auto;
    padding: 6px 0;
    scrollbar-width: thin;
    justify-content: flex-start;
    align-items: center;
    min-height: 40px;
}

.thumbnail-container::-webkit-scrollbar {
    height: 3px;
}

.thumbnail-container::-webkit-scrollbar-thumb {
    background: #e50914;
    border-radius: 2px;
}

.thumbnail {
    width: 35px;
    height: 35px;
    border-radius: 6px;
    cursor: pointer;
    opacity: 0.6;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    object-fit: cover;
    flex-shrink: 0;
}

.thumbnail.active {
    opacity: 1;
    border-color: #e50914;
    transform: scale(1.05);
}

.thumbnail:hover {
    opacity: 1;
    border-color: #e50914;
}

.popup-product-info h3 {
    font-size: 1.1rem;
    font-weight: 700;
    color: #222;
    margin-bottom: 6px;
}

.popup-product-info .price {
    font-size: 1.2rem;
    font-weight: 700;
    color: #e50914;
    margin-bottom: 10px;
}

/* ========== REVIEWS ========== */
.reviews-section {
    margin: 10px 0 5px;
    padding: 8px 10px;
    background: #f8f9fa;
    border-radius: 6px;
    min-height: 150px;
    position: relative;
    border: 1px solid #e9ecef;
}

.reviews-section h5 {
    font-size: 0.9rem;
    margin: 0 0 8px 0;
    color: #333;
    font-weight: 600;
}

.reviews-carousel {
    position: relative;
    overflow: hidden;
    min-height: 110px;
}

.reviews-carousel-inner {
    display: flex;
    transition: transform 0.3s ease;
}

.review-slide {
    min-width: 100%;
    padding: 6px 0;
    box-sizing: border-box;
}

.review-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 5px;
    flex-wrap: wrap;
}

.review-user {
    font-weight: 600;
    color: #333;
    font-size: 0.85rem;
}

.review-date {
    font-size: 0.7rem;
    color: #666;
}

.review-stars {
    font-size: 0.75rem;
    color: #ffc107;
    margin: 4px 0;
    display: flex;
    align-items: center;
    gap: 1px;
}

.review-comment {
    font-size: 0.8rem;
    color: #555;
    line-height: 1.3;
    margin: 0 0 5px 0;
}

.reviews-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.reviews-header h5 {
    margin: 0;
    font-size: 0.9rem;
    color: #333;
    font-weight: 600;
}

.leave-review-btn-small {
    background: #007bff;
    color: white;
    border: none;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.7rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 3px;
    text-decoration: none;
}

.leave-review-btn-small:hover {
    background: #0056b3;
    transform: translateY(-1px);
    color: white;
    text-decoration: none;
}

.review-carousel-nav {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-top: 8px;
}

.review-carousel-btn {
    background: #e50914;
    color: white;
    border: none;
    width: 25px;
    height: 25px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.8rem;
}

.review-carousel-btn:hover {
    background: #c40812;
    transform: scale(1.1);
}

.review-carousel-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

.review-count {
    font-size: 0.75rem;
    color: #666;
}

.no-reviews {
    text-align: center;
    color: #666;
    font-size: 0.8rem;
    padding: 15px 0;
}

/* ========== POPUP BUTTONS ========== */
.popup-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-top: 12px;
}

.popup-buttons button {
    padding: 8px 10px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.8rem;
    transition: all 0.3s ease;
}

.add-btn {
    background: #28a745;
    color: white;
}

.add-btn:hover:not(.disabled) {
    background: #218838;
    transform: translateY(-2px);
}

.buy-btn {
    background: #007bff;
    color: white;
}

.buy-btn:hover:not(.disabled) {
    background: #0056b3;
    transform: translateY(-2px);
}

.add-btn.disabled,
.buy-btn.disabled {
    background: #6c757d !important;
    cursor: not-allowed;
    opacity: 0.6;
    transform: none !important;
}

/* ========== SIMILAR PRODUCTS ========== */
.similar-products {
    grid-column: 1 / -1;
    margin-top: 15px;
}

.similar-title {
    font-size: 1rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 10px;
    padding-bottom: 4px;
    border-bottom: 2px solid #e50914;
}

.similar-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(85px, 1fr));
    gap: 6px;
}

.similar-product {
    background: #f8f9fa;
    border-radius: 6px;
    padding: 5px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    border: 2px solid transparent;
}

.similar-product:hover {
    transform: translateY(-3px);
    border-color: #e50914;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.similar-product.active {
    border-color: #e50914;
    background: #fff;
}

.similar-product img {
    width: 100%;
    height: 55px;
    object-fit: cover;
    border-radius: 4px;
    margin-bottom: 4px;
}

.similar-product h6 {
    font-size: 0.65rem;
    font-weight: 600;
    margin: 0;
    color: #333;
    line-height: 1.2;
}

.similar-price {
    font-size: 0.6rem;
    font-weight: 700;
    color: #e50914;
    margin-top: 2px;
}

.out-of-stock {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(220, 53, 69, 0.9);
    color: #fff;
    padding: 8px 15px;
    border-radius: 4px;
    font-weight: 700;
    font-size: 0.8rem;
    z-index: 5;
    text-align: center;
}

/* ========== BADGES ========== */
.discount-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    background: #e50914;
    color: white;
    padding: 3px 6px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
    z-index: 15;
    white-space: nowrap;
    width: auto;
    max-width: fit-content;
}

.new-arrival-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    background: linear-gradient(135deg, #0066cc, #0052a3);
    color: white;
    padding: 2px 5px;
    border-radius: 4px;
    font-size: 0.5rem;
    font-weight: 700;
    z-index: 15;
    display: flex;
    align-items: center;
    gap: 1px;
    box-shadow: 0 1px 4px rgba(0, 102, 204, 0.3);
    animation: flipInBadge 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    transform-origin: top right;
    letter-spacing: 0px;
}

.hot-deal-card .new-arrival-badge,
.popular-card .new-arrival-badge,
.product-card .new-arrival-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    background: linear-gradient(135deg, #0066cc, #0052a3);
    color: white;
    padding: 2px 5px;
    border-radius: 4px;
    font-size: 0.5rem;
    font-weight: 700;
    z-index: 15;
    display: flex;
    align-items: center;
    gap: 1px;
    box-shadow: 0 1px 4px rgba(0, 102, 204, 0.3);
    animation: flipInBadge 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    transform-origin: top right;
    letter-spacing: 0px;
}

.new-arrival-badge i {
    font-size: 0.5rem;
    animation: sparkle 1.5s ease-in-out infinite;
}

@keyframes flipInBadge {
    0% {
        opacity: 0;
        transform: perspective(400px) rotateY(90deg) scale(0.5);
    }
    50% {
        transform: perspective(400px) rotateY(-10deg);
    }
    100% {
        opacity: 1;
        transform: perspective(400px) rotateY(0deg) scale(1);
    }
}

@keyframes sparkle {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.6;
        transform: scale(1.2);
    }
}

/* ========== LOADING MORE ========== */
.loading-more-section {
    text-align: center;
    margin: 30px 0;
    padding: 20px 5px;
}

.loading-spinner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.spinner-circle {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(0, 0, 0, 0.1);
    border-top: 4px solid #000;
    border-radius: 50%;
    animation: spinnerRotate 1s linear 3s infinite;
}

@keyframes spinnerRotate {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-spinner p {
    color: #333;
    font-weight: 600;
    font-size: 0.95rem;
    margin: 0;
    letter-spacing: 0.5px;
}

/* ========== BACK TO TOP ========== */
.back-to-top {
    background: rgba(0, 0, 0, 0.4);
    color: white;
    border: none;
    padding: 0;
    border-radius: 50%;
    width: 38px;
    height: 38px;
    position: fixed;
    bottom: 80px;
    right: 20px;
    cursor: pointer;
    transition: all 0.4s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transform: translateY(100px);
}

.back-to-top.show {
    opacity: 1;
    transform: translateY(0);
}

.back-to-top:hover {
    background: rgba(0, 0, 0, 0.6);
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
}

.back-to-top i {
    font-size: 1.3rem;
    transition: transform 0.3s ease;
    animation: arrow-bounce 1.5s infinite;
}

.back-to-top:hover i {
    transform: translateY(-2px);
}

@keyframes arrow-bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-8px);
    }
}

/* ========== WISHLIST ALERT ========== */
.wishlist-alert {
    position: fixed;
    top: 80px;
    left: 50%;
    transform: translateX(-50%) translateY(-20px);
    background: linear-gradient(135deg, #e50914 0%, #ff6b6b 100%);
    color: white;
    padding: 16px 30px;
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(229, 9, 20, 0.4);
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 600;
    z-index: 9999;
    opacity: 0;
    transition: all 0.3s ease;
}

.wishlist-alert.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.wishlist-alert i {
    font-size: 1.3rem;
    animation: heartBeat 0.6s ease-in-out;
}

@keyframes heartBeat {
    0%, 100% {
        transform: scale(1);
    }
    25% {
        transform: scale(1.3);
    }
    50% {
        transform: scale(1.1);
    }
}

/* ========== REVIEW MODAL ========== */
#reviewModal .popup-content {
    max-width: 450px;
}

#reviewForm .mb-3 {
    margin-bottom: 15px !important;
}

#reviewForm .form-label {
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 5px;
}

.star-rating-input {
    display: flex;
    gap: 5px;
    margin-bottom: 10px;
}

.star-rating-input i {
    font-size: 1.5rem;
    color: #ddd;
    cursor: pointer;
    transition: color 0.2s ease;
}

.star-rating-input i:hover,
.star-rating-input i.bi-star-fill {
    color: #ffc107;
}

#reviewForm textarea {
    resize: vertical;
    min-height: 80px;
    max-height: 150px;
    font-size: 0.9rem;
}

#reviewForm .form-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 15px;
}

#reviewForm .btn {
    padding: 8px 16px;
    font-size: 0.9rem;
}

/* ========== MOBILE AD SLIDER ========== */
.ads-section {
    display: flex;
    justify-content: center;
    padding: 0 8px;
    margin: 10px 0 10px 0 !important;
}

.ads-slider-container {
    width: 100%;
    max-width: 100%;
    position: relative;
    padding: 0;
    border-radius: 14px;
    background: #ffffff;
    box-shadow: 0 6px 18px rgba(0,0,0,0.06);
    border-top: 2px solid #e50914;
    overflow: hidden;
    z-index: 1025;
    margin-bottom: 6px;
}

.ads-slider {
    display: flex;
    overflow: hidden;
    width: 100%;
    transition: transform 0.8s ease-in-out;
}

.ad-slide {
    flex: 0 0 100%;
    box-sizing: border-box;
    position: relative;
    border-radius: 10px;
    overflow: hidden;
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 24px rgba(0,0,0,0.16);
    background-clip: padding-box;
    aspect-ratio: 4 / 3;
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
    cursor: pointer;
}

.ad-slide img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: saturate(1.03) contrast(0.98);
}

.ad-slide-content {
    position: absolute;
    z-index: 3;
    color: white;
    text-align: center;
    padding: 12px 10px;
    width: 100%;
    left: 0;
    top: auto;
    bottom: 12px;
    transform: none;
    text-shadow: 0 2px 8px rgba(0,0,0,0.6);
    pointer-events: auto;
    backdrop-filter: blur(4px);
    background: linear-gradient(180deg, rgba(0,0,0,0.0), rgba(0,0,0,0.45));
    border-bottom-left-radius: 12px;
    border-bottom-right-radius: 12px;
}

.ad-slide-content h4 {
    margin: 0;
    font-size: 0.98rem;
    font-weight: 700;
}

.ad-slide-content p {
    margin: 6px 0 0;
    font-size: 0.8rem;
    line-height: 1.1rem;
    max-height: 2.3rem;
    overflow: hidden;
    text-overflow: ellipsis;
}

.slider-nav {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    transform: translateY(-50%);
    display: flex;
    justify-content: space-between;
    z-index: 20;
}

.slider-btn {
    pointer-events: auto;
    background: rgba(255,255,255,1);
    color: #e50914;
    border: 2px solid #e50914;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    cursor: pointer;
}

.slider-btn i {
    font-size: 1rem;
}

.slider-indicators {
    margin-top: 10px;
    display: flex;
    justify-content: center;
    gap: 6px;
    position: absolute;
    bottom: 10px;
    left: 0;
    right: 0;
    z-index: 20;
}

.slider-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255,255,255,0.5);
    transition: all 0.3s ease;
}

.slider-indicator.active {
    background: #fff;
    box-shadow: 0 2px 6px rgba(0,0,0,0.25);
    transform: scale(1.2);
}

/* ========== POPUP AD OVERLAY ========== */
.popup-ad-overlay {
    position: fixed;
    inset: 0;
    display: none;
    justify-content: center;
    align-items: center;
    background: rgba(0,0,0,0.55);
    z-index: 10050;
    padding: 16px;
}

.popup-ad-content {
    background: rgba(255,255,255,0.98);
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.45);
    width: 400px;
    max-width: 98%;
    min-width: 300px;
    padding: 4px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    text-align: center;
    transform: translateY(0);
    transition: transform 240ms ease, opacity 240ms ease;
}

.popup-ad-item img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: 8px;
    display: block;
}

.popup-ad-item h4 {
    margin: 8px 0 4px 0;
    font-size: 1rem;
    color: #222;
}

.popup-ad-item p {
    margin: 0 0 8px 0;
    font-size: 0.9rem;
    color: #444;
}

.close-popup-ad {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(0,0,0,0.06);
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

@media (max-width: 600px) {
    .popup-ad-content {
        width: 300px;
        padding: 4px;
    }
    .popup-ad-item img {
        height: 200px;
    }
}

@media (min-width: 1200px) {
    .popup-ad-content {
        width: 480px;
    }
}

/* ========== RESPONSIVE GLOBAL ========== */
@media (min-width: 768px) {
    .popup-body {
        grid-template-columns: 1fr 1fr;
        gap: 15px;
        padding: 0 15px 15px;
    }
    .image-gallery {
        height: 180px;
    }
}

@media (min-width: 1200px) {
    .desktop-layout {
        display: block;
    }
    .mobile-layout {
        display: none;
    }
    .container {
        padding: 0 15px;
    }
}

@media (min-width: 992px) and (max-width: 1199px) {
    .desktop-layout {
        display: block;
    }
    .mobile-layout {
        display: none;
    }
    .desktop-products-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 15px;
    }
    .desktop-categories-grid {
        grid-template-columns: repeat(5, 1fr);
        gap: 15px;
    }
    .container {
        padding: 0 10px;
    }
}

@media (min-width: 768px) and (max-width: 991px) {
    .container {
        padding: 0 10px;
    }
    .products-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 12px;
        padding: 0 10px;
    }
    .popup-body {
        grid-template-columns: 1fr 1fr;
    }
    .category-card {
        width: 140px;
        height: 140px;
    }
    .category-icon {
        font-size: 2.2rem;
    }
    .popup-content {
        max-height: 90vh;
    }
    .popup-header {
        padding: 15px 20px 0;
        margin-bottom: 15px;
    }
    .popup-title {
        font-size: 1.3rem;
    }
    .close-popup {
        font-size: 1.5rem;
        width: 35px;
        height: 35px;
    }
    .popup-body {
        gap: 20px;
        padding: 0 20px 20px;
    }
    .image-gallery {
        height: 250px;
    }
    .gallery-nav {
        padding: 0 12px;
    }
    .gallery-btn {
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
    }
    .gallery-indicators {
        bottom: 12px;
        gap: 6px;
    }
    .gallery-indicator {
        width: 10px;
        height: 10px;
    }
    .thumbnail-container {
        gap: 6px;
        margin-top: 8px;
        padding: 8px 0;
        min-height: 60px;
    }
    .thumbnail {
        width: 55px;
        height: 55px;
    }
    .popup-product-info h3 {
        font-size: 1.3rem;
        margin-bottom: 8px;
    }
    .popup-product-info .price {
        font-size: 1.4rem;
        margin-bottom: 12px;
    }
    .popup-buttons {
        gap: 10px;
        margin-top: 15px;
    }
    .popup-buttons button {
        padding: 10px;
        font-size: 0.85rem;
    }
    .similar-products {
        margin-top: 20px;
    }
    .similar-title {
        font-size: 1.1rem;
        margin-bottom: 12px;
        padding-bottom: 6px;
    }
    .similar-grid {
        grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
        gap: 10px;
    }
    .similar-product {
        padding: 8px;
        border-radius: 8px;
    }
    .similar-product img {
        height: 70px;
        border-radius: 6px;
        margin-bottom: 6px;
    }
    .similar-product h6 {
        font-size: 0.75rem;
    }
    .similar-price {
        font-size: 0.7rem;
        margin-top: 3px;
    }
    .ads-slider {
        height: 250px;
    }
}

@media (min-width: 1200px) {
    .container {
        max-width: 1200px;
        margin: 0 auto;
        padding: 0 15px;
    }
    .products-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 15px;
        padding: 0 15px;
    }
    .categories-scroll-container {
        justify-content: center;
        flex-wrap: wrap;
        overflow-x: visible;
        gap: 12px;
    }
    .ads-slider {
        height: 300px;
    }
}

@media (max-width: 767px) {
    .popup {
        padding: 5px;
    }
    .popup-content {
        width: 98%;
        max-height: 90vh;
        border-radius: 12px;
    }
    .hot-deal-content .out-stock-badge,
    .popular-content .out-stock-badge {
        display: none !important;
    }
    .hot-deal-content,
    .popular-content {
        padding: 2px 3px !important;
    }
    .hot-deal-content h5,
    .popular-content h5 {
        margin: 0 0 1px 0 !important;
        font-size: 0.7rem !important;
    }
    .hot-deal-content .price,
    .popular-content .price {
        font-size: 0.85rem !important;
        gap: 0px !important;
    }
    .hot-deal-content .badge,
    .popular-content .badge {
        margin-top: 0px !important;
        font-size: 0.6rem !important;
    }
    .product-info p:last-child {
        display: block !important;
    }
    .product-info {
        padding: 4px !important;
    }
    .product-info h5 {
        margin-bottom: 2px !important;
        font-size: 0.7rem !important;
    }
    .product-info p:not(.product-price) {
        margin: 1px 0 !important;
        font-size: 0.7rem !important;
    }
    .icon-cart {
        display: none !important;
    }
    .popup-body {
        grid-template-columns: 1fr;
        gap: 12px;
        padding: 0 12px 12px;
    }
    .image-gallery {
        height: 160px;
    }
    .category-card {
        width: 120px;
        height: 120px;
    }
    .category-icon {
        font-size: 1.8rem;
    }
    .gallery-btn {
        width: 30px;
        height: 30px;
        font-size: 0.9rem;
    }
    .thumbnail {
        width: 35px;
        height: 35px;
    }
    .thumbnail-container {
        gap: 5px;
        padding: 6px 0;
        min-height: 40px;
    }
    .similar-grid {
        grid-template-columns: repeat(auto-fit, minmax(75px, 1fr));
        gap: 6px;
    }
    .similar-product {
        padding: 5px;
    }
    .similar-product img {
        height: 50px;
    }
    .popup-buttons {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    .popup-header {
        padding: 10px 12px 0;
    }
    .reviews-section {
        min-height: 140px;
        padding: 6px 8px;
    }
    .reviews-carousel {
        min-height: 100px;
    }
    .leave-review-btn-small {
        padding: 3px 6px;
        font-size: 0.65rem;
    }
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 6px;
        padding: 0 3px;
    }
    .desktop-special-offers {
        margin: 10px 0 !important;
        padding: 14px !important;
    }
    .desktop-special-offers h2 {
        font-size: 1.05rem !important;
        margin-bottom: 6px !important;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 3px;
    }
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 5px;
        padding: 0 2px;
    }
    .thumbnail {
        width: 30px;
        height: 30px;
    }
    .thumbnail-container {
        gap: 4px;
    }
    .similar-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .category-card {
        width: 110px;
        height: 110px;
    }
    .category-icon {
        font-size: 1.6rem;
    }
    .image-gallery {
        height: 150px;
    }
    .product-card .image-container {
        height: 180px;
    }
    .product-info {
        padding: 6px;
    }
    .product-info h5 {
        font-size: 0.75rem;
    }
    .product-info p {
        font-size: 0.7rem;
    }
    .popup-product-info h3 {
        font-size: 1rem;
    }
    .popup-product-info .price {
        font-size: 1.1rem;
    }
}