/* Cart Page Styles - Flipkart Style */

.cart-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0;
}

/* Mobile Header Styles */
.cart-header-mobile {
    display: none;
    background: white;
    padding: 12px 16px;
    align-items: center;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1002;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
}

.cart-header-mobile .back-btn {
    color: #212121;
    font-size: 18px;
    margin-right: 20px;
    text-decoration: none;
}

.cart-header-mobile .header-title {
    font-size: 16px;
    font-weight: 500;
    color: #212121;
}


.pincode-left {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #212121;
}

.pincode-left i {
    color: var(--mobitez-purple);
    font-size: 14px;
}

.pincode-label {
    font-size: 14px;
    font-weight: 400;
}

#currentPincode {
    font-weight: 500;
}

.btn-check-pincode {
    padding: 6px 16px;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 2px;
    color: var(--mobitez-purple);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-check-pincode:hover {
    border-color: var(--mobitez-purple);
    background: #f9f9f9;
}

/* Cart Content Layout */
.cart-content {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 24px;
    align-items: start;
}

/* Cart Items Section */
.cart-items-section {
    background: white;
    border-radius: 4px;
    padding: 0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    overflow-y: visible;
}

/* Empty Cart */
.empty-cart {
    text-align: center;
    padding: 60px 20px;
}

.empty-cart-icon {
    font-size: 64px;
    color: #e0e0e0;
    margin-bottom: 16px;
}

.empty-cart h2 {
    font-size: 20px;
    font-weight: 500;
    color: #212121;
    margin-bottom: 8px;
}

.empty-cart p {
    font-size: 14px;
    color: #878787;
    margin-bottom: 24px;
}

/* Cart Items List */
.cart-items-list {
    padding: 20px;
    min-height: 200px;
}

.cart-item {
    padding: 20px 0;
    border-bottom: 1px solid #f0f0f0;
}

.cart-item:last-child {
    border-bottom: none;
}

.cart-item-main {
    display: flex;
    gap: 16px;
    margin-bottom: 16px;
}

.cart-item-image-wrapper {
    flex-shrink: 0;
}

.cart-item-image {
    width: 112px;
    height: 112px;
    object-fit: contain;
    border: 1px solid #f0f0f0;
    border-radius: 4px;
    background: white;
    padding: 8px;
    cursor: pointer;
}

.cart-item-info {
    flex: 1;
    min-width: 0;
}

.cart-item-name {
    font-size: 16px;
    font-weight: 500;
    color: #212121;
    text-decoration: none;
    line-height: 1.4;
    margin-bottom: 6px;
    display: block;
}

.cart-item-name:hover {
    color: var(--mobitez-purple);
}

.cart-item-specs {
    font-size: 14px;
    color: #878787;
    margin-bottom: 6px;
}

.cart-item-seller {
    font-size: 14px;
    color: #878787;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.cart-item-seller i {
    font-size: 12px;
}

.cart-item-pricing {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}

.cart-item-price {
    font-size: 18px;
    font-weight: 500;
    color: #212121;
}

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

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

.cart-item-protect-fee {
    font-size: 14px;
    color: #212121;
    margin-top: 4px;
}

.cart-item-emi {
    font-size: 14px;
    color: #878787;
    margin-top: 4px;
}

.cart-item-delivery {
    margin-top: 12px;
}

.delivery-info {
    font-size: 12px;
    color: #212121;
    display: flex;
    align-items: center;
    gap: 8px;
}

.delivery-express {
    font-style: italic;
    font-weight: 800;
    color: #212121;
    text-transform: uppercase;
    font-size: 11px;
}

.delivery-info i {
    color: #212121;
    font-size: 14px;
}

.delivery-text {
    color: #878787;
}

.protect-promise-fee {
    font-size: 12px;
    color: #212121;
    margin-top: 8px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.protect-promise-fee i {
    color: #878787;
    font-size: 12px;
    cursor: pointer;
}

/* Protection Plans (Optional) */
.cart-item-protection {
    margin-top: 16px;
    padding: 16px;
    background: #f5f5f5;
    border-radius: 4px;
}

.protection-title {
    font-size: 14px;
    font-weight: 500;
    color: #212121;
    margin-bottom: 12px;
}

.protection-option {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}

.protection-info {
    flex: 1;
}

.protection-name {
    font-size: 14px;
    font-weight: 500;
    color: #212121;
    margin-bottom: 4px;
}

.protection-duration {
    font-size: 12px;
    color: #878787;
    margin-bottom: 6px;
}

.protection-pricing {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}

.protection-price {
    font-size: 14px;
    font-weight: 500;
    color: #212121;
}

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

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

.protection-emi {
    font-size: 12px;
    color: #878787;
    margin-top: 4px;
}

.protection-description {
    font-size: 12px;
    color: #878787;
    line-height: 1.4;
    margin-bottom: 8px;
}

.protection-know-more {
    color: var(--mobitez-purple);
    text-decoration: none;
    font-size: 12px;
}

.protection-know-more:hover {
    text-decoration: underline;
}

.btn-add-protection {
    padding: 8px 16px;
    background: white;
    border: 1px solid var(--mobitez-purple);
    border-radius: 2px;
    color: var(--mobitez-purple);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-add-protection:hover {
    background: var(--mobitez-purple);
    color: white;
}

/* Quantity and Actions */
.cart-item-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #f0f0f0;
}

.quantity-controls {
    display: flex;
    align-items: center;
    border: 1px solid #e0e0e0;
    border-radius: 2px;
}

.quantity-btn {
    width: 32px;
    height: 32px;
    border: none;
    background: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #212121;
    font-size: 16px;
    font-weight: 500;
}

.quantity-btn:hover:not(:disabled) {
    background: #f5f5f5;
}

.quantity-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.quantity-input {
    width: 50px;
    height: 32px;
    border: none;
    border-left: 1px solid #e0e0f0;
    border-right: 1px solid #e0e0f0;
    text-align: center;
    font-size: 14px;
    color: #212121;
    background: white;
}

.cart-item-action-links {
    display: flex;
    gap: 16px;
}

.cart-action-link {
    color: #0a4409;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    padding: 0;
    text-decoration: none;
}

.cart-action-link:hover {
    text-decoration: underline;
}

/* Place Order Button */
.cart-actions {
    padding: 20px;
    border-top: 1px solid #f0f0f0;
    display: flex;
    justify-content: flex-end;
}

.btn-place-order-large {
    width: auto;
    min-width: 200px;
    padding: 12px 24px;
    background: var(--mobitez-purple);
    border: none;
    border-radius: 2px;
    color: white;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-block;
}

.btn-place-order-large:hover {
    background: var(--mobitez-purple-dark);
}

.btn-place-order-large:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Price Summary */
.cart-summary-section {
    position: sticky;
    top: 112px;
    align-self: start;
    height: fit-content;
    max-height: calc(100vh - 112px);
    overflow-y: visible;
    z-index: 10;
}

.price-summary {
    background: white;
    border-radius: 4px;
    padding: 16px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.summary-title {
    font-size: 16px;
    font-weight: 500;
    color: #212121;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid #f0f0f0;
    text-transform: capitalize;
}

.summary-content {
    margin-bottom: 16px;
}

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

#discountRow {
    display: flex;
}

.summary-total {
    font-size: 18px;
    font-weight: 500;
    padding-top: 12px;
    border-top: 1px dashed #e0e0e0;
    margin-top: 12px;
    margin-bottom: 16px;
}

.discount-amount {
    color: #388e3c;
    display: flex;
    align-items: center;
    gap: 4px;
}

.summary-savings {
    display: none;
    align-items: center;
    color: #388e3c;
    font-size: 14px;
    margin-bottom: 16px;
    padding: 12px;
    background: #e9f2e9;
    border-radius: 4px;
    font-weight: 500;
}

.summary-savings strong {
    font-weight: 500;
}

.summary-security {
    display: flex;
    align-items: center;
    gap: 8px;
    padding-top: 16px;
    border-top: 1px solid #f0f0f0;
    font-size: 12px;
    color: #878787;
}

.summary-security i {
    color: #388e3c;
    font-size: 14px;
}

/* Responsive */
@media (max-width: 968px) {
    .cart-content {
        grid-template-columns: 1fr;
    }

    .cart-summary-section {
        position: relative;
        top: 0;
    }
}

@media (max-width: 768px) {
    .cart-item-main {
        flex-direction: column;
    }

    .cart-item-image {
        width: 100%;
        height: auto;
        max-height: 300px;
    }

    .cart-item-actions {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .delivery-pincode-section {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
}

/* CRITICAL: Override flipkart-mobile-header.css padding specifically for the cart page */
@media (max-width: 768px) {

    html body:not(.homepage) main.main-content[class],
    body:not(.homepage) main.main-content[class],
    html body main.main-content[class],
    body main.main-content[class] {
        padding-top: 50px !important;
    }
}

/* Bottom Recommendations Sections */
.bottom-recommendations-section {
    background: white;
    padding: 0;
    box-shadow: 0 1px 1px 0 rgba(0, 0, 0, 0.1);
}

.bottom-recommendations-section .section-title {
    font-size: 20px;
    font-weight: 500;
    color: #212121;
    margin-top: 0;
    margin-bottom: 24px;
    padding: 0 16px;
}

.recommendations-container {
    position: relative;
    padding: 0 16px;
}

.recommendations-scroll {
    display: flex;
    overflow-x: auto;
    gap: 16px;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding-bottom: 8px;
}

.recommendations-scroll::-webkit-scrollbar {
    display: none;
}

.recommendations-products {
    display: flex;
    gap: 16px;
}

.recommendations-products .product-card {
    flex: 0 0 200px;
    width: 200px;
    border: 1px solid #f0f0f0;
    padding: 12px;
    border-radius: 4px;
    text-decoration: none;
    transition: box-shadow 0.2s;
}

.recommendations-products .product-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.scroll-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    z-index: 5;
    transition: all 0.2s;
}

.scroll-btn:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.scroll-btn-left {
    left: 0;
}

.scroll-btn-right {
    right: 0;
}

/* Super Deals Tag */
.super-deals-tag {
    background: #e8f5e9;
    color: #388e3c;
    font-size: 11px;
    font-weight: 700;
    padding: 4px 8px;
    border-radius: 2px;
    display: inline-block;
    margin-bottom: 8px;
    text-transform: uppercase;
}

/* Mobile Sticky Bottom Bar */
.mobile-sticky-bottom-bar {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: white;
    padding: 12px 16px;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    justify-content: space-between;
    align-items: center;
    z-index: 1001;
}

.sticky-price-info {
    display: flex;
    flex-direction: column;
}

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

.sticky-total-price {
    font-size: 18px;
    font-weight: 700;
    color: #212121;
    display: flex;
    align-items: center;
    gap: 4px;
}

.sticky-total-price i {
    font-size: 14px;
    color: #878787;
}

.btn-place-order-mobile {
    background: #fb641b;
    color: white;
    border: none;
    border-radius: 2px;
    padding: 12px 24px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.2);
}

/* Refined Pincode Section */
.delivery-pincode-section-refined {
    background: #fff;
    padding: 12px 16px;
    box-shadow: 0 1px 1px 0 rgba(0, 0, 0, 0.1);
    margin-bottom: 8px;
}

.pincode-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.pincode-label-main {
    font-size: 14px;
    color: #212121;
}

.btn-enter-pincode {
    color: #2874f0;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
}

/* Action Links Re-styled */
.cart-item-action-links {
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid #f0f0f0;
    display: flex;
    width: 100%;
}

.cart-action-link {
    flex: 1;
    text-align: center;
    color: #444;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    padding: 8px 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border-right: 1px solid #f0f0f0;
}

.cart-action-link:last-child {
    border-right: none;
}

.cart-action-link i {
    font-size: 14px;
    color: #878787;
}

.qty-dropdown {
    padding: 2px 8px;
    border: 1px solid #e0e0e0;
    border-radius: 2px;
    font-size: 14px;
    background: white;
}

/* Price Details Table Re-styled */
.summary-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 12px;
    font-size: 14px;
    color: #212121;
}

.summary-row.total-amount-row {
    border-top: 1px dashed #e0e0e0;
    padding-top: 12px;
    margin-top: 12px;
    font-size: 18px;
    font-weight: 700;
}

.summary-savings-banner {
    background: #f1f8e9;
    color: #388e3c;
    padding: 12px;
    border-radius: 2px;
    margin-top: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.savings-icon {
    font-size: 16px;
}

.fold-icon {
    font-size: 10px;
    color: #878787;
    margin-left: 4px;
}

@media (max-width: 768px) {
    .cart-header-mobile {
        display: flex;
    }

    .header,
    .mobile-header,
    .top-bar {
        display: none !important;
    }

    .cart-container {
        padding: 0;
    }

    .main-content {
        padding-top: 50px !important;
        padding-bottom: 75px !important;
    }

    .cart-item-main {
        display: flex;
        flex-direction: row;
        gap: 12px;
    }

    .cart-item-image-wrapper {
        width: 80px;
        min-width: 80px;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 8px;
        /* Added gap to push dropdown a bit */
    }

    .cart-item-image {
        padding: 5px;
        max-width: 100%;
        max-height: 100%;
        object-fit: contain;
    }

    .cart-item-info {
        flex: 1;
    }

    .cart-item-name {
        font-size: 14px;
        margin-bottom: 4px;
        line-height: 1.4;
        color: #212121;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    .cart-item-pricing {
        margin-bottom: 4px;
        display: flex;
        align-items: center;
        flex-wrap: wrap;
    }

    .cart-item-price {
        font-size: 16px !important;
        font-weight: 700 !important;
        color: #212121;
    }

    .qty-dropdown {
        margin-top: 4px;
    }

    .cart-item-action-links {
        border-top: 1px solid #f0f0f0;
        margin-top: 12px !important;
    }

    .mobile-sticky-bottom-bar {
        display: flex;
        bottom: 56px;
    }

    .cart-actions {
        display: none !important;
    }

    .bottom-recommendations-section {
        padding: 0;
    }
}