/* =========================================================
   CASSANDRA CROCHET — Catálogo Digital
   Estilos: artesanal, elegante, cálido, femenino, premium.
   ========================================================= */

:root {
  --crema: #faf6f0;
  --marfil: #f3ecdf;
  --beige: #e8ddc9;
  --marron-suave: #8a7360;
  --marron-oscuro: #4a3b30;
  --terracota: #c27a5c;
  --terracota-suave: #e3a486;
  --texto: #3a3129;
  --texto-suave: #6f6357;
  --blanco: #ffffff;
  --whatsapp: #3fa876;
  --sombra: 0 10px 30px rgba(74, 59, 48, 0.10);
  --sombra-fuerte: 0 20px 50px rgba(74, 59, 48, 0.22);
  --radius: 18px;
  --serif: 'Playfair Display', 'Georgia', serif;
  --sans: 'Poppins', 'Segoe UI', sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--sans);
  color: var(--texto);
  background: var(--crema);
  line-height: 1.6;
  overflow-x: hidden;
}

img { max-width: 100%; display: block; }

h1, h2, h3, h4 { font-family: var(--serif); color: var(--marron-oscuro); font-weight: 600; }

a { text-decoration: none; color: inherit; }

.container { max-width: 1280px; margin: 0 auto; padding: 0 24px; }

section { padding: 90px 0; }

.section-head { text-align: center; max-width: 640px; margin: 0 auto 50px; }
.eyebrow {
  display: inline-block;
  font-size: 0.75rem;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--terracota);
  font-weight: 600;
  margin-bottom: 14px;
}
.section-head h2 { font-size: clamp(1.8rem, 4vw, 2.6rem); margin-bottom: 14px; }
.section-head p { color: var(--texto-suave); font-size: 1.05rem; }

/* ---------- BOTONES ---------- */
.btn-primary, .btn-outline, .btn-whatsapp {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 15px 32px;
  border-radius: 40px;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  border: none;
  transition: all 0.25s ease;
  white-space: nowrap;
}
.btn-primary {
  background: var(--marron-oscuro);
  color: var(--crema);
}
.btn-primary:hover { background: var(--terracota); transform: translateY(-2px); box-shadow: var(--sombra); }

.btn-outline {
  background: transparent;
  color: var(--marron-oscuro);
  border: 1.5px solid var(--marron-oscuro);
}
.btn-outline:hover { background: var(--marron-oscuro); color: var(--crema); }

.btn-whatsapp {
  background: var(--whatsapp);
  color: #fff;
  width: 100%;
}
.btn-whatsapp:hover { background: #34925f; transform: translateY(-1px); }
.btn-whatsapp::before { content: "💬"; }

.btn-sm { padding: 10px 20px; font-size: 0.85rem; }

/* ---------- TOP BAR ---------- */
.topbar {
  background: var(--marron-oscuro);
  color: var(--marfil);
  text-align: center;
  font-size: 0.8rem;
  padding: 8px 16px;
  letter-spacing: 0.5px;
}

/* ---------- HEADER ---------- */
header.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(250, 246, 240, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(74,59,48,0.08);
}
.header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px 12px;
  max-width: 1280px;
  margin: 0 auto;
  gap: 20px;
}
.logo {
  font-family: var(--serif);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--marron-oscuro);
  letter-spacing: 0.5px;
  flex-shrink: 0;
}
.logo span { color: var(--terracota); }

/* Fila de categorías: SIEMPRE en su propia fila, ancho completo,
   con scroll horizontal. Nunca se encoge (flex-shrink:0 en cada pill). */
.category-menu {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding: 0 24px 16px;
  max-width: 1280px;
  margin: 0 auto;
}
.category-menu::-webkit-scrollbar { display: none; }

.cat-pill {
  flex-shrink: 0;
  border: 1px solid rgba(74,59,48,0.18);
  background: transparent;
  color: var(--texto-suave);
  padding: 9px 18px;
  border-radius: 30px;
  font-size: 0.83rem;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
  font-family: var(--sans);
}
.cat-pill:hover { border-color: var(--terracota); color: var(--terracota); }
.cat-pill.active { background: var(--marron-oscuro); color: var(--crema); border-color: var(--marron-oscuro); }

.header-actions { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }

.search-box {
  display: flex;
  align-items: center;
  background: var(--marfil);
  border-radius: 30px;
  padding: 9px 16px;
  gap: 8px;
  width: 230px;
  flex-shrink: 1;
  min-width: 0;
}
.search-box input {
  border: none;
  background: transparent;
  outline: none;
  font-family: var(--sans);
  font-size: 0.85rem;
  color: var(--texto);
  width: 100%;
  min-width: 0;
}

.icon-btn {
  background: var(--marfil);
  border: none;
  width: 42px;
  height: 42px;
  min-width: 42px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  transition: background 0.2s;
  flex-shrink: 0;
}
.icon-btn:hover { background: var(--beige); }
.icon-btn.active { background: var(--terracota-suave); }
.badge-count {
  position: absolute;
  top: -4px;
  right: -4px;
  background: var(--terracota);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  border-radius: 50%;
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ---------- HERO ---------- */
.hero {
  position: relative;
  min-height: 92vh;
  display: flex;
  align-items: center;
  padding: 60px 24px;
  overflow: hidden;
}
.hero-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center 25%;
  z-index: 0;
}
.hero-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(58,49,41,0.15) 0%, rgba(58,49,41,0.55) 100%);
}
.hero-content {
  position: relative;
  z-index: 1;
  max-width: 640px;
  margin: 0 auto;
  text-align: center;
  color: #fff;
}
.hero-content .eyebrow { color: var(--terracota-suave); }
.hero-content h1 {
  font-size: clamp(2.4rem, 6vw, 4rem);
  color: #fff;
  line-height: 1.15;
  margin-bottom: 20px;
  text-shadow: 0 4px 24px rgba(0,0,0,0.25);
}
.hero-content p {
  font-size: 1.15rem;
  margin-bottom: 34px;
  color: rgba(255,255,255,0.92);
  text-shadow: 0 2px 10px rgba(0,0,0,0.2);
}
.hero-actions { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }
.hero-actions .btn-outline { border-color: #fff; color: #fff; }
.hero-actions .btn-outline:hover { background: #fff; color: var(--marron-oscuro); }

/* ---------- CATEGORÍAS (showcase) ---------- */
.category-showcase {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 24px;
}
.cat-card {
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--blanco);
  box-shadow: var(--sombra);
  cursor: pointer;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.cat-card:hover { transform: translateY(-6px); box-shadow: var(--sombra-fuerte); }
.cat-card-img {
  height: 210px;
  background-size: cover;
  background-position: center;
}
.cat-card-body { padding: 22px; }
.cat-card-body h3 { font-size: 1.2rem; margin-bottom: 4px; }
.cat-card-body p { color: var(--texto-suave); font-size: 0.88rem; margin-bottom: 14px; }

/* ---------- DESTACADOS (carrusel) ---------- */
.featured-section { background: var(--marfil); }
.featured-track {
  display: flex;
  gap: 22px;
  overflow-x: auto;
  padding: 10px 4px 24px;
  scroll-snap-type: x mandatory;
}
.featured-track::-webkit-scrollbar { height: 8px; }
.featured-track::-webkit-scrollbar-thumb { background: var(--beige); border-radius: 10px; }
.featured-track .product-card { min-width: 270px; scroll-snap-align: start; }

/* ---------- GRID DE PRODUCTOS ---------- */
.catalog-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 30px;
}
.results-count { color: var(--texto-suave); font-size: 0.92rem; }

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(255px, 1fr));
  gap: 26px;
}

.product-card {
  background: var(--blanco);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--sombra);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  display: flex;
  flex-direction: column;
}
.product-card:hover { transform: translateY(-6px); box-shadow: var(--sombra-fuerte); }

.product-media {
  position: relative;
  aspect-ratio: 4/5;
  overflow: hidden;
  cursor: pointer;
  background: var(--marfil);
}
.product-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease, opacity 0.4s ease;
  opacity: 0;
}
.product-media img.loaded { opacity: 1; }
.product-card:hover .product-media img { transform: scale(1.06); }

.fav-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  background: rgba(255,255,255,0.85);
  border: none;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1.05rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s;
  backdrop-filter: blur(4px);
}
.fav-btn:hover { transform: scale(1.12); }

.product-badge {
  position: absolute;
  bottom: 12px;
  left: 12px;
  background: rgba(58,49,41,0.75);
  color: #fff;
  font-size: 0.7rem;
  padding: 4px 10px;
  border-radius: 20px;
  letter-spacing: 0.5px;
  backdrop-filter: blur(4px);
}

.product-info { padding: 20px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.product-cat { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 1px; color: var(--terracota); font-weight: 600; }
.product-info h3 { font-size: 1.12rem; line-height: 1.3; }
.product-desc {
  color: var(--texto-suave);
  font-size: 0.85rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex: 1;
}
.product-actions { margin-top: 8px; }

.empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 80px 20px;
  color: var(--texto-suave);
  font-size: 1.1rem;
  line-height: 2;
}

.load-more-wrap { text-align: center; margin-top: 46px; }

/* ---------- SOBRE LA MARCA ---------- */
.about-section {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: center;
}
.about-img {
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--sombra-fuerte);
  aspect-ratio: 4/5;
}
.about-img img { width: 100%; height: 100%; object-fit: cover; }
.about-text .eyebrow { display: block; }
.about-text h2 { margin: 10px 0 20px; font-size: clamp(1.8rem, 3.5vw, 2.4rem); }
.about-text p { color: var(--texto-suave); font-size: 1.05rem; margin-bottom: 26px; }
.about-stats { display: flex; gap: 40px; }
.about-stats div { text-align: left; }
.about-stats strong { display: block; font-family: var(--serif); font-size: 1.8rem; color: var(--terracota); }
.about-stats span { font-size: 0.82rem; color: var(--texto-suave); }

/* ---------- PERSONALIZADOS ---------- */
.custom-section {
  background: linear-gradient(135deg, var(--terracota) 0%, var(--marron-oscuro) 100%);
  color: #fff;
  border-radius: 30px;
  margin: 0 24px;
  padding: 70px 40px;
  text-align: center;
  max-width: 1232px;
  margin-left: auto;
  margin-right: auto;
}
.custom-section h2 { color: #fff; font-size: clamp(1.7rem, 4vw, 2.4rem); margin-bottom: 16px; }
.custom-section p { max-width: 560px; margin: 0 auto 30px; color: rgba(255,255,255,0.92); font-size: 1.05rem; }
.custom-section .btn-outline { border-color: #fff; color: #fff; }
.custom-section .btn-outline:hover { background: #fff; color: var(--marron-oscuro); }

/* ---------- FOOTER ---------- */
footer {
  background: var(--marron-oscuro);
  color: rgba(250,246,240,0.85);
  padding: 70px 0 26px;
  margin-top: 40px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 50px;
}
.footer-grid h4 { color: var(--crema); font-size: 0.95rem; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 18px; }
.footer-logo { font-family: var(--serif); font-size: 1.5rem; color: #fff; margin-bottom: 12px; }
.footer-logo span { color: var(--terracota-suave); }
.footer-grid p { font-size: 0.9rem; line-height: 1.8; color: rgba(250,246,240,0.7); }
.footer-grid ul { list-style: none; }
.footer-grid ul li { margin-bottom: 10px; }
.footer-grid ul a { font-size: 0.9rem; color: rgba(250,246,240,0.75); transition: color 0.2s; }
.footer-grid ul a:hover { color: var(--terracota-suave); }
.footer-social { display: flex; gap: 12px; margin-top: 6px; }
.footer-social a {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: rgba(250,246,240,0.1);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.05rem;
  transition: background 0.2s;
}
.footer-social a:hover { background: var(--terracota); }
.footer-bottom {
  text-align: center;
  font-size: 0.8rem;
  color: rgba(250,246,240,0.5);
  padding-top: 26px;
  border-top: 1px solid rgba(250,246,240,0.12);
}

/* ---------- WHATSAPP FLOTANTE ---------- */
.wa-float {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 60;
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--whatsapp);
  color: #fff;
  padding: 14px 20px;
  border-radius: 50px;
  box-shadow: 0 8px 24px rgba(63,168,118,0.45);
  font-weight: 600;
  font-size: 0.88rem;
  transition: transform 0.2s ease;
  animation: pulse-wa 2.4s infinite;
}
.wa-float:hover { transform: scale(1.05); }
.wa-float .wa-icon { font-size: 1.3rem; }
@keyframes pulse-wa {
  0%, 100% { box-shadow: 0 8px 24px rgba(63,168,118,0.45); }
  50% { box-shadow: 0 8px 30px rgba(63,168,118,0.75); }
}

/* ---------- BOTÓN VOLVER ARRIBA ---------- */
.back-to-top {
  position: fixed;
  bottom: 24px;
  left: 24px;
  z-index: 60;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--marron-oscuro);
  color: var(--crema);
  border: none;
  cursor: pointer;
  font-size: 1.1rem;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: all 0.3s ease;
  box-shadow: var(--sombra);
}
.back-to-top.show { opacity: 1; visibility: visible; transform: translateY(0); }

/* ---------- MODAL PRODUCTO ---------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(58,49,41,0.55);
  backdrop-filter: blur(4px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  visibility: hidden;
  transition: all 0.25s ease;
}
.modal-overlay.open { opacity: 1; visibility: visible; }
.modal-box {
  background: var(--crema);
  border-radius: 24px;
  max-width: 940px;
  width: 100%;
  max-height: 88vh;
  overflow-y: auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  position: relative;
  transform: scale(0.94);
  transition: transform 0.25s ease;
}
.modal-overlay.open .modal-box { transform: scale(1); }
.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: rgba(255,255,255,0.9);
  border: none;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  font-size: 1.1rem;
  cursor: pointer;
  z-index: 5;
}
.modal-gallery { position: relative; background: var(--marfil); }
.modal-gallery img {
  width: 100%;
  height: 100%;
  min-height: 320px;
  max-height: 88vh;
  object-fit: cover;
}
.modal-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255,255,255,0.85);
  border: none;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
}
#modalPrev { left: 14px; }
#modalNext { right: 14px; }
.modal-dots {
  position: absolute;
  bottom: 14px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 6px;
}
.modal-dots .dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: rgba(255,255,255,0.6);
  cursor: pointer;
}
.modal-dots .dot.active { background: #fff; width: 20px; border-radius: 10px; }

.modal-details { padding: 40px 36px; display: flex; flex-direction: column; }
.modal-cat { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 1px; color: var(--terracota); font-weight: 600; }
.modal-code { color: var(--texto-suave); font-size: 0.85rem; margin: 8px 0 4px; }
.modal-details h2 { font-size: 1.7rem; margin-bottom: 16px; }
.modal-details p.desc { color: var(--texto-suave); margin-bottom: 26px; line-height: 1.8; }
.modal-btns { display: flex; flex-direction: column; gap: 12px; margin-top: auto; }
.modal-secondary-btns { display: flex; gap: 10px; }
.modal-secondary-btns button {
  flex: 1;
  background: var(--marfil);
  border: 1px solid rgba(74,59,48,0.15);
  padding: 12px;
  border-radius: 30px;
  cursor: pointer;
  font-family: var(--sans);
  font-size: 0.85rem;
  font-weight: 500;
  transition: all 0.2s;
}
.modal-secondary-btns button:hover { background: var(--beige); }
.modal-secondary-btns button.active { background: var(--terracota-suave); }

/* ---------- RESPONSIVE ---------- */
@media (max-width: 980px) {
  .about-section { grid-template-columns: 1fr; }
  .modal-box { grid-template-columns: 1fr; }
  .modal-gallery img { min-height: 260px; max-height: 46vh; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 860px) {
  .header-top { padding: 14px 16px 10px; }
  .category-menu { padding: 0 16px 14px; }
  .search-box { width: 170px; }
}

@media (max-width: 600px) {
  section { padding: 60px 0; }
  .container { padding: 0 18px; }
  .hero { min-height: 82vh; padding: 40px 18px; }
  .hero-actions { flex-direction: column; width: 100%; }
  .hero-actions .btn-primary, .hero-actions .btn-outline { width: 100%; }
  .product-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
  .product-info { padding: 14px; }
  .product-info h3 { font-size: 0.95rem; }
  .product-desc { display: none; }
  .header-top { padding: 12px 14px 10px; gap: 10px; }
  .logo { font-size: 1.1rem; }
  .search-box { width: 130px; padding: 8px 12px; }
  .search-box input { font-size: 0.78rem; }
  .footer-grid { grid-template-columns: 1fr; gap: 30px; }
  .custom-section { margin: 0 14px; padding: 46px 24px; border-radius: 22px; }
  .wa-float span.wa-text { display: none; }
  .wa-float { padding: 14px; }
  .about-stats { gap: 24px; flex-wrap: wrap; }
}

@media (max-width: 380px) {
  .search-box { width: 100px; }
}
