/**
 * Panier boutique — premium ORAIMO
 * Préfixe : .cart-page
 */
.cart-page {
    padding: 1.25rem 0 5rem;
    background: #f4f4f5;
    min-height: 60vh;
}

.cart-page.shop-catalog-page {
    background: #f4f4f5;
}

.cart-header {
    margin-bottom: 1.5rem;
}

.cart-header__title {
    font-family: var(--font-display, var(--font-sans));
    font-size: clamp(1.5rem, 3vw, 1.875rem);
    font-weight: 700;
    letter-spacing: -0.03em;
    color: #18181b;
    margin: 0 0 0.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.cart-header__title .sk-icon {
    color: #18181b;
}

.cart-header__meta {
    font-size: 0.875rem;
    color: #71717a;
    margin: 0;
}

/* ─── Liste articles ─── */
.cart-items {
    background: #fff;
    border: 1px solid rgba(15, 23, 42, 0.06);
    border-radius: 12px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
    overflow: hidden;
}

.cart-item {
    display: grid;
    grid-template-columns: 96px 1fr auto;
    gap: 1rem 1.25rem;
    align-items: center;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

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

.cart-item__media {
    display: block;
    width: 96px;
    height: 96px;
    border-radius: 10px;
    overflow: hidden;
    background: #fafafa;
    border: 1px solid rgba(0, 0, 0, 0.04);
    flex-shrink: 0;
    text-decoration: none;
}

.cart-item__media img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.cart-item__media-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #a1a1aa;
}

.cart-item__body {
    min-width: 0;
}

.cart-item__name {
    font-size: 0.9375rem;
    font-weight: 600;
    color: #18181b;
    margin: 0 0 0.25rem;
    line-height: 1.35;
}

.cart-item__name a {
    color: inherit;
    text-decoration: none;
}

.cart-item__name a:hover {
    color: #52525b;
}

.cart-item__cat {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 500;
    color: #71717a;
    margin-bottom: 0.65rem;
}

.cart-item__unit {
    font-size: 0.8125rem;
    color: #52525b;
    font-variant-numeric: tabular-nums;
}

.cart-item__unit strong {
    font-weight: 600;
    color: #18181b;
}

.cart-item__actions {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.75rem;
}

.cart-item__remove-form {
    margin: 0;
}

.cart-item__total {
    font-size: 1rem;
    font-weight: 700;
    color: #18181b;
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.02em;
    white-space: nowrap;
}

.cart-item__remove {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: #a1a1aa;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
    padding: 0;
}

.cart-item__remove:hover {
    background: #fef2f2;
    color: #dc2626;
}

/* Stepper quantité */
.cart-qty-stepper {
    display: inline-flex;
    align-items: center;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
}

.cart-qty-btn {
    width: 2.25rem;
    height: 2.25rem;
    border: none;
    background: #fafafa;
    font-size: 1rem;
    font-weight: 500;
    color: #18181b;
    cursor: pointer;
    transition: background 0.2s;
    line-height: 1;
    padding: 0;
}

.cart-qty-btn:hover {
    background: #f4f4f5;
}

.cart-qty-btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.cart-qty-input {
    width: 2.75rem;
    height: 2.25rem;
    border: none;
    border-left: 1px solid rgba(0, 0, 0, 0.08);
    border-right: 1px solid rgba(0, 0, 0, 0.08);
    text-align: center;
    font-size: 0.875rem;
    font-weight: 600;
    color: #18181b;
    -moz-appearance: textfield;
    background: #fff;
}

.cart-qty-input::-webkit-outer-spin-button,
.cart-qty-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* ─── Récapitulatif ─── */
.cart-summary {
    position: sticky;
    top: 5.5rem;
    background: #fff;
    border: 1px solid rgba(15, 23, 42, 0.06);
    border-radius: 12px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
    overflow: hidden;
}

.cart-summary__head {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.cart-summary__title {
    font-size: 1rem;
    font-weight: 700;
    color: #18181b;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.cart-summary__body {
    padding: 1.25rem 1.5rem;
}

.cart-summary__row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 1rem;
    font-size: 0.875rem;
    color: #52525b;
    margin-bottom: 0.75rem;
}

.cart-summary__row strong {
    font-weight: 600;
    color: #18181b;
    font-variant-numeric: tabular-nums;
}

.cart-summary__row--muted span:last-child {
    color: #a1a1aa;
}

.cart-summary__divider {
    height: 1px;
    background: rgba(0, 0, 0, 0.06);
    margin: 1rem 0;
}

.cart-summary__total {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 1.25rem;
}

.cart-summary__total-label {
    font-size: 1rem;
    font-weight: 700;
    color: #18181b;
}

.cart-summary__total-value {
    font-size: 1.375rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    color: #18181b;
    font-variant-numeric: tabular-nums;
}

.cart-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    width: 100%;
    min-height: 3rem;
    padding: 0.65rem 1rem;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: background 0.2s, transform 0.2s, box-shadow 0.2s;
    text-decoration: none;
}

.cart-btn .sk-icon {
    width: 1.1rem;
    height: 1.1rem;
}

.cart-btn--primary {
    background: var(--brand-primary, #18181b);
    color: #fff;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
}

.cart-btn--primary:hover {
    filter: brightness(1.05);
    color: #fff;
    transform: translateY(-1px);
}

.cart-btn--ghost {
    background: transparent;
    color: #52525b;
    border: 1px solid rgba(0, 0, 0, 0.1);
    min-height: 2.5rem;
    margin-top: 0.65rem;
}

.cart-btn--ghost:hover {
    background: #fafafa;
    color: #18181b;
}

.cart-btn--danger {
    background: transparent;
    color: #71717a;
    border: none;
    min-height: auto;
    padding: 0.5rem;
    font-size: 0.8125rem;
    font-weight: 500;
    margin-top: 0.5rem;
}

.cart-btn--danger:hover {
    color: #dc2626;
    background: transparent;
    transform: none;
}

/* Confiance */
.cart-trust {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
    margin-top: 1.25rem;
    padding-top: 1.25rem;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
}

.cart-trust__item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 0.35rem;
    font-size: 0.6875rem;
    font-weight: 500;
    color: #52525b;
    padding: 0.65rem 0.35rem;
    background: #fafafa;
    border-radius: 8px;
}

.cart-trust__item .sk-icon {
    color: #18181b;
}

.cart-trust--mobile {
    display: none;
    margin-top: 1.25rem;
}

/* État vide */
.cart-empty {
    background: #fff;
    border: 1px solid rgba(15, 23, 42, 0.06);
    border-radius: 12px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
    padding: 3.5rem 1.5rem;
    text-align: center;
    max-width: 480px;
    margin: 2rem auto 0;
}

.cart-empty__icon {
    width: 4rem;
    height: 4rem;
    margin: 0 auto 1.25rem;
    border-radius: 50%;
    background: #f4f4f5;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #a1a1aa;
}

.cart-empty__title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #18181b;
    margin: 0 0 0.5rem;
}

.cart-empty__text {
    font-size: 0.9375rem;
    color: #71717a;
    margin: 0 0 1.5rem;
    line-height: 1.5;
}

/* Barre mobile checkout */
.cart-mobile-bar {
    display: none;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 900;
    background: #fff;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
    padding: 0.75rem 1rem calc(0.75rem + env(safe-area-inset-bottom, 0px));
    box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.06);
    align-items: center;
    gap: 1rem;
}

.cart-mobile-bar__total {
    flex-shrink: 0;
}

.cart-mobile-bar__label {
    display: block;
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #71717a;
}

.cart-mobile-bar__value {
    font-size: 1.125rem;
    font-weight: 700;
    color: #18181b;
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.02em;
}

.cart-mobile-bar .cart-btn--primary {
    flex: 1;
    min-height: 2.75rem;
}

/* FAB au-dessus de la barre checkout mobile */
body.shop-storefront-body:has(.cart-mobile-bar) .shop-fab-stack {
    bottom: calc(5rem + env(safe-area-inset-bottom, 0px));
}

/* ─── Responsive ─── */
@media (max-width: 991.98px) {
    .cart-summary {
        position: static;
        margin-top: 1.25rem;
    }

    .cart-trust--desktop {
        display: none;
    }

    .cart-trust--mobile {
        display: grid;
    }
}

@media (max-width: 767.98px) {
    .cart-page {
        padding-bottom: 6rem;
    }

    .cart-item {
        grid-template-columns: 72px 1fr;
        grid-template-rows: auto auto;
        gap: 0.75rem 1rem;
        padding: 1rem;
    }

    .cart-item__media {
        width: 72px;
        height: 72px;
        grid-row: span 2;
    }

    .cart-item__actions {
        grid-column: 2;
        flex-direction: row;
        align-items: center;
        justify-content: flex-start;
        flex-wrap: wrap;
        gap: 0.65rem 1rem;
        width: 100%;
    }

    .cart-item__total {
        margin-left: auto;
    }

    .cart-item__remove-form {
        order: 3;
    }

    .cart-summary__cta-desktop {
        display: none;
    }

    .cart-mobile-bar {
        display: flex;
    }

    .cart-qty-input {
        font-size: 16px;
    }

    .cart-trust {
        grid-template-columns: 1fr;
    }

    .cart-trust__item {
        flex-direction: row;
        text-align: left;
        font-size: 0.75rem;
    }
}

@media (min-width: 768px) {
    .cart-mobile-bar {
        display: none !important;
    }
}
