/* =========================
   CART (page-scoped)
   Regras: tudo escopado para não vazar no site
========================== */

.cart-page{
  padding: clamp(18px, 2.5vw, 32px) 0;
}

.cart-page .cart-wrap{
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: clamp(16px, 2.5vw, 26px);
  align-items: start;
}

@media (max-width: 980px){
  .cart-page .cart-wrap{
    grid-template-columns: 1fr;
  }
}

.cart-page .cart-title{
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  margin: 10px 0 14px;
}

.cart-page .cart-title h1{
  margin: 0;
  font-size: clamp(22px, 2.4vw, 30px);
  letter-spacing: -0.01em;
}

.cart-page .cart-title p{
  margin: 0;
  color: var(--muted2);
  font-size: 13px;
}

.cart-page .cart-panel{
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--line);
  padding: 16px;
}

.cart-page .cart-items{
  display: grid;
  gap: 12px;
}

.cart-page .cart-item{
  display: grid;
  grid-template-columns: 72px 1fr auto;
  gap: 12px;
  padding: 12px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

@media (max-width: 520px){
  .cart-page .cart-item{
    grid-template-columns: 64px 1fr;
    grid-template-rows: auto auto;
  }
}

.cart-page .cart-item-media{
  width: 72px;
  height: 72px;
  border-radius: 14px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.cart-page .cart-item-media img{
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.cart-page .cart-item-main{
  min-width: 0;
}

.cart-page .cart-item-name{
  margin: 0 0 6px;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.35;
}

.cart-page .cart-item-name a{
  color: inherit;
  text-decoration: none;
}

.cart-page .cart-item-name a:hover{
  text-decoration: underline;
}

.cart-page .cart-item-meta{
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  color: var(--muted2);
  font-size: 12px;
}

.cart-page .cart-item-actions{
  display: grid;
  gap: 10px;
  justify-items: end;
  align-content: start;
}

@media (max-width: 520px){
  .cart-page .cart-item-actions{
    grid-column: 1 / -1;
    justify-items: start;
  }
}

/* qty só do carrinho (não mexe no produto) */
.cart-page .qty{
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.02);
}

.cart-page .qty button{
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: transparent;
  color: inherit;
  cursor: pointer;
}

.cart-page .qty input{
  width: 50px;
  text-align: center;
  background: transparent;
  border: 0;
  color: inherit;
  font-weight: 700;
  outline: none;
}

.cart-page .cart-price{
  font-weight: 800;
  font-size: 14px;
}

.cart-page .remove-btn{
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  border-radius: 12px;
  padding: 10px 12px;
  cursor: pointer;
  font-weight: 700;
  font-size: 12px;
}

.cart-page .remove-btn:hover{
  border-color: rgba(255, 255, 255, 0.22);
}

.cart-page .summary{
  display: grid;
  gap: 10px;
}

.cart-page .summary h2{
  margin: 0 0 6px;
  font-size: 16px;
  font-weight: 800;
}

.cart-page .summary-row{
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 13px;
}

.cart-page .summary-row strong{
  color: var(--text);
  font-weight: 800;
}

.cart-page .summary-total{
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.cart-page .summary-cta{
  display: grid;
  gap: 10px;
  margin-top: 10px;
}

.cart-page .cart-empty{
  text-align: left;
  color: var(--muted);
  line-height: 1.7;
}

.cart-page .cart-empty strong{
  color: var(--text);
}

/* CTA fixa (mobile) */
.cart-page .sticky-cart{
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 12px;
  background: rgba(10, 10, 10, 0.88);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  display: none;
  z-index: 999;
}

.cart-page .sticky-cart .row{
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  max-width: 1100px;
  margin: 0 auto;
}

.cart-page .sticky-cart .title{
  font-weight: 800;
  font-size: 0.95rem;
  color: var(--text);
}

@media (max-width: 980px){
  .cart-page .sticky-cart{
    display: block;
  }

  /* não vaza pro site todo */
  body.page-cart{
    padding-bottom: 76px;
  }
}