/*--------- Cart Interface Styles ----------*/
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 clamp(10px, 3vw, 15px);
}

.cart-section {
    padding: clamp(40px, 8vw, 80px) 0;
    background-color: var(--pure-white, #ffffff);
    min-height: calc(100vh - 100px);
}

.cart-header {
    text-align: center;
    margin-bottom: clamp(2rem, 5vw, 3rem);
}

.cart-title {
    font-weight: 700;
    color: var(--dark-coffee, #3e2723);
    font-size: clamp(1.8rem, 4vw, 2.5rem);
    margin-bottom: clamp(0.25rem, 1vw, 0.5rem);
}

.divider {
    width: clamp(50px, 15vw, 100px);
    margin: 0 auto;
    border: none;
    border-top: clamp(2px, 0.5vw, 3px) solid var(--primary-brown, #8d6e63);
}

.alert {
    padding: clamp(10px, 2vw, 1rem);
    border-radius: clamp(4px, 1vw, 8px);
    text-align: center;
    margin-bottom: clamp(1rem, 3vw, 1.5rem);
    font-size: clamp(0.85rem, 1.5vw, 1rem);
    font-weight: 600;
}

.alert-danger {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

/*--------- Digital-Only & Combo Checkout Mode Banner ---------*/
.checkout-mode-banner {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: clamp(12px, 2.5vw, 16px) clamp(15px, 3vw, 20px);
    border-radius: clamp(8px, 2vw, 12px);
    margin-bottom: clamp(18px, 3vw, 25px);
    font-size: clamp(0.85rem, 1.5vw, 0.95rem);
    line-height: 1.5;
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.04);
}

.checkout-mode-banner i {
    font-size: 1.4rem;
    margin-top: 2px;
    flex-shrink: 0;
}

.checkout-mode-banner strong {
    display: block;
    font-size: clamp(0.95rem, 1.7vw, 1.05rem);
    margin-bottom: 3px;
}

.checkout-mode-banner.banner-digital-only {
    background: linear-gradient(135deg, #e0f7fa 0%, #f1f8e9 100%);
    border: 1px solid #80deea;
    border-left: 5px solid #00838f;
    color: #004d40;
}

.checkout-mode-banner.banner-combo {
    background: linear-gradient(135deg, #fff8e1 0%, #efebe9 100%);
    border: 1px solid #ffe082;
    border-left: 5px solid var(--primary-brown, #8d6e63);
    color: var(--dark-coffee, #3e2723);
}

/*--------- Digital Terms of Use & Watermark Agreement Box ---------*/
.digital-terms-box {
    margin-top: clamp(15px, 3vw, 22px);
    padding: clamp(14px, 2.5vw, 18px);
    border-radius: clamp(8px, 1.5vw, 10px);
    background: #fdfaf7;
    border: 1.5px solid rgba(141, 110, 99, 0.35);
    border-left: 5px solid var(--primary-brown, #8d6e63);
}

.digital-terms-header {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--dark-coffee, #3e2723);
    font-size: clamp(0.9rem, 1.6vw, 1rem);
    margin-bottom: 8px;
}

.digital-terms-header i {
    color: var(--primary-brown, #8d6e63);
    font-size: 1.15rem;
}

.digital-terms-desc {
    margin: 0 0 12px 0;
    font-size: clamp(0.8rem, 1.4vw, 0.88rem);
    color: #555555;
    line-height: 1.55;
}

.digital-terms-checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-weight: 600;
    font-size: clamp(0.84rem, 1.4vw, 0.92rem);
    color: var(--dark-coffee, #3e2723);
    cursor: pointer;
    background: #ffffff;
    padding: 10px 12px;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
}

.digital-terms-checkbox-label input[type="checkbox"] {
    margin-top: 3px;
    flex-shrink: 0;
}

/* Layout Grid */
.cart-layout {
    display: flex;
    flex-wrap: wrap;
    gap: clamp(15px, 4vw, 30px);
    align-items: flex-start;
}

.cart-forms {
    flex: 1 1 60%;
    min-width: 0;
}

.cart-summary {
    flex: 1 1 35%;
    min-width: 0;
}

.sticky-sidebar {
    position: sticky;
    top: clamp(80px, 10vw, 100px);
    z-index: 10;
}

/* Card Styling */
.card {
    background: var(--glass-bg, rgba(255, 255, 255, 0.9));
    border-radius: clamp(10px, 3vw, 15px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    border: 1px solid #eaeaea;
    overflow: hidden;
    margin-bottom: clamp(15px, 4vw, 25px);
}

.card-header {
    padding: clamp(1rem, 2.5vw, 1.2rem) clamp(1.2rem, 3vw, 1.5rem);
    border-bottom: 1px solid rgba(141, 110, 99, 0.15);
}

.card-header.bg-primary {
    background-color: var(--primary-brown, #8d6e63);
}

.card-header.bg-secondary {
    background-color: var(--dark-coffee, #3e2723);
}

.card-title {
    margin: 0;
    font-size: clamp(1.1rem, 2vw, 1.25rem);
    font-weight: 700;
}

.text-white {
    color: #fff !important;
}

.card-body {
    padding: clamp(1rem, 3vw, 1.5rem);
}

.card-body.no-padding {
    padding: 0;
}

/* Forms */
.form-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: clamp(10px, 2.5vw, 15px);
}

.form-group {
    display: flex;
    flex-direction: column;
    margin-bottom: clamp(10px, 2.5vw, 15px);
}

.form-group.full-width {
    grid-column: span 12;
}

.form-group.half-width {
    grid-column: span 6;
}

.form-group.third-width {
    grid-column: span 4;
}

.form-label {
    font-weight: 700;
    color: var(--text-muted, #6c757d);
    margin-bottom: clamp(3px, 1vw, 5px);
    font-size: clamp(0.8rem, 1.5vw, 0.9rem);
}

.required {
    color: #dc3545;
}

.form-control, .form-select {
    padding: clamp(0.5rem, 1.5vw, 0.75rem) clamp(0.75rem, 2vw, 1rem);
    border: 1px solid rgba(141, 110, 99, 0.2);
    border-radius: clamp(6px, 1.5vw, 8px);
    font-size: clamp(0.9rem, 1.5vw, 1rem);
    background-color: var(--pure-white, #ffffff);
    color: var(--text-main, #333333);
    transition: all 0.3s ease;
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary-brown, #8d6e63);
    box-shadow: 0 0 0 3px rgba(141, 110, 99, 0.15);
    outline: none;
}

.checkbox-container {
    background-color: #f8f9fa;
    padding: clamp(0.75rem, 2vw, 1rem);
    border: 1px solid #dee2e6;
    border-radius: clamp(6px, 1.5vw, 8px);
    margin: clamp(1rem, 3vw, 1.5rem) 0;
    display: flex;
    align-items: center;
}

.form-check-input {
    margin-right: clamp(8px, 2vw, 10px);
    width: clamp(1em, 2vw, 1.2em);
    height: clamp(1em, 2vw, 1.2em);
    accent-color: var(--primary-brown, #8d6e63);
}

.form-check-label {
    font-weight: 600;
    cursor: pointer;
    font-size: clamp(0.85rem, 1.5vw, 1rem);
}

/* Options Grid */
.options-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(clamp(200px, 30vw, 280px), 1fr));
    gap: clamp(15px, 3vw, 20px);
}

.delivery-date-text {
    font-size: clamp(0.85rem, 1.5vw, 0.9rem);
    color: var(--text-muted, #6c757d);
    margin-bottom: clamp(0.75rem, 2vw, 1rem);
}

.delivery-date-val {
    font-weight: 700;
    color: var(--dark-coffee, #3e2723);
}

/*--------- South African Couriers Interactive Styling ---------*/
.courier-filter-controls {
    display: flex;
    flex-wrap: wrap;
    gap: clamp(10px, 2vw, 15px);
    margin-bottom: clamp(15px, 3vw, 20px);
    background-color: #fcfcfc;
    padding: clamp(10px, 3vw, 15px);
    border-radius: clamp(6px, 1.5vw, 8px);
    border: 1px solid #eee;
    align-items: flex-end;
}

.filter-item {
    flex: 1 1 min(100%, 220px);
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.filter-label {
    font-size: clamp(0.75rem, 1.5vw, 0.85rem);
    font-weight: 700;
    color: var(--dark-coffee, #3e2723);
    margin-bottom: clamp(4px, 1vw, 6px);
}

.filter-item .form-select {
    width: 100%;
    max-width: 100%;
    text-overflow: ellipsis;
}

.courier-options-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 380px;
    overflow-y: auto;
    padding-right: 4px;
}

.courier-options-list::-webkit-scrollbar {
    width: 6px;
}

.courier-options-list::-webkit-scrollbar-thumb {
    background-color: rgba(141, 110, 99, 0.3);
    border-radius: 3px;
}

.courier-loading-state {
    text-align: center;
    padding: 25px;
    color: #6c757d;
}

.courier-loading-state i {
    color: var(--primary-brown, #8d6e63);
    margin-bottom: 8px;
}

.courier-option-card {
    display: flex;
    align-items: center;
    padding: clamp(10px, 2vw, 14px);
    border: 1.5px solid #e2e8f0;
    border-radius: 8px;
    background: #ffffff;
    cursor: pointer;
    transition: all 0.25s ease-in-out;
    gap: clamp(8px, 2vw, 12px);
}

.courier-option-card:hover {
    border-color: var(--primary-brown, #8d6e63);
    background-color: rgba(141, 110, 99, 0.03);
    transform: translateY(-1px);
}

.courier-option-card.courier-option-selected {
    border-color: var(--primary-brown, #8d6e63);
    background-color: rgba(141, 110, 99, 0.08);
    box-shadow: 0 3px 10px rgba(141, 110, 99, 0.15);
}

.courier-radio-container input[type="radio"] {
    accent-color: var(--primary-brown, #8d6e63);
    transform: scale(1.25);
    cursor: pointer;
    margin: 0;
}

.courier-info-container {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}

.courier-brand-header {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
}

.courier-brand-name {
    font-size: clamp(0.85rem, 1.8vw, 0.95rem);
    font-weight: 700;
    color: var(--dark-coffee, #3e2723);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.courier-badge {
    font-size: clamp(0.65rem, 1.2vw, 0.72rem);
    padding: 2px 7px;
    border-radius: 4px;
    font-weight: 600;
    color: white;
    white-space: nowrap;
}

.tcg-badge { background-color: #e65100; }
.fastway-badge { background-color: #0d47a1; }
.ram-badge { background-color: #b71c1c; }
.dpd-badge { background-color: #c2185b; }
.dsv-badge { background-color: #00695c; }
.aramex-badge { background-color: #d84315; }

.courier-eta-text {
    font-size: clamp(0.75rem, 1.5vw, 0.8rem);
    color: #555555;
}

.courier-rate-container {
    text-align: right;
    flex-shrink: 0;
}

.courier-price-val {
    font-size: clamp(0.95rem, 2vw, 1.1rem);
    font-weight: 700;
    color: var(--dark-coffee, #3e2723);
    white-space: nowrap;
}

.promo-status {
    font-size: clamp(0.8rem, 1.2vw, 0.85rem);
    font-weight: 700;
    margin-top: 5px;
}

.promo-status.success { color: #28a745; }
.promo-status.error { color: #dc3545; }

/* Cart Table */
.cart-table-wrapper {
    overflow-x: auto;
}

.cart-table {
    width: 100%;
    border-collapse: collapse;
}

.cart-table th {
    background-color: #f8f9fa;
    padding: clamp(0.75rem, 2vw, 1rem);
    text-align: left;
    font-weight: 600;
    color: var(--dark-coffee, #3e2723);
    border-bottom: 1px solid #dee2e6;
    font-size: clamp(0.85rem, 1.5vw, 1rem);
}

.cart-table td {
    padding: clamp(0.75rem, 2vw, 1rem);
    vertical-align: middle;
    border-bottom: 1px solid #dee2e6;
    font-size: clamp(0.85rem, 1.5vw, 1rem);
}

.cart-table tr:last-child td {
    border-bottom: none;
}

.text-center { text-align: center !important; }
.text-end { text-align: right !important; }

.product-info-cell {
    display: flex;
    align-items: center;
    gap: clamp(10px, 2.5vw, 15px);
}

.cart-prod-img {
    width: clamp(40px, 8vw, 60px);
    height: clamp(40px, 8vw, 60px);
    object-fit: cover;
    border-radius: clamp(3px, 1vw, 4px);
    border: 1px solid #dee2e6;
}

.prod-name {
    margin: 0 0 clamp(3px, 1vw, 5px) 0;
    font-weight: 600;
    font-size: clamp(0.85rem, 1.5vw, 0.9rem);
}

.prod-price {
    color: var(--text-muted, #6c757d);
    display: block;
    margin-bottom: clamp(3px, 1vw, 5px);
}

.removeproductbtn {
    background: none;
    border: none;
    color: #dc3545;
    font-size: clamp(0.75rem, 1.2vw, 0.8rem);
    cursor: pointer;
    padding: 0;
    text-decoration: underline;
}

.qty-form {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

.form-control-sm {
    width: clamp(40px, 8vw, 50px);
    text-align: center;
    padding: 5px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: clamp(0.85rem, 1.5vw, 1rem);
}

.editquantitybtn {
    background: transparent;
    border: 1px solid #ccc;
    border-radius: 4px;
    cursor: pointer;
    padding: 5px;
    transition: background 0.3s ease;
}

.editquantitybtn:hover {
    background: #f8f9fa;
}

.discount-badge {
    position: static;
    display: inline-block;
    background: #17a2b8;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: clamp(0.75rem, 1.2vw, 0.8rem);
    font-weight: 600;
    margin: 0 auto;
}

.item-total {
    font-weight: 700;
}

/* Summary Box */
.card-footer {
    background-color: #f8f9fa;
    padding: clamp(1rem, 3vw, 1.5rem);
    border-top: 1px solid #dee2e6;
}

.summary-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: clamp(1rem, 3vw, 1.5rem);
}

.summary-table td {
    padding: clamp(6px, 1.5vw, 8px) 0;
    color: var(--text-muted, #6c757d);
    font-weight: 600;
    font-size: clamp(0.9rem, 1.5vw, 1rem);
}

.summary-table .text-end { text-align: right; }

.shipping-cost { color: #dc3545; }
.discount-cost { color: #28a745; }

.total-row td {
    border-top: 1px solid #dee2e6;
    padding-top: clamp(10px, 2.5vw, 15px);
    margin-top: clamp(8px, 2vw, 10px);
    font-size: clamp(1.1rem, 2.5vw, 1.25rem);
    color: var(--dark-coffee, #3e2723);
}

.final-total {
    color: var(--primary-brown, #8d6e63) !important;
}

.btn-checkout {
    display: block;
    width: 100%;
    background: linear-gradient(135deg, var(--primary-brown, #8d6e63), var(--dark-coffee, #3e2723));
    color: white;
    border: none;
    padding: clamp(12px, 2.5vw, 15px);
    border-radius: clamp(6px, 1.5vw, 8px);
    font-size: clamp(1rem, 2vw, 1.1rem);
    font-weight: 700;
    cursor: pointer;
    transition: background 0.3s, transform 0.2s;
    text-align: center;
}

.btn-checkout:hover, .btn-checkout:focus {
    background: linear-gradient(135deg, var(--primary-hover, #6d4c41), var(--medium-brown, #5d4037));
    transform: translateY(-2px);
    outline: none;
    box-shadow: 0 4px 15px rgba(141, 110, 99, 0.3);
}

.btn-checkout:active {
    transform: translateY(0);
}

/* Fluid Responsive Size Badge */
.badge.badge-secondary {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    background-color: #6c757d !important;
    color: var(--pure-white, #ffffff) !important;
    padding: clamp(4px, 1.5vw, 6px) clamp(8px, 2vw, 12px) !important;
    border-radius: clamp(4px, 1vw, 8px) !important;
    font-size: clamp(0.7rem, 1.5vw, 0.85rem) !important;
    font-weight: 600;
    text-align: center;
    line-height: 1.2;
    white-space: nowrap !important;
    min-width: fit-content;
}

@media (max-width: 992px) {
    .cart-forms, .cart-summary {
        flex: 1 1 100%;
    }
    .form-group.half-width, .form-group.third-width {
        grid-column: span 12;
    }
}

@media (max-width: 380px) {
    .courier-brand-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 3px;
    }
    .badge.badge-secondary {
        font-size: 0.65rem !important;
        padding: 3px 6px !important;
    }
}