/* ==================================================
   DELBROS — styles.css (LIMPIO Y ESTABLE + MENU MOBILE)
================================================== */

/* -------------------------
   RESET / BASE
-------------------------- */
*,
*::before,
*::after{
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body{
  height:100%;
  scroll-behavior:smooth;
}

body{
  font-family: "Roboto", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:#f4f4f4;
  color:#181818;
  line-height:1.5;
  display:flex;
  flex-direction:column;
}

img{ max-width:100%; display:block; }
a{ color:inherit; text-decoration:none; }
button, input, textarea{ font-family:inherit; }

.container{
  max-width:1120px;
  margin:0 auto;
  padding:0 1.5rem;
}

/* -------------------------
   HEADER
-------------------------- */
.site-header{
  position:sticky;
  top:0;
  z-index:100;
  background:#181818;
  height:78px;
  border-bottom:1px solid rgba(255,255,255,.08);
}

.header-inner{
  height:100%;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
  padding:0 16px;
}

.header-left,
.header-center,
.header-right{
  display:flex;
  align-items:center;
}

/* Brand link (click -> home) */
.brand-link{
  text-decoration:none;
  color:inherit;
  display:flex;
  cursor:pointer;
}
.brand-link:hover{ opacity:.92; }

.header-left{ gap:14px; flex-shrink:0; }

.logo{
  height:45px;
  width:auto;
}

.brand-text{
  display:flex;
  align-items:center;
  gap:12px;
  line-height:1.05;
}

.brand-name{
  font-weight:800;
  font-size:40px;
  color:#fff;
  white-space:nowrap;
}

.brand-tagline{
  font-weight:600;
  font-size:15px;
  color:#FFF500;
  letter-spacing:.4px;
  border-left:1px solid rgba(242,194,0,.45);
  padding-left:10px;
  transform:translateY(2px);
}

/* Buscador */
.header-center{ flex:1; justify-content:center; }
.search-wrapper{ width:100%; max-width:650px; }

#search{
  width:100%;
  padding:.45rem .9rem;
  border-radius:999px;
  border:1px solid #3a3a3a;
  background:#121212;
  color:#fff;
  font-size:.9rem;
}
#search::placeholder{ color:#888; }
#search:focus{
  outline:none;
  border-color:#fff;
  box-shadow:0 0 0 1px #fff;
}

.search-wrapper{
  position: relative;
}

.search-clear{
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,.15);
  color: #fff;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  display: none;
}

.search-clear:hover{
  background: rgba(255,255,255,.25);
}

/* cuando hay texto, mostramos la X */
.search-wrapper.has-value .search-clear{
  display: block;
}

/* padding extra para que el texto no se meta debajo de la X */
#search{
  padding-right: 38px;
}

/* Nav desktop */
.header-nav{ display:flex; gap:10px; }

.nav-btn{
  font-weight:700;
  font-size:12px;
  letter-spacing:.6px;
  color:#fff;
  opacity:.9;
  padding:8px 10px;
  border-radius:999px;
}

.nav-btn:hover{
  background:rgba(255,255,255,.08);
  opacity:1;
}


/* =========================
   HEADER MOBILE FIX (LOGO + HAMB + SEARCH ABAJO)
========================= */
@media (max-width: 600px){

  /* clave: el header no puede tener altura fija si hay 2 filas */
  .site-header{
    height: auto;
    padding-bottom: 10px;
  }

  .header-inner{
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
  }

  /* Orden: 1) marca  2) hamburguesa  3) buscador */
  .brand-link{ order: 1; flex: 1; }
  .nav-toggle{ order: 2; display: flex; }

  .header-center{
    order: 3;
    width: 100%;
    margin-top: 6px;
  }

  .search-wrapper{
    max-width: 100%;
  }

  #search{
    width: 100%;
  }
}


/* -------------------------
   MOBILE MENU (HAMBURGUESA)
-------------------------- */
.nav-toggle{
  display:none; /* aparece solo en mobile */
  width:42px;
  height:42px;
  border-radius:12px;
  border:1px solid rgba(255,255,255,.18);
  background:rgba(255,255,255,.06);
  cursor:pointer;
  align-items:center;
  justify-content:center;
  gap:5px;
  flex-shrink:0;
}

.nav-toggle span{
  display:block;
  width:18px;
  height:2px;
  background:#fff;
  border-radius:2px;
  opacity:.95;
}

.nav-toggle:hover{ background:rgba(255,255,255,.10); }

/* Overlay + drawer (siempre en fixed, pero ocultos en desktop por display none) */
.nav-overlay{
  position:fixed;
  inset:0;
  background:rgba(0,0,0,.45);
  z-index:998;
  opacity:0;
  pointer-events:none;
  transition:opacity .18s ease;
}

.mobile-nav{
  position:fixed;
  top:0;
  right:0;
  height:100vh;
  width:min(340px, 86vw);
  background:#121212;
  color:#fff;
  z-index:999;
  transform:translateX(100%);
  transition:transform .20s ease;
  box-shadow:-20px 0 40px rgba(0,0,0,.35);
  padding:14px;
  display:flex;
  flex-direction:column;
  gap:10px;
}

.mobile-nav-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:8px 6px 10px;
  border-bottom:1px solid rgba(255,255,255,.10);
  margin-bottom:6px;
}

.mobile-nav-title{
  font-weight:900;
  letter-spacing:.4px;
}

.mobile-nav-close{
  width:38px;
  height:38px;
  border-radius:12px;
  border:1px solid rgba(255,255,255,.18);
  background:rgba(255,255,255,.06);
  color:#fff;
  cursor:pointer;
}

.mobile-nav-link{
  padding:12px 12px;
  border-radius:14px;
  font-weight:900;
  letter-spacing:.4px;
  border:1px solid rgba(255,255,255,.10);
  background:rgba(255,255,255,.04);
}

.mobile-nav-link:hover{ background:rgba(255,255,255,.08); }

.mobile-cta{
  margin-top:auto;
  background:#25D366;
  border-color:transparent;
  color:#fff;
  text-align:center;
}

.mobile-cta:hover{ filter:brightness(.96); }

/* Estado abierto (cuando JS agrega .nav-open al <html>) */
.nav-open .nav-overlay{
  opacity:1;
  pointer-events:auto;
}

.nav-open .mobile-nav{
  transform:translateX(0);
}

/* Por defecto NO se ven en desktop */
.mobile-nav,
.nav-overlay{
  display:none;
}

/* En mobile habilitamos drawer + overlay + botón */
@media (max-width: 600px){
  .header-nav{ display:none !important; }
  .nav-toggle{ display:flex; }
  .mobile-nav{ display:flex; }
  .nav-overlay{ display:block; }
}

/* -------------------------
   INFO STRIP
-------------------------- */
.info-strip{
  background:#fffde0;
  border-bottom:1px solid #f0e888;
}

.info-strip-inner{
  display:flex;
  gap:1rem;
  padding:.7rem 0;
  font-size:.85rem;
}

.info-item{
  flex:1;
  border-right:1px solid #efe6a3;
  padding-right:1rem;
}

.info-item:last-child{ border-right:none; }

.info-title{ font-weight:700; }
.info-text{ color:#555; }

/* -------------------------
   SECCIONES
-------------------------- */
.section-title{
  font-size:1.4rem;
  margin:18px 0 12px;
  font-weight:900;
}

/* -------------------------
   PRODUCTOS (CARDS)
-------------------------- */
#cards-container{
  display:grid;
  gap:16px;
}

#cards-container.cards-grid{
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

@media (max-width: 1100px){
  #cards-container.cards-grid{ grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* ✅ Mobile: 3 por fila */
@media (max-width: 820px){
  #cards-container.cards-grid{ grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* ✅ Muy chico: 2 por fila */
@media (max-width: 520px){
  #cards-container.cards-grid{ grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.card-link{ display:block; }

.card{
  position:relative;
  border-radius:14px;
  overflow:hidden;
  min-height:180px;
  display:flex;
  align-items:flex-end;
  background:#111;
  box-shadow:0 6px 14px rgba(0,0,0,.18);
  background-size:cover;
  background-position:center;
}

.card::before{
  content:"";
  position:absolute;
  inset:0;
  background:linear-gradient(to top, rgba(0,0,0,.55), transparent 60%);
  z-index:0;
}

.card-inner{
  position:relative;
  z-index:1;
  padding:16px;
  color:#fff;
}

.card-title{
  font-weight:700;
  font-size:1.1rem;
  color:#fff;
  text-shadow:
    -1px -1px 0 #000,
     1px -1px 0 #000,
    -1px  1px 0 #000,
     1px  1px 0 #000,
     0   2px 4px rgba(0,0,0,.7);
}

.card-tag{
  display:inline-block;
  margin-top:6px;
  padding:4px 10px;
  border-radius:999px;
  font-size:.75rem;
  border:1px solid rgba(255,245,0,.9);
  color:#fff500;
  background:rgba(0,0,0,.55);
}

/* -------------------------
   CONTACTO
-------------------------- */
#view-contacto{
  margin-top:3rem;
  background:#f4f4f4;
}

.contacto-layout{
  display:grid;
  grid-template-columns:1.2fr 1.3fr;
  gap:2rem;
  background:#fff;
  padding:2rem;
  border-radius:16px;
  box-shadow:0 4px 20px rgba(0,0,0,.05);
}

.contact-list{
  list-style:none;
  margin-top:1rem;
  display:grid;
  gap:.3rem;
}

.contact-form{
  border:1px solid #e0e0e0;
  border-radius:1rem;
  padding:1.4rem;
}

.field{
  display:grid;
  gap:.25rem;
  margin-bottom:.9rem;
}

label{ font-size:.85rem; color:#555; }

input, textarea{
  border-radius:.7rem;
  border:1px solid #d0d0d0;
  padding:.5rem .7rem;
}

input:focus, textarea:focus{
  outline:none;
  border-color:#fff500;
  box-shadow:0 0 0 2px rgba(255,245,0,.35);
}

/* -------------------------
   MAPA
-------------------------- */
#view-mapa{ margin-top:1.5rem; }

.map-card{
  background:#fff;
  padding:1.8rem;
  border-radius:16px;
  box-shadow:0 4px 20px rgba(0,0,0,.05);
}

.map-embed{
  width:100%;
  height:340px;
  border:0;
  border-radius:14px;
}

/* -------------------------
   WHATSAPP FLOTANTE
-------------------------- */
.wa-float{
  position:fixed;
  right:18px;
  bottom:18px;
  z-index:999;
  background:#25D366;
  color:#fff;
  font-weight:700;
  padding:12px 14px;
  border-radius:999px;
  box-shadow:0 10px 24px rgba(0,0,0,.28);
}

.wa-float:hover{ background:#1ebe5a; }

/* -------------------------
   PRODUCT PAGES (productos/*.html)
-------------------------- */
.back-link{
  display:inline-block;
  margin:10px 0 0;
  font-weight:800;
  letter-spacing:.4px;
  font-size:12px;
  opacity:.9;
  text-decoration:none;
}

.product-hero{ padding:22px 0 8px; }

.product-lead{
  color:#555;
  max-width:920px;
  margin-top:8px;
}

.product-grid{
  display:grid;
  grid-template-columns:1.2fr .8fr;
  gap:22px;
  margin-top:18px;
  align-items:start;
}

.product-card{
  background:#fff;
  border-radius:16px;
  box-shadow:0 4px 20px rgba(0,0,0,.05);
  padding:18px;
  overflow:hidden;
}

.badge{
  display:inline-block;
  padding:4px 10px;
  border-radius:999px;
  font-size:.78rem;
  font-weight:800;
  border:1px solid rgba(255,245,0,.9);
  color:#6b6500;
  background:#fffde0;
  margin-right:6px;
  margin-top:8px;
}

.spec-table{
  width:100%;
  border-collapse:collapse;
  margin-top:10px;
  font-size:.92rem;
}

.spec-table th,
.spec-table td{
  text-align:left;
  padding:10px 10px;
  border-bottom:1px solid #eee;
  vertical-align:top;
}

.spec-table th{ font-weight:900; }

.note{
  margin-top:10px;
  color:#666;
  font-size:.9rem;
}

.btn-whatsapp{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:10px;
  text-decoration:none;
  font-weight:900;
  border-radius:14px;
  padding:12px 14px;
  width:100%;
  max-width:420px;
}

/* -------------------------
   RESPONSIVE
-------------------------- */
@media(max-width:900px){
  .contacto-layout{ grid-template-columns:1fr; }
  .brand-tagline{ display:none; }
  .product-grid{ grid-template-columns:1fr; }
}

/* Mobile tuning fino */
@media (max-width: 520px){
  .site-header .header-inner{
    padding: 10px 12px;
    gap: 10px;
  }

  .site-header .logo{
    width: 34px;
    height: 34px;
  }

  .brand-name{
    font-size: 22px;
    line-height: 1;
  }

  .search-wrapper{ width: 100%; }

  #search{
    width: 100%;
    height: 34px;
    font-size: 14px;
  }

  .card-title{ font-size: 16px; }
  .card-tag{ font-size: 12px; }

  .wa-float{
    right: 14px;
    bottom: 14px;
    transform: scale(0.9);
    transform-origin: bottom right;
  }
}

/* Accesibilidad */
.sr-only{
  position:absolute !important;
  width:1px; height:1px;
  padding:0; margin:-1px;
  overflow:hidden;
  clip:rect(0,0,0,0);
  white-space:nowrap;
  border:0;
}
