/* ------------------------------------------------------------ */
/* Cart                                                         */
/* ------------------------------------------------------------ */

/* ------------------------------------------------------------ */
/* Shared local helpers                                         */
/* ------------------------------------------------------------ */

.shop-wrap{
  margin:0 auto;
  padding:28px 16px 28px;
}

.muted{
  color:var(--muted);
}

/* ------------------------------------------------------------ */
/* Cart topbar                                                  */
/* ------------------------------------------------------------ */

.cart-topbar{
  display:flex;
  align-items:flex-end;
  justify-content:space-between;
  gap:12px;
  margin-bottom:18px;
}

.cart-title{
  margin:0;
  font-size:22px;
  letter-spacing:-.02em;
}

.cart-subtitle{
  margin:6px 0 0;
  font-size:14px;
}

/* ------------------------------------------------------------ */
/* Cart layout                                                  */
/* ------------------------------------------------------------ */

.cart-layout{
  display:grid;
  grid-template-columns:1fr 340px;
  gap:18px;
  align-items:start;
}

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

/* ------------------------------------------------------------ */
/* Cart panels                                                  */
/* ------------------------------------------------------------ */

.cart-panel{
  overflow:hidden;
  border:1px solid var(--line, var(--gray-light));
  border-radius:14px;
  background:var(--surface);
  box-shadow:0 1px 2px var(--overlay-06), 0 8px 24px var(--overlay-06);
}

.cart-panel__head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  padding:14px 16px;
  border-bottom:1px solid var(--line, var(--gray-light));
}

.cart-panel__title{
  margin:0;
  font-size:16px;
  letter-spacing:-.01em;
}

.cart-panel__body{
  padding:12px;
}

.cart-panel__body .sum-actions .btn-primary{
  background:var(--link);
  border-color:var(--link);
  color:var(--surface);
}

.cart-notice{
  margin-bottom:12px;
}

.cart-empty{
  padding:16px;
  border:1px dashed var(--line, var(--gray-light));
  border-radius:14px;
  background:var(--soft, var(--surface-muted));
}

/* ------------------------------------------------------------ */
/* Cart items list                                              */
/* ------------------------------------------------------------ */

.cart-items{
  display:flex;
  flex-direction:column;
  gap:12px;
}

.cart-item{
  display:grid;
  grid-template-columns:92px 1fr auto;
  gap:14px;
  padding:12px;
  border:1px solid var(--line, var(--gray-light));
  border-radius:14px;
  background:var(--surface);
}

.cart-item.is-loading{
  opacity:.6;
  pointer-events:none;
  transition:opacity .2s ease;
}

@media (max-width:520px){
  .cart-item{
    grid-template-columns:80px 1fr;
    grid-template-areas:
      "img main"
      "aside aside";
  }

  .cart-item__media{
    grid-area:img;
  }

  .cart-item__main{
    grid-area:main;
  }

  .cart-item__aside{
    grid-area:aside;
    flex-direction:row;
    align-items:center;
    justify-content:space-between;
  }
}

/* ------------------------------------------------------------ */
/* Cart item media                                              */
/* ------------------------------------------------------------ */

.cart-item__media{
  display:flex;
  align-items:center;
  justify-content:center;
  width:92px;
  height:92px;
  overflow:hidden;
  border:1px solid var(--line, var(--gray-light));
  border-radius:12px;
  background:var(--surface);
}

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

.cart-item__placeholder{
  width:100%;
  height:100%;
  background:linear-gradient(135deg, var(--surface-muted) 0%, var(--surface-2) 100%);
}

/* ------------------------------------------------------------ */
/* Cart item content                                            */
/* ------------------------------------------------------------ */

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

.cart-item__title{
  margin:0;
  overflow:hidden;
  font-size:15px;
  font-weight:700;
  letter-spacing:-.01em;
  line-height:1.25;
  white-space:nowrap;
  text-overflow:ellipsis;
}

.cart-item__title a{
  color:inherit;
}

.cart-item__title a:hover{
  text-decoration:underline;
}

.cart-item__variant{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  margin:8px 0 8px;
}

.cart-item__desc{
  display:-webkit-box;
  overflow:hidden;
  margin:6px 0 10px;
  font-size:14px;
  line-height:1.35;
  -webkit-line-clamp:2;
  -webkit-box-orient:vertical;
}

.cart-item__meta{
  display:flex;
  flex-wrap:wrap;
  align-items:center;
  gap:10px 14px;
}

.chip{
  display:inline-flex;
  align-items:center;
  gap:6px;
  padding:6px 10px;
  border:1px solid var(--line, var(--gray-light));
  border-radius:999px;
  background:var(--soft, var(--surface-muted));
  color:var(--charcoal);
  font-size:12px;
  font-weight:600;
}

/* ------------------------------------------------------------ */
/* Cart item side                                               */
/* ------------------------------------------------------------ */

.cart-item__aside{
  display:flex;
  flex-direction:column;
  justify-content:space-between;
  align-items:flex-end;
  gap:10px;
  min-width:180px;
}

.cart-item__price{
  text-align:right;
}

.cart-item__line-total{
  font-weight:800;
  letter-spacing:-.01em;
}

.cart-item__unit{
  margin-top:2px;
  font-size:12px;
}

.cart-item__compare{
  margin-top:4px;
  font-size:12px;
}

.cart-item__actions{
  display:flex;
  align-items:center;
  gap:10px;
}

/* ------------------------------------------------------------ */
/* Cart quantity                                                */
/* ------------------------------------------------------------ */

.cart-qty{
  display:inline-flex;
  align-items:center;
  overflow:hidden;
  border-radius:12px;
  background:var(--surface);
}

.cart-qty__btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:38px;
  height:38px;
  border:1px solid var(--line, var(--gray-light));
  background:var(--surface);
  color:var(--gray-mid);
  font-size:2em;
  cursor:pointer;
}

.cart-qty__btn:hover{
  background:var(--soft, var(--surface-muted));
}

.cart-qty__btn:disabled{
  opacity:.5;
  cursor:not-allowed;
}

.cart-qty__input{
  width:56px;
  height:38px;
  border-left:1px solid var(--line, var(--gray-light));
  border-right:1px solid var(--line, var(--gray-light));
  text-align:center;
  font-weight:800;
}

/* ------------------------------------------------------------ */
/* Cart stock / messages                                        */
/* ------------------------------------------------------------ */

.cart-stock{
  margin-left:6px;
  color:var(--muted);
  font-size:12px;
}

.cart-stock--low{
  color:var(--err-strong);
  font-weight:600;
}

.cart-stock--out{
  color:var(--err);
  font-weight:600;
}

.cart-message{
  margin-top:10px;
  padding:10px 12px;
  border-radius:10px;
  font-size:14px;
}

.cart-message--error{
  border:1px solid var(--flash-error-border);
  background:var(--flash-error-bg);
  color:var(--toast-error-text);
}

.cart-message--success{
  border:1px solid var(--flash-success-border);
  background:var(--flash-success-bg);
  color:var(--toast-success-text);
}

/* ------------------------------------------------------------ */
/* Summary                                                      */
/* ------------------------------------------------------------ */

.sum-row{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  padding:10px 0;
  border-bottom:1px solid var(--line, var(--gray-light));
  font-size:14px;
}

.sum-row--total{
  padding-top:14px;
  border-bottom:0;
}

.sum-row--total strong{
  font-size:16px;
}

.sum-actions{
  display:flex;
  flex-direction:column;
  gap:10px;
  margin-top:14px;
}

.sum-note{
  margin:12px 0 0;
  font-size:12px;
  line-height:1.4;
}

.cart-footer{
  display:flex;
  flex-wrap:wrap;
  gap:10px;
  margin-top:14px;
}

/* ------------------------------------------------------------ */
/* Fancy prices used in cart / summary                          */
/* ------------------------------------------------------------ */

.price__current--fancy{
  display:inline-flex;
  align-items:flex-start;
  gap:2px;
  line-height:1;
  color:var(--text);
}

.price__current--fancy .price__main{
  font-weight:800;
  line-height:.88;
  letter-spacing:-.05em;
}

.price__current--fancy .price__top{
  display:inline-flex;
  align-items:flex-start;
  gap:1px;
  padding-top:3px;
}

.price__current--fancy .price__dec,
.price__current--fancy .price__cur{
  font-weight:700;
  line-height:1;
}

.cart-item__line-total .price__main{
  font-size:1.5rem;
}

.cart-item__line-total .price__dec,
.cart-item__line-total .price__cur{
  font-size:.72rem;
}

.cart-item__unit .price__main{
  font-size:1rem;
}

.cart-item__unit .price__dec,
.cart-item__unit .price__cur{
  font-size:.65rem;
}

.sum-row--total .price__main{
  font-size:1.8rem;
}

.sum-row--total .price__dec,
.sum-row--total .price__cur{
  font-size:.78rem;
}

/* ------------------------------------------------------------ */
/* Small legacy helper                                          */
/* ------------------------------------------------------------ */

.cart-prod__img{
  width:48px;
  height:48px;
  object-fit:cover;
  border:1px solid var(--overlay-08);
  border-radius:10px;
}

/* ------------------------------------------------------------ */
/* Checkout alternative payment methods                                 */
/* ------------------------------------------------------------ */

.checkout-alt-payment {
  margin-top: 1.25rem;
}

.checkout-alt-payment__sep {
  margin: 1rem 0;
  text-align: center;
  color: var(--muted, var(--muted));
  font-size: 0.95rem;
}

.paypal-button-container {
  min-height: 44px;
}