/* DE LA FINCA - delafinca.com.ve
   Paleta de marca: terracota #8F341B (principal), crema #F5EBDE, carbon #2A2A2A,
   marron #534438, rojo #DE2D1B, naranja #E17E12. Tipografias: Prompt / Poppins. */

:root {
  --terracota: #8F341B;
  --terracota-osc: #74290F;
  --crema: #F5EBDE;
  --crema-claro: #FAF5EC;
  --carbon: #2A2A2A;
  --marron: #534438;
  --rojo: #DE2D1B;
  --naranja: #E17E12;
  --blanco: #FFFFFF;
  --sombra: 0 2px 10px rgba(42, 42, 42, .10);
  --radio: 14px;
  --header-h: 62px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: 'Poppins', system-ui, sans-serif;
  color: var(--carbon);
  background: var(--crema-claro);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, .font-marca { font-family: 'Prompt', 'Poppins', sans-serif; }
img { max-width: 100%; display: block; }
a { color: var(--terracota); }

.contenedor { max-width: 1080px; margin: 0 auto; padding: 0 16px; }

/* ---------- Header ---------- */
.header {
  position: sticky; top: 0; z-index: 50;
  background: var(--terracota);
  color: var(--blanco);
  box-shadow: 0 2px 8px rgba(42,42,42,.25);
}
.header-inner {
  height: var(--header-h);
  display: flex; align-items: center; gap: 10px;
  max-width: 1080px; margin: 0 auto; padding: 0 14px;
}
.header-logo { display: flex; align-items: center; }
.header-logo img { height: 40px; width: auto; }
.header-nav { display: flex; gap: 2px; margin-left: auto; align-items: center; }
.header-nav a {
  color: var(--crema); text-decoration: none; font-weight: 500;
  font-size: .92rem; padding: 8px 10px; border-radius: 8px;
}
.header-nav a:hover, .header-nav a.activo { background: rgba(255,255,255,.14); color: #fff; }
.btn-carrito {
  position: relative; display: flex; align-items: center; gap: 6px;
  background: var(--crema); color: var(--terracota);
  border: 0; border-radius: 999px; padding: 8px 14px;
  font: 600 .92rem 'Poppins', sans-serif; cursor: pointer; margin-left: 6px;
}
.btn-carrito svg { width: 20px; height: 20px; }
.badge-carrito {
  position: absolute; top: -6px; right: -4px;
  background: var(--rojo); color: #fff; border-radius: 999px;
  font-size: .7rem; font-weight: 700; min-width: 19px; height: 19px;
  display: none; align-items: center; justify-content: center; padding: 0 4px;
}
.badge-carrito.visible { display: flex; }

@media (max-width: 560px) {
  .header-nav a.solo-escritorio { display: none; }
  .header-logo img { height: 34px; }
}

/* ---------- Botones ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 0; border-radius: 999px; cursor: pointer; text-decoration: none;
  font: 600 1rem 'Poppins', sans-serif; padding: 13px 26px;
  transition: transform .12s ease, box-shadow .12s ease;
}
.btn:active { transform: scale(.97); }
.btn-primario { background: var(--terracota); color: #fff; }
.btn-primario:hover { background: var(--terracota-osc); }
.btn-claro { background: var(--crema); color: var(--terracota); }
.btn-wsp { background: #25D366; color: #fff; }
.btn-wsp:hover { background: #1EBE5A; }
.btn svg { width: 20px; height: 20px; }

/* ---------- Hero ---------- */
.hero {
  position: relative; color: #fff;
  background: var(--terracota);
  overflow: hidden;
}
.hero-foto {
  position: absolute; inset: 0;
  background-size: cover; background-position: center;
  opacity: .28;
}
.hero-grad {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(143,52,27,.2) 0%, rgba(116,41,15,.75) 100%);
}
.hero-contenido {
  position: relative; text-align: center;
  padding: 52px 18px 58px;
  max-width: 760px; margin: 0 auto;
}
.hero-contenido img.logo { height: 110px; width: auto; margin: 0 auto 18px; }
.hero-contenido h1 { font-size: clamp(1.5rem, 4.5vw, 2.4rem); margin: 0 0 10px; font-weight: 600; }
.hero-contenido p { font-size: clamp(1rem, 2.6vw, 1.15rem); margin: 0 0 26px; color: var(--crema); }
.hero-acciones { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* ---------- Banner promo ---------- */
.banner-promo {
  background: var(--naranja); color: #fff; text-align: center;
  padding: 10px 16px; font-weight: 600; font-size: .95rem;
}

/* ---------- Secciones ---------- */
.seccion { padding: 44px 0; }
.seccion-titulo { display: flex; align-items: baseline; gap: 12px; margin-bottom: 20px; }
.seccion-titulo h2 { font-size: 1.5rem; margin: 0; color: var(--terracota); }
.seccion-titulo a { font-size: .9rem; font-weight: 600; white-space: nowrap; }
.seccion-alterna { background: var(--crema); }

/* ---------- Grilla de categorias ---------- */
.grilla-categorias {
  display: grid; gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}
.tarjeta-categoria {
  background: var(--blanco); border-radius: var(--radio); box-shadow: var(--sombra);
  padding: 22px 12px; text-align: center; text-decoration: none; color: var(--carbon);
  transition: transform .15s ease, box-shadow .15s ease;
}
.tarjeta-categoria:hover { transform: translateY(-3px); box-shadow: 0 6px 18px rgba(42,42,42,.15); }
.tarjeta-categoria .chip-icono { margin: 0 auto 10px; }
.tarjeta-categoria span { font-weight: 600; font-size: .95rem; }

.chip-icono {
  width: 72px; height: 72px; border-radius: 50%;
  background: var(--crema); display: flex; align-items: center; justify-content: center;
}
.chip-icono svg { width: 40px; height: 40px; color: var(--terracota); }

/* ---------- Tarjetas de producto ---------- */
.grilla-productos {
  display: grid; gap: 12px;
  grid-template-columns: repeat(auto-fill, minmax(158px, 1fr));
}
@media (max-width: 400px) {
  .grilla-productos { grid-template-columns: repeat(2, 1fr); }
}
.tarjeta-producto {
  background: var(--blanco); border-radius: var(--radio); box-shadow: var(--sombra);
  display: flex; flex-direction: column; overflow: hidden; position: relative;
}
.producto-img {
  aspect-ratio: 4 / 3; background: var(--crema);
  display: flex; align-items: center; justify-content: center;
}
.producto-img svg { width: 52px; height: 52px; color: var(--terracota); opacity: .85; }
.producto-img img { width: 100%; height: 100%; object-fit: cover; }
.producto-info { padding: 10px 12px 12px; display: flex; flex-direction: column; flex: 1; gap: 4px; }
.producto-nombre {
  font-size: .88rem; font-weight: 500; line-height: 1.25; margin: 0;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  min-height: 2.2em;
}
.producto-unidad { font-size: .72rem; color: var(--marron); }
.producto-precios { margin-top: auto; display: flex; flex-direction: column; }
.precio-usd { font: 600 1.05rem 'Prompt', sans-serif; color: var(--terracota); }
.precio-usd .tachado { color: #9a9a9a; text-decoration: line-through; font-size: .82rem; font-weight: 400; margin-left: 6px; }
.precio-bs { font-size: .74rem; color: #767676; }
.producto-agregar {
  margin-top: 8px; border: 0; border-radius: 10px; cursor: pointer;
  background: var(--terracota); color: #fff; font: 600 .85rem 'Poppins', sans-serif;
  padding: 9px 10px; display: flex; align-items: center; justify-content: center; gap: 6px;
  transition: background .12s ease;
}
.producto-agregar:hover { background: var(--terracota-osc); }
.producto-agregar.agregado { background: #1e7d34; }
.producto-agregar svg { width: 16px; height: 16px; }
.etiqueta-oferta {
  position: absolute; top: 8px; left: 8px; z-index: 2;
  background: var(--rojo); color: #fff; font-size: .7rem; font-weight: 700;
  padding: 3px 9px; border-radius: 999px;
}

/* ---------- Catalogo: busqueda + chips ---------- */
.barra-catalogo {
  position: sticky; top: var(--header-h); z-index: 40;
  background: var(--crema-claro);
  padding: 12px 0 8px;
  box-shadow: 0 6px 8px -6px rgba(42,42,42,.12);
}
.campo-busqueda {
  display: flex; align-items: center; gap: 8px;
  background: var(--blanco); border: 1.5px solid #e2d7c6; border-radius: 999px;
  padding: 10px 16px;
}
.campo-busqueda:focus-within { border-color: var(--terracota); }
.campo-busqueda svg { width: 18px; height: 18px; color: var(--marron); flex: none; }
.campo-busqueda input {
  border: 0; outline: 0; background: transparent; width: 100%;
  font: 400 1rem 'Poppins', sans-serif; color: var(--carbon);
}
.chips-categorias {
  display: flex; gap: 8px; overflow-x: auto; padding: 10px 2px 4px;
  scrollbar-width: none;
}
.chips-categorias::-webkit-scrollbar { display: none; }
.chip {
  flex: none; border: 1.5px solid #e2d7c6; background: var(--blanco);
  color: var(--marron); border-radius: 999px; padding: 7px 15px;
  font: 500 .85rem 'Poppins', sans-serif; cursor: pointer; white-space: nowrap;
}
.chip.activo { background: var(--terracota); border-color: var(--terracota); color: #fff; }
.sin-resultados { text-align: center; color: var(--marron); padding: 40px 0; }
.titulo-grupo-cat { color: var(--terracota); font-size: 1.2rem; margin: 26px 0 12px; }

/* ---------- Drawer del carrito ---------- */
.velo {
  position: fixed; inset: 0; z-index: 90; background: rgba(42,42,42,.5);
  visibility: hidden; opacity: 0; transition: opacity .2s ease, visibility .2s;
}
.velo.abierto { visibility: visible; opacity: 1; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 95;
  width: min(420px, 100vw);
  background: var(--blanco); box-shadow: -4px 0 24px rgba(0,0,0,.2);
  transform: translateX(105%); transition: transform .25s ease;
  display: flex; flex-direction: column;
}
.drawer.abierto { transform: translateX(0); }
.drawer-cabecera {
  background: var(--terracota); color: #fff;
  padding: 14px 18px; display: flex; align-items: center; justify-content: space-between;
}
.drawer-cabecera h3 { margin: 0; font-size: 1.1rem; }
.drawer-cerrar { background: none; border: 0; color: #fff; font-size: 1.5rem; cursor: pointer; line-height: 1; padding: 4px; }
.drawer-cuerpo { flex: 1; overflow-y: auto; padding: 14px 16px; }
.carrito-vacio { text-align: center; color: var(--marron); padding: 40px 12px; }
.carrito-vacio svg { width: 54px; height: 54px; color: var(--terracota); opacity: .5; margin: 0 auto 10px; }

.item-carrito {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 0; border-bottom: 1px solid #f0e6d8;
}
.item-info { flex: 1; min-width: 0; }
.item-nombre { font-size: .88rem; font-weight: 500; line-height: 1.25; }
.item-precio { font-size: .8rem; color: var(--marron); }
.item-subtotal { font: 600 .92rem 'Prompt', sans-serif; color: var(--terracota); white-space: nowrap; }
.stepper { display: flex; align-items: center; gap: 2px; }
.stepper button {
  width: 28px; height: 28px; border: 1.5px solid #e2d7c6; background: var(--crema-claro);
  border-radius: 8px; font-size: 1rem; font-weight: 700; color: var(--terracota);
  cursor: pointer; line-height: 1;
}
.stepper span { min-width: 46px; text-align: center; font-size: .84rem; font-weight: 600; }
.item-quitar { background: none; border: 0; color: #b3261e; cursor: pointer; font-size: 1.05rem; padding: 4px; }

.drawer-pie { border-top: 2px solid var(--crema); padding: 14px 16px calc(14px + env(safe-area-inset-bottom)); }
.fila-total { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 4px; }
.fila-total .total-usd { font: 700 1.35rem 'Prompt', sans-serif; color: var(--terracota); }
.fila-total .total-bs { font-size: .8rem; color: #767676; }
.nota-tasa { font-size: .72rem; color: #9a9a9a; margin: 0 0 12px; }

.form-checkout label { display: block; font-size: .82rem; font-weight: 600; margin: 10px 0 4px; color: var(--marron); }
.form-checkout input[type=text], .form-checkout textarea {
  width: 100%; border: 1.5px solid #e2d7c6; border-radius: 10px; padding: 10px 12px;
  font: 400 .92rem 'Poppins', sans-serif; color: var(--carbon); background: var(--crema-claro);
}
.form-checkout input:focus, .form-checkout textarea:focus { outline: none; border-color: var(--terracota); }
.form-checkout textarea { min-height: 54px; resize: vertical; }
.opciones-entrega { display: flex; flex-direction: column; gap: 6px; }
.opcion-entrega {
  display: flex; align-items: center; gap: 8px; cursor: pointer;
  border: 1.5px solid #e2d7c6; border-radius: 10px; padding: 9px 12px;
  font-size: .86rem; background: var(--crema-claro);
}
.opcion-entrega:has(input:checked) { border-color: var(--terracota); background: var(--crema); }
.opcion-entrega input { accent-color: var(--terracota); margin: 0; }
.drawer-pie .btn-wsp { width: 100%; margin-top: 14px; }
.enlace-vaciar {
  display: block; text-align: center; margin-top: 10px; background: none; border: 0;
  color: #9a9a9a; font-size: .8rem; cursor: pointer; text-decoration: underline; width: 100%;
}
.error-checkout { color: var(--rojo); font-size: .8rem; margin-top: 8px; display: none; }

/* ---------- Franja de fotos ---------- */
.franja-fotos { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.franja-fotos img { border-radius: var(--radio); width: 100%; height: 200px; object-fit: cover; }
@media (max-width: 640px) {
  .franja-fotos { grid-template-columns: 1fr 1fr; }
  .franja-fotos img:nth-child(3) { display: none; }
}

/* ---------- Mayoreo ---------- */
.tarjeta-info {
  background: var(--blanco); border-radius: var(--radio); box-shadow: var(--sombra);
  padding: 22px;
}
.grilla-info { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.tarjeta-info h3 { margin: 0 0 8px; color: var(--terracota); font-size: 1.05rem; display: flex; align-items: center; gap: 8px; }
.tarjeta-info h3 svg { width: 22px; height: 22px; flex: none; }
.tarjeta-info p { margin: 0; font-size: .9rem; line-height: 1.55; color: #4a4a4a; }
.lista-check { margin: 8px 0 0; padding: 0; list-style: none; }
.lista-check li { padding-left: 24px; position: relative; font-size: .9rem; line-height: 1.7; color: #4a4a4a; }
.lista-check li::before { content: '✓'; position: absolute; left: 2px; color: var(--naranja); font-weight: 700; }

/* ---------- Footer ---------- */
.footer { background: var(--carbon); color: var(--crema); padding: 36px 0 26px; margin-top: 30px; }
.footer-grid { display: grid; gap: 24px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.footer h4 { margin: 0 0 10px; color: #fff; font-family: 'Prompt', sans-serif; font-size: 1rem; }
.footer p, .footer a { font-size: .88rem; color: var(--crema); line-height: 1.7; margin: 0; }
.footer a { text-decoration: none; }
.footer a:hover { text-decoration: underline; }
.footer .fila-icono { display: flex; align-items: flex-start; gap: 8px; margin-bottom: 6px; }
.footer .fila-icono svg { width: 17px; height: 17px; flex: none; margin-top: 3px; color: var(--naranja); }
.footer-logo { height: 46px; width: auto; margin-bottom: 10px; }
.footer-legal { border-top: 1px solid #3d3d3d; margin-top: 26px; padding-top: 16px; text-align: center; font-size: .76rem; color: #9a9a9a; }

/* ---------- Boton WhatsApp flotante ---------- */
.wsp-flotante {
  position: fixed; right: 16px; bottom: 16px; z-index: 60;
  width: 54px; height: 54px; border-radius: 50%;
  background: #25D366; color: #fff; display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 14px rgba(0,0,0,.28); text-decoration: none;
}
.wsp-flotante svg { width: 28px; height: 28px; }

/* ---------- Utilidades ---------- */
.centrado { text-align: center; }
.oculto { display: none !important; }
