.cart-page { padding: 16px 0; }
.cart-title{ margin: 6px 0 14px; }

.cart-empty{
  border:1px solid var(--line);
  border-radius:12px;
  background:#fff;
  padding:16px;
  text-align:center;
}

.cart-wrap {
  display: grid;
  grid-template-columns: 1fr 320px; /* list | summary */
  gap: 16px;
  align-items: start;
}

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

@media (max-width: 860px){
  .cart-wrap { grid-template-columns: 1fr; }
}

/* cart list */
.cart-list{
  border:1px solid var(--line);
  border-radius:12px;
  background:#fff;
  padding:6px;
  display:flex;
  flex-direction:column;
  gap:8px;
}
.cart-row{
  display:grid;
  /* BEFORE: grid-template-columns: 84px 1fr 110px 110px 32px; */
  grid-template-columns: 84px minmax(0,1fr) 110px 110px 32px;
  gap:10px; align-items:center; padding:8px;
  border-bottom:1px dashed var(--line);
}
.cart-row:last-child{ border-bottom:0; }

.cart-img{
  width:84px; height:84px;
  border:1px solid var(--line);
  border-radius:10px;
  display:flex; align-items:center; justify-content:center;
  overflow:hidden; background:#fff;
}
.cart-img img{
  width:100%;
  height:100%;
  object-fit:contain;
  padding:4px;
  background:#fff;
}

/* cart.css */
.cart-name h3{ margin:0 0 4px; font-size:1rem; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.cart-name a{ text-decoration:none; color:inherit; }
.cart-name a:hover{ color: var(--brand); text-decoration: underline; }
.cart-name .muted{ font-size:.9rem; }

.cart-price{ font-weight:700; }
.cart-price .old{
  color:#888; text-decoration:line-through; margin-left:6px; font-weight:400;
}

.cart-qty{ display:flex; align-items:center; gap:8px; }
.cart-qty input[type="number"]{
  width:84px; padding:8px 10px; border:1px solid var(--line); border-radius:10px;
}

.cart-remove{
  display:flex; align-items:center; justify-content:center;
}
.cart-remove button{
  border:1px solid var(--line); background:#fff; border-radius:8px; cursor:pointer;
  width:32px; height:32px; line-height:1; font-weight:800;
}

/* summary */
.cart-summary{
  border:1px solid var(--line);
  border-radius:12px;
  background:#fff;
  padding:12px;
  height:max-content;
  position:sticky; top:90px;
}
.summary-row{
  display:flex; align-items:center; justify-content:space-between;
  margin:8px 0;
}
.summary-row.small{ font-size:.95rem; color: var(--muted); }
.summary-row.total{ font-size:1.25rem; font-weight:800; }

.summary-actions{ display:grid; gap:8px; margin-top:10px; }
.tiny{ font-size:.85rem; color:var(--muted); margin-top:8px; }

/* =========================================================
   CBS CART MOBILE PATCH
   Matches real cart.js structure:
   cart-row | cart-img | cart-name | cart-price | cart-qty | cart-remove
   ========================================================= */

@media (max-width:760px){

  .cart-page{
    padding-top:14px;
    padding-bottom:24px;
  }

  .cart-title{
    font-size:1.6rem;
    margin:12px 0 14px;
  }

  .cart-wrap{
    display:grid;
    grid-template-columns:1fr;
    gap:16px;
  }

  .cart-list{
    border:0;
    padding:0;
    background:transparent;
    display:grid;
    gap:12px;
  }

  .cart-row{
    display:grid;
    grid-template-columns:76px minmax(0, 1fr) auto;
    grid-template-areas:
      "img name remove"
      "img price price"
      "qty qty qty";
    gap:8px 12px;
    align-items:start;
    border:1px solid var(--line);
    border-radius:14px;
    padding:12px;
    background:#fff;
  }

  .cart-row:last-child{
    border-bottom:1px solid var(--line);
  }

  .cart-img{
    grid-area:img;
    width:76px;
    height:76px;
    border-radius:10px;
  }

  .cart-img img{
    width:100%;
    height:100%;
    object-fit:contain;
    padding:4px;
    background:#fff;
  }

  .cart-name{
    grid-area:name;
    min-width:0;
  }

  .cart-name h3{
    margin:0 0 4px;
    font-size:0.98rem;
    line-height:1.25;
    white-space:normal;
    overflow:visible;
    text-overflow:clip;
  }

  .cart-name .muted{
    font-size:0.82rem;
    line-height:1.25;
  }

  .cart-price{
    grid-area:price;
    display:grid;
    gap:4px;
    font-size:0.98rem;
    line-height:1.25;
  }

  .cart-price .price{
    font-weight:800;
  }

  .cart-price .old{
    margin-left:0;
    font-size:0.85rem;
  }

  .cart-price{
    display:grid;
    gap:4px;
  }

  .cart-unit-line,
  .cart-line-subtotal{
    display:flex;
    align-items:baseline;
    gap:6px;
    line-height:1.25;
  }

  .cart-label{
    color:var(--muted);
    font-size:0.82rem;
    font-weight:600;
  }

  .cart-line-subtotal strong{
    font-weight:800;
  }

  .cart-qty{
    grid-area:qty;
    display:flex;
    align-items:center;
    justify-content:flex-end;
    gap:8px;
    padding-top:8px;
    border-top:1px dashed var(--line);
  }

  .cart-qty::before{
    content:"Quantity";
    color:var(--muted);
    font-size:0.9rem;
    margin-right:auto;
  }

  .cart-qty input[type="number"]{
    width:90px;
    height:40px;
  }

  .qty-btn{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    width:34px;
    height:34px;
    border:1px solid var(--line);
    border-radius:10px;
    background:#fff;
    color:#0c3d7a;
    font-size:1.2rem;
    font-weight:800;
    line-height:1;
    cursor:pointer;
  }

  .qty-btn:hover{
    background:#f7f7f9;
  }

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

  .cart-qty input[type="number"]{
    text-align:center;
  }

  .cart-remove{
    grid-area:remove;
    align-self:start;
    justify-self:end;
  }

  .cart-remove button{
    width:34px;
    height:34px;
    border-radius:10px;
  }

  .cart-summary{
    position:static;
    width:100%;
    border-radius:14px;
    padding:14px;
  }

  .summary-row{
    display:flex;
    justify-content:space-between;
    align-items:center;
    gap:12px;
  }

  .summary-row strong{
    white-space:nowrap;
  }

  .summary-actions{
    display:grid;
    grid-template-columns:1fr;
    gap:10px;
    margin-top:14px;
  }

  .summary-actions .btn,
  .summary-actions button,
  .summary-actions a{
    width:100%;
    min-height:44px;
  }

  .tiny{
    font-size:0.82rem;
    line-height:1.35;
  }
}


/* Extra small phones */
@media (max-width:420px){

  .cart-title{
    font-size:1.4rem;
  }

  .cart-row{
    grid-template-columns:64px minmax(0, 1fr) auto;
    gap:8px 10px;
    padding:10px;
  }

  .cart-img{
    width:64px;
    height:64px;
  }

  .cart-name h3{
    font-size:0.94rem;
  }

  .cart-price{
    font-size:0.94rem;
  }

  .cart-qty input[type="number"]{
    width:82px;
  }
}