/* ═══════════════════════════════════════════════════════
   SONIDO NORTE – CARRITO PREMIUM MOBILE-FIRST
   ═══════════════════════════════════════════════════════ */
:root {
    --c-bg: #f5f5f7;
    --c-card: #ffffff;
    --c-border: #e8e8ed;
    --c-text: #1d1d1f;
    --c-muted: #86868b;
    --c-accent: #000000;
    --c-green: #34c759;
    --c-green-soft: #e8faf0;
    --c-blue: #007aff;
    --c-blue-soft: #e8f2ff;
    --c-orange: #ff9500;
    --c-orange-soft: #fff4e6;
    --c-red: #ff3b30;
    --c-soft: #f5f5f7;
    --radius: 16px;
    --radius-sm: 12px;
    --shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.12);
}

.flatpickr-calendar {
    box-shadow: var(--shadow-lg);
    border: none;
    border-radius: var(--radius);
}

/* Layout */
.cart-page {
    max-width: 1280px;
    margin: 0 auto;
    padding: 120px 16px 120px;
}

/* Progress Steps */
.progress-bar-steps {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    margin-bottom: 40px;
    padding: 0 20px;
}

.step-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.step-num {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    font-size: 0.75rem;
    background: var(--c-border);
    color: var(--c-muted);
    transition: 0.3s;
}

.step-item.active .step-num {
    background: var(--c-accent);
    color: #fff;
}

.step-item.done .step-num {
    background: var(--c-green);
    color: #fff;
}

.step-label {
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--c-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.step-item.active .step-label {
    color: var(--c-text);
}

.step-line {
    width: 40px;
    height: 2px;
    background: var(--c-border);
    margin: 0 8px;
}

.step-line.done {
    background: var(--c-green);
}

/* Cards */
.c-card {
    background: var(--c-card);
    border-radius: var(--radius);
    padding: 28px;
    margin-bottom: 16px;
    box-shadow: var(--shadow);
    border: 1px solid var(--c-border);
    transition: 0.2s;
}

.c-card:hover {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.c-card-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 24px;
}

.c-card-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.c-card-icon.delivery {
    background: var(--c-blue-soft);
    color: var(--c-blue);
}

.c-card-icon.equipment {
    background: var(--c-orange-soft);
    color: var(--c-orange);
}

.c-card-icon.staff {
    background: #f3e8ff;
    color: #8b5cf6;
}

.c-card-icon.insurance {
    background: var(--c-green-soft);
    color: var(--c-green);
}

.c-card-title {
    font-family: 'Outfit', sans-serif;
    font-size: 1rem;
    font-weight: 800;
}

.c-card-subtitle {
    font-size: 0.7rem;
    color: var(--c-muted);
    font-weight: 600;
}

/* Labels */
.c-label {
    font-size: 0.65rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--c-muted);
    margin-bottom: 10px;
    display: block;
}

.c-input {
    width: 100%;
    border: 2px solid var(--c-border);
    border-radius: var(--radius-sm);
    padding: 14px 16px;
    font-weight: 600;
    font-size: 0.9rem;
    transition: 0.2s;
    outline: none;
    background: #fff;
}

.c-input:focus {
    border-color: var(--c-accent);
    box-shadow: 0 0 0 4px rgba(0, 0, 0, 0.06);
}

/* Delivery Selector */
.del-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.del-option {
    border: 2px solid var(--c-border);
    border-radius: var(--radius);
    padding: 20px 16px;
    cursor: pointer;
    transition: 0.25s;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.del-option::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: transparent;
    transition: 0.25s;
}

.del-option.active {
    border-color: var(--c-accent);
    background: #fafafa;
}

.del-option.active::before {
    background: var(--c-accent);
}

.del-option i {
    font-size: 1.6rem;
    display: block;
    margin-bottom: 10px;
}

.del-option .del-name {
    font-weight: 800;
    font-size: 0.8rem;
    display: block;
    margin-bottom: 4px;
}

.del-option .del-desc {
    font-size: 0.65rem;
    color: var(--c-muted);
    line-height: 1.4;
}

.del-option .del-badge {
    display: inline-block;
    background: var(--c-green-soft);
    color: var(--c-green);
    font-size: 0.6rem;
    font-weight: 800;
    padding: 3px 8px;
    border-radius: 6px;
    margin-top: 8px;
    text-transform: uppercase;
}

/* Pill Toggles */
.pill-row {
    display: flex;
    background: var(--c-soft);
    padding: 4px;
    border-radius: var(--radius-sm);
    gap: 4px;
}

.pill-btn {
    flex: 1;
    border: none;
    background: transparent;
    padding: 12px 8px;
    border-radius: 10px;
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    color: var(--c-muted);
    cursor: pointer;
    transition: 0.2s;
    white-space: nowrap;
}

.pill-btn.active {
    background: #fff;
    color: var(--c-text);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

/* Date Picker Trigger */
.date-box {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px;
    border: 2px solid var(--c-border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: 0.2s;
    background: #fff;
}

.date-box:hover {
    border-color: var(--c-accent);
}

.date-box i {
    font-size: 1.2rem;
    color: var(--c-blue);
}

.date-box .date-text {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--c-text);
}

.date-box .date-hint {
    font-size: 0.65rem;
    color: var(--c-muted);
}

.days-pill {
    background: var(--c-accent);
    color: #fff;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.65rem;
    font-weight: 900;
    margin-left: auto;
    white-space: nowrap;
}

/* Cart Items */
.cart-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 18px 0;
    border-bottom: 1px solid var(--c-border);
}

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

.cart-item-thumb {
    width: 56px;
    height: 56px;
    background: var(--c-soft);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.cart-item-thumb i {
    font-size: 1.4rem;
    color: var(--c-muted);
}

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

.cart-item-name {
    font-weight: 800;
    font-size: 0.85rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cart-item-brand {
    font-size: 0.65rem;
    color: var(--c-muted);
    font-weight: 600;
}

.cart-item-opts {
    font-size: 0.6rem;
    color: var(--c-green);
    font-weight: 700;
    margin-top: 4px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.cart-item-qty {
    display: flex;
    align-items: center;
    gap: 0;
    background: var(--c-soft);
    border-radius: 10px;
    overflow: hidden;
    flex-shrink: 0;
}

.qty-btn {
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    font-size: 0.9rem;
    font-weight: 900;
    color: var(--c-text);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.15s;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.qty-btn:hover {
    background: var(--c-border);
}

.qty-btn:active {
    transform: scale(0.9);
}

.qty-val {
    font-size: 0.75rem;
    font-weight: 900;
    min-width: 24px;
    text-align: center;
    color: var(--c-text);
}

.cart-item-price {
    font-weight: 900;
    font-size: 0.9rem;
    text-align: right;
    white-space: nowrap;
    min-width: 80px;
}

.cart-item-del {
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    color: var(--c-muted);
    font-size: 1.2rem;
    cursor: pointer;
    border-radius: 8px;
    transition: 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.cart-item-del:hover {
    background: #fee;
    color: var(--c-red);
}

.cart-empty {
    text-align: center;
    padding: 50px 20px;
}

.cart-empty i {
    font-size: 3rem;
    color: var(--c-border);
    margin-bottom: 16px;
    display: block;
}

.cart-empty-text {
    font-weight: 800;
    color: var(--c-muted);
    font-size: 0.85rem;
}

.add-more-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: var(--c-soft);
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 800;
    color: var(--c-text);
    text-decoration: none;
    transition: 0.2s;
    margin-top: 16px;
}

.add-more-link:hover {
    background: var(--c-border);
    color: var(--c-text);
}

/* Protection Toggle */
.protect-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.protect-opt {
    border: 2px solid var(--c-border);
    border-radius: var(--radius);
    padding: 20px 16px;
    cursor: pointer;
    transition: 0.25s;
    text-align: center;
}

.protect-opt.active {
    border-color: var(--c-accent);
    background: #fafafa;
}

.protect-opt i {
    font-size: 1.6rem;
    display: block;
    margin-bottom: 8px;
}

.protect-opt .po-title {
    font-weight: 800;
    font-size: 0.75rem;
    display: block;
    text-transform: uppercase;
}

.protect-opt .po-desc {
    font-size: 0.6rem;
    color: var(--c-muted);
    margin-top: 4px;
    line-height: 1.4;
}

/* Pickup section */
.pickup-box {
    margin-top: 20px;
    padding: 20px;
    background: var(--c-soft);
    border-radius: var(--radius-sm);
}

.cp-wrap {
    position: relative;
    margin-top: 20px;
}

.cp-badge {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.55rem;
    font-weight: 900;
    background: var(--c-accent);
    color: #fff;
    padding: 4px 10px;
    border-radius: 6px;
    letter-spacing: 0.05em;
}

/* Summary Sidebar */
.summary-wrap {
    position: sticky;
    top: 120px;
}

.summary-card {
    background: var(--c-accent);
    color: #fff;
    border-radius: 24px;
    padding: 32px;
    box-shadow: var(--shadow-lg);
}

.sum-title {
    font-family: 'Outfit', sans-serif;
    font-size: 0.7rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    opacity: 0.5;
    margin-bottom: 24px;
}

.sum-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    font-size: 0.8rem;
    font-weight: 600;
    opacity: 0.7;
}

.sum-divider {
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    margin: 16px 0;
}

.sum-discount {
    background: rgba(52, 199, 89, 0.15);
    border: 1px solid rgba(52, 199, 89, 0.3);
    border-radius: var(--radius-sm);
    padding: 16px;
    margin-top: 20px;
}

.sum-discount-title {
    font-size: 0.6rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--c-green);
    margin-bottom: 10px;
}

.sum-discount-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.65rem;
    padding: 3px 0;
    opacity: 0.7;
}

.sum-discount-row.active-row {
    opacity: 1;
    color: var(--c-green);
    font-weight: 700;
}

.sum-total-area {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.15);
}

.sum-total-label {
    font-size: 0.65rem;
    font-weight: 800;
    text-transform: uppercase;
    opacity: 0.5;
}

.sum-total-price {
    font-family: 'Outfit', sans-serif;
    font-size: 2.6rem;
    font-weight: 900;
    line-height: 1;
    margin: 4px 0;
}

.sum-total-iva {
    font-size: 0.6rem;
    opacity: 0.4;
    font-weight: 700;
}

.sum-fianza {
    margin-top: 16px;
    padding: 14px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-sm);
    border: 1px dashed rgba(255, 255, 255, 0.2);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.7rem;
}

.sum-fianza-label {
    opacity: 0.6;
    font-weight: 700;
}

.sum-fianza-val {
    font-weight: 900;
}

.sum-insurance {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--c-green);
}

.btn-send {
    width: 100%;
    border: none;
    background: #fff;
    color: #000;
    padding: 18px 24px;
    border-radius: 14px;
    font-weight: 900;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: 24px;
    cursor: pointer;
    transition: 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.btn-send:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 24px rgba(255, 255, 255, 0.15);
}

.btn-send:active {
    transform: translateY(0);
}

/* Mobile Bottom Bar */
.mobile-total-bar {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--c-accent);
    color: #fff;
    padding: 16px 20px;
    z-index: 999;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.2);
}

.mobile-total-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 600px;
    margin: 0 auto;
}

.mobile-total-info .mobile-total-label {
    font-size: 0.6rem;
    font-weight: 700;
    text-transform: uppercase;
    opacity: 0.6;
}

.mobile-total-info .mobile-total-price {
    font-family: 'Outfit', sans-serif;
    font-size: 1.4rem;
    font-weight: 900;
}

.mobile-total-btn {
    background: #fff;
    color: #000;
    border: none;
    padding: 14px 28px;
    border-radius: 12px;
    font-weight: 900;
    font-size: 0.8rem;
    text-transform: uppercase;
    cursor: pointer;
}

/* Tech Settings */
.tech-days-wrap {
    margin-top: 16px;
    padding: 16px;
    background: var(--c-soft);
    border-radius: var(--radius-sm);
    display: none;
}

.tech-days-wrap.visible {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Contact Modal */
.cart-page .modal-content {
    border-radius: 24px !important;
    border: none !important;
    overflow: hidden;
}

.modal-header-custom {
    background: var(--c-accent);
    color: #fff;
    padding: 32px;
}

.modal-header-custom h4 {
    font-family: 'Outfit', sans-serif;
    font-weight: 900;
    margin: 0;
}

/* ========================================
   CHECKOUT FLOW STYLES
   ======================================== */
.checkout-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 2000;
    display: none;
    align-items: flex-end;
    justify-content: center;
    padding: 0;
    transition: opacity 0.3s ease;
}

.checkout-overlay.active {
    display: flex;
}

.checkout-panel {
    background: #fff;
    width: 100%;
    max-width: 500px;
    border-radius: 24px 24px 0 0;
    padding: 32px 24px 48px;
    position: relative;
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 -20px 60px rgba(0, 0, 0, 0.2);
}

.checkout-overlay.active .checkout-panel {
    transform: translateY(0);
}

.btn-close-checkout {
    position: absolute;
    top: 20px;
    right: 20px;
    background: #f1f5f9;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    color: #64748b;
    z-index: 10;
}

.btn-back-checkout {
    background: none;
    border: none;
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #94a3b8;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 0;
    margin-bottom: 5px;
}

.checkout-step {
    display: none;
    animation: fadeIn 0.3s ease;
}

.checkout-step.active {
    display: block;
}

.checkout-header {
    text-align: center;
    margin-bottom: 30px;
}

.checkout-icon {
    width: 64px;
    height: 64px;
    background: #f8fafc;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    color: #000;
    margin: 0 auto 20px;
}

.checkout-header h3 {
    font-family: 'Outfit', sans-serif;
    font-weight: 900;
    font-size: 1.5rem;
    margin-bottom: 6px;
    color: #000;
}

.checkout-header p {
    color: #64748b;
    font-size: 0.85rem;
    margin: 0;
}

/* Registration Steps Progress */
.checkout-progress {
    height: 4px;
    background: #f1f5f9;
    border-radius: 10px;
    margin: 15px 0 25px;
    overflow: hidden;
}

.checkout-progress .progress-bar {
    height: 100%;
    background: #000;
    transition: width 0.4s ease;
}

.reg-sub-step {
    display: none;
}

.reg-sub-step.active {
    display: block;
}

/* Desktop override */
@media (min-width: 992px) {
    .checkout-overlay {
        align-items: center;
        padding: 40px;
    }

    .checkout-panel {
        border-radius: 28px;
        transform: scale(0.9);
        opacity: 0;
    }

    .checkout-overlay.active .checkout-panel {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header-custom p {
    font-size: 0.8rem;
    opacity: 0.6;
    margin: 8px 0 0;
}

/* ═══ RESPONSIVE ═══ */

/* Tablet */
@media (max-width: 991px) {
    .cart-page {
        padding: 100px 12px 140px;
    }

    .progress-bar-steps {
        margin-bottom: 24px;
    }

    .step-label {
        display: none;
    }

    .step-line {
        width: 24px;
    }

    .summary-wrap {
        position: relative;
        top: 0;
    }

    .mobile-total-bar {
        display: block;
    }

    .summary-card .btn-send {
        display: none;
    }

    .c-card {
        padding: 20px;
        border-radius: 14px;
    }

    .modal-header-custom {
        padding: 24px;
    }

    .modal-header-custom h4 {
        font-size: 1.1rem;
    }
}

/* Small tablet — delivery grid to 1+2 */
@media (max-width: 767px) {
    .del-grid {
        grid-template-columns: 1fr 1fr !important;
    }

    .del-grid .del-option:first-child {
        grid-column: 1 / -1;
    }
}

/* Mobile */
@media (max-width: 575px) {
    .cart-page {
        padding: 90px 10px 150px;
    }

    .del-grid,
    .protect-grid {
        grid-template-columns: 1fr !important;
    }

    .del-option {
        padding: 16px 14px;
    }

    .cart-item {
        flex-wrap: wrap;
        gap: 10px;
    }

    .cart-item-price {
        min-width: unset;
    }

    .sum-total-price {
        font-size: 2rem;
    }

    .pill-btn {
        font-size: 0.65rem;
        padding: 12px 6px;
        min-height: 44px;
    }

    .pill-row {
        gap: 3px;
    }

    .c-card {
        padding: 16px;
        border-radius: 12px;
    }

    .c-card-title {
        font-size: 0.85rem;
    }

    .c-card-subtitle {
        font-size: 0.65rem;
    }

    .date-box {
        padding: 14px;
    }

    .cart-item-del {
        width: 44px;
        height: 44px;
    }

    .modal-header-custom {
        padding: 20px 16px;
    }

    .modal-body {
        padding: 16px !important;
    }

    .modal-header-custom h4 {
        font-size: 1rem;
    }

    .summary-card {
        padding: 24px 20px;
        border-radius: 18px;
    }
}

/* iPhone safe area for fixed bottom bar */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
    .mobile-total-bar {
        padding-bottom: calc(16px + env(safe-area-inset-bottom));
    }
}

/* Flatpickr mobile improvements */
@media (max-width: 575px) {
    .flatpickr-calendar {
        width: calc(100vw - 24px) !important;
        left: 12px !important;
        right: 12px !important;
    }

    .flatpickr-months {
        padding: 8px 0;
    }
}

/* Touch targets — minimum 44px for all interactive elements */
.del-option,
.protect-opt {
    min-height: 44px;
}

.cart-item-del,
.pill-btn,
.btn-send,
.mobile-total-btn {
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

/* Smooth interaction feedback */
.del-option:active,
.protect-opt:active {
    transform: scale(0.98);
}

.pill-btn:active {
    transform: scale(0.95);
}

/* Time Selector Custom UI */
.time-selector-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.time-panel {
    background: #fff;
    border-radius: 32px;
    width: 100%;
    max-width: 440px;
    padding: 40px;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.3);
    transform: translateY(20px);
    transition: 0.3s;
    color: var(--c-text);
}

.time-selector-overlay.active {
    display: flex;
}

.time-selector-overlay.active .time-panel {
    transform: translateY(0);
}

.time-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin-top: 15px;
}

.time-pill {
    padding: 10px;
    border-radius: 12px;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    font-size: 0.75rem;
    font-weight: 800;
    color: #64748b;
    cursor: pointer;
    text-align: center;
    transition: 0.2s;
}

.time-pill:hover {
    background: #e2e8f0;
    color: #000;
}

.time-pill.active {
    background: #000;
    color: #fff;
    border-color: #000;
}

.time-header {
    margin-bottom: 25px;
    text-align: left;
}

.time-header h3 {
    font-family: 'Outfit', sans-serif;
    font-weight: 950;
    font-size: 1.4rem;
    margin-bottom: 8px;
    color: #000;
}

.time-header p {
    color: #64748b;
    font-size: 0.85rem;
    margin: 0;
}