/* =====================================================
   HILO MÁGICO · styles.css
   1. Tokens   2. Base   3. Ovillos (overlay)   4. Topbar/Header
   5. Botones  6. Hero   7. Beneficios   8. Secciones
   9. Colecciones  10. Destacado  11. Productos  12. CTA
   13. Footer  14. Movimiento reducido
   (Los media queries están en responsive.css)
   ===================================================== */

/* ---------- 1. TOKENS ---------- */
:root {
  --brand:      #139f83;   /* botones, iconos */
  --brand-dark: #0d7d67;   /* hover */
  --mint:       #84d2c0;   /* titulares sobre fondo oscuro, tarjeta menta */
  --mint-soft:  #cbe5df;   /* franja y fondo de productos */
  --mint-wash:  #eef6f4;   /* fondo general */
  --ink:        #0e4b3e;   /* texto principal */
  --ink-soft:   #4f7b70;   /* texto secundario */
  --deep:       #0f3d33;   /* footer */
  --pink:       #c45d78;   /* nota "tejido a pedido" */
  --white:      #ffffff;

  --font-display: "Fredoka", "Poppins", system-ui, sans-serif;
  --font-body:    "Poppins", system-ui, sans-serif;
  --font-script:  "Dancing Script", cursive;

  --radius-lg: 28px;
  --radius-md: 20px;
  --shadow: 0 14px 34px -18px rgba(14, 75, 62, .35);
  --container: 1240px;

  /* Ovillo mini (máscara para iconos de lista) */
  --yarn-mini: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.9' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='M4.200 8c4.500 3 10 3 13.600 0M3.300 13.500c5 3 11 3 15.400 0M8 3.600c3.500 4 3.500 10 0 14.800M14.500 3.600c-3 4-3 10 0 14.800'/%3E%3Cpath d='M17.500 17c2.500.8 4 .2 4 2.500s-2.500 2.200-3.800 1.200'/%3E%3C/svg%3E");
}

/* ---------- 2. BASE ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 90px; }
html { overflow-x: clip; }
body {
  margin: 0;
  position: relative;
  overflow-x: clip;
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--ink);
  background: var(--mint-wash);
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; margin: 0; padding: 0; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { font-family: var(--font-display); font-weight: 500; line-height: 1.15; }

.collections > *, .products > *, .feature__grid > *, .footer__grid > *, .perks__list > *, .topbar__inner > * { min-width: 0; }
.container { width: min(100% - 2.5rem, var(--container)); margin-inline: auto; }
.icon { width: 1.1em; height: 1.1em; flex: none; }

:focus-visible { outline: 3px solid var(--brand); outline-offset: 3px; border-radius: 8px; }

/* ---- Espacios de imagen ----
   .ph  = degradado (con degree) que marca dónde va la imagen.
   Al poner un src en el <img>, la foto tapa el degradado automáticamente. */
.ph { position: relative; overflow: hidden; }
.ph img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
}
.ph img[src=""] { display: none; }

.ph--hero-1 { background: linear-gradient(115deg, #d7c9ba 0%, #eadfd3 45%, #f3d9d9 100%); }
.ph--hero-2 { background: linear-gradient(125deg, #e6dccb 0%, #f4ecdc 50%, #f6e2a8 100%); }
.ph--hero-3 { background: linear-gradient(135deg, #b9e3d7 0%, #dff1ec 50%, #f6d6dc 100%); }
.ph--tile-1 { background: linear-gradient(160deg, #dccfbf 0%, #f2e9db 100%); }
.ph--tile-3 { background: linear-gradient(145deg, #5b5148 0%, #8a7b6b 100%); }
.ph--feature { background: linear-gradient(140deg, #f6ead2 0%, #e6d3b8 100%); }
.ph--card-1, .ph--card-2, .ph--card-3 { background: linear-gradient(150deg, #ecdcc6 0%, #f8eedc 100%); }
.ph--cta { background: linear-gradient(130deg, #8b7a5a 0%, #c9a94f 100%); }

/* ---------- 3. OVILLOS (overlay con parallax) ---------- */
.yarn-overlay {
  position: absolute; inset: 0;
  z-index: 90;
  overflow: hidden;
  pointer-events: none;
}
.yarn {
  position: absolute;
  color: var(--brand);
  opacity: .13;
  animation: yarn-float 9s ease-in-out infinite;
}
.yarn__inner { will-change: transform; }
.yarn svg { width: 100%; height: auto; }

.yarn--a { width: clamp(220px, 28vw, 420px); top:  4%; left: -6%;  }
.yarn--b { width: clamp(180px, 22vw, 330px); top: 24%; right: -5%; animation-delay: -3s; }
.yarn--c { width: clamp(140px, 16vw, 250px); top: 46%; left:  4%;  animation-delay: -5s; }
.yarn--d { width: clamp(220px, 26vw, 400px); top: 68%; right: -4%; animation-delay: -2s; }
.yarn--e { width: clamp(160px, 19vw, 290px); top: 88%; left: -3%;  animation-delay: -6s; }

@keyframes yarn-float {
  0%, 100% { translate: 0 0;     rotate: -2deg; }
  50%      { translate: 0 -18px; rotate:  3deg; }
}

/* ---------- 4. TOPBAR + HEADER ---------- */
.topbar { background: var(--brand); color: var(--white); font-size: .875rem; }
.topbar__inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 40px; }
.topbar__contact, .topbar__social { display: flex; align-items: center; gap: 1.5rem; }
.topbar__contact a { display: inline-flex; align-items: center; gap: .5rem; }
.topbar__contact a:hover { text-decoration: underline; }
.topbar__social { gap: .5rem; }
.topbar__social span { margin-right: .35rem; }

.social {
  display: grid; place-items: center;
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--white); color: var(--brand);
  transition: transform .2s ease;
}
.social:hover { transform: translateY(-2px); }
.social .icon { width: 15px; height: 15px; }

.header {
  position: sticky; top: 0; z-index: 60;
  background: rgba(238, 246, 244, .92);
  backdrop-filter: blur(10px);
  box-shadow: 0 1px 0 rgba(14, 75, 62, .08);
}
.header__inner { display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; min-height: 82px; }

.logo { display: inline-flex; align-items: center; }
.logo img { height: 62px; width: auto; }
.logo img[src=""] { display: none; }
.logo__fallback {
  display: none;
  font-family: var(--font-script);
  font-size: 2.1rem; line-height: 1;
  color: var(--brand);
}
.logo img[src=""] + .logo__fallback { display: block; }
.logo--light .logo__fallback { color: var(--mint); }

.nav { display: flex; align-items: center; gap: 2rem; }
.nav ul { display: flex; align-items: center; gap: 1.6rem; }
.nav ul a { font-weight: 500; padding: .35rem 0; border-bottom: 2px solid transparent; transition: border-color .2s ease, color .2s ease; }
.nav ul a:hover { color: var(--brand); border-color: var(--mint); }

.burger { display: none; width: 46px; height: 46px; border: 0; border-radius: 50%; background: var(--brand); cursor: pointer; padding: 0; }
.burger span { display: block; width: 20px; height: 2px; margin: 4px auto; background: var(--white); border-radius: 2px; transition: transform .25s ease, opacity .2s ease; }
.burger[aria-expanded="true"] span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.burger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.burger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* ---------- 5. BOTONES ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .55rem;
  padding: .85rem 1.7rem;
  font: 500 .95rem/1 var(--font-body);
  border: 2px solid var(--brand);
  border-radius: 999px;
  cursor: pointer;
  transition: background .2s ease, color .2s ease, transform .2s ease, box-shadow .2s ease;
}
.btn--primary { background: var(--brand); color: var(--white); }
.btn--primary:hover { background: var(--brand-dark); border-color: var(--brand-dark); transform: translateY(-2px); box-shadow: 0 10px 20px -10px rgba(13, 125, 103, .7); }
.btn--outline { background: var(--white); color: var(--brand); }
.btn--outline:hover { background: var(--brand); color: var(--white); transform: translateY(-2px); }
.btn--sm { padding: .7rem 1.3rem; font-size: .85rem; }
.card__actions .btn { white-space: nowrap; }

/* ---------- 6. HERO ---------- */
.hero { position: relative; height: clamp(400px, 46vw, 640px); overflow: hidden; background: var(--mint-soft); }
.hero__track, .slide { position: absolute; inset: 0; }

.slide { opacity: 0; visibility: hidden; transition: opacity .8s ease, visibility .8s; }
.slide.is-active { opacity: 1; visibility: visible; }
.slide__media { position: absolute; inset: 0; }
.slide__media img { object-position: right center; }
.slide__media::after {  /* velo oscuro suave para leer el titular */
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, rgba(15, 61, 51, .62) 0%, rgba(15, 61, 51, .3) 45%, rgba(15, 61, 51, 0) 75%);
}
.slide__content {
  position: relative; height: 100%;
  display: flex; flex-direction: column; justify-content: center; align-items: flex-start; gap: 1.1rem;
  max-width: 560px; margin-inline: auto;
  padding-inline: 0;
}
.slide__content { margin-left: max(5rem, calc((100% - var(--container)) / 2)); }
.slide__kicker { color: var(--white); font-size: 1rem; max-width: 12em; }
.slide__title { color: var(--mint); font-size: clamp(2rem, 4.4vw, 3.4rem); max-width: 11em; text-shadow: 0 2px 18px rgba(15, 61, 51, .25); }

.slide.is-active .slide__kicker,
.slide.is-active .slide__title,
.slide.is-active .btn { animation: rise .7s cubic-bezier(.2, .7, .2, 1) both; }
.slide.is-active .slide__title { animation-delay: .1s; }
.slide.is-active .btn { animation-delay: .2s; }
@keyframes rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }

.hero__arrow {
  position: absolute; top: 50%; translate: 0 -50%; z-index: 3;
  display: grid; place-items: center;
  width: 44px; height: 44px; padding: 0;
  border: 0; border-radius: 50%;
  background: var(--mint); color: var(--white);
  cursor: pointer; transition: background .2s ease, transform .2s ease;
}
.hero__arrow:hover { background: var(--brand); transform: scale(1.08); }
.hero__arrow .icon { width: 20px; height: 20px; }
.hero__arrow--prev { left: 1.5rem; }
.hero__arrow--next { right: 1.5rem; }

.hero__dots { position: absolute; bottom: 1.2rem; left: 50%; translate: -50% 0; z-index: 3; display: flex; gap: .6rem; }
.hero__dots button {
  width: 18px; height: 18px; padding: 0;
  border: 0; border-radius: 50%;
  background: var(--mint); cursor: pointer;
  transition: background .2s ease, transform .2s ease;
}
.hero__dots button[aria-selected="true"] { background: var(--brand); transform: scale(1.2); }

/* ---------- 7. BENEFICIOS ---------- */
.perks { background: var(--mint-soft); padding-block: 1.6rem; }
.perks__list { display: flex; justify-content: space-between; align-items: center; gap: 1.5rem; }
.perk { display: flex; align-items: center; gap: 1rem; }
.perk__icon { display: grid; place-items: center; width: 68px; height: 68px; flex: none; border-radius: 50%; background: var(--white); color: var(--brand); }
.perk__icon svg { width: 38px; height: 38px; }
.perk__text { font-weight: 500; font-size: 1.05rem; line-height: 1.35; }

/* ---------- 8. SECCIONES ---------- */
.section { padding-block: clamp(3rem, 6vw, 5rem); background: var(--white); }
.section--soft { background: var(--mint-soft); }
.section__head { text-align: center; margin-bottom: clamp(2rem, 4vw, 3rem); }
.section__title { font-size: clamp(1.6rem, 2.6vw, 2.25rem); }
.divider {
  display: block; width: 56px; height: 10px; margin: .7rem auto .9rem;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 56 10'%3E%3Cpath d='M2 5h14M22 5c3-5 6 5 9 0s6 5 9 0M44 5h10' fill='none' stroke='%2384d2c0' stroke-width='3' stroke-linecap='round'/%3E%3C/svg%3E") center / contain no-repeat;
}
.section__lead { max-width: 36em; margin-inline: auto; color: var(--ink-soft); font-size: .95rem; }

/* ---------- 9. COLECCIONES ---------- */
.collections {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 1.1rem;
  min-height: clamp(420px, 44vw, 560px);
}
.tile { position: relative; display: block; overflow: hidden; border-radius: var(--radius-md); isolation: isolate; }
.tile--big { grid-row: 1 / 3; }
.tile__media { position: absolute; inset: 0; z-index: -1; transition: transform .6s ease; }
.tile:hover .tile__media { transform: scale(1.04); }
.tile__body { position: relative; padding: 2rem 2rem 0; display: flex; flex-direction: column; gap: .35rem; }
.tile__kicker { font-size: .9rem; }
.tile__title { font-size: clamp(1.4rem, 2.2vw, 1.9rem); max-width: 9em; }
.tile__btn { position: absolute; left: 2rem; bottom: 1.6rem; }

.tile--big .tile__media::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(255, 255, 255, .55) 0%, rgba(255, 255, 255, 0) 55%);
}
.tile--big .tile__kicker { color: var(--ink-soft); }

.tile--mint { background: var(--mint); color: var(--ink); }
.tile--mint .tile__body { height: 100%; justify-content: center; max-width: 60%; padding-block: 1.5rem; padding-right: 0; }
.tile--mint .tile__title { max-width: 8em; hyphens: auto; overflow-wrap: break-word; }
.tile__pattern { position: absolute; top: 0; right: 0; width: 46%; height: 100%; color: var(--brand); z-index: -1; opacity: .9; }

.tile--photo { color: var(--white); }
.tile--photo .tile__media::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(15, 30, 26, .72) 0%, rgba(15, 30, 26, .25) 70%); }
.tile--photo .tile__body { padding-top: 1.5rem; }
.tile--photo .tile__title { font-size: clamp(1.25rem, 1.9vw, 1.6rem); max-width: 14em; }
.tile--photo .tile__btn { bottom: 1.2rem; }

/* ---------- 10. DESTACADO ---------- */
.feature { padding-block: clamp(3rem, 6vw, 5rem); background: var(--mint-wash); overflow-x: clip; }
.feature__grid { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); align-items: center; gap: 2rem; }
.feature__text { display: flex; flex-direction: column; align-items: flex-start; gap: 1rem; }
.feature__kicker { font-size: .95rem; max-width: 12em; }
.feature__title { font-size: clamp(2rem, 3.8vw, 3.1rem); color: var(--brand); max-width: 8em; }
.feature__visual { position: relative; }
.feature__hearts { position: absolute; inset: -6% -4% auto auto; width: 82%; color: var(--brand); z-index: 0; }
.feature__media { position: relative; z-index: 1; aspect-ratio: 5 / 4; border-radius: 46% 54% 50% 50% / 52% 48% 52% 48%; }
.feature__media img { object-fit: contain; }

/* ---------- 11. PRODUCTOS ---------- */
.products { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.6rem; }
.card { display: flex; flex-direction: column; overflow: hidden; border-radius: var(--radius-lg); background: var(--white); box-shadow: var(--shadow); transition: transform .3s ease; }
.card:hover { transform: translateY(-6px); }
.card__media { aspect-ratio: 16 / 10; }
.badge {
  position: absolute; top: .9rem; right: .9rem; z-index: 2;
  display: inline-flex; align-items: center; gap: .35rem;
  padding: .3rem .8rem; border-radius: 999px;
  background: rgba(19, 159, 131, .88); color: var(--white);
  font-size: .75rem; font-weight: 500; white-space: nowrap;
}
.card__body { display: flex; flex-direction: column; align-items: flex-start; gap: .7rem; padding: 1rem 1.3rem 1.4rem; flex: 1; }
.card__title { font-size: 1.5rem; color: var(--brand); }
.card__text { font-size: .85rem; color: var(--ink); }
.card__chips { display: flex; gap: .5rem; flex-wrap: wrap; }
.pill { white-space: nowrap; display: inline-flex; align-items: center; gap: .4rem; padding: .25rem .8rem; border: 1px solid var(--mint-soft); border-radius: 999px; font-size: .75rem; color: var(--ink-soft); }
.pill .icon { color: var(--mint); width: 14px; height: 14px; }
.pill--tag { background: var(--mint-soft); border-color: transparent; color: var(--brand-dark); }
.pill--tag .icon { color: var(--brand); }
.card__note { width: 100%; padding-top: .8rem; border-top: 1px solid var(--mint-soft); font-size: .75rem; color: var(--pink); }
.card__actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(9.5rem, 1fr)); gap: .7rem; width: 100%; margin-top: auto; }

/* ---------- 12. CTA ---------- */
.cta { padding-block: clamp(2.5rem, 5vw, 4rem); background: var(--mint-wash); }
.cta__box { position: relative; overflow: hidden; isolation: isolate; min-height: clamp(280px, 28vw, 400px); display: flex; align-items: center; border-radius: var(--radius-lg); }
.cta__media { position: absolute; inset: 0; z-index: -1; }
.cta__media::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(15, 30, 26, .72) 0%, rgba(15, 30, 26, .3) 55%, rgba(15, 30, 26, 0) 90%); }
.cta__content { display: flex; flex-direction: column; align-items: flex-start; gap: 1rem; padding: 2.5rem clamp(1.5rem, 4vw, 3.5rem); max-width: 520px; color: var(--white); }
.cta__title { font-size: clamp(1.9rem, 3.6vw, 2.9rem); }

/* ---------- 13. FOOTER ---------- */
.footer { background: var(--deep); color: #a9c9c0; padding-top: 3.5rem; }
.footer__grid { display: grid; grid-template-columns: 1.3fr 1fr 1fr 1.1fr; gap: 2.5rem; }
.footer__brand { display: flex; flex-direction: column; gap: 1.2rem; }
.footer__brand p { font-size: .85rem; max-width: 26em; }
/* Título con subrayado fino (::after). Para una línea corta en vez del ancho del texto: width: 48px */
.footer__col h3 { position: relative; display: inline-block; color: var(--white); font-size: 1.25rem; padding-bottom: .55rem; margin-bottom: 1.1rem; }
.footer__col h3::after { content: ""; position: absolute; left: 0; bottom: 0; width: 100%; height: 3px; border-radius: 3px; background: var(--mint); }
.footer__col ul { display: flex; flex-direction: column; gap: .7rem; font-size: .85rem; }
/* Links tipo bullet: ovillo pequeño como icono (no aplica a la lista de contacto) */
.footer__col ul:not(.footer__contact) a { display: inline-flex; align-items: center; gap: .6rem; }
.footer__col ul:not(.footer__contact) a::before {
  content: ""; flex: none; width: 15px; height: 15px;
  background-color: var(--mint);
  -webkit-mask: var(--yarn-mini) center / contain no-repeat;
          mask: var(--yarn-mini) center / contain no-repeat;
  transition: transform .3s ease, background-color .2s ease;
}
.footer__col ul:not(.footer__contact) a:hover::before { background-color: var(--white); transform: rotate(60deg); }
.footer__col a:hover { color: var(--white); text-decoration: underline; }
.footer__contact a { overflow-wrap: anywhere; display: inline-flex; align-items: center; gap: .6rem; color: var(--white); font-size: .95rem; }
.footer__contact .icon { color: var(--mint); width: 1.25em; height: 1.25em; }
.footer__social { display: flex; gap: .5rem; margin-top: 1rem; }
.footer__copy { margin-top: 3rem; padding: 1.2rem 1rem; text-align: center; font-size: .8rem; color: #8fb5ac; background: rgba(0, 0, 0, .18); }

/* ---------- 14. MOVIMIENTO REDUCIDO ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition-duration: .01ms !important; }
}
