/*
Theme Name: Astra Child
Theme URI: https://example.com/
Description: Tema hijo personalizado basado en Astra
Author: Samuel Cancinos
Author URI: https://example.com/
Template: astra
Version: 1.0.0
Text Domain: astra-child
*/

/* =========================
   IMPORTAR FUENTE MONTSERRAT
========================= */
@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@600&display=swap');

/* =========================
   HEADER PERSONALIZADO ASTRA CHILD
========================= */

#custom-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  background: #fff;
  z-index: 9999;
  box-shadow: 0 1px 4px rgba(0,0,0,0.1);
  transition: all 0.3s ease;
  font-family: 'Montserrat', sans-serif;
  font-weight: 600;
}

/* Efecto shrink al hacer scroll */
#custom-header.shrink .site-logo img { height: 46px; }
#custom-header.shrink .header-main { padding: 8px 5%; }

.header-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 15px 5%;
}

/* --- LOGO --- */
.site-logo img {
  height: 60px;
  transition: height 0.3s ease;
}

/* --- DERECHA (buscador + menú) --- */
.header-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 5px;
}

/* ==== BUSCADOR ESCRITORIO ESTILO LÍNEA ==== */
.header-search form {
  display: flex;
  align-items: center;
  border-bottom: 2px solid #ccc;
  max-width: 400px;
  width: 100%;
  background: transparent;
  transition: border-color 0.3s ease;
  font-family: 'Montserrat', sans-serif;
  font-weight: 600;
}

.header-search form:hover,
.header-search form:focus-within {
  border-color: #000;
}

.header-search .search-field {
  flex: 1;
  border: none;
  background: transparent;
  padding: 8px 10px;
  font-size: 14px;
  outline: none;
  font-family: 'Montserrat', sans-serif;
  font-weight: 600;
}

.header-search button {
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px 10px;
  color: #000;
  font-size: 16px;
  font-family: 'Montserrat', sans-serif;
  font-weight: 600;
}

/* ==== MENÚ ESCRITORIO ==== */
.main-navigation ul {
  list-style: none;
  display: flex;
  gap: 25px;
  margin: 0;
  padding: 0;
}

.main-navigation a {
  position: relative;
  text-decoration: none;
  color: #000;
  font-weight: 600;
  text-transform: uppercase;
  transition: color 0.3s ease;
  font-family: 'Montserrat', sans-serif;
}

.main-navigation a:hover {
  color: #2e2e2e;
}

.main-navigation .current-menu-item > a,
.main-navigation .current_page_item > a {
  color: #242424;
}

.main-navigation a::after {
  content: "";
  position: absolute;
  bottom: -5px;
  left: 0;
  width: 0%;
  height: 2px;
  background: #2e2e2e;
  transition: width 0.3s ease;
}

.main-navigation a:hover::after,
.main-navigation .current-menu-item > a::after,
.main-navigation .current_page_item > a::after {
  width: 100%;
}

/* ==== VISIBILIDAD ==== */
.desktop-only {
  display: block;
}

.mobile-only {
  display: none;
}

/* =========================
   MODO MÓVIL
========================= */
@media (max-width: 768px) {

  .desktop-only { display: none !important; }
  .mobile-only { display: inline-block; }

  .header-main {
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
  }

  /* --- BUSCADOR MÓVIL --- */
  .header-search-mobile {
    display: none;
    padding: 10px 20px;
    background: #fff;
    border-top: 1px solid #eee;
    font-family: 'Montserrat', sans-serif;
    font-weight: 600;
  }

  .header-search-mobile form {
    display: flex;
    align-items: center;
    border: 1px solid #ccc;
    border-radius: 25px;
    overflow: hidden;
  }

  .header-search-mobile .search-field {
    flex: 1;
    border: none;
    padding: 8px 12px;
    font-family: 'Montserrat', sans-serif;
    font-weight: 600;
  }

  .header-search-mobile button {
    background: none;
    border: none;
    padding: 8px 12px;
    color: #000;
    font-family: 'Montserrat', sans-serif;
    font-weight: 600;
  }

  /* === MENÚ MÓVIL (SIDEBAR) con dvh/svh y safe-area === */
  #mobile-sidebar {
    position: fixed;
    top: 0;
    left: -100%;
    width: 100%;

    /* Altos correctos en iOS/Safari */
    height: 100vh;          /* fallback */
    height: 100dvh;         /* viewport dinámico real */
    min-height: 100svh;     /* small viewport (iOS) */

    background: rgba(241, 116, 25, 0.60);
    backdrop-filter: blur(10px);
    transition: left 0.4s ease;
    z-index: 10001;
    display: flex;
    flex-direction: column;
    font-family: 'Montserrat', sans-serif;

    /* Si algo falla, que el contenedor completo haga scroll */
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  #mobile-sidebar.active { left: 0; }

  /* Contenedor interno: estructura y safe-area */
  #mobile-sidebar .sidebar-inner {
    display: flex;
    flex-direction: column;

    height: 100vh;          /* fallback */
    height: 100dvh;
    min-height: 100svh;

    padding: 60px 22px 18px;
    padding-bottom: calc(18px + env(safe-area-inset-bottom, 0));
  }

  #mobile-sidebar .sidebar-content {
    flex: 1 1 auto;
    color: #fff;
    padding: 0 6px 10px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  #mobile-sidebar ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 24px;
  }

  #mobile-sidebar a {
    text-decoration: none;
    color: #ffffff;
    font-size: 20px;
    font-weight: 600;
    transition: color 0.3s ease;
  }

  #mobile-sidebar a:hover { color: #F17419; }

  #close-sidebar {
    background: none;
    border: none;
    font-size: 26px;
    color: #fff;
    position: absolute;
    top: 25px;
    right: 25px;
    cursor: pointer;
  }

  /* Footer del sidebar: SOLO login + contacto */
  #mobile-sidebar .sidebar-footer {
    flex: 0 0 auto;
    margin-top: 6px;
    margin-bottom: 14px;   /* lo “sube” un poco del borde */
    padding-top: 12px;
    border-top: 1px solid rgba(255,255,255,0.14);
    display: grid;
    gap: 8px;
    justify-items: center;        /* centra hijos */
  }

  #mobile-sidebar .login-link {
      justify-content: center;      /* centra el login si lo dejas */
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    text-decoration: none;
    color: #fff;
  }

  #mobile-sidebar .login-link i { font-size: 18px; }

  /* Contacto con iconos */
  #mobile-sidebar .sidebar-contact {
    display: grid;
    gap: 6px;
    font-size: 8px;
    line-height: 1.25;
      text-align: center;           /* centra el texto */
  justify-items: center;        /* centra cada fila */
  opacity: .95;
  }

  #mobile-sidebar .sidebar-contact .contact-email,
  #mobile-sidebar .sidebar-contact .contact-pbx {
    display: inline-flex;
    align-items: center;
      justify-content: center;      /* centra icono + texto */
    gap: 8px;
  }

  #mobile-sidebar .sidebar-contact .contact-email,
  #mobile-sidebar .sidebar-contact .contact-pbx a {
    color: #fff;
    text-decoration: none;
    word-break: break-word;
  }

  #mobile-sidebar .sidebar-contact .contact-email span { line-height: 1.25; }

  #mobile-sidebar .sidebar-contact .contact-email:hover span,
  #mobile-sidebar .sidebar-contact .contact-pbx a:hover { text-decoration: underline; }

  #mobile-sidebar .sidebar-contact i {
    font-size: 14px;
    width: 18px;           /* alinea texto */
    text-align: center;
    opacity: 0.9;
  }

  #mobile-sidebar .sidebar-contact .contact-pbx { opacity: 0.9; }

  /* Texto / links un poco menos “pesados” */
#mobile-sidebar .sidebar-contact a{
  color: #fff;
  font-weight: 600;             /* antes 700 */
  text-decoration: none;
}
#mobile-sidebar .sidebar-contact a:hover{
  text-decoration: underline;
}

  /* Overlay también con dvh */
  .sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;

    height: 100vh;     /* fallback */
    height: 100dvh;
    min-height: 100svh;

    background: rgba(241, 116, 25, 0.35);
    display: none;
    z-index: 10000;
  }

  #mobile-sidebar.active ~ .sidebar-overlay { display: block; }

  body.no-scroll { overflow: hidden; }

  /* === SUBMENÚS EN EL SIDEBAR MÓVIL === */
  #mobile-sidebar .menu-item-has-children > a::after {
    content: "▾";
    float: right;
    transition: transform 0.3s ease;
  }

  #mobile-sidebar .menu-item-has-children.open > a::after {
    transform: rotate(180deg);
  }

  #mobile-sidebar .menu-item-has-children ul.sub-menu {
    display: none;
    margin-top: 10px;
    padding-left: 15px;
    border-left: 2px solid rgba(255, 255, 255, 0.2);
  }

  #mobile-sidebar .menu-item-has-children ul.sub-menu li a {
    font-size: 18px;
    color: #ddd;
  }

  #mobile-sidebar .menu-item-has-children ul.sub-menu li a:hover { color: #F17419; }
} /* <-- cierre correcto del bloque móvil */


/* =========================
   FORZAR OCULTAR EN ESCRITORIO
========================= */
@media (min-width: 769px) {
  #mobile-sidebar,
  .sidebar-overlay,
  #mobile-menu-toggle,
  #mobile-search-toggle,
  .header-search-mobile {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    position: absolute !important;
    left: -9999px !important;
    height: 0 !important;
    width: 0 !important;
    overflow: hidden !important;
  }
}

/* === SUBMENÚS - DESKTOP POR DEFECTO OCULTOS === */
.main-navigation ul ul {
  display: none;
  position: absolute;
  background: #fff;
  box-shadow: 0 2px 5px rgba(0,0,0,0.15);
  padding: 10px 0;
  min-width: 180px;
  z-index: 999;
}

.main-navigation li:hover > ul { display: block; }

.main-navigation ul ul li { display: block; padding: 0; }

.main-navigation ul ul a {
  color: #000;
  padding: 10px 20px;
  display: block;
  text-transform: none;
  font-size: 14px;
  font-weight: 500;
}

.main-navigation ul ul a:hover {
  background: #f8f8f8;
  color: #F17419;
}

/* =========================
   AJUSTE: TIPOGRAFÍA MENÚ ESCRITORIO (más pequeño)
========================= */
@media (min-width: 769px) {
  /* enlaces de primer nivel del menú principal */
  #site-navigation > ul > li > a,
  .main-navigation > ul > li > a,
  .main-navigation .menu > li > a,
  .main-navigation #primary-menu > li > a {
    font-size: 13px;
    letter-spacing: .02em;
    line-height: 1.2;
  }
}
