/* ============================================================
   SHAINY CREATION — cart.css  v6.0
   ============================================================ */
.cart-layout { display: grid; grid-template-columns: 1fr 380px; gap: 40px; align-items: start; padding: 40px var(--side-pad) 64px; max-width: 1200px; margin: 0 auto; }
.cart-empty { text-align: center; padding: 88px 20px; max-width: 460px; margin: 0 auto; }
.cart-empty svg { width: 56px; height: 56px; stroke: var(--blush-deep); fill: none; margin: 0 auto 20px; display: block; stroke-width: 1.2; }
.cart-empty h2 { font-family: var(--f-display); font-size: 28px; font-weight: 500; margin-bottom: 9px; letter-spacing: -.02em; }
.cart-empty p  { font-size: 14px; color: var(--text-soft); margin-bottom: 28px; font-weight: 300; }

.cart-header-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; padding-bottom: 16px; border-bottom: 2px solid var(--border-soft); }
.cart-header-row h2 { font-family: var(--f-display); font-size: 24px; font-weight: 500; letter-spacing: -.015em; }
.clear-cart-btn { background: none; border: none; font-size: 11px; letter-spacing: .1em; text-transform: uppercase; font-weight: 600; color: var(--text-muted); cursor: pointer; transition: color var(--t); padding: 4px 0; }
.clear-cart-btn:hover { color: var(--badge-red); }

.cart-item { display: grid; grid-template-columns: 2fr 88px auto 34px; gap: 14px; align-items: center; padding: 20px 0; border-bottom: 1px solid var(--border-soft); }
/* Row2 = qty controls + total side by side on desktop */
.cart-item-row2 { display: flex; align-items: center; gap: 18px; }
.cart-item-info { display: flex; gap: 16px; align-items: center; }
.cart-item-img  { width: 72px; height: 88px; background: var(--blush); flex-shrink: 0; display: flex; align-items: center; justify-content: center; overflow: hidden; border-radius: var(--r-sm); }
.cart-item-img img { width: 100%; height: 100%; object-fit: cover; }
.cart-item-name { font-size: 14px; font-weight: 500; margin-bottom: 4px; line-height: 1.35;
  overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.cart-item-meta { font-size: 11px; color: var(--text-muted); line-height: 1.6; }
.cart-item-price, .cart-item-total { font-size: 14px; font-weight: 600; color: var(--text); }

.cart-qty { display: flex; align-items: center; border: 1.5px solid var(--border); border-radius: var(--r-sm); overflow: hidden; width: fit-content; }
.cart-qty-btn { width: 30px; height: 32px; background: none; border: none; font-size: 15px; display: flex; align-items: center; justify-content: center; color: var(--text-soft); transition: background var(--t); }
.cart-qty-btn:hover { background: var(--blush); color: var(--text); }
.cart-qty-val { width: 36px; text-align: center; font-size: 13px; font-weight: 600; border: none; border-left: 1px solid var(--border-soft); border-right: 1px solid var(--border-soft); height: 32px; font-family: var(--f-body); outline: none; background: none; color: var(--text); }
.remove-btn { background: none; border: none; color: var(--text-muted); font-size: 18px; line-height: 1; transition: color var(--t); padding: 0; display: flex; align-items: center; justify-content: center; width: 30px; height: 30px; border-radius: 50%; }
.remove-btn:hover { color: var(--badge-red); background: rgba(200,64,74,.07); }

.cart-summary { background: var(--off-white); border: 1px solid var(--border-soft); padding: 26px; position: sticky; top: 76px; border-radius: var(--r-lg); }
.summary-title { font-family: var(--f-display); font-size: 20px; font-weight: 500; margin-bottom: 20px; padding-bottom: 16px; border-bottom: 1px solid var(--border-soft); letter-spacing: -.01em; }
.summary-row { display: flex; justify-content: space-between; align-items: center; font-size: 13px; margin-bottom: 11px; color: var(--text-soft); }
.summary-row.total { font-size: 16px; font-weight: 700; color: var(--text); padding-top: 14px; border-top: 2px solid var(--border); margin-top: 7px; margin-bottom: 0; }

.free-ship-progress { margin: 16px 0; padding: 13px 0; border-top: 1px solid var(--border-soft); border-bottom: 1px solid var(--border-soft); }
.progress-bar { height: 4px; background: var(--blush-mid); border-radius: 10px; overflow: hidden; margin-bottom: 9px; }
.progress-fill { height: 100%; background: linear-gradient(90deg, var(--rose-light), var(--rose)); border-radius: 10px; transition: width .55s cubic-bezier(.4,0,.2,1); }
.free-ship-progress p { font-size: 12px; color: var(--text-soft); line-height: 1.5; }
.free-ship-progress p span { font-weight: 700; color: var(--rose); }

.coupon-wrap { display: flex; margin-bottom: 9px; border-radius: var(--r-sm); overflow: hidden; border: 1.5px solid var(--border); transition: border-color var(--t); }
.coupon-wrap:focus-within { border-color: var(--rose); }
.coupon-wrap input { flex: 1; padding: 10px 13px; border: none; background: var(--white); font-family: var(--f-body); font-size: 13px; outline: none; letter-spacing: .07em; text-transform: uppercase; color: var(--text); font-weight: 500; }
.coupon-wrap input::placeholder { font-weight: 300; letter-spacing: .03em; text-transform: none; color: var(--text-muted); }
.coupon-btn { padding: 10px 16px; background: var(--text); color: #fff; border: none; font-family: var(--f-body); font-size: 10px; letter-spacing: .15em; text-transform: uppercase; font-weight: 700; cursor: pointer; transition: background var(--t); white-space: nowrap; }
.coupon-btn:hover { background: var(--rose-dark); }
.coupon-msg { font-size: 12px; min-height: 16px; margin-bottom: 13px; line-height: 1.5; }

.checkout-btn { width: 100%; justify-content: center; padding: 15px; font-size: 11px; margin-top: 5px; margin-bottom: 11px; border-radius: var(--r-sm); letter-spacing: .17em; }
.continue-shopping { display: block; text-align: center; font-size: 12px; color: var(--text-muted); letter-spacing: .07em; margin-bottom: 16px; transition: color var(--t); }
.continue-shopping:hover { color: var(--rose); }

.cart-trust { display: flex; gap: 12px; padding-top: 16px; border-top: 1px solid var(--border-soft); flex-wrap: wrap; }
.cart-trust span { display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--text-soft); flex: 1; min-width: 80px; }
.cart-trust svg { width: 12px; height: 12px; stroke: var(--rose); fill: none; flex-shrink: 0; }

@media (max-width: 1100px) { .cart-layout { padding: 28px 36px 52px; } }

/* ── TABLET / MOBILE: single-column layout ── */
@media (max-width: 900px) {
  /* Cart outer layout: single column, full width */
  .cart-layout {
    grid-template-columns: 1fr;
    padding: 20px 16px 52px;
    gap: 20px;
    max-width: 100%;
    width: 100%;
    box-sizing: border-box;
  }
  .cart-summary { position: static; width: 100%; box-sizing: border-box; }

  /* Cart item: switch from 5-col grid to block/flex layout */
  .cart-item {
    display: block;        /* drop the 5-col grid entirely */
    position: relative;
    padding: 16px 0;
    border-bottom: 1px solid var(--border-soft);
    overflow: hidden;      /* prevent children from overflowing */
    width: 100%;
    box-sizing: border-box;
  }

  /* Row 1: image + name/meta */
  .cart-item-info {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    padding-right: 40px;   /* space for remove btn */
    margin-bottom: 10px;
    width: 100%;
    box-sizing: border-box;
  }
  .cart-item-img {
    width: 64px;
    height: 78px;
    flex-shrink: 0;
  }
  /* Name + meta column fills remaining space */
  .cart-item-info > div {
    flex: 1;
    min-width: 0;          /* allow text to truncate */
  }
  .cart-item-name {
    font-size: 13px;
    font-weight: 500;
    line-height: 1.35;
    margin-bottom: 3px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
  }

  /* Unit price: hidden on mobile (shown in total below) */
  .cart-item-price { display: none; }

  /* Row 2: qty controls + line total side by side */
  .cart-item-row2 {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
    box-sizing: border-box;
    padding-right: 40px;   /* space for remove btn */
  }
  .cart-qty { flex-shrink: 0; }
  .cart-item-total {
    font-size: 14px;
    font-weight: 700;
    color: var(--text);
    white-space: nowrap;
    flex-shrink: 0;
  }

  /* Remove btn: absolute position top-right */
  .remove-btn {
    position: absolute;
    top: 16px;
    right: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
  }
}

/* ── Summary row: amounts never clip ── */
@media (max-width: 900px) {
  .cart-summary { padding: 20px; }
  .summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    width: 100%;
    box-sizing: border-box;
  }
  .summary-row span:first-child { flex: 1; min-width: 0; }
  .summary-row span:last-child  { flex-shrink: 0; white-space: nowrap; }
}

@media (max-width: 480px) {
  .cart-layout { padding: 16px 14px 44px; }
  .cart-item-img { width: 56px; height: 68px; }
  .cart-summary { padding: 16px; }
  .summary-title { font-size: 18px; }
}
