/* ============================================================================
   UAT Cart + Checkout UX polish — UX-A (Cart/Loading UX + Checkout UX)
   ----------------------------------------------------------------------------
   Scope : cart.html skeleton reveal + premium empty state,
           checkout.html Bestellübersicht polish (trust dedup is markup-only).
   Owner : UX-A — do not restyle shared components here (use .uat-* namespaces).
   Loaded: shop/templates/shop/cart.html + shop/templates/shop/checkout.html
   ============================================================================ */


/* ────────────────────────────────────────────────────────────────────────────
   1. WARENKORB — Premium skeleton reveal (no layout shift)
   Pattern: server renders real content inside .uat-cart-reveal; a skeleton
   overlay (.uat-cart-skeleton) sits absolutely on top. Without JS the skeleton
   never shows. With JS the content stays visibility:hidden (space reserved)
   until DOMContentLoaded, then skeleton fades out and content fades in.
   ──────────────────────────────────────────────────────────────────────────── */

.uat-cart-stage {
    position: relative;
}

/* No-JS default: skeleton hidden, real content visible. */
.uat-cart-skeleton {
    display: none;
}

/* JS enabled (class added by inline script before markup parses): */
.js-uat-cart .uat-cart-reveal {
    visibility: hidden;
    opacity: 0;
    transition: opacity .35s ease, visibility .35s ease;
}

.js-uat-cart .uat-cart-skeleton {
    display: block;
    position: absolute;
    inset: 0;
    z-index: 30;
    padding: 1.25rem;
    background: #f6f2ed;
    border: 1px solid #e8e2dc;
    border-radius: 18px;
    overflow: hidden;
    transition: opacity .45s ease, visibility .45s ease;
}

.js-uat-cart .uat-cart-stage.uat-cart-loaded .uat-cart-reveal {
    visibility: visible;
    opacity: 1;
}

.js-uat-cart .uat-cart-stage.uat-cart-loaded .uat-cart-skeleton {
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
}

/* ── Skeleton building blocks ─────────────────────────────────────────────── */

.uat-sk-bar {
    background: linear-gradient(90deg, #eae3da 0%, #f4eee7 45%, #eae3da 100%);
    background-size: 220% 100%;
    animation: uatSkShimmer 1.5s ease-in-out infinite;
    border-radius: 6px;
}

@keyframes uatSkShimmer {
    0%   { background-position: 100% 0; }
    100% { background-position: -120% 0; }
}

.uat-sk-title {
    width: 34%;
    max-width: 260px;
    height: 2rem;
    margin-bottom: 1.25rem;
}

.uat-sk-card {
    background: #fff;
    border: 1px solid #e8e3dd;
    border-radius: 14px;
    box-shadow: 0 10px 28px rgba(22, 28, 45, .05);
    overflow: hidden;
}

.uat-sk-header {
    height: 2.45rem;
    border-radius: 0;
}

.uat-sk-row {
    display: flex;
    align-items: center;
    gap: .9rem;
    padding: 1.1rem;
    border-bottom: 1px solid #f0ece7;
}

.uat-sk-row:last-child {
    border-bottom: none;
}

.uat-sk-thumb {
    width: 76px;
    height: 76px;
    flex-shrink: 0;
    border-radius: 10px;
}

.uat-sk-lines {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: .55rem;
}

.uat-sk-line {
    height: .8rem;
    width: 100%;
}

.uat-sk-line--lg { height: .95rem; width: 68%; }
.uat-sk-line--sm { height: .7rem;  width: 45%; }

.uat-sk-side {
    width: 110px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: .5rem;
}

.uat-sk-side .uat-sk-line    { width: 70px; }
.uat-sk-side .uat-sk-line--sm { width: 48px; }

/* Summary column placeholders (match real summary card rhythm approx.) */
.uat-sk-notice {
    height: 2.9rem;
    border-radius: 12px;
    margin-bottom: .75rem;
}

.uat-sk-summary .uat-sk-body {
    padding: 1.1rem;
    display: flex;
    flex-direction: column;
    gap: .95rem;
}

.uat-sk-summary .uat-sk-total {
    height: 1.9rem;
    width: 56%;
    align-self: flex-end;
}

.uat-sk-btn {
    height: 2.6rem;
    border-radius: 10px;
}

/* Empty-cart placeholder (server knows cart is empty → matching size) */
.uat-sk-empty-card {
    background: #fff;
    border: 1px dashed #d7d1ca;
    border-radius: 14px;
    padding: 2.4rem 1.4rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .95rem;
}

.uat-sk-circle {
    width: 64px;
    height: 64px;
    border-radius: 50%;
}

.uat-sk-w40 { width: 40%; }
.uat-sk-w55 { width: 55%; }

.uat-sk-btn-inline {
    width: 200px;
    height: 2.7rem;
}

/* ── Reduced motion: static placeholder, no shimmer, instant reveal ───────── */

@media (prefers-reduced-motion: reduce) {
    .uat-sk-bar {
        animation: none;
        background: #ece5dd;
    }

    .js-uat-cart .uat-cart-reveal,
    .js-uat-cart .uat-cart-skeleton {
        transition: none;
    }
}


/* ────────────────────────────────────────────────────────────────────────────
   2. WARENKORB — Premium empty state
   ──────────────────────────────────────────────────────────────────────────── */

.uat-cart-empty-icon {
    width: 78px;
    height: 78px;
    margin: 0 auto .9rem;
    border-radius: 50%;
    background: linear-gradient(135deg, #f6ede3, #efe2d2);
    color: #b98a2f;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.1rem;
}

.uat-cart-empty h4 {
    font-size: 1.35rem;
    font-weight: 600;
}

.uat-cart-empty p {
    max-width: 30rem;
    margin-left: auto;
    margin-right: auto;
}

.uat-cart-empty-cta {
    border-radius: 999px;
    padding: .65rem 2rem;
    font-weight: 600;
}

.uat-cart-empty-hint {
    margin-top: 1.3rem;
    padding-top: 1.1rem;
    border-top: 1px solid #efe8e0;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: .45rem 1.1rem;
    font-size: .8rem;
    color: #8a7a6d;
}

.uat-cart-empty-hint i {
    color: #b98a2f;
}


/* ────────────────────────────────────────────────────────────────────────────
   3. CHECKOUT — Bestellübersicht polish (premium hierarchy, larger icons)
   ──────────────────────────────────────────────────────────────────────────── */

.uat-ck-summary-item {
    align-items: flex-start;
    padding-bottom: .85rem;
    margin-bottom: .85rem;
}

.uat-ck-item-thumb {
    width: 72px;
    height: 72px;
    object-fit: cover;
    border-radius: 10px;
    box-shadow: 0 3px 10px rgba(52, 37, 29, .08);
}

.uat-ck-item-name {
    font-size: .95rem;
    font-weight: 600;
    color: #2f241d;
}

.uat-ck-item-meta {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
}

.uat-ck-item-qty {
    color: #6b7280;
}

/* Totals block: consistent labeled rows with muted gold icons */
.uat-ck-totals {
    display: flex;
    flex-direction: column;
}

.uat-ck-total-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    padding: .5rem 0;
    font-size: .92rem;
    color: #4b5563;
}

.uat-ck-total-label {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    min-width: 0;
}

.uat-ck-total-icon {
    color: #b98a2f;
    font-size: 1.1rem;
    width: 1.6rem;
    text-align: center;
    flex-shrink: 0;
}

.uat-ck-total-value {
    font-weight: 600;
    color: #2f241d;
    white-space: nowrap;
}

.uat-ck-total-row--discount .uat-ck-total-label,
.uat-ck-total-row--discount .uat-ck-total-value {
    color: #0f766e;
}

/* Shipping blocked: keep the danger colour on the row despite value styling. */
.uat-ck-total-row.text-danger .uat-ck-total-label,
.uat-ck-total-row.text-danger .uat-ck-total-value {
    color: #dc3545;
}

.uat-ck-total-row--grand {
    margin-top: .55rem;
    padding-top: .85rem;
    border-top: 1px solid #ece2d9;
}

.uat-ck-grand-value {
    font-size: 1.35rem;
    font-weight: 700;
    color: #4b372d;
}

.uat-ck-coupon-heading {
    display: flex;
    align-items: center;
    gap: .5rem;
}

.uat-ck-coupon-icon {
    color: #b98a2f;
    font-size: 1.1rem;
}


/* ────────────────────────────────────────────────────────────────────────────
   Responsive fine-tuning
   ──────────────────────────────────────────────────────────────────────────── */

@media (max-width: 767.98px) {
    .js-uat-cart .uat-cart-skeleton {
        padding: .9rem;
    }

    .uat-sk-side {
        display: none;
    }

    .uat-sk-title {
        width: 52%;
    }

    .uat-ck-grand-value {
        font-size: 1.2rem;
    }
}
