/* Custom CSS to refine Tailwind-based product cards for Flipkart look */

/* General body styling for Flipkart background */
body {
    background-color: #f1f2f6; /* Light gray background like Flipkart */
}

/* Header and categories (from previous code, adjusting for Tailwind-like base) */
.top-header .container {
    max-width: 1200px;
}

.categories-nav .container {
    max-width: 1200px;
}

/* Product Card Base Styles */
.product-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 10px; /* Padding inside the card */
    background-color: #fff;
    border-radius: 4px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05); /* Subtle shadow */
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
    cursor: pointer; /* Indicate it's clickable */
    text-decoration: none; /* Remove underline from anchor tag */
    color: inherit; /* Inherit text color */
    position: relative; /* For potential badges/etc. */
    height: 100%; /* Ensure cards in a grid have equal height */
    overflow: hidden; /* Hide overflowing text */
}

.product-card:hover {
    transform: translateY(-2px); /* Slight lift on hover */
    box-shadow: 0 4px 8px rgba(0,0,0,0.1); /* More prominent shadow on hover */
}

.product-image-container {
    width: 100%; /* Takes full width of card */
    height: 150px; /* Fixed height for consistent image display */
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 8px;
    overflow: hidden; /* Hide overflow */
}

.product-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain; /* Ensures image fits without cropping */
}

.product-details {
    width: 100%; /* Ensures details span full width */
    flex-grow: 1; /* Allows details section to grow and push price to bottom */
    display: flex;
    flex-direction: column;
    justify-content: space-between; /* Distribute space */
}

.product-title {
    font-size: 14px; /* Tailwind's text-sm */
    font-weight: 500; /* Tailwind's font-medium */
    color: #212121; /* Tailwind's text-gray-800 */
    margin-bottom: 4px;
    height: 3em; /* Approx. 2 lines of text */
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2; /* Limit to 2 lines */
    -webkit-box-orient: vertical;
    text-align: center; /* Center the title */
}

.product-rating {
    display: flex;
    justify-content: center; /* Center stars */
    align-items: center;
    margin-bottom: 4px;
    gap: 4px;
}

.product-rating .rating-stars i {
    color: #ffc107; /* Golden yellow for stars */
    font-size: 11px;
}

.product-rating .rating-count {
    font-size: 11px;
    color: #878787;
}

.product-special-offer {
    font-size: 12px; /* Tailwind's text-xs */
    font-weight: 600; /* Tailwind's font-semibold */
    color: #388e3c; /* Tailwind's text-green-700 */
    margin-top: 4px;
    margin-bottom: 4px;
}

.product-price {
    font-size: 14px; /* Tailwind's text-sm */
    color: #212121; /* Tailwind's text-gray-600 */
    margin-top: auto; /* Pushes price to the bottom if content above varies */
    font-weight: 500;
}

.product-price .font-bold {
    font-weight: 700; /* For current price in horizontal scroll */
}

.product-price .line-through {
    color: #878787; /* For original price */
    font-size: 12px;
}

.product-price .text-green-600 {
    font-weight: 600;
    font-size: 12px;
}

/* Specific adjustments for horizontal scroll cards */
.flex-shrink-0 {
    min-width: 180px; /* Ensure cards have a minimum width for scrolling */
}


/* Responsive adjustments for the sections */
/* This will largely be handled by your existing Tailwind grid classes (grid-cols-2 md:grid-cols-3 lg:grid-cols-6) */
/* Adding one more breakpoint for smaller phones */
@media (max-width: 640px) { /* sm breakpoint for Tailwind */
    .product-image-container {
        height: 120px; /* Smaller image height on very small screens */
    }
    .product-title {
        font-size: 13px;
        height: 2.8em;
    }
    .product-price {
        font-size: 13px;
    }
    .product-price .font-bold {
        font-size: 16px; /* Slightly larger for main price */
    }
    .product-card {
        padding: 8px;
    }
    .section-header h2 {
        font-size: 18px;
    }
    .section-header button {
        padding: 6px 12px;
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    .product-grid {
        grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); /* Even smaller cards on very small phones */
    }
    .product-image-container {
        height: 100px;
    }
    .product-title {
        font-size: 12px;
        height: 2.5em;
    }
    .product-rating .rating-stars i,
    .product-rating .rating-count,
    .product-special-offer,
    .product-price,
    .product-price .line-through,
    .product-price .text-green-600 {
        font-size: 10px;
    }
    .product-card {
        padding: 5px;
    }
    .flex-shrink-0 {
        min-width: 150px;
    }
}


/* Optional: Adjust header and categories for mobile */
@media (max-width: 768px) { /* md breakpoint for Tailwind */
    .top-header .container {
        flex-direction: column;
        align-items: center;
        gap: 8px;
    }
    .search-bar {
        width: 100%;
        margin: 0;
    }
    .top-header .header-left {
        width: 100%;
        justify-content: center;
    }
    .top-header .header-nav {
        display: none; /* Hide full nav on small screens, consider a hamburger menu */
    }
    .categories-nav .container ul {
        justify-content: flex-start; /* Align categories left on scroll */
    }
}


/* --- MODAL (POPUP) STYLES --- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6); /* Semi-transparent black background */
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000; /* Ensure it's on top of everything */
    overflow-y: auto; /* Allow scrolling if content is tall */
    padding: 20px 0; /* Add vertical padding for smaller screens */
}

.modal-content {
    background-color: #fff;
    border-radius: 8px;
    position: relative;
    max-width: 1200px; /* Max width similar to main container */
    width: 95%; /* Take most of the screen width */
    max-height: 95vh; /* Max height of the viewport */
    overflow-y: auto; /* Scrollable content inside modal */
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.modal-close-button {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: #878787;
    z-index: 1001; /* Ensure close button is above content */
    padding: 5px; /* Increase click area */
    line-height: 1; /* For better vertical alignment of 'x' */
}

.modal-body {
    padding: 20px; /* Padding inside the modal */
}

/* Styles for the injected product details (similar to previous single product page CSS) */
.product-page-modal {
    display: flex;
    padding: 20px;
    gap: 20px;
}

.product-left-modal {
    flex: 0 0 400px;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
}

.main-product-image-modal {
    position: relative;
    width: 100%;
    height: 350px; /* Fixed height for image area */
    display: flex;
    justify-content: center;
    align-items: center;
}

.main-product-image-modal img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.image-actions-modal {
    position: absolute;
    top: 10px;
    right: 10px;
    display: flex;
    gap: 10px;
}

.image-actions-modal i {
    background-color: #fff;
    border-radius: 50%;
    padding: 8px;
    font-size: 16px;
    cursor: pointer;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
    color: #878787;
}

.product-actions-sticky-modal {
    width: 100%;
    display: flex;
    gap: 10px;
    margin-top: 20px;
    justify-content: center;
}

.add-to-cart-modal, .buy-now-modal {
    flex: 1;
    padding: 12px 20px;
    border: none;
    color: #fff;
    font-weight: bold;
    font-size: 16px;
    cursor: pointer;
    border-radius: 2px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.add-to-cart-modal {
    background-color: #ff9f00;
}

.buy-now-modal {
    background-color: #fb641b;
}

.product-right-modal {
    flex: 1;
}

.product-title-modal {
    font-size: 24px;
    font-weight: 500;
    line-height: 1.3;
    margin-bottom: 8px;
}

.product-rating-modal {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
}

.product-rating-modal .rating-stars i {
    color: #ffc107;
    font-size: 14px;
    margin-right: 2px;
}

.product-rating-modal .rating-count {
    font-size: 14px;
    color: #878787;
    margin-left: 5px;
}

.special-price-modal {
    font-size: 14px;
    color: #878787;
}

.price-details-modal {
    display: flex;
    align-items: flex-end;
    margin: 5px 0 10px;
}

.current-price-modal {
    font-size: 28px;
    font-weight: bold;
    margin-right: 10px;
}

.original-price-modal {
    text-decoration: line-through;
    color: #878787;
    margin-right: 10px;
}

.discount-modal {
    color: #388e3c;
    font-weight: bold;
}

.emi-info-modal, .delivery-date-modal {
    font-size: 14px;
    margin-bottom: 5px;
}

.available-offers-modal, .highlights-section-modal {
    margin-top: 20px;
    border-top: 1px dotted #e0e0e0;
    padding-top: 20px;
}

.available-offers-modal h2, .highlights-section-modal h2 {
    font-size: 18px;
    font-weight: 500;
    margin-bottom: 15px;
}

.available-offers-modal p {
    font-size: 14px;
    margin-bottom: 8px;
    display: flex;
    align-items: flex-start;
}

.available-offers-modal p i {
    color: #388e3c;
    margin-right: 8px;
    margin-top: 3px;
}

.view-more-offers-modal {
    font-size: 14px;
    margin-top: 10px;
    display: block;
}

.highlights-section-modal ul {
    list-style: none; /* Remove default list style */
    padding-left: 0;
}

.highlights-section-modal li {
    font-size: 14px;
    color: #212121;
    margin-bottom: 5px;
    display: flex;
    align-items: flex-start;
    gap: 5px;
}

.highlights-section-modal li i {
    color: #388e3c;
    font-size: 14px;
    margin-top: 2px;
}


/* Responsive for Modal */
@media (max-width: 992px) {
    .product-page-modal {
        flex-direction: column;
        gap: 10px;
        padding: 15px;
    }
    .product-left-modal {
        flex: none;
        width: 100%;
        max-width: 400px; /* Limit image section width even when stacked */
        margin: 0 auto; /* Center it */
    }
    .main-product-image-modal {
        height: 250px; /* Adjust image height for smaller screens */
    }
    .product-actions-sticky-modal {
        margin-top: 15px;
    }
    .product-title-modal {
        font-size: 20px;
    }
    .current-price-modal {
        font-size: 24px;
    }
}

@media (max-width: 768px) {
    .modal-content {
        width: 98%;
        max-height: 98vh;
        border-radius: 0; /* Full screen on very small devices */
    }
    .modal-close-button {
        top: 10px;
        right: 10px;
        font-size: 24px;
    }
    .product-page-modal {
        padding: 10px;
    }
    .product-left-modal {
        max-width: 300px;
    }
    .main-product-image-modal {
        height: 200px;
    }
    .add-to-cart-modal, .buy-now-modal {
        font-size: 14px;
        padding: 10px 15px;
    }
    .product-title-modal {
        font-size: 18px;
    }
    .current-price-modal {
        font-size: 22px;
    }
    .product-rating-modal .rating-stars i,
    .product-rating-modal .rating-count,
    .special-price-modal,
    .emi-info-modal,
    .delivery-date-modal,
    .available-offers-modal p,
    .highlights-section-modal li {
        font-size: 13px;
    }
    .available-offers-modal h2, .highlights-section-modal h2 {
        font-size: 16px;
    }
}

















  body {
            background-color: #f1f2f6;
            margin: 0; /* Important: Remove default body margin */
            padding: 0; /* Important: Remove default body padding */
            overflow-x: hidden; /* Prevent horizontal scrollbar if content slightly overflows */
        }

        /* --- Main Page Slider Styles --- */
        .main-slider-container {
            position: relative;
            width: 100%; /* Make it take 100% of the parent's width */
            /* max-width: 1200px; <--- REMOVED THIS TO ALLOW FULL WIDTH ON BIG SCREENS */
            height: 280px;
            margin: 20px 0; /* 20px top/bottom margin, 0px left/right margin */
            overflow: hidden;
            border-radius: 0px; /* Changed to 0px for sharp edges on full width, or keep if preferred */
            box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
            background-color: #fff;
        }

        .main-slider-images {
            display: flex;
            transition: transform 0.5s ease-in-out;
            height: 100%;
        }

        .main-slider-images img {
            width: 100%;
            height: 100%;
            object-fit: cover;
            flex-shrink: 0;
        }

        .main-slider-button {
            position: absolute;
            top: 50%;
            transform: translateY(-50%);
            background-color: rgba(0, 0, 0, 0.5);
            color: white;
            border: none;
            padding: 10px 15px;
            cursor: pointer;
            font-size: 28px;
            z-index: 5;
            border-radius: 3px;
            opacity: 0.7;
            transition: opacity 0.2s;
        }

        .main-slider-button:hover {
            opacity: 1;
        }

        .main-slider-button.prev {
            left: 10px;
        }

        .main-slider-button.next {
            right: 10px;
        }

        .main-slider-dots {
            position: absolute;
            bottom: 15px;
            left: 50%;
            transform: translateX(-50%);
            display: flex;
            gap: 8px;
            z-index: 5;
        }

        .main-slider-dot {
            width: 10px;
            height: 10px;
            background-color: rgba(255, 255, 255, 0.7);
            border-radius: 50%;
            cursor: pointer;
            transition: background-color 0.3s;
        }

        .main-slider-dot.active {
            background-color: #2874f0;
            box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.5);
        }

        @media (max-width: 768px) {
            .main-slider-container {
                height: 200px;
                margin-top: 10px;
                margin-bottom: 10px;
            }

            .main-slider-button {
                padding: 8px 12px;
                font-size: 20px;
            }

            .main-slider-dots {
                bottom: 10px;
            }

            .main-slider-dot {
                width: 8px;
                height: 8px;
            }
        }