



/* ================= FLASH SALE ================= */

/* 🔥 Image Lazy Load Blur Effect */
.lazy-load {
    filter: blur(5px);
    transition: 0.3s;
}

.lazy-load.loaded {
    filter: blur(0);
}

.flash-sale-section {
    background: #fff;
    padding: 15px;
    border-radius: 12px;
}

/* HEADER */
.flash-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 15px;
}

.flash-header h2 {
    font-size: 1.8rem;
    font-weight: bold;
}

/* TIMER */
.flash-timer {
    display: flex;
    gap: 6px;
}

.flash-timer span {
    background: #ff4d4d;
    color: white;
    padding: 6px 10px;
    border-radius: 6px;
    font-weight: bold;
}

/* GRID */
.flash-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 15px;
    align-items: stretch;
}

/* CARD FIX */
.flash-card {
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
    border-radius: 10px;
    overflow: hidden;
    transition: 0.3s;
    height: 100%;
}

.flash-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.12);
}

/* IMAGE */
.flash-img {
    position: relative;
    width: 100%;
    height: 160px;
    overflow: hidden;
}

.flash-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: 0.3s;
}

.flash-card:hover img {
    transform: scale(1.05);
}

/* OVERLAY */
.stock-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    background: rgba(0,0,0,0.6);
    color: white;
    text-align: center;
    padding: 6px;
    font-size: 14px;
}

/* PRICE */
.flash-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
}

.flash-price {
    color: #ff4d4d;
    font-weight: bold;
    font-size: 1.4rem;
}

.flash-discount {
    background: #ff4d4d;
    color: white;
    padding: 5px 10px;
    border-radius: 8px;
    font-weight: bold;
}

/* ================= RESPONSIVE ================= */

@media (max-width: 1199px) {
    .products-row { grid-template-columns: repeat(5, 1fr); }
    .flash-grid { grid-template-columns: repeat(5, 1fr); }
}

@media (max-width: 991px) {
    .products-row { grid-template-columns: repeat(4, 1fr); }
    .flash-grid { grid-template-columns: repeat(4, 1fr); }
}

@media (max-width: 767px) {

    /* PRODUCTS */
    .products-row { grid-template-columns: repeat(2, 1fr); }

    /* FLASH */
    .flash-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .flash-img { height: 130px; }

    .flash-price { font-size: 1.2rem; }

    .flash-discount {
        font-size: 0.9rem;
        padding: 4px 8px;
    }

    .stock-overlay {
        font-size: 12px;
        padding: 4px;
    }

    .flash-header {
        flex-wrap: wrap;
        gap: 10px;
    }

    .flash-header h2 { font-size: 1.4rem; }

    .flash-timer span {
        padding: 4px 8px;
        font-size: 0.9rem;
    }

    .shop-more { font-size: 0.9rem; }
}

@media (max-width: 480px) {
    .flash-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
}







/* Slider Styles */
.slider-section {
    padding: 10px 0;
}

.slider-container {
    width: 100%;
    max-width: 1240px;
    margin: 0 auto;
    height: 350px;
    overflow: hidden;
    position: relative;
    border-radius: 10px;
    background-color: #f8f9fa;
}

.slider {
    display: flex;
    height: 100%;
    transition: transform 0.5s ease-in-out;
    will-change: transform;
}

.slide {
    flex: 0 0 100%;
    height: 100%;
    min-width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.slide-link {
    display: block;
    width: 100%;
    height: 100%;
    text-decoration: none;
    cursor: pointer;
}

.slide-img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    cursor: pointer;
}

.slider-controls {
    position: absolute;
    bottom: 25px;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    gap: 10px;
    z-index: 10;
}

.slider-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: rgba(0, 0, 0, 0.3);
    cursor: pointer;
    transition: all 0.3s ease;
}

.slider-dot.active {
    background-color: #2563eb;
    transform: scale(1.3);
}

/* Homepage Section Styles */
.homepage-section {
    margin-bottom: 40px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #f0f0f0;
}

.section-title {
    font-size: 1.8rem;
    font-weight: 600;
    color: #333;
    margin: 0;
}

.view-all-link {
    color: #2563eb;
    text-decoration: none;
    font-weight: 500;
    font-size: 1.1rem;
    transition: color 0.3s ease;
}

.view-all-link:hover {
    color: white;
}

/* Products Row - Updated for 6 products on desktop */
.products-row {
    display: grid;
    grid-template-columns: repeat(6, 1fr); /* Changed from 5 to 6 columns */
    gap: 20px;
    margin-top: 20px;
}

.product-2 {
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
    border: 1px solid #eee;
    transition: all 0.3s ease;

    display: flex;              
    flex-direction: column;     
    height: 100%;              
}

.product-2:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 25px rgba(0,0,0,0.12);
}

/* Updated Badge Styles - Left and Right Top Corners */


/* Left Top Corner Discount Badge */
.left-top-corner {
    left: 0;
    border-radius: 0 0 12px 0;
    background: linear-gradient(135deg, #FF4444 0%, #FF6B6B 100%);
    color: white;
    padding: 8px 12px;
    min-width: 55px;
    transform: translateX(-1px);
}

.badge-discount {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.discount-percent {
    font-size: 1.2rem;
    font-weight: 800;
    line-height: 1;
    letter-spacing: -0.5px;
}

.discount-text {
    font-size: 0.7rem;
    opacity: 0.95;
    margin-top: 1px;
    letter-spacing: 1px;
}

/* Right Top Corner New Badge */
.right-top-corner {
    right: 0;
    border-radius: 0 0 0 12px;
    background: linear-gradient(135deg, #00C853 0%, #4CAF50 100%);
    color: white;
    padding: 6px 12px;
    min-width: 50px;
    transform: translateX(1px);
}

.badge-new {
    font-size: 0.85rem;
    font-weight: 800;
    letter-spacing: 1px;
}

/* Out of Stock Badge */
.badge-out {
    top: 10px;
    left: 10px;
    background: linear-gradient(135deg, #dc3545 0%, #e74c3c 100%);
    color: white;
    border-radius: 4px;
    padding: 6px 10px;
}

/* Product Media Styles */
.product-media {
    position: relative;
    overflow: hidden;
    padding-top: 100%; /* 1:1 Aspect Ratio */
    background-color: #f8f9fa;
}



.product-2:hover .product-image {
    transform: scale(1.05);
}



.product-body {
    padding: 15px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.product-title {
    font-size: 1.2rem;
    margin-bottom: 8px;
    line-height: 1.3;
}

.product-title a {
    color: #333;
    text-decoration: none;
}

.product-title a:hover {
    color: #2563eb;
}

.product-price {
    font-size: 1.6rem;
    font-weight: 600;
    color: #2EB7EB;
    margin-bottom: 8px;
}

.was-price {
    font-size: 1.1rem;
    color: #999;
    text-decoration: line-through;
    margin-left: 8px;
}

.product-action-vertical {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 2;
}

.btn-product-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: white;
    border-radius: 50%;
    color: #666;
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.btn-product-icon:hover {
    background: #2563eb;
    color: white;
    transform: translateY(-2px);
}

.free-shipping {
    color: #00c853;
    font-size: 1.2rem;
}

.free-shipping i {
    margin-right: 5px;
}

/* Buy Now Container - UPDATED for anchor tag styling */
.buy-now-container {
    margin-top: auto;
    margin-bottom: 20px;
}

/* IMPROVED Buy Now Button - Now as anchor tag */
.btn-buy-now {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    background: white;
    border: 1px solid #28AAE3;
    color: black;
    padding: 0px 0px;
    font-size: 1.1rem;
    font-weight: 700;
    text-transform: uppercase;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(40, 170, 227, 0.3);
    letter-spacing: 0.5px;
    min-height: 38px;
}

.btn-buy-now:hover:not(.view-out-of-stock) {
    background: linear-gradient(135deg, #28AAE3 0%, #1072BD 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(40, 170, 227, 0.4);
    gap: 12px;
    color: white;
}

.btn-buy-now:active:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(40, 170, 227, 0.3);
}

/* Style for View Details button (out of stock) */
.btn-buy-now.view-out-of-stock {
    background: white;
    border: 1px solid #6c757d;
    color: #6c757d;
    box-shadow: 0 4px 15px rgba(108, 117, 125, 0.2);
}

.btn-buy-now.view-out-of-stock:hover {
    background: linear-gradient(135deg, #6c757d 0%, #495057 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(108, 117, 125, 0.3);
    gap: 12px;
    color: white;
}

.btn-buy-now.view-out-of-stock:hover .buy-now-icon {
    transform: scale(1.2);
}

.buy-now-icon {
    font-size: 1.2rem;
    transition: transform 0.3s ease;
}

.buy-now-text {
    letter-spacing: 0.8px;
    font-weight: 800;
}

.buy-now-arrow {
    font-size: 1.3rem;
    font-weight: 900;
    transition: transform 0.3s ease;
}

.btn-buy-now:hover:not(.view-out-of-stock) .buy-now-arrow {
    transform: translateX(5px);
}

.btn-buy-now:hover:not(.view-out-of-stock) .buy-now-icon {
    transform: scale(1.2) rotate(10deg);
}

/* Ripple Effect */
.btn-buy-now::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 5px;
    height: 5px;
    background: rgba(255, 255, 255, 0.6);
    opacity: 0;
    border-radius: 100%;
    transform: scale(1, 1) translate(-50%);
    transform-origin: 50% 50%;
}

.btn-buy-now:focus:not(:active)::after {
    animation: ripple 1s ease-out;
}

@keyframes ripple {
    0% {
        transform: scale(0, 0);
        opacity: 0.8;
    }
    100% {
        transform: scale(25, 25);
        opacity: 0;
    }
}

/* Pulse animation for attention - only for BUY NOW buttons */
.btn-buy-now:not(.view-out-of-stock) {

}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(40, 170, 227, 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(40, 170, 227, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(40, 170, 227, 0);
    }
}

/* Product card specific hover effect */
.product-2:hover .btn-buy-now:not(.view-out-of-stock) {
    animation: none;
    box-shadow: 0 8px 20px rgba(40, 170, 227, 0.4);
}

.product-2:hover .btn-buy-now.view-out-of-stock {
    animation: none;
    box-shadow: 0 8px 20px rgba(108, 117, 125, 0.3);
}

/* Responsive adjustments for products */
@media (max-width: 1199px) {
    .products-row {
        grid-template-columns: repeat(5, 1fr); /* 5 products on large tablets */
    }
}

@media (max-width: 991px) {
    .products-row {
        grid-template-columns: repeat(4, 1fr); /* 4 products on tablets */
    }
    
    .btn-buy-now {
        padding: 0px 0px;
        font-size: 1.1rem;
        min-height: 44px;
    }
    
    .left-top-corner,
    .right-top-corner {
        padding: 5px 8px;
        min-width: 45px;
    }
    
    .discount-percent {
        font-size: 1rem;
    }
    
    .badge-new {
        font-size: 0.75rem;
        padding: 5px 8px;
    }
}

@media (max-width: 767px) {
    .products-row {
        grid-template-columns: repeat(3, 1fr); /* 3 products on small tablets */
        gap: 15px;
    }
    
    .section-title {
        font-size: 1.5rem;
    }
    
    .section-header {
        flex-direction: row; /* Changed from column to row - FIXED */
        align-items: center; /* Changed from flex-start to center - FIXED */
        gap: 15px; /* Changed from 10px to 15px - FIXED */
    }
    
    .btn-buy-now {
        padding: 0px 0px;
        font-size: 1.1rem;
        gap: 5px;
        min-height: 42px;
    }
    
    .left-top-corner,
    .right-top-corner {
        padding: 4px 6px;
        min-width: 40px;
        font-size: 0.7rem;
    }
    
    .discount-percent {
        font-size: 0.9rem;
    }
    
    .discount-text {
        font-size: 0.6rem;
    }
    
    .badge-new {
        font-size: 0.7rem;
        padding: 4px 6px;
    }
}

@media (max-width: 575px) {
    .products-row {
        grid-template-columns: repeat(2, 1fr); /* 2 products on mobile */
        gap: 12px;
    }
    
    .section-header {
        flex-direction: row; /* Keep as row on mobile too */
        align-items: center;
        gap: 10px;
    }
    
    .btn-buy-now {
        padding: 8px 10px;
        font-size: 1.1rem;
        min-height: 40px;
    }
}

@media (max-width: 375px) {
    .products-row {
        grid-template-columns: 1fr; /* 1 product on very small screens */
    }
}

/* Responsive adjustments for slider */
@media (max-width: 1024px) {
    .slider-container {
        height: 250px;
        max-width: calc(100% - 40px);
    }
}

@media (max-width: 768px) {
    .slider-container {
        height: 125px;
        max-width: calc(100% - 40px);
    }
    
    .slider-controls {
        bottom: 15px; /* Changed from 25px to 15px - moves dots lower */
    }
    
    .slider-dot {
        width: 7px;
        height: 7px;
    }
}

@media (max-width: 480px) {
    .slider-container {
        height: 112px;
        max-width: calc(100% - 30px);
    }
    
    .slider-controls {
        bottom: 10px; /* Even lower on very small screens */
    }
}

/* UPDATED CSS for out of stock items - now clickable */
.product.out-of-stock {
    opacity: 0.85;
    pointer-events: auto; /* Changed from 'none' to 'auto' */
}

.product.out-of-stock .product-media::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.4);
    z-index: 1;
}

.product.out-of-stock .product-image {
    filter: grayscale(20%);
}

.out-of-stock-img {
    opacity: 0.7;
}

.product.out-of-stock .product-title a {
    color: #6c757d;
}

.product.out-of-stock .product-title a:hover {
    color: #2563eb;
}

.product.out-of-stock .product-price {
    color: #6c757d;
}
