/* ═══════════════════════════════════════════════════════════
   SAN SEBASTIAN FOREST — Design Enhancements
   Archivo 100 % aditivo. No rompe ni reemplaza reglas base.
   ═══════════════════════════════════════════════════════════ */

/* ── 1. TOPBAR SCROLL-SHRINK ──────────────────────────────── */
.topbar {
  transition:
    height 0.35s cubic-bezier(0.22, 0.6, 0.36, 1),
    box-shadow 0.35s ease,
    background 0.35s ease,
    border-color 0.35s ease;
}
.topbar.is-scrolled {
  height: 56px;
  background: rgba(247, 243, 235, 0.98) !important;
  border-bottom-color: rgba(108, 80, 45, 0.15) !important;
  box-shadow: 0 2px 24px rgba(26, 18, 11, 0.11);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
}

/* Logo: vuelve a colores reales al hacer scroll (quita el invert) */
.topbar.is-scrolled .brand img {
  filter: none !important;
}

/* Texto de nav, iconos y botones de país → oscuros al hacer scroll */
.topbar.is-scrolled .nav-link,
.topbar.is-scrolled .icon-btn,
.topbar.is-scrolled .hamburger,
.forest-site .topbar.is-scrolled .nav-link,
.forest-site .topbar.is-scrolled .icon-btn,
.forest-site .topbar.is-scrolled .hamburger {
  color: #3f3325 !important;
  transition: color 0.3s ease, background 0.2s ease;
}

.topbar.is-scrolled .nav-link:hover,
.topbar.is-scrolled .nav-link.is-active,
.forest-site .topbar.is-scrolled .nav-link:hover,
.forest-site .topbar.is-scrolled .nav-link.is-active {
  color: #1a120b !important;
}

/* Subrayado del nav activo → dorado oscuro */
.topbar.is-scrolled .nav-link::after,
.forest-site .topbar.is-scrolled .nav-link::after {
  background: #b48645 !important;
}

/* Botones de país (ES / US) → modo claro */
.topbar.is-scrolled .country-btn,
.forest-site .topbar.is-scrolled .country-btn {
  color: #3f3325 !important;
}
.topbar.is-scrolled .country-btn strong,
.forest-site .topbar.is-scrolled .country-btn strong {
  color: #3f3325 !important;
}
.topbar.is-scrolled .country-btn.is-active,
.forest-site .topbar.is-scrolled .country-btn.is-active {
  border-color: rgba(108, 80, 45, 0.4) !important;
  background: rgba(180, 134, 69, 0.1) !important;
}

/* Logo escala suavemente — sin afectar layout */
.topbar .brand {
  transition: transform 0.35s cubic-bezier(0.22, 0.6, 0.36, 1);
  transform-origin: left center;
}
.topbar.is-scrolled .brand {
  transform: scale(0.88);
}

/* Transición suave en logo y texto al pasar a modo claro */
.topbar .brand img {
  transition: filter 0.35s ease;
}
.topbar .nav-link,
.topbar .icon-btn,
.topbar .hamburger,
.topbar .country-btn,
.topbar .country-btn strong {
  transition: color 0.3s ease, background 0.2s ease, border-color 0.2s ease;
}

/* ── 2. REGLA DORADA ANIMADA ──────────────────────────────── */
/* La regla arranca en ancho 0; JS añade .is-drawn al entrar en viewport */
html body .story-title-rule {
  width: 0 !important;
  transition: width 0.72s cubic-bezier(0.22, 0.6, 0.36, 1) 0.18s;
}
html body .story-title-rule.is-drawn {
  width: 42px !important;
}
html body .forest-hero-copy .story-title-rule.is-drawn {
  width: 56px !important;
}

/* ── 3. COLLECTION CARD — HOVER REFINADO ─────────────────── */
.collection-card img {
  transition: transform 0.6s cubic-bezier(0.22, 0.6, 0.36, 1) !important;
  will-change: transform;
}
@media (hover: hover) and (pointer: fine) {
  .collection-card:hover img {
    transform: scale(1.05);
  }

  /* Subrayado dorado deslizante bajo el nombre de categoría */
  .collection-card span {
    position: relative;
    display: inline-block;
  }
  .collection-card span::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -3px;
    height: 1px;
    width: 0;
    background: #b48645;
    transition: width 0.32s ease 0.08s;
  }
  .collection-card:hover span::after {
    width: 100%;
  }

  /* Flecha "View more" se desplaza ligeramente */
  .collection-card small {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: gap 0.25s ease, color 0.2s ease;
  }
  .collection-card:hover small {
    gap: 9px;
    color: #9c6f35;
  }
}

/* ── 4. PRODUCT CARD — SOMBRA EN HOVER ───────────────────── */
@media (hover: hover) and (pointer: fine) {
  .product-card:hover .product-media {
    box-shadow: 0 22px 48px rgba(26, 18, 11, 0.17);
  }
  .product-card:hover .image-secondary {
    transform: scale(1.04) !important;
  }
}

/* ── 5. SHIMMER EN BOTONES CTA ────────────────────────────── */
.hero-cta,
.hero-outline-btn,
.story-editorial-btn {
  position: relative;
  overflow: hidden;
}
.hero-cta::before,
.hero-outline-btn::before,
.story-editorial-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -130%;
  width: 65%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.2) 50%,
    transparent 100%
  );
  transform: skewX(-20deg);
  pointer-events: none;
  transition: left 0s;
}
@media (hover: hover) and (pointer: fine) {
  .hero-cta:hover::before,
  .hero-outline-btn:hover::before,
  .story-editorial-btn:hover::before {
    left: 160%;
    transition: left 0.58s ease;
  }
}

/* ── 6. TEXT ARROW BTN — FLECHA DESLIZANTE ───────────────── */
.text-arrow-btn {
  transition: color 0.22s ease, border-color 0.22s ease;
}
.text-arrow-btn span[aria-hidden="true"] {
  display: inline-block;
  transition: transform 0.26s cubic-bezier(0.22, 0.6, 0.36, 1);
}
@media (hover: hover) and (pointer: fine) {
  .text-arrow-btn:hover span[aria-hidden="true"] {
    transform: translateX(6px);
  }
}

/* ── 7. TEXTURA GRAIN EN HERO ─────────────────────────────── */
/* Añade grano fotográfico sobre la imagen de portada */
.forest-editorial-hero {
  position: relative;
}
.forest-hero-shade {
  position: relative;
  z-index: 2;
}
.forest-editorial-hero::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0.042;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='256' height='256'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.7' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='256' height='256' filter='url(%23g)' opacity='1'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 256px 256px;
}

/* ── 8. PROCESS STEP — ICONO CON ANILLO ──────────────────── */
/* El icono Bootstrap queda centrado dentro de un círculo tenue */
.process-step i {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  border: 1px solid rgba(201, 154, 96, 0.28);
  transition: border-color 0.32s ease, background 0.32s ease;
  flex-shrink: 0;
}
@media (hover: hover) and (pointer: fine) {
  .process-step:hover i {
    border-color: rgba(201, 154, 96, 0.72);
    background: rgba(201, 154, 96, 0.1);
  }
}
/* Conector entre steps más elegante */
.process-step + .process-step::before {
  color: rgba(201, 154, 96, 0.5);
  font-size: 0.8rem;
}

/* ── 9. EM ITALIC — RESALTADO DORADO ──────────────────────── */
/* Unifica el color de los em en h1/h2 en toda la site */
.forest-hero-copy h1 em,
.forest-story-panel h2 em,
.forest-project-cta h2 em,
.section-heading-center h2 em,
.story-editorial-copy h2 em,
.home-story-summary .blog-text-content h2 em,
.story-cta-panel h2 em,
.about-story-hero h1 em {
  color: #c99a60;
  font-style: italic;
}

/* ── 10. FOREST STORY SPLIT — KEN BURNS REVEAL ────────────── */
.forest-story-split > img {
  transition: transform 1.1s cubic-bezier(0.22, 0.6, 0.36, 1);
  transform: scale(1.04);
}
.forest-story-split > img.is-visible {
  transform: scale(1);
}

/* ── 11. SECCIÓN NEWSLETTER — LÍNEA INFERIOR ANIMADA ────────  */
.newsletter-input:focus {
  outline: none;
  border-color: #b48645 !important;
  box-shadow: 0 0 0 2px rgba(180, 134, 69, 0.18);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

/* ── 12. FOOTER LINKS — HOVER ELEGANTE ───────────────────── */
.footer-links a {
  position: relative;
  display: inline-block;
  transition: color 0.22s ease, transform 0.22s ease;
}
@media (hover: hover) and (pointer: fine) {
  .footer-links a:hover {
    color: #c99a60 !important;
    transform: translateX(4px);
  }
}

/* ── 13. SOCIAL ICONS — HOVER GLOW ───────────────────────── */
.social-icon {
  transition: color 0.22s ease, transform 0.22s ease;
}
@media (hover: hover) and (pointer: fine) {
  .social-icon:hover {
    color: #c99a60 !important;
    transform: translateY(-3px);
  }
}

/* ── 14. CURSOR PERSONALIZADO (solo desktop con mouse) ───────  */
@media (hover: hover) and (pointer: fine) {
  .ssf-cursor {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 99999;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #b48645;
    pointer-events: none;
    /* El transform se aplica via JS sin transición para tracking 1:1 */
    transition:
      width 0.22s ease,
      height 0.22s ease,
      background 0.22s ease,
      opacity 0.22s ease;
    will-change: transform;
    opacity: 0;
  }
  .ssf-cursor.is-active {
    opacity: 0.85;
  }
  .ssf-cursor.is-hovering {
    width: 28px;
    height: 28px;
    background: transparent;
    border: 1.5px solid #b48645;
    opacity: 0.7;
  }
}
/* Cursor no se muestra si el usuario prefiere menos movimiento */
@media (prefers-reduced-motion: reduce) {
  .ssf-cursor { display: none !important; }
}

/* ── 15. PRODUCT DETAIL — IMAGEN ACTIVA SUBRAYADA ────────── */
.product-thumb.is-active {
  outline: 2px solid #b48645 !important;
  outline-offset: 3px;
  transition: outline 0.18s ease;
}

/* ── 16. ABOUT GALLERY — ZOOM EN HOVER ───────────────────── */
.about-gallery-grid img {
  transition: transform 0.5s cubic-bezier(0.22, 0.6, 0.36, 1),
              box-shadow 0.5s ease;
  will-change: transform;
}
@media (hover: hover) and (pointer: fine) {
  .about-gallery-grid img:hover {
    transform: scale(1.035) translateY(-4px);
    box-shadow: 0 22px 38px rgba(31, 48, 39, 0.18);
  }
}

/* ── 17. FEATURE BOX — BORDE IZQUIERDO ANIMADO ───────────── */
.feature-box {
  border-left: 2px solid transparent;
  transition:
    transform 0.25s ease,
    box-shadow 0.25s ease,
    border-color 0.25s ease;
}
@media (hover: hover) and (pointer: fine) {
  .feature-box:hover {
    border-left-color: #b48645;
  }
}

/* ── 18. PAGE LOADER — REFINADO ──────────────────────────── */
/* Fade más suave al ocultar */
.page-loader {
  transition: opacity 0.3s ease;
}
