/* ============================================
   LAYOUT.CSS - Estructura, contenedores y nav
   ============================================ */


/* ── Contenedor global ───────────────────── */

.container {
  max-width: 1500px;
  margin: 0 auto;
  padding: 0 20px;
}


/* ── Navegación ──────────────────────────── */

#main-nav {
  background-color: #e6d6f3;
  color: white;
  padding: 1rem 0;
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  transition: background-color 0.4s ease, box-shadow 0.4s ease;
  /* ← SIN "transition: all" para evitar animar height/transform accidentalmente */
}

#main-nav.scrolled {
  background-color: white;
  box-shadow: 0 2px 15px rgba(0, 0, 0, 0.15);
}

#main-nav.scrolled .nav-menu a {
  color: var(--color-primary);
}

#main-nav.scrolled .menu-toggle span {
  background-color: var(--color-primary);
}

.nav-wrapper {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* Logo en el nav */
#main-nav a[href="/"] {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

#main-nav .logo {
  height: 50px;
  width: auto;
  display: block;
  cursor: pointer;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

#main-nav .logo:hover {
  transform: scale(1.05);
  opacity: 0.9;
}

/* Menú de navegación */
.nav-menu {
  display: flex;
  list-style: none;
  gap: 2rem;
}

.nav-menu a {
  color: #444444;
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  transition: color 0.3s;
  position: relative;
}

.nav-menu a:hover,
.nav-menu a.active {
  color: #36A6A0;
}

.nav-menu a.active::after {
  content: '';
  position: absolute;
  bottom: -5px;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--color-accent);
}


/* ── Menú hamburguesa ────────────────────── */

.menu-toggle {
  display: none;
  flex-direction: column;
  cursor: pointer;
  padding: 5px;
  background: transparent;
  border: none;
  z-index: 1001;
}

.menu-toggle span {
  width: 25px;
  height: 3px;
  background: var(--color-primary);
  margin: 3px 0;
  border-radius: 2px;
  transition: all 0.3s ease;
}


/* ── Contenedor principal SPA ────────────── */

#app {
  min-height: 60vh;
  /* SOLO opacity — transform rompería position:fixed de los modales */
  transition: opacity 0.25s ease;
}


/* ── Barra de promoción ──────────────────── */

.promo-bar {
  background: linear-gradient(135deg, #36A6A0 0%, #8B6BAF 100%);
  padding: 12px 0;
  position: sticky;
  /* Usa la variable --nav-height definida en base.css (80px) */
  top: var(--nav-height, 80px);
  z-index: 999;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.promo-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
}

.promo-text {
  display: flex;
  align-items: center;
  gap: 10px;
  color: white;
  font-size: 1rem;
  font-weight: 500;
}

.promo-icon   { font-size: 1.5rem; }

.promo-text strong {
  font-weight: 700;
  text-decoration: underline;
}

.promo-btn {
  background: white;
  color: var(--color-primary);
  padding: 10px 30px;
  border-radius: 25px;
  font-weight: 700;
  font-family: var(--font-heading);
  font-size: 0.95rem;
  transition: all 0.3s;
  white-space: nowrap;
}

.promo-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
  background: var(--color-accent);
  color: var(--color-dark);
}

.promo-social {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-left: auto;
}

.promo-social-icons { display: flex; gap: 10px; }

.promo-social-icon {
  width: 35px;
  height: 35px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s;
  background: rgba(255, 255, 255, 0.2);
  color: white;
}

.promo-social-icon svg { width: 18px; height: 18px; }

.promo-social-icon:hover          { transform: translateY(-3px); background: white; }
.promo-social-icon.facebook:hover  { color: #1877F2; }
.promo-social-icon.instagram:hover { color: #E4405F; }
.promo-social-icon.tiktok:hover    { color: #000000; }


/* ── Footer ──────────────────────────────── */

footer {
  background-color: #e6d6f3;
  color: #444444;
  padding: 60px 0 20px;
  margin-top: 0;
}

.footer-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
  margin: 2rem 0;
}

.footer-section h3 {
  color: #8B6BAF;
  margin-bottom: 1rem;
  font-size: 1.2rem;
}

.footer-section p { margin: 0.5rem 0; opacity: 0.9; }

.logo-footer {
  height: 50px;
  width: auto;
  margin-bottom: 1rem;
}

.footer-bottom {
  text-align: center;
  padding-top: 2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  opacity: 0.7;
}


/* ── Botón flotante WhatsApp ─────────────── */

.whatsapp-float {
  position: fixed;
  bottom: 30px;
  right: 30px;
  background-color: #25D366;
  border-radius: 50px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 20px;
  min-width: 60px;
  height: 60px;
  box-shadow: 0 4px 12px rgba(37, 211, 102, 0.4);
  z-index: 1000;
  transition: box-shadow 0.3s, transform 0.3s;
  animation: pulse-whatsapp 2s infinite;
}

.whatsapp-float:hover {
  transform: scale(1.05) translateY(-3px);
  box-shadow: 0 8px 25px rgba(37, 211, 102, 0.6);
  animation: none;
}

.whatsapp-icon { width: 35px; height: 35px; flex-shrink: 0; }

.whatsapp-text {
  color: white;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1rem;
  white-space: nowrap;
}


/* ── Loading spinner ─────────────────────── */

.loading-spinner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 400px;
}

.spinner {
  width: 50px;
  height: 50px;
  border: 4px solid var(--bg-light);
  border-top-color: var(--color-primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}


/* ── Página de error ─────────────────────── */

.error-page        { text-align: center; padding: 80px 20px; }
.error-page h1     { font-size: 3rem; margin-bottom: 1rem; }


/* ── Contacto (layout grid) ──────────────── */

.contacto-grid {
  display: grid;
  grid-template-columns: 2.2fr 1fr;
  gap: 4rem;
  align-items: start;
}

.contacto-form-wrap { order: 1; }
.contacto-info      { order: 2; }


/* ════════════════════════════════════════════
   RESPONSIVE
   ════════════════════════════════════════════ */

@media (max-width: 968px) {
  .promo-content  { flex-wrap: wrap; justify-content: center; gap: 1rem; }
  .promo-text     { font-size: 0.9rem; }
  .promo-social   { flex-direction: column; gap: 8px; }
}

@media (max-width: 768px) {

  /* Nav móvil */
  .menu-toggle { display: flex; }

  .nav-menu {
    position: fixed;
    right: -100%;
    top: 70px;
    flex-direction: column;
    background-color: #e6d6f3;
    width: 70%;
    max-width: 320px;
    height: calc(100vh - 70px);
    text-align: center;
    transition: right 0.3s ease;
    box-shadow: -5px 0 20px rgba(0, 0, 0, 0.15);
    padding: 2rem 0;
    gap: 0;
    overflow-y: auto;
    z-index: 999;
    align-items: center;
    justify-content: flex-start;
  }

  .nav-menu.active { right: 0; }

  .nav-menu li {
    margin: 1rem 0;
    width: 100%;
    display: flex;
    justify-content: center;
  }

  .nav-menu li:first-child { margin-top: 1rem; }

  .nav-menu a:hover { background: rgba(139, 107, 175, 0.2); }

  .menu-toggle.active span:nth-child(1) { transform: rotate(-45deg) translate(-5px, 6px); }
  .menu-toggle.active span:nth-child(2) { opacity: 0; }
  .menu-toggle.active span:nth-child(3) { transform: rotate(45deg) translate(-5px, -6px); }

  /* Promo bar */
  .promo-bar      { top: 70px; padding: 10px 0; }
  .promo-content  { flex-direction: column; gap: 0.8rem; }
  .promo-text     { text-align: center; font-size: 0.85rem; }
  .promo-social   { flex-direction: row; }
  .promo-label    { display: none; }

  /* Footer */
  .footer-content { grid-template-columns: 1fr; text-align: center; }

  /* WhatsApp */
  .whatsapp-float { bottom: 25px; right: 20px; padding: 0 12px; height: 55px; }
  .whatsapp-text  { font-size: 0.85rem; }

  /* Contacto */
  .contacto-grid  { grid-template-columns: 1fr; gap: 2rem; }
}

@media (max-width: 480px) {
  .whatsapp-float {
    min-width: 55px;
    height: 55px;
    border-radius: 50%;
    padding: 0;
    justify-content: center;
  }
  .whatsapp-text  { display: none; }
}
