@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

/* ==========================================================================
   DIRECTORIO COMERCIAL GUATEMALA GT - ESTILOS COMPARTIDOS (HEADER/FOOTER)
   Compatible con páginas "simple" y páginas legales.
   ========================================================================== */

:root{
  --brand: #1565c0;
  --bg: #f5f5f5;
  --text: #333;
  --card: #ffffff;
  --border: rgba(0,0,0,0.10);
}

html, body{
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
  color: var(--text);
}

h1,h2,h3,h4{
  letter-spacing: -0.01em;
}


.container-simple{
  width: min(1200px, 92%);
  margin: 0 auto;
}

/* Accesibilidad */
.sr-only{
  position:absolute;
  width:1px;height:1px;
  padding:0;margin:-1px;
  overflow:hidden;clip:rect(0,0,0,0);
  white-space:nowrap;border:0;
}

/* HEADER */
.header-simple{
  background: var(--card);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 1000;
}

.header-row{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 14px;
  padding: 12px 0;
}

.logo-simple img{
  display:block;
  height:auto;
}

.header-controls{
  display:flex;
  align-items:center;
  gap: 12px;
  flex-wrap: wrap;
  justify-content:flex-end;
}

.category-dropdown{
  padding: 10px 40px 10px 14px;
  font-size: 15px;
  border: 2px solid var(--brand);
  border-radius: 8px;
  background: var(--brand);
  color: #fff;
  cursor: pointer;
  font-weight: 600;
  min-width: 220px;
  appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 18px;
}

.search-form{
  display:flex;
  align-items:center;
  border: 2px solid var(--brand);
  border-radius: 10px;
  overflow:hidden;
  background: #fff;
  min-width: min(420px, 90vw);
}

.search-form input{
  flex:1;
  border:0;
  padding: 10px 12px;
  outline:none;
  font-size: 15px;
  color: var(--text);
}

.search-form button{
  border:0;
  background: var(--brand);
  color:#fff;
  padding: 10px 14px;
  cursor:pointer;
  display:flex;
  align-items:center;
  justify-content:center;
}

/* FOOTER */
.footer-simple{
  margin-top: 40px;
  background: var(--card);
  border-top: 1px solid var(--border);
}

.footer-grid{
  display:grid;
  grid-template-columns: 1.2fr 0.9fr 0.9fr;
  gap: 22px;
  padding: 26px 0 12px;
}

.footer-brand p{
  margin-top: 10px;
  color: #555;
  line-height: 1.6;
}

.footer-links h3,
.footer-contact h3{
  margin-bottom: 10px;
  color: var(--text);
  font-size: 16px;
}

.footer-links a{
  display:block;
  padding: 6px 0;
  color: #444;
  text-decoration:none;
}

.footer-links a:hover{
  text-decoration:underline;
}

.footer-contact p{
  margin: 8px 0;
  color:#444;
}

.footer-contact a{
  color: var(--brand);
}

.footer-bottom{
  border-top: 1px solid var(--border);
  padding: 12px 0 22px;
  color:#666;
  font-size: 14px;
}

/* Responsive */
@media (max-width: 900px){
  .header-row{ align-items:flex-start; }
  .header-controls{ width:100%; justify-content:flex-start; }
  .search-form{ min-width: 100%; }
  .category-dropdown{ width: 100%; min-width: 0; }
  .footer-grid{ grid-template-columns: 1fr; }
}

/* 404 */
.error-card{
  margin: 40px auto;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 28px;
  box-shadow: 0 10px 22px rgba(0,0,0,0.06);
  text-align:center;
}
.error-card h1{
  font-size: 48px;
  color: var(--brand);
  margin-bottom: 6px;
}
.error-card p{ color:#555; margin: 8px 0 18px; }
.error-actions{
  display:flex;
  gap: 12px;
  justify-content:center;
  flex-wrap:wrap;
}
.btn-primary, .btn-secondary{
  display:inline-flex;
  align-items:center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 10px;
  border: 2px solid var(--brand);
  text-decoration:none;
  font-weight:700;
}
.btn-primary{ background: var(--brand); color:#fff; }
.btn-secondary{ background: #fff; color: var(--brand); }


/* NAV SIMPLE (links principales) */
.nav-simple{
  display:flex;
  align-items:center;
  gap: 14px;
  margin-left: 18px;
  flex-wrap: wrap;
}
.nav-simple a{
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
  font-size: 14px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid transparent;
}
.nav-simple a:hover{
  border-color: var(--border);
  background: rgba(21,101,192,0.06);
}
.nav-simple a.is-active{
  color: var(--brand);
  background: rgba(21,101,192,0.10);
  border-color: rgba(21,101,192,0.25);
}

/* Header layout: logo + nav + controls */
.header-row{
  justify-content: flex-start;
}
.header-controls{
  margin-left: auto;
}

/* Responsive header */
@media (max-width: 820px){
  .header-row{
    flex-wrap: wrap;
  }
  .nav-simple{
    width: 100%;
    margin-left: 0;
    order: 3;
    padding-top: 6px;
  }
  .header-controls{
    width: 100%;
    order: 2;
    justify-content:flex-start;
  }
}


/* ==================== HEADER DESKTOP FIX ====================
   Mejora alineación en PC (en móvil ya funciona bien)
   ============================================================ */
@media (min-width: 821px){
  .header-row{
    align-items: center;
    gap: 16px;
  }
  .nav-simple{
    flex: 1 1 auto;
    min-width: 240px;
  }
  .header-controls{
    flex-wrap: nowrap;
    gap: 10px;
  }
  .category-dropdown{
    min-width: 210px;
    max-width: 240px;
  }
  .search-form{
    width: 360px;
    max-width: 420px;
  }
  .search-form input[type="search"]{
    width: 100%;
  }
}

/* ==================== HEADER MENU DESKTOP CLEAN ====================
   En PC: header limpio (solo logo + menú). Controles pasan debajo del hero.
   En móvil: se mantiene como estaba.
   =================================================================== */
@media (min-width: 821px){
  .header-controls{ display:none !important; }

  .header-row{
    justify-content: space-between;
    align-items: center;
  }
  .nav-simple{
    flex: 1 1 auto;
    justify-content: flex-end;
    margin-left: 18px;
  }
  .nav-simple a{
    font-size: 15px;
    padding: 10px 12px;
  }

  .desktop-searchbar{ display:block !important; }
}
@media (max-width: 820px){
  .desktop-searchbar{ display:none !important; }
}
.desktop-searchbar{
  display:none;
  margin-top: 14px;
}
.desktop-searchbar .search-wrap{
  display:flex;
  align-items:center;
  gap: 12px;
  flex-wrap: wrap;
}
.desktop-searchbar .category-dropdown{
  min-width: 280px;
  max-width: 340px;
}
.desktop-searchbar .search-form{
  width: min(520px, 100%);
}

/* ==================== FOOTER LOGO FIX ==================== */
.footer-simple .footer-logo{
  display:flex;
  align-items:center;
  gap: 10px;
}
.footer-simple .footer-logo img{
  width: auto !important;
  height: auto !important;
  max-height: 44px;
  max-width: 180px;
  object-fit: contain;
}
