/* Nutri Delfi · Tienda (carrito.php) — mismo estilo editorial que el inicio.
   Se carga después de style.css, carrito.css y mejoras.css. */

.nd-tienda-page { background: #fff; }

/* --- Encabezado de la tienda (más bajo que el hero del inicio) --- */
.nd-tienda-hero {
  position: relative; overflow: hidden;
  padding: calc(76px + clamp(48px, 7vw, 90px)) 24px clamp(56px, 7vw, 90px);
  background:
    linear-gradient(90deg, rgba(248, 244, 240, .96) 0%, rgba(248, 244, 240, .88) 45%, rgba(248, 244, 240, .55) 100%),
    url('../images/opt/hero-1536.webp') center 40% / cover no-repeat;
}
.nd-tienda-hero::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 60px;
  background: #fff; border-radius: 50% 50% 0 0 / 100% 100% 0 0;
}
.nd-tienda-hero-in { position: relative; z-index: 1; max-width: 1140px; margin: 0 auto; }
.nd-tienda-hero h1, .nd-tienda-hero .nd-tienda-hero-h1 {
  font-family: 'Cormorant Garamond', Georgia, serif; font-weight: 500;
  font-size: clamp(2.6rem, 5.4vw, 4.2rem); line-height: 1.02; color: #3f3330; margin: 0 0 14px;
}
.nd-tienda-hero .nd-tienda-hero-h1 { font-size: clamp(2rem, 4vw, 3rem); margin: 0; }
.nd-tienda-hero .nd-tienda-hero-h1 a { color: inherit; text-decoration: none; }
.nd-tienda-hero h1 em, .nd-tienda-hero-h1 em { font-style: italic; color: #518951; }
.nd-tienda-hero p {
  font-family: 'Poppins', sans-serif; font-weight: 300; font-size: 1.05rem; line-height: 1.75;
  color: #5e4a44; max-width: 560px; margin: 0;
}

/* --- Contenido --- */
.nd-tienda { max-width: 1140px; margin: 0 auto; padding: 10px 24px 110px; }
.nd-tienda #tienda-container { max-width: none; padding: 0; }

/* Cómo comprar: 3 pasos */
.nd-pasos {
  list-style: none; margin: 0 0 48px; padding: 0;
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px;
}
.nd-pasos li {
  display: flex; align-items: center; gap: 14px;
  background: #f8f4f0; border-radius: 18px; padding: 16px 18px;
  font-family: 'Poppins', sans-serif; text-align: left;
}
.nd-pasos strong { display: block; font-weight: 500; color: #3f3330; font-size: .98rem; }
.nd-pasos li span:not(.nd-paso-ico) { font-size: .86rem; font-weight: 300; color: #6f5a52; }
.nd-paso-ico {
  flex: 0 0 44px; height: 44px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: #fff; color: #518951; font-size: 1.05rem;
}

/* Avisos (resultado del pago, enlaces inválidos) */
.nd-aviso {
  display: flex; gap: 16px; align-items: flex-start;
  border-radius: 18px; padding: 18px 22px; margin: 0 0 32px;
  font-family: 'Poppins', sans-serif; text-align: left;
}
.nd-aviso > i { font-size: 1.6rem; margin-top: 2px; }
.nd-aviso strong { display: block; font-weight: 600; margin-bottom: 2px; }
.nd-aviso p { margin: 4px 0 0; font-weight: 300; }
.nd-aviso-success { background: #eef5ec; color: #2f5a2f; }
.nd-aviso-success > i { color: #518951; }
.nd-aviso-warning { background: #fdf3e6; color: #6b4a1c; }
.nd-aviso-warning > i { color: #c98a2e; }
.nd-aviso-danger { background: #fbecea; color: #7a2e26; }
.nd-aviso-danger > i { color: #c0513f; }

/* --- Catálogo --- */
.nd-catalogo {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr));
  gap: 28px; text-align: left;
}
.nd-catalogo.d-none { display: none !important; }
.nd-prod {
  display: flex; flex-direction: column; overflow: hidden;
  background: #fff; border-radius: 22px; border: 1px solid #f0e8e1;
  box-shadow: 0 10px 30px rgba(90, 70, 60, .07);
  transition: transform .35s ease, box-shadow .35s ease;
}
.nd-prod:hover { transform: translateY(-5px); box-shadow: 0 20px 44px rgba(90, 70, 60, .13); }
.nd-prod-img { position: relative; display: block; aspect-ratio: 4 / 3; overflow: hidden; background: #f8f4f0; }
.nd-prod-img img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .6s ease; }
.nd-prod:hover .nd-prod-img img { transform: scale(1.04); }
.nd-prod-tag {
  position: absolute; left: 14px; top: 14px;
  background: rgba(248, 244, 240, .94); color: #6f5a52; border-radius: 999px; padding: 6px 12px;
  font-family: 'Poppins', sans-serif; font-size: .75rem; font-weight: 500; letter-spacing: .08em;
}
.nd-prod-tag i { color: #c0513f; margin-right: 4px; }
.nd-prod-body { display: flex; flex-direction: column; flex: 1; padding: 22px 24px 24px; }
.nd-prod-titulo {
  font-family: 'Cormorant Garamond', Georgia, serif; font-weight: 600;
  font-size: 1.55rem; line-height: 1.15; margin: 0 0 10px;
  /* Los nombres vienen cargados en MAYÚSCULAS: se muestran en tipo oración */
  text-transform: lowercase;
}
.nd-prod-titulo::first-letter { text-transform: uppercase; }
.nd-prod-titulo a { color: #3f3330; text-decoration: none; }
.nd-prod-titulo a:hover { color: #518951; }
.nd-prod-desc {
  font-family: 'Poppins', sans-serif; font-weight: 300; font-size: .93rem; line-height: 1.65; color: #5e4a44;
  margin: 0 0 8px;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.nd-prod-mas {
  align-self: flex-start; margin-bottom: 18px;
  font-family: 'Poppins', sans-serif; font-size: .85rem; font-weight: 500; color: #518951; text-decoration: none;
}
.nd-prod-mas:hover { color: #3f6e3f; text-decoration: underline; }
.nd-prod-pie {
  margin-top: auto; padding-top: 16px; border-top: 1px solid #f0e8e1;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.nd-prod-precio {
  font-family: 'Poppins', sans-serif; font-weight: 600; font-size: 1.35rem; color: #3f3330;
}
.nd-tienda-page .btn-agregar-carrito {
  width: auto; border-radius: 999px; padding: 10px 20px;
  background: #518951; border: 0; color: #fff;
  font-family: 'Poppins', sans-serif; font-weight: 500; font-size: .92rem;
  box-shadow: 0 6px 16px rgba(81, 137, 81, .25);
}
.nd-tienda-page .btn-agregar-carrito:hover { background: #457745; color: #fff; }
.nd-tienda-page .btn-agregar-carrito:disabled { opacity: .75; }

/* Estado "cargando" / errores del catálogo */
.nd-tienda #catalogo-loading .spinner-border { color: #70ad70 !important; }
.nd-tienda .alert { border-radius: 16px; font-family: 'Poppins', sans-serif; }

/* --- Ficha de producto (carrito.php?ref=...) --- */
.nd-tienda .ficha-producto {
  display: grid; grid-template-columns: 1fr 1fr; gap: clamp(28px, 5vw, 64px); align-items: start;
  background: none; box-shadow: none; padding: 0; margin: 0;
}
.nd-tienda .ficha-producto-imagen img {
  width: 100%; height: auto; border-radius: 22px; box-shadow: 0 20px 44px rgba(90, 70, 60, .14);
}
.nd-ficha-tipo {
  display: inline-flex; align-items: center; gap: 8px; margin-bottom: 12px;
  font-family: 'Poppins', sans-serif; font-size: .78rem; font-weight: 500; letter-spacing: .12em;
  text-transform: uppercase; color: #8a716a;
}
.nd-ficha-tipo i { color: #c0513f; }
.nd-tienda .ficha-producto-titulo {
  font-family: 'Cormorant Garamond', Georgia, serif; font-weight: 500;
  font-size: clamp(2rem, 3.6vw, 2.8rem); line-height: 1.08; color: #3f3330; margin: 0 0 14px;
  text-transform: lowercase;
}
.nd-tienda .ficha-producto-titulo::first-letter { text-transform: uppercase; }
.nd-tienda .ficha-producto-precio {
  font-family: 'Poppins', sans-serif; font-weight: 600; font-size: 1.8rem; color: #518951; margin: 0 0 18px;
}
.nd-tienda .ficha-producto-descripcion {
  font-family: 'Poppins', sans-serif; font-weight: 300; font-size: .98rem; line-height: 1.8; color: #5e4a44; margin: 0 0 26px;
}
.nd-tienda .ficha-producto-btn-comprar {
  width: 100%; max-width: 360px; border-radius: 999px; padding: 14px 24px;
  background: #518951; border: 0; color: #fff; font-family: 'Poppins', sans-serif; font-weight: 500; font-size: 1.05rem;
  box-shadow: 0 8px 20px rgba(81, 137, 81, .28);
}
.nd-tienda .ficha-producto-btn-comprar:hover { background: #457745; color: #fff; }
.nd-ficha-garantias {
  list-style: none; padding: 0; margin: 16px 0 24px; display: grid; gap: 6px;
  font-family: 'Poppins', sans-serif; font-size: .88rem; color: #6f5a52;
}
.nd-ficha-garantias i { color: #518951; width: 18px; margin-right: 6px; }
.nd-ficha-volver { margin-top: 40px; }
.nd-tienda .ficha-producto-volver { color: #518951; font-family: 'Poppins', sans-serif; font-weight: 500; text-decoration: none; }
.nd-tienda .ficha-producto-volver:hover { color: #3f6e3f; text-decoration: underline; }

/* --- Carrito (panel lateral) --- */
.nd-tienda-page #offcanvasCarrito { font-family: 'Poppins', sans-serif; }
.nd-tienda-page #offcanvasCarrito .offcanvas-header { background: #f8f4f0; border-bottom: 1px solid #efe6dd; }
.nd-tienda-page #offcanvasCarrito .offcanvas-title {
  font-family: 'Cormorant Garamond', Georgia, serif; font-weight: 600; font-size: 1.7rem; color: #3f3330;
}
.nd-tienda-page #offcanvasCarrito .offcanvas-title i { color: #518951; font-size: 1.2rem; margin-right: 6px; }
.nd-tienda-page .carrito-item .nombre { text-transform: lowercase; }
.nd-tienda-page .carrito-item .nombre::first-letter { text-transform: uppercase; }
.nd-tienda-page #carrito-total { color: #518951 !important; font-size: 1.25rem; }
.nd-tienda-page #form-checkout .form-control { border-radius: 12px; padding: 10px 14px; border-color: #e3d8ce; }
.nd-tienda-page #form-checkout .form-control:focus { border-color: #70ad70; box-shadow: 0 0 0 .2rem rgba(112, 173, 112, .2); }
.nd-tienda-page .btn-pagar {
  border-radius: 999px; background: #518951; border: 0; color: #fff; font-weight: 500; padding: 12px 20px;
}
.nd-tienda-page .btn-pagar:hover { background: #457745; color: #fff; }

/* Botón flotante del carrito: alineado con los otros flotantes, en el lugar del naranja */
.nd-tienda-page .btn-carrito-flotante {
  right: 30px; bottom: 200px; width: 55px; height: 55px; border-radius: 50%;
  background: #ff9800; color: #fff; border: 0; z-index: 101;
  box-shadow: 0 4px 10px rgba(0, 0, 0, .3); display: flex; align-items: center; justify-content: center; font-size: 22px;
}

@media (max-width: 768px) {
  .nd-tienda-hero { text-align: center; padding-top: calc(70px + 40px); }
  .nd-tienda-hero p { margin: 0 auto; }
  .nd-tienda-hero .nd-eyebrow::before { display: none; }
  .nd-pasos { grid-template-columns: 1fr; gap: 10px; margin-bottom: 32px; }
  .nd-tienda .ficha-producto { grid-template-columns: 1fr; }
  .nd-tienda .ficha-producto-btn-comprar { max-width: none; }
  .nd-tienda-page .btn-carrito-flotante { right: 14px; bottom: 126px; width: 46px; height: 46px; font-size: 19px; }
}
@media (prefers-reduced-motion: reduce) {
  .nd-prod, .nd-prod-img img { transition: none; }
  .nd-prod:hover, .nd-prod:hover .nd-prod-img img { transform: none; }
}

/* Ajustes: imagen completa (las portadas son apaisadas) y grilla centrada */
.nd-catalogo { grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 360px)); justify-content: center; }
.nd-prod-img { aspect-ratio: 16 / 10; }
.nd-prod-img img { object-fit: contain; padding: 10px; box-sizing: border-box; }
.nd-prod-tag { top: auto; bottom: 12px; left: 12px; }
