/* =========================
   CARRITO
========================= */

.cart-page {
  padding-top: 1rem;
  padding-bottom: 2rem;
  background: #f5f6f8;
  min-height: 60vh;
}

/* =========================
   HEADER
========================= */
.cart-page-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.cart-page-title {
  font-size: 1.9rem;
  font-weight: 800;
  color: #1f2937;
  margin: 0 0 0.3rem;
  line-height: 1.1;
}

.cart-page-subtitle {
  margin: 0;
  color: #6b7280;
  font-size: 1rem;
}

.cart-link-back {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  text-decoration: none;
  background: #fff;
  color: #1d4ed8;
  border: 1px solid #dbe2ea;
  border-radius: 12px;
  padding: 0.8rem 1rem;
  font-weight: 600;
  transition: all 0.2s ease;
}

.cart-link-back:hover {
  background: #f8fbff;
  color: #1e40af;
  border-color: #bfd3f5;
}

/* =========================
   LAYOUT
========================= */
.cart-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 1.5rem;
  align-items: start;
}

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

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

/* =========================
   LISTA PRODUCTOS
========================= */
.cart-products-card {
  background: #fff;
  border: 1px solid #e7ebf0;
  border-radius: 18px;
  box-shadow: 0 0.35rem 1.2rem rgba(0, 0, 0, 0.06);
  overflow: hidden;
}

.cart-product-row + .cart-product-row {
  border-top: 1px solid #edf1f5;
}

.cart-product-grid {
  display: grid;
  grid-template-columns: 112px minmax(220px, 1fr) 170px 140px 170px;
  gap: 1rem;
  align-items: center;
  padding: 1.25rem;
}

/* =========================
   MEDIA
========================= */
.cart-product-media-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
}

.cart-product-media {
  width: 96px;
  height: 96px;
  border-radius: 14px;
  background: #f8fafc;
  border: 1px solid #e8edf2;
  overflow: hidden;
  flex-shrink: 0;
}

.cart-product-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  display: block;
  padding: 8px;
  background: #fff;
}

.cart-product-noimg {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f8f9fa;
  color: #6b7280;
  font-size: 0.82rem;
  text-align: center;
  padding: 0.5rem;
}

/* =========================
   INFO
========================= */
.cart-product-info {
  min-width: 0;
}

.cart-product-title {
  font-size: 1.08rem;
  font-weight: 700;
  line-height: 1.25;
  margin: 0 0 0.55rem;
  color: #111827;
}

.cart-product-title a {
  color: inherit;
  text-decoration: none;
}

.cart-product-title a:hover {
  color: #2563eb;
}

.cart-product-meta {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.cart-meta-item {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  font-size: 0.9rem;
  line-height: 1.3;
}

.cart-meta-label {
  color: #6b7280;
  font-weight: 600;
}

.cart-meta-value {
  color: #374151;
}

/* =========================
   BOXES
========================= */
.cart-product-box {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.45rem;
}

.cart-field-label {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #6b7280;
  font-weight: 700;
}

.cart-price-value {
  font-size: 1rem;
  font-weight: 600;
  color: #1f2937;
}

.cart-subtotal-value {
  font-size: 1.18rem;
  font-weight: 800;
  color: #111827;
  line-height: 1;
}

/* =========================
   CANTIDAD
========================= */
.cart-qty-form {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  width: 100%;
}

.cart-qty-input {
  width: 100%;
  max-width: 110px;
  min-width: 0;
  text-align: center;
  border-radius: 12px;
  border: 1px solid #d7dde5;
  height: 44px;
  box-shadow: none;
}

.cart-qty-input:focus {
  border-color: #9bbcf7;
  box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.12);
}

.cart-btn-update {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0.65rem 1rem;
  border: 0;
  border-radius: 12px;
  background: #eef2f7;
  color: #1f2937;
  font-weight: 600;
}

.cart-btn-update:hover {
  background: #e2e8f0;
  color: #111827;
}

/* =========================
   REMOVE
========================= */
.cart-remove-form {
  margin-top: 0.2rem;
}

.cart-btn-remove {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  border: 1px solid #f0d0d0;
  background: #fff5f5;
  color: #b42318;
  border-radius: 12px;
  padding: 0.55rem 0.85rem;
  font-weight: 600;
}

.cart-btn-remove:hover {
  background: #ffeaea;
  color: #912018;
}

/* =========================
   RESUMEN
========================= */
.cart-summary-card {
  background: #fff;
  border: 1px solid #e7ebf0;
  border-radius: 18px;
  box-shadow: 0 0.35rem 1.2rem rgba(0, 0, 0, 0.06);
  padding: 1.25rem;
  position: sticky;
  top: 96px;
}

.cart-summary-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: #111827;
  margin: 0 0 1rem;
}

.cart-summary-body {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.cart-summary-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  color: #4b5563;
  font-size: 0.98rem;
}

.cart-summary-row strong {
  color: #111827;
}

.cart-summary-muted {
  color: #6b7280;
}

.cart-summary-divider {
  height: 1px;
  background: #e9edf2;
  margin: 0.25rem 0;
}

.cart-summary-total {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-top: 0.2rem;
}

.cart-summary-total span {
  font-size: 1.05rem;
  color: #111827;
  font-weight: 700;
}

.cart-summary-total strong {
  font-size: 1.7rem;
  line-height: 1;
  color: #111827;
}

.cart-summary-actions {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 1.25rem;
}

.cart-btn-checkout {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  min-height: 50px;
  border: 0;
  border-radius: 14px;
  background: #ff6f0f;
  color: #fff;
  font-weight: 800;
  text-decoration: none;
  padding: 0.85rem 1rem;
}

.cart-btn-checkout:hover {
  background: #ea650d;
  color: #fff;
}

.cart-btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  border-radius: 14px;
  border: 1px solid #cfe0fb;
  background: #fff;
  color: #2563eb;
  font-weight: 700;
  text-decoration: none;
  padding: 0.85rem 1rem;
}

.cart-btn-secondary:hover {
  background: #f8fbff;
  color: #1d4ed8;
}

/* =========================
   CARRITO VACÍO
========================= */
.cart-empty-card {
  background: #fff;
  border: 1px solid #e7ebf0;
  border-radius: 18px;
  box-shadow: 0 0.35rem 1.2rem rgba(0, 0, 0, 0.06);
  padding: 3rem 1.25rem;
  text-align: center;
}

.cart-empty-icon {
  font-size: 3rem;
  line-height: 1;
  color: #9ca3af;
  margin-bottom: 1rem;
}

.cart-empty-title {
  font-size: 1.45rem;
  font-weight: 800;
  color: #111827;
  margin-bottom: 0.65rem;
}

.cart-empty-text {
  max-width: 520px;
  margin: 0 auto 1.25rem;
  color: #6b7280;
  font-size: 1rem;
}

/* =========================
   TABLET
========================= */
@media (max-width: 1199.98px) {
  .cart-layout {
    grid-template-columns: 1fr;
  }

  .cart-summary-card {
    position: static;
  }

  .cart-product-grid {
    grid-template-columns: 100px minmax(200px, 1fr) 160px 130px 160px;
  }
}

@media (max-width: 991.98px) {
  .cart-product-grid {
    grid-template-columns: 88px 1fr;
    gap: 1rem;
    align-items: start;
  }

  .cart-product-media {
    width: 88px;
    height: 88px;
  }

  .cart-product-box--qty,
  .cart-product-box--price,
  .cart-product-box--subtotal {
    grid-column: 2 / 3;
    padding-top: 0.15rem;
  }

  .cart-product-box--price,
  .cart-product-box--subtotal {
    border-top: 1px dashed #edf1f5;
    margin-top: 0.4rem;
    padding-top: 0.75rem;
  }

  .cart-product-box--qty {
    margin-top: 0.35rem;
  }

  .cart-qty-form {
    max-width: 240px;
  }
}

/* =========================
   MOBILE
========================= */
@media (max-width: 767.98px) {
  .cart-page {
    padding-top: 0.6rem;
    padding-bottom: 1.5rem;
  }

  .cart-page-header {
    margin-bottom: 1rem;
  }

  .cart-page-title {
    font-size: 1.5rem;
  }

  .cart-page-subtitle {
    font-size: 0.95rem;
  }

  .cart-link-back {
    width: 100%;
    justify-content: center;
  }

  .cart-products-card,
  .cart-summary-card,
  .cart-empty-card {
    border-radius: 16px;
  }

  .cart-product-grid {
    grid-template-columns: 72px 1fr;
    gap: 0.9rem;
    padding: 1rem;
  }

  .cart-product-media {
    width: 72px;
    height: 72px;
    border-radius: 12px;
  }

  .cart-product-img {
    padding: 6px;
  }

  .cart-product-title {
    font-size: 0.98rem;
    margin-bottom: 0.4rem;
  }

  .cart-product-meta {
    gap: 0.25rem;
  }

  .cart-meta-item {
    font-size: 0.84rem;
  }

  .cart-price-value {
    font-size: 0.98rem;
  }

  .cart-subtotal-value {
    font-size: 1.06rem;
  }

  .cart-qty-form {
    max-width: 100%;
  }

  .cart-qty-input {
    max-width: 100%;
    height: 42px;
  }

  .cart-btn-update,
  .cart-btn-remove,
  .cart-btn-checkout,
  .cart-btn-secondary {
    width: 100%;
  }

  .cart-summary-card {
    padding: 1rem;
  }

  .cart-summary-title {
    font-size: 1.12rem;
  }

  .cart-summary-total strong {
    font-size: 1.45rem;
  }

  .cart-empty-card {
    padding: 2.25rem 1rem;
  }

  .cart-empty-title {
    font-size: 1.25rem;
  }

  .cart-empty-text {
    font-size: 0.95rem;
  }
}

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

  .cart-product-media-wrap {
    justify-content: flex-start;
  }

  .cart-product-media {
    width: 84px;
    height: 84px;
  }

  .cart-product-box--qty,
  .cart-product-box--price,
  .cart-product-box--subtotal {
    grid-column: auto;
    border-top: 1px dashed #edf1f5;
    padding-top: 0.75rem;
    margin-top: 0.2rem;
  }

  .cart-summary-row,
  .cart-summary-total {
    font-size: 0.95rem;
  }

  .cart-summary-total strong {
    font-size: 1.35rem;
  }
}