body.cart-modal-open {
    overflow: hidden !important;
}

/* Force header down when modal is open */
body.cart-modal-open #header, 
body.cart-modal-open .header-container, 
body.cart-modal-open header,
body.cart-modal-open .nav-container {
    z-index: 1 !important;
}

.cart-modal-overlay {
    position: fixed !important;
    z-index: 999999999 !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    background: rgba(0, 0, 0, 0.45) !important;
    backdrop-filter: blur(8px) !important;
    -webkit-backdrop-filter: blur(8px) !important;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 16px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.cart-modal-overlay.active {
    display: flex;
    opacity: 1;
}

/* Reset font-size for the entire modal to 16px base */
.cart-modal-container {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 16px;
    line-height: 1.5;
    background: white;
    width: 100%;
    max-width: 980px;
    max-height: 90vh;
    border-radius: 20px;
    box-shadow: 0 25px 60px -10px rgba(0, 0, 0, 0.2);
    outline: none;
    border: none;
    overflow: hidden;
    position: relative;
    transform: translateY(30px);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    box-sizing: border-box;
}

.cart-modal-container *,
.cart-modal-container *::before,
.cart-modal-container *::after {
    box-sizing: border-box;
}

.cart-modal-overlay.active .cart-modal-container {
    transform: translateY(0);
}

.cart-modal-close-top {
    position: absolute;
    top: 20px;
    right: 20px;
    background: transparent;
    border: none;
    color: #9ca3af;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    z-index: 10;
    outline: none;
    font-size: 22px;
    font-weight: 300;
}

.cart-modal-close-top:hover {
    color: #111827;
}

.cart-modal-body {
    display: flex;
    flex-direction: column;
}

@media (min-width: 850px) {
    .cart-modal-body {
        flex-direction: row;
    }
}

/* Left Column */
.cart-modal-left {
    flex: 1.3;
    padding: 32px 32px 24px;
    background: #fff;
    overflow-y: auto;
    max-height: 90vh;
    /* Invisible scrollbar */
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.cart-modal-left::-webkit-scrollbar {
    display: none;
}

.cart-modal-success-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 28px;
}

.success-icon {
    width: 40px;
    height: 40px;
    min-width: 40px;
    background: #dcfce7;
    color: #16a34a;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cart-modal-success-header h3 {
    margin: 0;
    font-size: 22px;
    font-weight: 800;
    color: #16a34a;
    letter-spacing: -0.3px;
}

/* Product Card */
.cart-product-card {
    display: flex;
    gap: 18px;
    padding: 18px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    margin-bottom: 20px;
    align-items: center;
}

.product-image-wrapper {
    width: 90px;
    height: 90px;
    background: #fff;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6px;
    border: 1px solid #e5e7eb;
}

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

.product-main-details {
    flex: 1;
}

.product-main-details h4 {
    margin: 0 0 4px 0;
    font-size: 17px;
    font-weight: 800;
    color: #1e293b;
    letter-spacing: -0.2px;
    line-height: 1.3;
}

.product-config-summary {
    font-size: 13px;
    color: #6b7280;
    margin-bottom: 10px;
    line-height: 1.4;
}

.product-arrival-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    padding: 5px 12px;
    border-radius: 6px;
}

.arrival-label {
    font-size: 11px;
    font-weight: 700;
    color: #15803d;
}

.arrival-date {
    font-size: 11px;
    font-weight: 700;
    color: #15803d;
    text-transform: uppercase;
}

/* Mobile summary: hidden on desktop */
.cart-mobile-summary {
    display: none;
}

/* Mobile bottom bar: hidden on desktop */
.cart-modal-mobile-bar {
    display: none;
}

/* Detail Section — Unified Card (like mockup) */
.cart-detail-section {
    margin-bottom: 24px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.section-title {
    font-size: 10px;
    font-weight: 800;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin: 0;
    padding: 12px 18px;
    background: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
}

.cart-detail-content {
    display: flex;
    flex-direction: column;
    padding: 0;
}

.cart-detail-item {
    background: transparent;
    border-radius: 0;
    padding: 14px 18px;
    border: none;
}

.marking-detail-item {
    border-top: 1px dashed #d1d5db;
}

.detail-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0;
}

.detail-item-header:has(+ .detail-item-variants:not(:empty)) {
    margin-bottom: 10px;
}

.detail-item-title {
    display: flex;
    align-items: center;
    gap: 7px;
    font-weight: 700;
    font-size: 14px;
    color: #1e293b;
}

.detail-item-title i {
    color: #9ca3af;
    font-size: 13px;
}

.detail-item-title i.text-primary {
    color: #6366f1;
}

.detail-item-price {
    font-size: 13px;
    color: #6b7280;
    font-weight: 500;
    white-space: nowrap;
}

.detail-item-variants {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.variant-row {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    color: #374151;
    font-weight: 500;
    align-items: center;
    padding: 5px 0;
}

.variant-row.nested {
    margin-left: 5px;
    padding-left: 14px;
    border-left: 2px solid #e5e7eb;
    font-size: 12px;
    color: #4b5563;
    font-weight: 400;
    padding: 4px 0 4px 14px;
}

.variant-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 10px;
    border: 2px solid #fff;
    box-shadow: 0 0 0 1px rgba(0,0,0,0.12);
    vertical-align: middle;
}

.cart-detail-total-row {
    padding: 12px 18px;
    border-top: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
    background: #f9fafb;
    margin-top: 0;
}

.cart-detail-total-row .label {
    font-weight: 800;
    color: #1e293b;
}

.cart-detail-total-row .value {
    font-weight: 800;
    color: #1e293b;
    font-size: 18px;
}

.cart-modal-footer-left {
    margin-top: 20px;
}

.btn-back-to-shop {
    color: #6b7280;
    font-weight: 700;
    font-size: 13px;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: color 0.2s;
}

.btn-back-to-shop:hover {
    color: #111827;
}

/* Right Column */
.cart-modal-right {
    width: 100%;
    background: #f9fafb;
    padding: 32px 30px;
    border-left: 1px solid #e5e7eb;
}

@media (min-width: 850px) {
    .cart-modal-right {
        width: 380px;
        min-width: 380px;
    }
}

.summary-title {
    font-size: 11px;
    font-weight: 800;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin: 0 0 22px 0;
}

.cart-summary-box {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 28px;
}

.cart-summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cart-summary-row .label {
    font-size: 14px;
    color: #6b7280;
    font-weight: 600;
}

.cart-summary-row .value {
    font-size: 15px;
    color: #1e293b;
    font-weight: 600;
}

.highlight-green {
    color: #16a34a !important;
}

.cart-summary-total {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 2px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cart-summary-total .label {
    font-size: 15px;
    font-weight: 800;
    color: #1e293b;
}

.cart-summary-total .value {
    font-size: 32px;
    font-weight: 900;
    color: #1e293b;
    letter-spacing: -0.5px;
}

/* Actions */
.cart-modal-actions {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.cart-btn-primary {
    background: #55c65e;
    color: white;
    border: none;
    padding: 16px;
    border-radius: 12px;
    font-weight: 800;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 6px 18px rgba(85, 198, 94, 0.25);
}

.cart-btn-primary:hover {
    background: #4eb356;
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(85, 198, 94, 0.35);
}

.cart-btn-primary i {
    font-size: 14px;
}

.cart-trust-info {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    padding: 8px 0;
}

.trust-label {
    font-size: 9px;
    font-weight: 800;
    color: #9ca3af;
    display: flex;
    align-items: center;
    gap: 4px;
}

.trust-icons {
    display: flex;
    align-items: center;
    gap: 10px;
    opacity: 0.5;
}

.trust-icons img {
    height: 12px;
    object-fit: contain;
}

.cart-btn-secondary {
    background: transparent;
    color: #6b7280;
    border: 1px solid #e5e7eb;
    padding: 12px;
    border-radius: 10px;
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.cart-btn-secondary:hover {
    background: #f3f4f6;
    color: #111827;
}

/* Responsive adjustments */
@media (max-width: 849px) {
    .cart-modal-overlay {
        padding: 0;
        align-items: flex-end; /* Stick to bottom */
    }

    .cart-modal-container {
        border-radius: 20px 20px 0 0;
        width: 100%;
        max-width: none;
        height: auto;
        max-height: 95vh;
        display: flex;
        flex-direction: column;
        overflow: hidden;
        margin-bottom: 0;
        position: relative;
        transform: translateY(100%); /* Slide up from bottom */
    }

    .cart-modal-overlay.active .cart-modal-container {
        transform: translateY(0);
    }

    .cart-modal-close-top {
        top: 15px;
        right: 15px;
        background: #f3f4f6;
        width: 28px;
        height: 28px;
        font-size: 16px;
    }

    .cart-modal-body {
        flex-direction: column;
        overflow: hidden;
        height: 100%;
    }

    .cart-modal-left {
        width: 100%;
        padding: 24px 20px 120px 20px; /* More bottom padding for the bar */
        overflow-y: auto;
        -ms-overflow-style: none;
        scrollbar-width: none;
    }
    .cart-modal-left::-webkit-scrollbar {
        display: none;
    }

    .cart-modal-right {
        display: none;
    }

    .cart-modal-footer-left {
        display: none;
    }

    .cart-mobile-summary {
        display: block;
        margin-top: 14px;
        padding-top: 14px;
        border-top: 1px solid #e5e7eb;
    }

    .cart-mobile-summary .summary-title {
        background: transparent;
        border-bottom: none;
        padding: 0;
        margin-bottom: 12px;
    }

    .cart-mobile-summary .cart-summary-box {
        padding: 12px 14px;
        border: 1px solid #e5e7eb;
        border-radius: 10px;
        background: #fff;
        margin-bottom: 12px;
        gap: 8px;
    }

    .cart-mobile-summary .cart-summary-row .label {
        font-size: 13px;
    }

    .cart-mobile-summary .cart-summary-row .value {
        font-size: 13px;
    }

    .mobile-seguir-btn {
        width: 100%;
        text-align: center;
    }

    .cart-product-card {
        padding: 12px;
        margin-bottom: 12px;
        background: #f9fafb;
    }

    .cart-detail-section {
        margin-bottom: 14px;
    }

    .cart-detail-section .section-title {
        padding: 10px 16px;
        font-size: 9px;
    }

    .cart-detail-section .cart-detail-item {
        padding: 12px 16px;
    }

    .cart-detail-section .cart-detail-total-row {
        padding: 10px 16px;
    }

    .cart-detail-section .cart-detail-total-row .label {
        font-size: 13px;
        font-weight: 700;
        white-space: nowrap;
        margin-right: 8px;
    }

    .cart-detail-section .cart-detail-total-row .value {
        font-size: 15px;
        font-weight: 800;
        white-space: nowrap;
        flex-shrink: 0;
        text-align: right;
    }

    .cart-detail-section .cart-detail-total-row .value small {
        font-size: 11px;
        font-weight: 400;
        color: #6b7280;
    }

    .cart-detail-section .detail-item-title {
        font-size: 13px;
        flex: 1;
        min-width: 0;
    }

    .cart-detail-section .detail-item-title span {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .cart-detail-section .detail-item-price {
        font-size: 11px;
        flex-shrink: 0;
        white-space: nowrap;
        margin-left: 8px;
    }

    .cart-detail-section .variant-row {
        font-size: 11px;
    }

    .cart-detail-section .variant-row.nested {
        font-size: 11px;
    }

    .cart-detail-section .variant-row span:last-child {
        flex-shrink: 0;
        white-space: nowrap;
        margin-left: 8px;
    }

    .product-image-wrapper {
        width: 70px;
        height: 70px;
    }

    .cart-modal-success-header {
        margin-bottom: 20px;
        padding-right: 40px; /* Room for the X */
    }

    .cart-modal-success-header h3 {
        font-size: 18px;
        line-height: 1.2;
    }

    /* Mobile Bottom Bar Styles */
    .cart-modal-mobile-bar {
        display: flex;
        flex-direction: column;
        position: absolute;
        bottom: 0;
        left: 0;
        right: 0;
        background: white;
        padding: 12px 20px calc(12px + env(safe-area-inset-bottom, 0px));
        border-top: 1px solid #f3f4f6;
        box-shadow: 0 -10px 20px rgba(0,0,0,0.05);
        z-index: 100;
    }

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

    .mobile-bar-total-info {
        display: flex;
        flex-direction: column;
        min-width: 90px;
    }

    .mobile-bar-total-label {
        font-size: 10px;
        font-weight: 700;
        color: #9ca3af;
        letter-spacing: 0.3px;
    }

    .mobile-bar-total-value {
        font-size: 20px;
        font-weight: 800;
        color: #111827;
        letter-spacing: -0.5px;
        line-height: 1.1;
        margin-top: 1px;
    }

    .mobile-bar-btn {
        flex: 1;
        padding: 12px !important;
        font-size: 15px !important;
        font-weight: 700 !important;
        border-radius: 12px !important;
        height: 46px;
    }

    .mobile-bar-trust {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 10px;
        padding-top: 6px;
        border-top: 1px solid #f9fafb;
    }

    .mobile-bar-trust .trust-label {
        font-size: 9px;
        color: #9ca3af;
    }

    .mobile-bar-trust .trust-icons {
        display: flex;
        align-items: center;
        gap: 8px;
        opacity: 0.6;
    }
}
