/* Plantillas de sitio — distribución, fondos y variantes visuales */

/* ========== Fondos animados ========== */
.template-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.template-bg--mesh {
  background:
    radial-gradient(ellipse 80% 60% at 10% 20%, rgba(0, 200, 83, 0.14), transparent 55%),
    radial-gradient(ellipse 70% 50% at 90% 10%, rgba(255, 193, 7, 0.12), transparent 50%),
    radial-gradient(ellipse 60% 70% at 50% 100%, rgba(0, 151, 69, 0.1), transparent 55%);
  animation: tplMeshShift 18s ease-in-out infinite alternate;
}

.template-bg--aurora {
  background:
    linear-gradient(125deg, rgba(0, 230, 118, 0.08), transparent 40%),
    linear-gradient(235deg, rgba(105, 240, 174, 0.1), transparent 45%),
    linear-gradient(15deg, rgba(0, 200, 83, 0.06), transparent 50%);
  animation: tplAurora 14s ease-in-out infinite alternate;
}

.template-bg--waves {
  background: linear-gradient(180deg, transparent 60%, rgba(0, 151, 167, 0.06) 100%);
}

.template-bg--waves::before,
.template-bg--waves::after {
  content: '';
  position: absolute;
  left: -20%;
  width: 140%;
  height: 40%;
  border-radius: 45%;
  background: rgba(0, 151, 167, 0.07);
  animation: tplWaveDrift 12s ease-in-out infinite;
}

.template-bg--waves::before { top: 12%; }
.template-bg--waves::after {
  top: 28%;
  animation-delay: -4s;
  opacity: 0.7;
}

.template-bg--grid {
  background-image:
    linear-gradient(rgba(0, 200, 83, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 200, 83, 0.05) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(180deg, #000 0%, transparent 85%);
}

.template-bg--topo {
  opacity: 0.35;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120' viewBox='0 0 120 120'%3E%3Cpath fill='none' stroke='%2300c853' stroke-width='0.6' opacity='0.35' d='M0 60 Q30 20 60 60 T120 60'/%3E%3Cpath fill='none' stroke='%2300c853' stroke-width='0.6' opacity='0.25' d='M0 80 Q40 40 80 80 T160 80'/%3E%3C/svg%3E");
  background-size: 120px 120px;
}

.template-bg--stripes {
  background: repeating-linear-gradient(
    -12deg,
    transparent,
    transparent 18px,
    rgba(0, 200, 83, 0.04) 18px,
    rgba(0, 200, 83, 0.04) 19px
  );
}

.template-bg--frost {
  background:
    radial-gradient(ellipse 100% 80% at 50% 0%, rgba(255,255,255,0.9), transparent 60%),
    linear-gradient(180deg, rgba(225,245,254,0.5) 0%, transparent 50%),
    linear-gradient(135deg, rgba(79,195,247,0.08) 0%, transparent 50%);
  animation: tplFrostShimmer 10s ease-in-out infinite alternate;
}

.template-bg--sunset {
  background: linear-gradient(135deg, rgba(255,112,67,0.12) 0%, rgba(255,193,7,0.1) 40%, rgba(255,87,34,0.08) 100%);
  animation: tplSunsetPulse 12s ease-in-out infinite alternate;
}

.template-bg--sunset::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 40%;
  background: linear-gradient(0deg, rgba(255,152,0,0.06), transparent);
}

@keyframes tplFrostShimmer {
  from { opacity: 0.85; }
  to { opacity: 1; }
}

@keyframes tplSunsetPulse {
  from { filter: hue-rotate(0deg); }
  to { filter: hue-rotate(8deg); }
}

.template-bg--orbs .template-bg__orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(40px);
  animation: tplOrbFloat 16s ease-in-out infinite;
}

.template-bg__orb--1 {
  width: 280px;
  height: 280px;
  top: 8%;
  left: -4%;
  background: rgba(255, 193, 7, 0.22);
}

.template-bg__orb--2 {
  width: 220px;
  height: 220px;
  top: 42%;
  right: -2%;
  background: rgba(0, 200, 83, 0.18);
  animation-delay: -5s;
}

.template-bg__orb--3 {
  width: 180px;
  height: 180px;
  bottom: 10%;
  left: 30%;
  background: rgba(255, 138, 80, 0.15);
  animation-delay: -9s;
}

.template-bg--particles .template-bg__particle {
  position: absolute;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--color-live-green);
  opacity: 0.35;
  left: calc(var(--i) * 5.5%);
  top: calc((var(--i) * 13%) % 90% + 5%);
  animation: tplParticle 6s ease-in-out infinite;
  animation-delay: calc(var(--i) * -0.35s);
}

.template-bg--botanical .template-bg__leaf {
  position: absolute;
  border-radius: 50% 0 50% 50%;
  background: radial-gradient(circle at 30% 30%, rgba(109, 76, 65, 0.2), transparent 70%);
  animation: tplLeafSway 10s ease-in-out infinite;
}

.template-bg__leaf--1 { width: 140px; height: 140px; top: 12%; left: 4%; }
.template-bg__leaf--2 { width: 100px; height: 100px; top: 55%; right: 8%; animation-delay: -3s; }
.template-bg__leaf--3 { width: 80px; height: 80px; bottom: 15%; left: 40%; animation-delay: -6s; }

@keyframes tplMeshShift {
  from { transform: scale(1) translateY(0); }
  to { transform: scale(1.05) translateY(-2%); }
}

@keyframes tplAurora {
  from { filter: hue-rotate(0deg); opacity: 0.85; }
  to { filter: hue-rotate(18deg); opacity: 1; }
}

@keyframes tplWaveDrift {
  0%, 100% { transform: translateX(0) rotate(0deg); }
  50% { transform: translateX(3%) rotate(2deg); }
}

@keyframes tplOrbFloat {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(12px, -18px); }
}

@keyframes tplParticle {
  0%, 100% { transform: translateY(0); opacity: 0.25; }
  50% { transform: translateY(-14px); opacity: 0.55; }
}

@keyframes tplLeafSway {
  0%, 100% { transform: rotate(0deg); }
  50% { transform: rotate(8deg); }
}

/* ========== Hero ========== */
.site-tpl.tpl-hero-fullscreen .hero__media-shell {
  padding: 0;
}

.site-tpl.tpl-hero-fullscreen .hero__media-inner {
  border-radius: 0;
  border: none;
}

.site-tpl.tpl-hero-minimal .hero {
  min-height: clamp(320px, 55vh, 520px);
  align-items: center;
}

.site-tpl.tpl-hero-minimal .hero__overlay {
  background: linear-gradient(180deg, rgba(20,50,28,0.25) 0%, rgba(20,50,28,0.65) 100%);
}

.site-tpl.tpl-hero-split .hero {
  min-height: auto;
  padding-top: 5.5rem;
  padding-bottom: 2rem;
}

@media (min-width: 900px) {
  .site-tpl.tpl-hero-split .hero {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    align-items: center;
    min-height: min(88vh, 760px);
  }

  .site-tpl.tpl-hero-split .hero__media-shell {
    position: relative;
    inset: auto;
    grid-column: 2;
    grid-row: 1;
    height: min(68vh, 560px);
    padding: 0;
    z-index: 0;
  }

  .site-tpl.tpl-hero-split .hero__content {
    grid-column: 1;
    grid-row: 1;
    padding-bottom: 2rem;
    color: var(--color-text);
  }

  .site-tpl.tpl-hero-split .hero__title {
    color: var(--color-dark-green);
    text-shadow: var(--theme-title-shadow, none);
    max-width: 16ch;
  }

  .site-tpl.tpl-hero-split .hero__tagline {
    color: var(--color-live-green-dark);
    text-shadow: none;
  }

  .site-tpl.tpl-hero-split .hero__subtitle {
    color: var(--color-muted);
  }

  .site-tpl.tpl-hero-split .hero .btn--secondary {
    color: var(--color-text);
    border-color: var(--theme-card-border, var(--color-border));
  }

  .site-tpl.tpl-hero-split .hero__brand {
    position: relative;
    top: auto;
    right: auto;
    margin-bottom: 1rem;
  }
}

/* Hero centrado */
.site-tpl.tpl-hero-centered .hero__content {
  position: relative;
  text-align: center;
  margin-inline: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.site-tpl.tpl-hero-centered .hero__title {
  max-width: 20ch;
}

.site-tpl.tpl-hero-centered .hero__subtitle {
  margin-inline: auto;
}

.site-tpl.tpl-hero-centered .hero__actions {
  justify-content: center;
}

.site-tpl.tpl-hero-centered .hero__brand {
  position: relative;
  top: auto;
  right: auto;
  margin-bottom: 1rem;
}

/* Hero apilado (logo arriba) */
.site-tpl.tpl-hero-stacked .hero__content {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.site-tpl.tpl-hero-stacked .hero__brand {
  position: relative;
  top: auto;
  right: auto;
  order: -1;
  margin-bottom: 1.25rem;
}

/* Hero magazine (tipografía grande ancha) */
.site-tpl.tpl-hero-magazine .hero {
  min-height: min(92vh, 820px);
  align-items: end;
}

.site-tpl.tpl-hero-magazine .hero__title {
  max-width: 22ch;
  font-size: clamp(2.5rem, 6vw + 1rem, calc(var(--theme-font-hero, 72px) * 1.1));
  line-height: 0.95;
}

.site-tpl.tpl-hero-magazine .hero__brand {
  position: relative;
  top: auto;
  right: auto;
  margin-bottom: 1rem;
}

@media (min-width: 900px) {
  .site-tpl.tpl-hero-magazine .hero__content {
    max-width: 70%;
  }
}

/* ========== Navegación ========== */
.site-tpl.tpl-nav-bar .site-header {
  padding: 0;
}

.site-tpl.tpl-nav-bar .nav-island {
  width: 100%;
  max-width: none;
  border-radius: 0;
  margin: 0;
  min-height: calc(var(--theme-nav-height, 64px) * 0.95);
}

.site-tpl.tpl-nav-floating .site-header {
  padding: 0.5rem 1rem;
}

.site-tpl.tpl-nav-floating .nav-island {
  box-shadow: var(--theme-card-shadow, 0 8px 32px rgba(0,0,0,0.08));
}

/* Nav píldora centrada */
.site-tpl.tpl-nav-pill .site-header {
  padding: 0.75rem 1rem;
  display: flex;
  justify-content: center;
}

.site-tpl.tpl-nav-pill .nav-island {
  width: auto;
  max-width: min(900px, calc(100% - 2rem));
  padding-inline: 1.5rem;
  border-radius: 999px;
}

/* Nav transparente */
.site-tpl.tpl-nav-transparent .site-header {
  background: transparent;
}

.site-tpl.tpl-nav-transparent .hero {
  padding-top: 5.5rem;
}

.site-tpl.tpl-nav-transparent .nav-island {
  background: rgba(255, 255, 255, 0.55);
  border-color: transparent;
  transition: background 0.35s ease, backdrop-filter 0.35s ease;
}

.site-tpl.tpl-nav-transparent .site-header.is-scrolled .nav-island,
.site-tpl.tpl-nav-transparent .nav-island.is-scrolled {
  background: rgba(255, 255, 255, 0.92);
  border-color: var(--theme-card-border, var(--color-border));
}

.site-tpl.theme-gold.tpl-nav-transparent .nav-island {
  background: rgba(26, 26, 26, 0.65);
  color: #e0e0e0;
}

/* Nav centrado (logo arriba, links abajo) */
@media (min-width: 900px) {
  .site-tpl.tpl-nav-centered .nav-island {
    flex-direction: column;
    align-items: center;
    border-radius: 1.25rem;
    padding: 1rem 1.5rem 1.1rem;
    gap: 0.75rem;
    width: min(var(--theme-nav-width, 1120px), calc(100% - 1rem));
  }

  .site-tpl.tpl-nav-centered .nav-logo {
    flex-direction: column;
    text-align: center;
  }

  .site-tpl.tpl-nav-centered .nav-menu {
    width: 100%;
    flex-direction: column;
    align-items: center;
  }

  .site-tpl.tpl-nav-centered .nav-links {
    justify-content: center;
    flex-wrap: wrap;
  }

  .site-tpl.tpl-nav-centered .nav-actions {
    justify-content: center;
  }
}

/* Nav lateral (sidebar) */
@media (min-width: 1100px) {
  .site-tpl.tpl-nav-sidebar {
    padding-left: 240px;
  }

  .site-tpl.tpl-nav-sidebar .site-header {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: 220px;
    z-index: 50;
    padding: 1.25rem 0.75rem;
    display: flex;
    align-items: stretch;
  }

  .site-tpl.tpl-nav-sidebar .nav-island {
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    height: 100%;
    max-width: none;
    margin: 0;
    border-radius: 0 1.25rem 1.25rem 0;
    padding: 1.25rem 1rem;
    overflow-y: auto;
  }

  .site-tpl.tpl-nav-sidebar .nav-logo {
    flex-direction: column;
    text-align: center;
    margin-bottom: 1rem;
  }

  .site-tpl.tpl-nav-sidebar .nav-toggle {
    display: none;
  }

  .site-tpl.tpl-nav-sidebar .nav-menu {
    flex-direction: column;
    align-items: stretch;
    flex: 1;
  }

  .site-tpl.tpl-nav-sidebar .nav-links {
    flex-direction: column;
    align-items: stretch;
    gap: 0.25rem;
  }

  .site-tpl.tpl-nav-sidebar .nav-links a {
    padding: 0.55rem 0.75rem;
    border-radius: 8px;
  }

  .site-tpl.tpl-nav-sidebar .nav-links a:hover {
    background: color-mix(in srgb, var(--color-primary) 12%, transparent);
  }

  .site-tpl.tpl-nav-sidebar .nav-actions {
    flex-direction: column;
    margin-top: auto;
    gap: 0.75rem;
  }

  .site-tpl.tpl-nav-sidebar .lang-switch {
    justify-content: center;
  }

  .site-tpl.tpl-nav-sidebar.tpl-hero-split .hero {
    min-height: min(82vh, 700px);
  }

  .site-tpl.tpl-nav-sidebar.tpl-hero-split .hero__media-shell {
    height: min(58vh, 460px);
  }
}

@media (max-width: 1099px) {
  .site-tpl.tpl-nav-sidebar .site-header {
    position: sticky;
    top: 0;
    z-index: 50;
  }
}

/* ========== Contenedor ========== */
.site-tpl.tpl-container-wide {
  --container: min(1280px, calc(100% - 2rem));
}

.site-tpl.tpl-container-narrow {
  --container: min(960px, calc(100% - 2rem));
}

/* ========== Catálogo ========== */
.site-tpl.tpl-catalog-dense .catalog-grid {
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.85rem;
}

.site-tpl.tpl-catalog-dense .category-grid {
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
}

@media (min-width: 768px) {
  .site-tpl.tpl-catalog-masonry .catalog-grid {
    display: block;
    columns: 2;
    column-gap: 1rem;
  }

  .site-tpl.tpl-catalog-masonry .catalog-card {
    display: inline-block;
    width: 100%;
    margin: 0 0 1rem;
    break-inside: avoid;
  }
}

@media (min-width: 1100px) {
  .site-tpl.tpl-catalog-masonry .catalog-grid {
    columns: 3;
  }
}

/* Catálogo lista vertical */
.site-tpl.tpl-catalog-list .catalog-grid {
  grid-template-columns: 1fr;
  max-width: 720px;
  margin-inline: auto;
}

.site-tpl.tpl-catalog-list .catalog-card {
  flex-direction: row;
  min-height: 120px;
  align-items: stretch;
}

.site-tpl.tpl-catalog-list .catalog-card:hover {
  transform: translateY(-3px);
}

.site-tpl.tpl-catalog-list .catalog-card__media {
  width: 140px;
  min-height: 100%;
  flex-shrink: 0;
  aspect-ratio: unset;
  height: auto;
}

.site-tpl.tpl-catalog-list .catalog-card__media img {
  height: 100%;
  min-height: 120px;
  object-fit: cover;
}

@media (max-width: 600px) {
  .site-tpl.tpl-catalog-list .catalog-card {
    flex-direction: column;
  }
  .site-tpl.tpl-catalog-list .catalog-card__media {
    width: 100%;
    height: 140px;
  }
}

/* Grid bento categorías (10+ items) */
.site-tpl.tpl-catalog-bento .category-grid {
  grid-template-columns: repeat(2, 1fr);
  grid-auto-rows: minmax(120px, auto);
  gap: 1rem;
}

@media (min-width: 600px) {
  .site-tpl.tpl-catalog-bento .category-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (min-width: 900px) {
  .site-tpl.tpl-catalog-bento .category-grid {
    grid-template-columns: repeat(6, 1fr);
    grid-auto-rows: minmax(110px, auto);
  }

  .site-tpl.tpl-catalog-bento .category-card:nth-child(10n+1) {
    grid-column: span 3;
    grid-row: span 2;
  }

  .site-tpl.tpl-catalog-bento .category-card:nth-child(10n+5),
  .site-tpl.tpl-catalog-bento .category-card:nth-child(10n+6) {
    grid-column: span 2;
  }
}

/* Bento legacy por id de plantilla */
.site-tpl.tpl-citrus-bento .category-grid,
.site-tpl.tpl-catalog-bento.tpl-citrus-bento .category-grid {
  grid-template-columns: repeat(2, 1fr);
  grid-auto-rows: minmax(120px, auto);
}

@media (min-width: 600px) {
  .site-tpl.tpl-citrus-bento .category-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (min-width: 900px) {
  .site-tpl.tpl-citrus-bento .category-grid {
    grid-template-columns: repeat(6, 1fr);
  }

  .site-tpl.tpl-citrus-bento .category-card:nth-child(10n+1) {
    grid-column: span 3;
    grid-row: span 2;
  }

  .site-tpl.tpl-citrus-bento .category-card:nth-child(10n+5),
  .site-tpl.tpl-citrus-bento .category-card:nth-child(10n+6) {
    grid-column: span 2;
  }
}

/* ========== Tarjetas ========== */
.site-tpl.tpl-cards-glass .catalog-card,
.site-tpl.tpl-cards-glass .category-card__shell,
.site-tpl.tpl-cards-glass .pillar-card,
.site-tpl.tpl-cards-glass .featured-card__shell {
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(14px);
}

.site-tpl.theme-midnight.tpl-cards-glass .catalog-card,
.site-tpl.theme-midnight.tpl-cards-glass .category-card__shell {
  background: rgba(30, 46, 36, 0.75);
}

.site-tpl.theme-gold.tpl-cards-glass .catalog-card,
.site-tpl.theme-gold.tpl-cards-glass .category-card__shell,
.site-tpl.theme-gold.tpl-cards-glass .pillar-card {
  background: rgba(42, 42, 42, 0.88);
  color: #e0e0e0;
}

.site-tpl.theme-gold.tpl-nav-bar .nav-island,
.site-tpl.theme-gold.tpl-nav-bar .site-header.is-scrolled .nav-island {
  background: rgba(26, 26, 26, 0.94);
  color: #f5f5f5;
  border-color: color-mix(in srgb, var(--color-primary) 35%, transparent);
}

.site-tpl.theme-gold.tpl-nav-bar .nav-links a,
.site-tpl.theme-gold.tpl-nav-bar .nav-logo__text strong {
  color: #f5f5f5;
}

.site-tpl.theme-gold.tpl-nav-bar .nav-logo__text small {
  color: #9e9e9e;
}

.site-tpl.tpl-cards-sharp .catalog-card,
.site-tpl.tpl-cards-sharp .category-card__shell,
.site-tpl.tpl-cards-sharp .pillar-card {
  border-radius: 4px;
}

.site-tpl.tpl-cards-bordered .catalog-card,
.site-tpl.tpl-cards-bordered .category-card__shell {
  border-width: 2px;
  box-shadow: none;
}

.site-tpl.tpl-cards-soft .catalog-card,
.site-tpl.tpl-cards-soft .category-card__shell {
  border-radius: var(--theme-card-radius, 12px);
}

/* ========== Ondas ========== */
.site-tpl.tpl-waves-off .section-wave {
  display: none;
}

/* ========== Z-index contenido sobre fondos ========== */
.site-tpl .site-header,
.site-tpl #main,
.site-tpl .site-footer {
  position: relative;
  z-index: 2;
}

.site-tpl .grain {
  z-index: 1;
}

.site-tpl .page-decor {
  z-index: 1;
}

@media (prefers-reduced-motion: reduce) {
  .template-bg,
  .template-bg::before,
  .template-bg::after,
  .template-bg__orb,
  .template-bg__particle,
  .template-bg__leaf {
    animation: none !important;
  }
}

@media (max-width: 767px) {
  .template-bg--orbs .template-bg__orb,
  .template-bg--botanical .template-bg__leaf {
    transform: scale(0.7);
  }

  .site-tpl.tpl-hero-split .hero {
    min-height: 70vh;
  }
}
