/*
  ============================================================
  STYLESHEET: warenkorb.css
  Stick With Sam — Cart Page
  /public/kaufabwicklung/warenkorb.css
  ============================================================
  Loaded after global_style.css via $pageCSS in header.php.

  global_style.css already handles:
    - CSS variables, reset, background, nav, buttons, footer
    - .glass-panel, .panel, .count-badge
    - .reveal, .toast-wrap, .toast

  This file ONLY contains styles unique to the cart page.

  CONTENTS:
  1.  Page layout          — two-column grid
  2.  Cart panel           — left column container
  3.  Cart item row        — individual item with qty controls
  4.  Qty stepper          — +/- quantity controls
  5.  Empty state          — shown when cart is empty
  6.  Promo code           — discount code input row
  7.  Order summary panel  — right column sticky panel
  8.  Shipping options     — radio-style shipping selector
  9.  Summary rows         — subtotal, shipping, discount, total
  10. Checkout button      — full width gradient button
  11. Responsive           — mobile stacking
  ============================================================
*/


/* ============================================================
   1. PAGE LAYOUT
   Two-column grid: cart items left, order summary right.
   Summary is sticky so it stays visible while scrolling.
   ============================================================ */
.warenkorb-page {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 2rem;
    max-width: 1100px;
    margin: 0 auto;
    padding: 8rem 1.5rem 4rem;
    align-items: start;
}


/* ============================================================
   2. CART PANEL
   Left column — contains heading, item rows and promo code.
   ============================================================ */
.cart-panel {
    background: rgba(255, 255, 255, 0.10);
    backdrop-filter: blur(22px);
    -webkit-backdrop-filter: blur(22px);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 24px;
    padding: 2rem;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.35);
}

.cart-panel .panel-header {
    display: flex;
    align-items: baseline;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.cart-panel .panel-header h1 {
    font-family: 'Playfair Display', serif;
    font-size: 1.6rem;
    color: var(--text);
}

/* Divider between items */
.cart-divider {
    border: none;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    margin: 0;
}


/* ============================================================
   3. CART ITEM ROW
   Each row shows: image, name + meta, qty stepper, price, remove
   ============================================================ */
.cart-item {
    display: grid;
    grid-template-columns: 72px 1fr auto;
    gap: 1rem;
    align-items: center;
    padding: 1.1rem 0;
    animation: fadeUp 0.4s ease both;
    transition: background 0.2s;
}

/* Item image */
.item-img {
    width: 72px;
    height: 72px;
    border-radius: 14px;
    background: linear-gradient(135deg,
    rgba(90, 26, 138, 0.45),
    rgba(212, 95, 186, 0.25)
    );
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.2rem;
    flex-shrink: 0;
    overflow: hidden;
}

.item-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 14px;
}

/* Item info: name, tag, size */
.item-info { display: flex; flex-direction: column; gap: 3px; }

.item-name {
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--text);
}

.item-meta { display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; }

.item-tag {
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    background: var(--gold-dim);
    color: var(--gold);
    border: 1px solid rgba(245, 200, 66, 0.3);
    border-radius: 99px;
    padding: 2px 8px;
}

.item-size {
    font-size: 0.72rem;
    color: var(--muted);
}

/* Right column: price + remove */
.item-price-col {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.5rem;
}

.item-price {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--gold);
}

.item-unit {
    font-size: 0.7rem;
    color: var(--muted);
}

/* Remove button */
.item-remove {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--muted);
    font-size: 0.85rem;
    padding: 4px;
    border-radius: 50%;
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s, background 0.2s;
}

.item-remove:hover {
    color: var(--red);
    background: var(--red-dim);
}


/* ============================================================
   4. QTY STEPPER
   +/- buttons with quantity number between them.
   ============================================================ */
.qty-control {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 6px;
}

.qty-btn {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.10);
    border: 1px solid rgba(255, 255, 255, 0.18);
    color: var(--text);
    font-size: 0.95rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    line-height: 1;
}

.qty-btn:hover { background: rgba(255, 255, 255, 0.22); }

.qty-val {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text);
    min-width: 18px;
    text-align: center;
}


/* ============================================================
   5. EMPTY STATE
   Shown when the cart has no items.
   ============================================================ */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--muted);
}

.empty-emoji {
    font-size: 3rem;
    display: block;
    margin-bottom: 1rem;
}

.empty-state p {
    font-size: 0.88rem;
    color: var(--muted);
    margin-bottom: 1.25rem;
    line-height: 1.6;
}

.btn-continue {
    display: inline-block;
    padding: 0.65rem 1.4rem;
    border-radius: 99px;
    border: 1.5px solid rgba(255, 255, 255, 0.18);
    background: rgba(255, 255, 255, 0.08);
    color: var(--text);
    font-size: 0.82rem;
    font-weight: 500;
    text-decoration: none;
    transition: background 0.2s;
}

.btn-continue:hover { background: rgba(255, 255, 255, 0.18); }


/* ============================================================
   6. PROMO CODE
   Input + Apply button row at the bottom of the cart panel.
   Only shown when cart has items.
   ============================================================ */
.promo-wrap {
    display: flex;
    gap: 0.6rem;
    margin-top: 1.5rem;
    padding-top: 1.25rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.promo-input {
    flex: 1;
    padding: 0.6rem 1rem;
    border-radius: 99px;
    border: 1.5px solid rgba(255, 255, 255, 0.15);
    background: rgba(255, 255, 255, 0.07);
    color: var(--text);
    font-family: 'DM Sans', sans-serif;
    font-size: 0.82rem;
    outline: none;
    transition: border-color 0.2s;
}

.promo-input:focus { border-color: var(--purple-bright); }
.promo-input::placeholder { color: var(--muted); }

.btn-promo {
    padding: 0.6rem 1.1rem;
    border-radius: 99px;
    border: 1.5px solid rgba(255, 255, 255, 0.18);
    background: rgba(255, 255, 255, 0.10);
    color: var(--text);
    font-family: 'DM Sans', sans-serif;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    white-space: nowrap;
}

.btn-promo:hover { background: rgba(255, 255, 255, 0.22); }

/* Feedback message below promo row */
.promo-msg {
    font-size: 0.75rem;
    margin-top: 0.4rem;
    padding-left: 0.5rem;
}

.promo-msg.ok  { color: var(--green); }
.promo-msg.err { color: var(--red); }

/* Continue shopping link */
.continue-link {
    display: inline-block;
    margin-top: 1rem;
    font-size: 0.78rem;
    color: var(--muted);
    text-decoration: none;
    transition: color 0.2s;
}

.continue-link:hover { color: var(--purple-light); }


/* ============================================================
   7. ORDER SUMMARY PANEL
   Right column — sticky. Shows totals and checkout button.
   ============================================================ */
.summary-panel {
    position: sticky;
    top: 90px;
    background: rgba(255, 255, 255, 0.10);
    backdrop-filter: blur(22px);
    -webkit-backdrop-filter: blur(22px);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 24px;
    padding: 1.75rem;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.35);
}

.summary-panel h2 {
    font-family: 'Playfair Display', serif;
    font-size: 1.2rem;
    color: var(--text);
    margin-bottom: 1.25rem;
}

.shipping-notice {
    margin-bottom: 1.75rem; /* increase this until it matches */
}

/* ============================================================
   9. SUMMARY ROWS
   Subtotal, Shipping, Discount (conditional), Total.
   ============================================================ */
.summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.82rem;
    color: var(--muted);
    margin-bottom: 0.6rem;
}

.summary-row span:last-child {
    font-weight: 500;
    color: var(--text-soft);
}

/* Discount row — green text, hidden until promo applied */
.summary-row.discount { color: var(--green); }
.summary-row.discount span:last-child { color: var(--green); }

/* Total row — larger, gold price */
.summary-row.total {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text);
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    padding-top: 0.85rem;
    margin-top: 0.5rem;
    margin-bottom: 1.25rem;
}

.summary-row.total span:last-child {
    color: var(--gold);
    font-size: 1.15rem;
}


/* ============================================================
   10. CHECKOUT BUTTON
   ============================================================ */
.btn-checkout {
    width: 100%;
    padding: 0.85rem;
    border: none;
    border-radius: 14px;
    background: linear-gradient(90deg, var(--purple-bright), var(--pink));
    color: #fff;
    font-family: 'DM Sans', sans-serif;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    letter-spacing: 0.02em;
    transition: opacity 0.2s, transform 0.15s;
    box-shadow: 0 6px 24px rgba(155, 63, 212, 0.4);
    margin-bottom: 0.75rem;
}

.btn-checkout:hover {
    opacity: 0.88;
    transform: translateY(-1px);
}

/* Secure checkout note below button */
.secure-note {
    text-align: center;
    font-size: 0.7rem;
    color: var(--muted);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
}


/* ============================================================
   11. RESPONSIVE
   ============================================================ */
@media (max-width: 820px) {
    .warenkorb-page {
        grid-template-columns: 1fr;
    }

    .summary-panel {
        position: static;
    }
}

@media (max-width: 500px) {
    .cart-item {
        grid-template-columns: 58px 1fr;
    }

    .item-price-col {
        grid-column: 1 / -1;
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }

    .warenkorb-page {
        padding-top: 6rem;
    }
}