/* =========================================================
   CARRINHO.CSS — Estilos específicos da página de carrinho
   Depende de: global.css
   ========================================================= */

.cart-page {
  padding: 40px 0 64px;
}

.cart-page__title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.8rem;
  color: var(--text-main);
  margin-bottom: 28px;
}

/* =========================================================
   LAYOUT: lista de itens + resumo lateral
   ========================================================= */

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

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

/* =========================================================
   ITEM DO CARRINHO
   ========================================================= */

.cart-item {
  display: grid;
  grid-template-columns: 64px 1fr auto auto auto;
  align-items: center;
  gap: 16px;
  padding: 14px 16px;
}

.cart-item__cover {
  width: 64px;
  height: 86px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--bg-elevated);
  flex-shrink: 0;
}

.cart-item__cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cart-item__title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1rem;
  color: var(--text-main);
  margin-bottom: 4px;
}

.cart-item__price-unit {
  color: var(--grey-text);
  font-size: 0.8rem;
}

.cart-item__qty {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-elevated);
  border-radius: var(--radius-sm);
  padding: 4px 6px;
}

.qty-btn {
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-main);
  transition: background 0.15s var(--ease);
}

.qty-btn:hover {
  background: var(--bg-card-hover);
}

.qty-value {
  min-width: 20px;
  text-align: center;
  font-weight: 600;
  color: var(--text-main);
}

.cart-item__price-total {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--text-main);
  white-space: nowrap;
}

.cart-item__remove {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  color: var(--grey-text);
  transition: background 0.15s var(--ease), color 0.15s var(--ease);
}

.cart-item__remove:hover {
  background: var(--bg-elevated);
  color: var(--danger);
}

/* =========================================================
   RESUMO LATERAL
   ========================================================= */

.cart-summary {
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  padding: 20px;
  position: sticky;
  top: calc(var(--header-height) + 20px);
}

.cart-summary__title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.1rem;
  color: var(--text-main);
  margin-bottom: 16px;
}

.cart-summary__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.9rem;
  color: var(--grey-text);
  padding: 8px 0;
}

.cart-summary__row--total {
  border-top: 1px solid var(--grey-line);
  margin-top: 8px;
  padding-top: 14px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--text-main);
}

.cart-summary [data-checkout-btn] {
  margin-top: 18px;
}

/* =========================================================
   ESTADO VAZIO
   ========================================================= */

.cart-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 6px;
  padding: 80px 0;
  color: var(--grey-text);
}

.cart-empty svg {
  color: var(--grey-line);
  margin-bottom: 12px;
}

.cart-empty__title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.2rem;
  color: var(--text-main);
}

.cart-empty__text {
  font-size: 0.9rem;
  margin-bottom: 18px;
}

/* =========================================================
   RESPONSIVO
   ========================================================= */

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

  .cart-summary {
    position: static;
  }
}

@media (max-width: 560px) {
  .cart-item {
    grid-template-columns: 56px 1fr;
    grid-template-areas:
      "cover info"
      "cover qty"
      "total total"
      "remove remove";
    row-gap: 8px;
  }

  .cart-item__cover { grid-area: cover; }
  .cart-item__info { grid-area: info; }
  .cart-item__qty { grid-area: qty; justify-self: start; }
  .cart-item__price-total { grid-area: total; justify-self: start; }
  .cart-item__remove { grid-area: remove; justify-self: start; }
}
