/* =========================
   BASE - ESTRUCTURA ORIGINAL
========================= */

.custom-cart {
  display: block;
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

/* Reset */
.custom-cart * {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* Título */
.cart-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
}

.cart-title img {
  width: 28px;
  opacity: 0.8;
}

.cart-title h2 {
  font-family: "Open Sans", sans-serif;
  font-size: 28px;
  font-weight: 600;
  color: var(--gongora-text, #343434);
  margin: 0;
}

/* ITEMS CONTENEDOR */
.cart-items {
  display: flex;
  flex-direction: column;
}

/* ITEM */
.cart-item {
  display: grid;
  grid-template-columns: 60px 1fr 100px 120px 100px 50px;
  gap: 10px;
  padding: 15px 0;
  border-bottom: 1px solid #eee;
  align-items: center;
}

/* Imagen */
.item-image {
  display: flex;
  justify-content: center;
  align-items: center;
}

.item-image img {
  width: 60px;
  height: 60px;
  object-fit: cover;
  border-radius: 4px;
}

/* Nombre */
.item-name {
  display: flex;
  align-items: center;
}

.item-name p {
  font-family: "Open Sans", sans-serif;
  font-style: italic;
  font-size: 14px;
  font-weight: 500;
  color: #343434;
  margin: 0;
}

/* PRECIO */
.item-price {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.item-price .sale-price {
  font-family: "Open Sans", sans-serif;
  font-size: 16px;
  font-weight: 600;
  color: #343434;
  margin: 0;
}

.item-price .regular-price {
  font-family: "Open Sans", sans-serif;
  font-size: 12px;
  font-weight: 500;
  color: #AAAAAA;
  text-decoration: line-through;
  margin: 0;
}

.item-price .normal-price {
  font-family: "Open Sans", sans-serif;
  font-size: 16px;
  font-weight: 600;
  color: #343434;
  margin: 0;
}

/* CANTIDAD */
.item-qty {
  display: flex;
  gap: 3px;
  align-items: center;
  justify-content: center;
}

.item-qty .qty-input {
  width: 50px;
  height: 30px;
  text-align: center;
  border: 1px solid #eee;
  font-weight: 600;
  font-size: 14px;
  background: white;
}

.item-qty input:focus {
  outline: 2px solid var(--gongora-primary-color, #E7A71A);
}

.item-qty button {
  width: 30px;
  height: 30px;
  background-color: var(--gongora-primary-color, #E7A71A);
  border: none;
  display: flex;
  justify-content: center;
  align-items: center;
  color: white;
  font-size: 16px;
  font-weight: bold;
  cursor: pointer;
  transition: background-color 0.2s ease;
  border-radius: 3px;
}

.item-qty button:hover {
  background-color: var(--gongora-primary-color, #E7A71A);
  filter: brightness(0.8);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.item-qty button.minus,
.item-qty button.plus {
  font-size: 20px;
}

/* SUBTOTAL */
.item-subtotal {
  font-family: "Open Sans", sans-serif;
  font-size: 16px;
  font-weight: 600;
  color: #343434;
  display: flex;
  justify-content: center;
  align-items: center;
  text-align: center;
}

/* BOTÓN ELIMINAR */
.btn-action {
  display: flex;
  justify-content: center;
  align-items: center;
}

.remove-item {
  background-color: #F81010;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 8px;
  border: none;
  cursor: pointer;
  border-radius: 3px;
  transition: background-color 0.2s ease;
  width: 36px;
  height: 36px;
}

.remove-item:hover {
  background-color: #960707;
}

.remove-item img {
  width: 18px;
  height: 18px;
  filter: invert(1);
}

/* ACCIONES DEL CARRITO - BOTONES */
.cart-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  margin-top: 30px;
  flex-wrap: wrap;
  width: 100%;
}

/* Botón Secundario: Continuar Comprando */
.btn-continue-shopping {
  background-color: transparent;
  border: 2px solid #ddd;
  border-radius: 8px;
  padding: 12px 24px;
  font-family: "Open Sans", sans-serif;
  font-weight: 600;
  font-size: 14px;
  color: #343434;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
  display: inline-block;
  width: auto;
  box-sizing: border-box;
}

.btn-continue-shopping:hover {
  border-color: var(--gongora-primary-color, #E7A71A);
  color: var(--gongora-primary-color, #E7A71A);
}

/* Botón Principal: Procesar el Pago */
.btn-checkout {
  background-color: var(--gongora-primary-color, #E7A71A);
  border: none;
  border-radius: 8px;
  padding: 12px 32px;
  font-family: "Open Sans", sans-serif;
  font-weight: 600;
  font-size: 14px;
  color: white;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
  display: inline-block;
  width: auto;
  box-sizing: border-box;
  box-shadow: 0 2px 8px rgba(231, 167, 26, 0.2);
}

.btn-checkout:hover {
  filter: brightness(0.9);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(231, 167, 26, 0.4);
}

/* =========================
   CARRITO VACÍO
========================= */

.empty-cart {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  padding: 60px 20px;
  text-align: center;
}

.empty-cart img {
  width: 100px;
  opacity: 0.7;
}

.empty-cart p {
  font-family: "Open Sans", sans-serif;
  font-size: 18px;
  color: #666;
  margin: 0;
}

.btn-shop {
  background-color: var(--gongora-primary-color, #E7A71A);
  padding: 12px 28px;
  border-radius: 8px;
  color: white;
  text-decoration: none;
  font-family: "Open Sans", sans-serif;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  border: none;
  transition: all 0.2s ease;
  display: inline-block;
}

.btn-shop:hover {
  filter: brightness(0.9);
  transform: translateY(-2px);
}

/* =========================
   LOADER
========================= */

.cart-loader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.6);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 999;
  opacity: 0;
  pointer-events: none;
  transition: 0.3s;
}

.cart-loader.active {
  display: flex;
  opacity: 1;
  pointer-events: all;
}

.cart-loader img {
  width: 50px;
}

/* =========================
   RESPONSIVE - MOBILE
========================= */

@media (max-width: 600px) {
  .custom-cart {
    padding: 12px;
  }

  .cart-item {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 15px;
    border: 1px solid #eee;
    border-radius: 8px;
    margin-bottom: 15px;
    background: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  }

  .item-image {
    display: flex;
    justify-content: center;
  }

  .item-name {
    justify-content: center;
    text-align: center;
  }

  .item-name p {
    font-size: 13px;
  }

  .item-price {
    align-items: center;
  }

  .item-subtotal {
    justify-content: center;
  }

  .item-qty {
    justify-content: center;
  }

  .btn-action {
    justify-content: center;
  }

  .cart-title h2 {
    font-size: 22px;
  }

  /* Botones en mobile apilados */
  .cart-actions {
    flex-direction: column;
    justify-content: stretch;
    margin-top: 20px;
  }

  .btn-continue-shopping,
  .btn-checkout {
    width: 100%;
  }
}
