/* ============================================================
   CART STYLES — Carrinho de Compras
   ============================================================ */

/* ── Cart Icon & Badge ────────────────────────────────────── */
.cart-icon-btn {
  position: relative;
}

.cart-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: #2C1A0E;
  color: #F6F1E9;
  font-size: 0.65rem;
  font-weight: 600;
  min-width: 18px;
  height: 18px;
  border-radius: 50%;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 2px;
  line-height: 1;
}

/* ── Cart Drawer ──────────────────────────────────────────── */
.cart-drawer {
  position: fixed;
  inset: 0;
  z-index: 9998;
  pointer-events: none;
}

.cart-drawer.open {
  pointer-events: auto;
}

.cart-drawer-bg {
  position: absolute;
  inset: 0;
  background: rgba(44, 26, 14, 0.4);
  backdrop-filter: blur(4px);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.cart-drawer.open .cart-drawer-bg {
  opacity: 1;
}

.cart-drawer-panel {
  position: absolute;
  top: 0;
  right: 0;
  width: 100%;
  max-width: 420px;
  height: 100%;
  background: #F6F1E9;
  box-shadow: -4px 0 24px rgba(44, 26, 14, 0.15);
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.3s ease;
}

.cart-drawer.open .cart-drawer-panel {
  transform: translateX(0);
}

/* ── Cart Header ──────────────────────────────────────────── */
.cart-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px;
  border-bottom: 1px solid rgba(44, 26, 14, 0.1);
}

.cart-drawer-header h3 {
  font-size: 1.5rem;
  font-weight: 600;
  color: #2C1A0E;
  margin: 0;
}

.cart-close-btn {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: rgba(44, 26, 14, 0.6);
  cursor: pointer;
  padding: 4px;
  transition: color 0.2s ease;
  line-height: 1;
}

.cart-close-btn:hover {
  color: #2C1A0E;
}

/* ── Cart Body ────────────────────────────────────────────── */
.cart-drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px 24px;
}

/* ── Cart Items ───────────────────────────────────────────── */
.cart-items {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.cart-item {
  display: flex;
  gap: 12px;
  padding: 12px;
  background: white;
  border-radius: 12px;
  border: 1px solid rgba(44, 26, 14, 0.08);
}

.cart-item-img {
  width: 80px;
  height: 80px;
  border-radius: 8px;
  overflow: hidden;
  flex-shrink: 0;
  background: rgba(44, 26, 14, 0.04);
}

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

.cart-item-details {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.cart-item-name {
  font-size: 0.9rem;
  font-weight: 600;
  color: #2C1A0E;
  margin: 0;
  line-height: 1.3;
}

.cart-item-variant {
  font-size: 0.75rem;
  color: rgba(44, 26, 14, 0.6);
  margin: 0;
}

.cart-item-price {
  font-size: 0.85rem;
  font-weight: 600;
  color: #2C1A0E;
  margin: 0;
}

.cart-item-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: flex-end;
}

.cart-item-qty {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(44, 26, 14, 0.04);
  border-radius: 8px;
  padding: 4px;
}

.qty-btn {
  background: white;
  border: none;
  width: 24px;
  height: 24px;
  border-radius: 6px;
  font-size: 1rem;
  font-weight: 600;
  color: #2C1A0E;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.qty-btn:hover:not(:disabled) {
  background: #2C1A0E;
  color: #F6F1E9;
}

.qty-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.cart-item-qty span {
  font-size: 0.85rem;
  font-weight: 600;
  color: #2C1A0E;
  min-width: 20px;
  text-align: center;
}

.cart-item-remove {
  background: none;
  border: none;
  padding: 4px;
  cursor: pointer;
  color: rgba(44, 26, 14, 0.4);
  transition: color 0.2s ease;
}

.cart-item-remove:hover {
  color: #d32f2f;
}

.cart-item-remove svg {
  width: 18px;
  height: 18px;
}

/* ── Cart Empty ───────────────────────────────────────────── */
.cart-empty {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  gap: 16px;
  text-align: center;
}

.cart-empty svg {
  width: 64px;
  height: 64px;
  color: rgba(44, 26, 14, 0.2);
}

.cart-empty p {
  font-size: 0.95rem;
  color: rgba(44, 26, 14, 0.5);
  margin: 0;
}

/* ── Cart Footer ──────────────────────────────────────────── */
.cart-drawer-footer {
  display: none;
  flex-direction: column;
  gap: 16px;
  padding: 24px;
  border-top: 1px solid rgba(44, 26, 14, 0.1);
  background: #F6F1E9;
}

.cart-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 1.1rem;
  font-weight: 600;
  color: #2C1A0E;
}

/* ── Product Price in Catalog ─────────────────────────────── */
.cat-price {
  font-size: 1rem;
  font-weight: 600;
  color: #2C1A0E;
  margin-top: 8px;
}

/* ── Button Variants ──────────────────────────────────────── */
.btn-outline {
  background: transparent;
  border: 1.5px solid rgba(44, 26, 14, 0.15);
  color: #2C1A0E;
}

.btn-outline:hover {
  background: rgba(44, 26, 14, 0.05);
  border-color: rgba(44, 26, 14, 0.25);
}

/* ── Modal Buy Button ─────────────────────────────────────── */
.modal-content .btn:not(:last-child) {
  margin-bottom: 12px;
}

/* ── Mobile Adjustments ───────────────────────────────────── */
@media (max-width: 768px) {
  .cart-drawer-panel {
    max-width: 100%;
  }

  .cart-drawer-header {
    padding: 20px;
  }

  .cart-drawer-body {
    padding: 12px 20px;
  }

  .cart-drawer-footer {
    padding: 20px;
  }

  .cart-item {
    padding: 10px;
  }

  .cart-item-img {
    width: 70px;
    height: 70px;
  }

  .cart-item-name {
    font-size: 0.85rem;
  }
}
