/* ==========================================================
   VIBALCA · RESPONSIVE (iPhone / iPad / Android)
   Se carga al FINAL en todas las páginas. No cambia colores
   ni el diseño de escritorio: solo adapta a pantallas pequeñas.
   Breakpoints: 1100 · 960 (menú hamburguesa) · 768 · 560 · 400
   ========================================================== */

/* ---------- Base segura para iOS / Android ---------- */
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}

body {
  overflow-x: hidden;               /* nunca scroll horizontal */
  -webkit-font-smoothing: antialiased;
}

img, svg, video, iframe {
  max-width: 100%;
}

/* iOS necesita el prefijo -webkit- */
.btn-secondary {
  -webkit-backdrop-filter: blur(6px);
}

/* La copia de "Ubícanos" y Facebook solo se usa en el menú móvil */
.nav-extra {
  display: none;
}

/* El botón hamburguesa no existe en escritorio */
.menu-toggle {
  display: none;
}

/* Cuando el menú está abierto no se desplaza el fondo */
html.menu-lock,
html.menu-lock body {
  overflow: hidden;
}

/* Zonas seguras (iPhone con notch / Dynamic Island) */
.main-header {
  padding-top: env(safe-area-inset-top);
}

.footer-bottom-container {
  padding-bottom: calc(24px + env(safe-area-inset-bottom));
}

.cookie-banner {
  padding-bottom: env(safe-area-inset-bottom);
}

/* Solo en dispositivos táctiles: sin "hover pegado" */
@media (hover: none) {

  .trust-card:hover .trust-card-inner {
    transform: none;
  }

  .trust-card:hover .trust-icon {
    background: rgba(14, 42, 71, .06);
    transform: none;
  }

  .trust-card:hover .svg-icon {
    stroke: var(--azul);
  }

  .trust-card.is-flipped .trust-card-inner {
    transform: rotateY(180deg);
  }

  .product-card:hover,
  .claims-card:hover {
    transform: none;
  }
}


/* ==========================================================
   ≤ 1100px · Tablet horizontal
   ========================================================== */
@media (max-width: 1100px) {

  .header-container {
    width: 94%;
  }

  .nav-menu ul {
    gap: 26px;
  }

  .header-actions {
    margin-left: 20px;
  }
}


/* ==========================================================
   ≤ 960px · MENÚ HAMBURGUESA
   ========================================================== */
@media (max-width: 960px) {

  .header-container {
    width: 100%;
    height: 72px;
    padding: 0 20px;
    position: relative;
  }

  .logo {
    width: 118px;
    margin: 0;
    transform: none;
  }

  .logo img {
    width: 118px;
  }

  /* Oculta Ubícanos y Facebook de la barra (van dentro del panel) */
  .header-container > .btn-ubicanos,
  .header-container > .facebook-link {
    display: none;
  }

  /* Botón hamburguesa */
  .menu-toggle {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    width: 46px;
    height: 46px;
    margin-left: auto;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    cursor: pointer;
    transition: background .25s ease;
    -webkit-appearance: none;
    appearance: none;
  }

  .menu-toggle:active {
    background: rgba(14, 42, 71, .06);
  }

  .menu-toggle span {
    display: block;
    width: 24px;
    height: 2.5px;
    border-radius: 3px;
    background: var(--azul);
    transition: transform .3s ease, opacity .2s ease;
  }

  .menu-open .menu-toggle span:nth-child(1) {
    transform: translateY(7.5px) rotate(45deg);
  }

  .menu-open .menu-toggle span:nth-child(2) {
    opacity: 0;
  }

  .menu-open .menu-toggle span:nth-child(3) {
    transform: translateY(-7.5px) rotate(-45deg);
  }

  /* Panel desplegable */
  .nav-menu {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex: none;
    display: block;
    max-height: 0;
    overflow: hidden;
    background: var(--blanco);
    border-bottom: 1px solid var(--gris);
    box-shadow: 0 18px 30px rgba(14, 42, 71, .10);
    transition: max-height .35s ease;
  }

  .menu-open .nav-menu {
    max-height: calc(100vh - 72px);
    max-height: calc(100dvh - 72px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .nav-menu ul {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 8px 20px 0;
  }

  .nav-menu li {
    border-bottom: 1px solid var(--gris);
  }

  .nav-menu li:last-child {
    border-bottom: 0;
  }

  .nav-menu ul a {
    display: block;
    padding: 18px 4px;
    font-size: 18px;
  }

  .nav-menu ul a[aria-current="page"] {
    color: var(--celeste);
    font-weight: 600;
  }

  .nav-extra {
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 18px 24px 26px;
  }

  .nav-extra .btn-ubicanos {
    flex: 1;
    margin: 0;
    padding: 14px 20px;
    text-align: center;
    font-size: 16px;
  }

  .nav-extra .facebook-link {
    display: flex;
    margin: 0;
    width: 50px;
    height: 50px;
    justify-content: center;
    border: 1.5px solid var(--gris);
    border-radius: 50%;
  }
}


/* ==========================================================
   ≤ 768px · Tablet vertical y móviles
   ========================================================== */
@media (max-width: 768px) {

  /* iOS hace zoom si el campo tiene menos de 16px */
  input,
  select,
  textarea {
    font-size: 16px !important;
  }

  /* ---------- HERO ---------- */
  .hero {
    min-height: 0;
    padding: 70px 0 130px;
  }

  .hero-overlay {
    background: linear-gradient(
      180deg,
      rgba(8, 28, 52, .72) 0%,
      rgba(8, 28, 52, .55) 100%
    );
  }

  .hero-container {
    width: 88%;
  }

  .hero-content {
    padding-top: 0;
  }

  .hero-content h1 {
    font-size: clamp(34px, 9vw, 46px);
    letter-spacing: -1px;
    margin-bottom: 24px;
  }

  .hero-content p {
    font-size: 16.5px;
    line-height: 1.7;
    margin-bottom: 34px;
  }

  .hero-buttons {
    flex-direction: column;
    align-items: stretch;
    gap: 14px;
  }

  .hero-buttons a,
  .cta-buttons a {
    text-align: center;
  }

  /* ---------- ¿POR QUÉ VIBALCA? ---------- */
  .trust-section {
    padding: 60px 0 60px;
  }

  .trust-title {
    margin-bottom: 40px;
  }

  .trust-title h2 {
    font-size: 32px;
  }

  .trust-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-top: -90px;
  }

  .trust-card {
    height: 300px;
  }

  .trust-face {
    padding: 22px 16px;
  }

  .trust-icon {
    margin-bottom: 24px;
  }

  .trust-card h3 {
    font-size: 20px;
  }

  .trust-back p {
    font-size: 14px;
    line-height: 1.6;
    max-width: none;
  }

  /* ---------- SOLUCIONES (slider) ---------- */
  .solutions-section {
    padding: 70px 0;
  }

  .solutions-header {
    margin-bottom: 36px;
  }

  .solutions-header h2 {
    font-size: 32px;
  }

  .solutions-header p {
    font-size: 16px;
    line-height: 1.75;
  }

  .slides-wrapper {
    border-radius: 24px;
  }

  .solution-slide {
    height: auto;
    flex-direction: column;
    align-items: stretch;
    border-radius: 0;
    background: var(--blanco);
  }

  .solution-image {
    position: relative;
    inset: auto;
    width: 100%;
    height: 230px;
    flex-shrink: 0;
  }

  .solution-info {
    position: static;
    transform: none;
    width: auto;
    padding: 28px 24px 32px;
    border-radius: 0;
    border: 0;
    box-shadow: none;
    background: var(--blanco);
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }

  .solution-info h3 {
    font-size: 28px;
  }

  .slider-arrow {
    width: 42px;
    height: 42px;
    font-size: 16px;
    top: 115px;                     /* centrado sobre la imagen */
  }

  .prev { left: 10px; }
  .next { right: 10px; }

  .slider-dots {
    margin-top: 24px;
  }

  /* ---------- CTA FINAL ---------- */
  .cta-section {
    min-height: 0;
    padding: 80px 0;
  }

  .cta-container h2 {
    font-size: 34px;
    margin-bottom: 22px;
  }

  .cta-container p {
    font-size: 17px;
    line-height: 1.75;
  }

  .cta-buttons {
    flex-direction: column;
    align-items: stretch;
    gap: 14px;
    margin-top: 34px;
  }

  /* ---------- FOOTER ---------- */
  .footer {
    margin-top: 60px;
  }

  .footer-container {
    padding: 48px 0 36px;
    row-gap: 36px;
  }

  .footer-column:last-child,
  .footer-hours {
    padding-top: 0;
  }

  .footer-hours h4 {
    margin-bottom: 18px;
  }

  .claims-card {
    padding: 24px;
  }

  .footer-bottom-container {
    gap: 14px;
  }

  .footer-bottom-links {
    gap: 14px 22px;
  }
}


/* ==========================================================
   ≤ 560px · Móviles
   ========================================================== */
@media (max-width: 560px) {

  .trust-grid {
    grid-template-columns: 1fr;
    margin-top: -90px;
  }

  .trust-card {
    height: 250px;
  }

  .trust-back p {
    font-size: 15px;
  }

  .solution-image {
    height: 210px;
  }

  .slider-arrow {
    top: 105px;
  }

  .footer-logo {
    width: 160px;
  }
}


/* ==========================================================
   ≤ 400px · Móviles pequeños (360 px Android compactos)
   ========================================================== */
@media (max-width: 400px) {

  .header-container {
    padding: 0 16px;
  }

  .logo,
  .logo img {
    width: 108px;
  }

  .hero-content h1 {
    font-size: 32px;
  }

  .trust-title h2,
  .solutions-header h2 {
    font-size: 28px;
  }

  .cta-container h2 {
    font-size: 30px;
  }
}


/* ==========================================================
   AJUSTES POR PÁGINA (móvil)
   ========================================================== */

/* ---------- CATÁLOGO (productos.html) ---------- */
@media (max-width: 768px) {

  .hero-productos {
    height: auto;
    min-height: 420px;
    padding: 60px 0;
  }

  .catalogo {
    padding: 40px 0 70px;
  }

  .catalogo-container {
    grid-template-columns: minmax(0, 1fr);
    gap: 28px;
  }

  .sidebar,
  .productos-grid {
    min-width: 0;
  }

  .sidebar {
    padding: 22px 18px;
    border-radius: 20px;
  }

  .sidebar h3 {
    font-size: 18px;
    margin-bottom: 12px;
  }

  .sidebar-divider {
    margin: 20px 0;
  }

  /* Categorías en una fila deslizable (como botones) */
  .sidebar ul {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding: 2px 2px 8px;
    margin: 0 -2px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }

  .sidebar ul::-webkit-scrollbar {
    display: none;
  }

  .sidebar li,
  .sidebar li:hover {
    flex: 0 0 auto;
    padding: 10px 18px;
    border: 1px solid #E5EAF0;
    border-radius: 999px;
    font-size: 15px;
    white-space: nowrap;
  }

  .sidebar li.active {
    background: var(--celeste);
    border-color: var(--celeste);
    color: #fff;
  }

  /* Productos: 2 por fila */
  .productos-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
  }

  .product-card {
    height: auto;
    border-radius: 18px;
  }

  .product-image {
    height: 180px;
    padding: 10px;
  }

  .product-image img {
    margin-top: 0;
    width: 100%;
    height: 100%;
  }

  .product-content {
    padding: 12px 10px 16px;
  }

  .product-content h3 {
    font-size: 15px;
    margin-bottom: 8px;
  }

  .product-link {
    font-size: 14px;
    gap: 6px;
  }
}

@media (max-width: 360px) {
  .productos-grid {
    gap: 10px;
  }

  .product-content h3 {
    font-size: 14px;
  }
}


/* ---------- PÁGINAS DE PRODUCTO ---------- */
@media (max-width: 768px) {

  .product-breadcrumb {
    padding: 22px 6% 8px;
  }

  .product-hero {
    padding: 10px 6% 40px;
    gap: 26px;
  }

  .product-cta-group a,
  .product-cta-group button {
    width: 100%;
    text-align: center;
    justify-content: center;
  }
}


/* ---------- NOSOTROS ---------- */
@media (max-width: 768px) {

  .about-hero {
    height: auto;
    min-height: 560px;
    padding: 90px 0 70px;
  }

  .numbers-title,
  .essence-title,
  .valores-title,
  .story-content h2 {
    font-size: 32px;
  }

  .number-card h3 {
    font-size: 56px;
  }
}

@media (max-width: 560px) {

  .about-content h1 {
    font-size: 32px;
  }

  .about-content p {
    font-size: 16px;
  }

  .commitment h2 {
    font-size: 1.8rem;
  }
}


/* ---------- FORMULARIOS (contacto / reclamos) ---------- */
@media (max-width: 560px) {

  .contact-form button[type="submit"],
  .reclamo-form button[type="submit"],
  .reclamo-form .reclamo-submit {
    width: 100%;
    justify-content: center;
  }
}


/* ---------- Pantallas muy anchas: nada cambia ---------- */


/* ---------- BANNER DE COOKIES (móvil) ---------- */
@media (max-width: 640px) {

  .cookie-banner {
    bottom: -420px;
  }

  .cookie-banner-show {
    bottom: 0;
  }

  .cookie-banner-hide {
    bottom: -420px;
  }

  .cookie-banner-inner {
    gap: 16px;
    padding: 18px 0;
  }

  .cookie-banner-text {
    min-width: 0;
    width: 100%;
    flex: none;
  }

  .cookie-banner-actions {
    width: 100%;
    gap: 10px;
  }

  .cookie-btn-reject,
  .cookie-btn-accept {
    flex: 1;
    padding: 12px 10px;
    white-space: normal;
  }
}


/* ---------- Miniaturas de producto (muchas fotos) ---------- */
@media (max-width: 768px) {

  .product-hero-gallery,
  .product-hero-info {
    min-width: 0;
  }

  .product-thumbs {
    flex-wrap: wrap;
  }

  .product-thumbs img {
    width: 62px;
    height: 62px;
  }
}

.product-presentations {
  flex-wrap: wrap;
}
