/* ==========================================================
   Tienda / Carrito - Lic. Denegri Delfina
   Estilos específicos para carrito.php (catálogo + offcanvas)
   ========================================================== */

#tienda-container {
  padding-top: 10px;
}

.tienda-subtitulo {
  color: #a0522d;
  font-size: 1.1rem;
  max-width: 700px;
  margin: 0 auto;
}

/* ---------- Cards de productos ---------- */
.producto-card {
  border: none;
  border-radius: 16px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  background-color: #fff;
  height: 100%;
}

.producto-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.14);
}

.producto-card .producto-img-wrapper {
  width: 100%;
  height: 190px;
  overflow: hidden;
  background-color: #f8f4f0;
}

.producto-card .producto-img-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.producto-card .card-body {
  display: flex;
  flex-direction: column;
}

.producto-card .card-title {
  color: #AE988A;
  font-weight: 700;
}

.producto-card .card-text {
  color: #555;
  font-size: 0.92rem;
  flex-grow: 1;
}

.producto-card .producto-precio {
  font-size: 1.3rem;
  font-weight: 700;
  color: #a0522d;
  margin: 10px 0;
}

/* ---------- Acciones de la tarjeta: Agregar al carrito + Compartir ---------- */
.producto-acciones {
  display: flex;
  align-items: stretch;
  gap: 8px;
}

.btn-agregar-carrito {
  flex: 1 1 auto;
  background-color: #AE988A;
  border: none;
  color: #fff;
  font-weight: 600;
  border-radius: 8px;
  padding: 10px;
  transition: background 0.3s ease;
}

.btn-agregar-carrito:hover {
  background-color: #D8A798;
  color: #fff;
}

.btn-agregar-carrito:disabled {
  background-color: #c9c1bd;
  cursor: default;
}

/* Botón "Compartir" de cada producto del catálogo: enlaza a la ficha dedicada
   (carrito.php?producto={ID}), donde el usuario puede compartir por WhatsApp,
   copiar el enlace o comprar directamente ese producto. */
.btn-compartir-producto {
  flex: 0 0 auto;
  width: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #f8f4f0;
  border: 1px solid #e0d8d2;
  color: #AE988A;
  border-radius: 8px;
  text-decoration: none;
  font-size: 15px;
  transition: background 0.3s ease, color 0.3s ease;
}

.btn-compartir-producto:hover {
  background-color: #AE988A;
  color: #fff;
}

/* ---------- Botón flotante del carrito ---------- */
.btn-carrito-flotante {
  position: fixed;
  right: 30px;
  bottom: 200px;
  width: 55px;
  height: 55px;
  border: none;
  border-radius: 50%;
  background-color: #ff9800;
  color: #fff;
  font-size: 22px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 1050;
}

.badge-carrito {
  position: absolute;
  top: -6px;
  right: -6px;
  background-color: #d9534f;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  min-width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
}

/* ---------- Offcanvas del carrito ---------- */
#offcanvasCarrito {
  width: 380px;
}

#offcanvasCarrito .offcanvas-header {
  background-color: #f8f4f0;
  border-bottom: 1px solid #eee;
}

#offcanvasCarrito .offcanvas-title {
  color: #AE988A;
  font-weight: 700;
}

.carrito-item {
  display: flex;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid #eee;
}

.carrito-item img {
  width: 64px;
  height: 64px;
  object-fit: cover;
  border-radius: 8px;
  flex-shrink: 0;
  background-color: #f8f4f0;
}

.carrito-item-info {
  flex-grow: 1;
  min-width: 0;
}

.carrito-item-info .nombre {
  font-weight: 600;
  color: #333;
  font-size: 0.9rem;
  margin-bottom: 4px;
}

.carrito-item-controles {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-cantidad {
  width: 26px;
  height: 26px;
  border: 1px solid #ddd;
  background-color: #fff;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  font-size: 13px;
}

.btn-cantidad:hover {
  background-color: #f8f4f0;
}

.carrito-item-precio {
  font-weight: 700;
  color: #a0522d;
  white-space: nowrap;
}

.btn-eliminar-item {
  border: none;
  background: none;
  color: #d9534f;
  cursor: pointer;
  font-size: 15px;
}

.btn-pagar {
  background-color: #70ad70;
  border: none;
  color: #fff;
  font-weight: 700;
  padding: 12px;
  border-radius: 8px;
}

.btn-pagar:hover {
  background-color: #5c9a5c;
  color: #fff;
}

.btn-pagar:disabled {
  background-color: #a9c8a9;
}

@media (max-width: 420px) {
  #offcanvasCarrito {
    width: 100%;
  }
}

/* ==========================================================
   Ficha de producto (landing) - carrito.php?producto={ID}
   Disposición de dos columnas con Flexbox:
     - Izquierda: título, descripción, precio, botón de compra y compartir.
     - Derecha: imagen del producto.
   100% responsivo: en pantallas angostas las columnas se apilan (columna única).
   ========================================================== */
.ficha-producto {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 40px;
  background-color: #fff;
  border-radius: 20px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
  padding: 40px;
  margin-top: 20px;
}

.ficha-producto-col {
  flex: 1 1 320px;
  min-width: 280px;
}

.ficha-producto-texto {
  text-align: left;
}

.ficha-producto-titulo {
  color: #AE988A;
  font-weight: 700;
  font-size: 2rem;
  margin-bottom: 16px;
}

.ficha-producto-descripcion {
  color: #555;
  font-size: 1.05rem;
  line-height: 1.6;
  margin-bottom: 20px;
}

.ficha-producto-precio {
  font-size: 2rem;
  font-weight: 700;
  color: #a0522d;
  margin-bottom: 24px;
}

.ficha-producto-btn-comprar {
  width: 100%;
  max-width: 320px;
  font-size: 1.05rem;
  padding: 14px 20px;
}

.ficha-producto-compartir {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 24px;
  flex-wrap: wrap;
}

.ficha-producto-compartir-label {
  color: #555;
  font-weight: 600;
}

.btn-compartir {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 18px;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.btn-compartir:hover {
  transform: translateY(-3px);
  opacity: 0.9;
  color: #fff;
}

.btn-compartir-whatsapp {
  background-color: #25D366;
}

.btn-compartir-copiar {
  background-color: #AE988A;
}

.copiar-enlace-feedback {
  color: #70ad70;
  font-weight: 600;
  font-size: 0.9rem;
}

.ficha-producto-imagen {
  display: flex;
  justify-content: center;
  align-items: center;
}

.ficha-producto-imagen img {
  width: 100%;
  max-width: 380px;
  border-radius: 16px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
  object-fit: cover;
}

.ficha-producto-volver {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #AE988A;
  font-weight: 600;
  text-decoration: none;
}

.ficha-producto-volver:hover {
  color: #a0522d;
  text-decoration: underline;
}

/* En pantallas móviles, las columnas se apilan: primero el texto, luego la imagen */
@media (max-width: 767px) {
  .ficha-producto {
    flex-direction: column;
    padding: 24px;
    gap: 24px;
  }

  .ficha-producto-texto {
    text-align: center;
  }

  .ficha-producto-compartir {
    justify-content: center;
  }

  .ficha-producto-btn-comprar {
    max-width: 100%;
    margin: 0 auto;
  }

  .ficha-producto-titulo {
    font-size: 1.5rem;
  }

  .ficha-producto-precio {
    font-size: 1.6rem;
  }
}
