/* Flipkart Frontend Styles */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: #f1f3f6;
    color: #212121;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 10px;
    /* Reduced side padding for wider mobile cards */
}

/* Header */
.main-header {
    background: #2874f0;
    padding: 10px 0;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.menu-icon {
    display: flex;
    flex-direction: column;
    gap: 4px;
    cursor: pointer;
    padding: 5px 2px;
}

.menu-icon span {
    display: block;
    width: 18px;
    height: 2px;
    background: white;
    border-radius: 2px;
}

.logo {
    text-align: left;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    /* Prevent images from stretching across the header */
}

.logo h1 {
    font-size: 18px;
    font-weight: 600;
    font-style: italic;
    color: white;
    margin: 0;
}

.logo h1 span {
    font-size: 13px;
    font-weight: 300;
    color: #f0f0f0;
}

.logo p {
    font-size: 11px;
    font-style: italic;
    color: #f0f0f0;
    margin-top: -3px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
}

.logo p span {
    color: #ffe500;
    font-weight: 600;
}

.header-actions {
    display: flex;
    align-items: center;
}

.cart-link {
    position: relative;
    padding: 5px;
}

.cart-count {
    position: absolute;
    top: -2px;
    right: -5px;
    background: #ff6161;
    color: white;
    font-size: 10px;
    min-width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    border: 1px solid white;
}

.header-bottom {
    width: 100%;
}

/* Header Content for Address/Summary Pages */
.header-content {
    display: flex;
    align-items: center;
    height: 52px;
    /* Standard Flipkart-lite header height */
}

.search-bar {
    background: white;
    border-radius: 2px;
    display: flex;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    position: relative;
    /* For dropdown positioning */
}

.search-bar input {
    flex: 1;
    border: none;
    padding: 10px 15px;
    font-size: 14px;
    color: #212121;
}

.search-bar input::placeholder {
    color: #9e9e9e;
}

.search-bar input:focus {
    outline: none;
}

.search-bar button {
    background: transparent;
    border: none;
    padding: 0 15px;
    font-size: 16px;
    color: #c2c2c2;
    cursor: pointer;
}

.search-results-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border-top: 1px solid #f0f0f0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 2000;
    display: none;
    max-height: 400px;
    overflow-y: auto;
    border-radius: 0 0 2px 2px;
}

.search-result-item {
    display: flex;
    align-items: center;
    padding: 12px;
    gap: 15px;
    cursor: pointer;
    border-bottom: 1px solid #f8f8f8;
    transition: background 0.2s;
}

.search-result-item:hover {
    background: #f1f3f6;
}

.search-result-item img {
    width: 40px;
    height: 40px;
    object-fit: contain;
    flex-shrink: 0;
}

.result-info {
    flex: 1;
    overflow: hidden;
}

.result-title {
    font-size: 13px;
    color: #212121;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: 500;
}

.result-price {
    font-size: 13px;
    color: #388e3c;
    font-weight: 600;
    margin-top: 2px;
}

/* Categories */
.categories-section {
    background: white;
    padding: 15px 0;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.categories-scroll {
    display: flex;
    gap: 40px;
    overflow-x: auto;
    padding: 15px 10px;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    width: 100%;
}

.categories-scroll::-webkit-scrollbar {
    height: 0px;
    /* Hide scrollbar for cleaner look */
}

.category-item {
    text-align: center;
    min-width: 80px;
    cursor: pointer;
    transition: transform 0.2s;
    flex-shrink: 0;
}

.category-item:hover,
.category-item.active {
    transform: translateY(-5px);
}

.category-item.active p {
    color: #2874f0;
    font-weight: 600;
}

.category-item.active .category-icon {
    border-bottom: 3px solid #2874f0;
    padding-bottom: 5px;
}

.category-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.category-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.category-item p {
    font-size: 14px;
    font-weight: 500;
    color: #333;
    margin-top: 5px;
}

/* Banner Slider */
.banner-section {
    margin: 20px 0;
}

.banner-slider {
    position: relative;
    width: 100%;
    overflow: hidden;
    border-radius: 4px;
}

.banner-slide {
    display: none;
    animation: fadeIn 0.5s;
}

.banner-slide.active {
    display: block;
}

.banner-slide img {
    width: 100%;
    height: auto;
    object-fit: cover;
    display: block;
}

@media (max-width: 768px) {
    .banner-slide img {
        min-height: 180px;
        /* Ensure banner is visible on small phones */
    }
}

@keyframes fadeIn {
    from {
        opacity: 0.4;
    }

    to {
        opacity: 1;
    }
}

.banner-dots {
    text-align: center;
    margin-top: 15px;
}

.dot {
    height: 10px;
    width: 10px;
    margin: 0 5px;
    background-color: #bbb;
    border-radius: 50%;
    display: inline-block;
    cursor: pointer;
    transition: background-color 0.3s;
}

.dot.active,
.dot:hover {
    background-color: #2874f0;
}

/* Deals Section */
.deals-section {
    background: white;
    margin-bottom: 20px;
}

.deals-section .container {
    padding: 0 !important;
    /* Edge-to-edge for products */
    max-width: 100%;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 12px;
    /* Inner padding for header */
    border-bottom: 1px solid #f0f0f0;
}

.section-header h2 {
    font-size: 22px;
    font-weight: 500;
    color: #212121;
}

.timer {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
    color: #212121;
    font-size: 14px;
}

.timer-icon {
    font-size: 18px;
}

.sale-badge {
    background: #ff6161;
    color: white;
    padding: 8px 16px;
    border-radius: 3px;
    font-size: 13px;
    font-weight: 600;
}

/* Products Grid */
.products-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    /* Exactly 2 columns */
    gap: 1px;
    /* Divider line look */
    background: #f1f3f6;
    /* Divider color */
    border-top: 1px solid #f1f3f6;
    border-bottom: 1px solid #f1f3f6;
}

.product-card {
    background: white;
    padding: 12px;
    cursor: pointer;
    transition: all 0.3s;
    min-height: 280px;
    display: flex;
    flex-direction: column;
    border: none !important;
    /* Edge-to-edge clean look */
}

.product-card:hover {
    background: #f9f9f9;
}

.product-image {
    width: 100%;
    height: 140px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
}

.product-image img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.product-info {
    text-align: left;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.product-title {
    font-size: 14px;
    font-weight: 400;
    color: #212121;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.4;
    height: 38px;
}

.product-pricing-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.discount {
    color: #388e3c;
    font-weight: 500;
    font-size: 14px;
}

.original-price {
    color: #878787;
    text-decoration: line-through;
    font-size: 14px;
}

.selling-price {
    color: #212121;
    font-size: 18px;
    font-weight: 700;
}

.main-price-row {
    margin-top: 5px;
}

.product-badge {
    display: flex;
    align-items: center;
}

.delivery-info {
    color: #212121;
    font-size: 13px;
    font-weight: 400;
    margin-top: 5px;
}

/* Product Page Styles */
.product-page {
    background: white;
    margin: 20px 0;
    border-radius: 4px;
}

.product-container {
    display: grid;
    grid-template-columns: 40% 60%;
    gap: 40px;
    padding: 30px;
}

.product-gallery {
    position: sticky;
    top: 80px;
    height: fit-content;
}

.main-image {
    width: 100%;
    height: 500px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #f0f0f0;
    margin-bottom: 20px;
}

.main-image img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.thumbnail-gallery {
    display: flex;
    gap: 10px;
    overflow-x: auto;
}

.thumbnail {
    width: 80px;
    height: 80px;
    border: 2px solid #f0f0f0;
    cursor: pointer;
    transition: border-color 0.3s;
}

.thumbnail:hover,
.thumbnail.active {
    border-color: #2874f0;
}

.thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.product-details h1 {
    font-size: 20px;
    font-weight: 400;
    color: #212121;
    margin-bottom: 15px;
}

.product-price {
    display: flex;
    align-items: baseline;
    gap: 15px;
    margin-bottom: 20px;
}

.product-price .current-price {
    font-size: 28px;
    font-weight: 500;
    color: #212121;
}

.product-price .original-price {
    font-size: 18px;
    color: #878787;
    text-decoration: line-through;
}

.product-price .discount {
    font-size: 16px;
    color: #388e3c;
    font-weight: 500;
}

.variant-selector {
    margin-bottom: 25px;
}

.variant-selector h3 {
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 10px;
    color: #878787;
}

.variant-options {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.variant-option {
    padding: 10px 20px;
    border: 1px solid #c2c2c2;
    border-radius: 20px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
}

.variant-option:hover,
.variant-option.selected {
    border-color: #2874f0;
    color: #2874f0;
}

.action-buttons {
    display: flex;
    gap: 15px;
    margin: 30px 0;
}

.btn-buy,
.btn-cart {
    flex: 1;
    padding: 15px;
    border: none;
    border-radius: 2px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-buy {
    background: #ff9f00;
    color: white;
}

.btn-buy:hover {
    background: #e68a00;
}

.btn-cart {
    background: #fb641b;
    color: white;
}

.btn-cart:hover {
    background: #e25513;
}

.product-description {
    margin-top: 30px;
    padding-top: 30px;
    border-top: 1px solid #f0f0f0;
}

.product-description h2 {
    font-size: 18px;
    font-weight: 500;
    margin-bottom: 15px;
}

.product-description p {
    color: #212121;
    line-height: 1.6;
    margin-bottom: 10px;
}

.product-description ul {
    list-style: none;
    padding: 0;
}

.product-description li {
    padding: 8px 0;
    color: #212121;
    line-height: 1.6;
}

.product-description li:before {
    content: "✓ ";
    color: #388e3c;
    font-weight: bold;
    margin-right: 8px;
}

.dsc-banner {
    margin-top: 30px;
}

.dsc-banner img {
    width: 100%;
    border-radius: 4px;
}

/* Address Page */
.address-page {
    background: #f1f3f6;
    min-height: 100vh;
    padding: 20px 0;
}

.address-container {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 65% 35%;
    gap: 20px;
}

.address-form {
    background: white;
    padding: 30px;
    border-radius: 4px;
}

.address-form h2 {
    font-size: 20px;
    font-weight: 500;
    margin-bottom: 25px;
    color: #212121;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #212121;
    font-size: 14px;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 12px;
    border: 1px solid #c2c2c2;
    border-radius: 2px;
    font-size: 14px;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #2874f0;
}

.btn-submit {
    width: 100%;
    padding: 15px;
    background: #fb641b;
    color: white;
    border: none;
    border-radius: 2px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s;
}

.btn-submit:hover {
    background: #e25513;
}

.order-summary {
    background: white;
    padding: 25px;
    border-radius: 4px;
    height: fit-content;
    position: sticky;
    top: 80px;
}

.order-summary h3 {
    font-size: 18px;
    font-weight: 500;
    margin-bottom: 20px;
    color: #212121;
}

.summary-product {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid #f0f0f0;
}

.summary-product img {
    width: 80px;
    height: 80px;
    object-fit: contain;
    border: 1px solid #f0f0f0;
}

.summary-product-info h4 {
    font-size: 14px;
    font-weight: 400;
    margin-bottom: 8px;
}

.summary-product-info .price {
    font-size: 16px;
    font-weight: 500;
    color: #212121;
}

.price-details {
    margin-top: 20px;
}

.price-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 12px;
    font-size: 14px;
}

.price-row.total {
    font-size: 16px;
    font-weight: 600;
    padding-top: 12px;
    border-top: 1px solid #f0f0f0;
}

/* Checkout Progress Bar */
.checkout-progress {
    background: #fff;
    padding: 20px 0;
    margin-bottom: 20px;
    border-bottom: 1px solid #f0f0f0;
}

.progress-container {
    max-width: 600px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    position: relative;
}

.progress-line {
    position: absolute;
    top: 15px;
    left: 10%;
    right: 10%;
    height: 2px;
    background: #f0f0f0;
    z-index: 1;
}

.progress-line-active {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background: #2874f0;
    transition: width 0.3s ease;
}

.progress-step {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    flex: 1;
}

.step-circle {
    width: 32px;
    height: 32px;
    background: #fff;
    border: 2px solid #f0f0f0;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    color: #878787;
    font-size: 14px;
    transition: all 0.3s ease;
}

.progress-step.active .step-circle {
    border-color: #2874f0;
    background: #2874f0;
    color: #fff;
}

.progress-step.completed .step-circle {
    border-color: #2874f0;
    background: #fff;
    color: #2874f0;
}

.step-label {
    font-size: 12px;
    font-weight: 500;
    color: #878787;
}

.progress-step.active .step-label {
    color: #212121;
    font-weight: 600;
}

@media (max-width: 768px) {
    .progress-container {
        padding: 0 20px;
    }
}


/* Footer Styles (Refined) */
.footer-section {
    background: #172337;
    color: #fff;
    padding: 60px 0 30px;
    margin-top: 40px;
    font-size: 12px;
}

.footer-top {
    display: flex;
    justify-content: space-between;
    padding-bottom: 40px;
}

.footer-left {
    display: flex;
    flex: 3;
    justify-content: space-between;
    padding-right: 40px;
}

.footer-divider {
    width: 1px;
    background: #454d5e;
    margin: 0 40px;
}

.footer-right {
    display: flex;
    flex: 2;
    justify-content: space-between;
}

.footer-col {
    min-width: 150px;
}

.footer-col h3 {
    color: #878787;
    font-size: 12px;
    font-weight: 400;
    margin-bottom: 15px;
}

.footer-col ul {
    list-style: none;
    padding: 0;
}

.footer-col ul li {
    margin-bottom: 10px;
}

.footer-col ul li a {
    color: #fff;
    text-decoration: none;
    transition: opacity 0.2s;
}

.footer-col ul li a:hover {
    text-decoration: underline;
}

.address-col p {
    line-height: 1.5;
    color: #fff;
    margin-bottom: 15px;
}

.social-icons {
    display: flex;
    gap: 15px;
}

.social-link {
    width: 25px;
    height: 25px;
    background: #fff;
    color: #172337;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    text-decoration: none;
    font-weight: bold;
    font-size: 12px;
}

.footer-bottom {
    padding-top: 30px;
    border-top: 1px solid #454d5e;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.bottom-item {
    display: flex;
    align-items: center;
    gap: 10px;
}

.bottom-item .icon {
    font-size: 16px;
    color: #ffe500;
}

.bottom-item a {
    color: #fff;
    text-decoration: none;
    font-size: 14px;
}

.bottom-item.copyright {
    color: #fff;
    font-size: 14px;
}

.payment-methods img {
    max-height: 25px;
    opacity: 0.9;
}

/* Responsive */
@media (max-width: 992px) {
    .footer-top {
        flex-direction: column;
    }

    .footer-left {
        flex-wrap: wrap;
        padding-right: 0;
        gap: 20px;
    }

    .footer-divider {
        display: none;
    }

    .footer-right {
        margin-top: 30px;
        padding-top: 30px;
        border-top: 1px solid #454d5e;
        gap: 20px;
    }
}

@media (max-width: 768px) {
    .header-content {
        flex-wrap: wrap;
    }

    .search-bar {
        order: 3;
        width: 100%;
    }

    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
        /* Tighter gap for mobile */
        padding: 10px 0;
    }

    .product-card {
        padding: 10px;
        min-height: auto;
    }

    .product-image {
        height: 180px;
        /* Shorter image for mobile */
    }

    .product-title {
        font-size: 13px;
        margin-bottom: 8px;
    }

    .product-pricing {
        gap: 6px;
        margin-bottom: 4px;
    }

    .selling-price {
        font-size: 16px;
    }

    .discount,
    .original-price {
        font-size: 12px;
    }

    .product-container {
        grid-template-columns: 1fr;
        padding: 10px;
    }

    .address-container {
        grid-template-columns: 1fr;
    }

    .footer-bottom {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .bottom-item {
        width: 100%;
        justify-content: center;
    }

    /* Fix banner cutting and padding */
    .banner-section {
        margin: 10px 0;
    }

    .categories-section {
        padding: 5px 0;
    }
}

@media (max-width: 480px) {
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 2px;
    }

    .product-card {
        padding: 8px;
        min-height: 240px;
    }

    .product-image {
        height: 120px;
    }

    .selling-price {
        font-size: 14px;
    }

    .product-title {
        font-size: 12px;
        height: 34px;
    }

    .logo h1 {
        font-size: 16px;
    }

    .menu-icon span {
        width: 15px;
    }
}