/* ==========================================================================
   HOJA RESPONSIVE AISLADA (responsive.css)
 ========================================================================== */

/* --------------------------------------------------------------------------
   RANGO 5: ESCRITORIOS GRANDES (1025px o más)
   -> Restaura el flujo horizontal perfecto sin saltos de línea.
 -------------------------------------------------------------------------- */   

@media screen and (min-width: 1025px) {

  .header__inner {
    flex-wrap: nowrap !important; /* Desactiva por completo el salto de línea */
    gap: 2rem !important;
    background-color: cornflowerblue;
  }

  .header__cats-btn, .header__phoneII { 
    display: none; 
  }

  .header__search {
    flex: 1 1 260px !important;
    max-width: 520px !important;
    margin: 0 auto !important;
    order: 3 !important;
  }

  .header__cta {
    flex: none !important;
    order: 4 !important;
    margin-left: auto !important;
    justify-content: flex-end !important;
  }
  
}
   
/* --------------------------------------------------------------------------
   RANGO 1: ESCRITORIOS MEDIANOS (De 971px a 1024px)
   -> Aquí el bloque de contacto baja a la segunda línea y se centra solo.
-------------------------------------------------------------------------- */
@media screen and (min-width: 971px) and (max-width: 1024px) {

  .header__inner {
    flex-wrap: wrap;
    gap: 1rem 1.5rem;
    background-color: blue;
  }

  .header__cats-btn { display: none; }

  .header__cta {
    flex: 1 1 100% !important;       
    justify-content: center !important; 
    margin-top: 0.5rem;   
    order: 4 !important; 
    margin-left: 0 !important;
  }

  .header__phoneII {
    display: none !important; 
  }
}

/* --------------------------------------------------------------------------
   RANGO 2: TABLETS Y PANTALLAS MEDIANAS (De 633px a 970px)
   -> El teléfono vuelve a subir a la primera línea al lado del logo y se ajusta la topbar.
 -------------------------------------------------------------------------- */
@media screen and (min-width: 633px) and (max-width: 970px) {

  .topbar__inner {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .topbar__red {
    clip-path: none;
    justify-content: center;
    padding: 0.5rem 1rem;
  }

  .topbar__red-inner {
    padding-left: 0;
    text-align: center;
  }

  .topbar__tagline {
    font-size: 0.7rem;
    letter-spacing: 0.5px;
  }

  .topbar__black {
    clip-path: none; 
    justify-content: center; 
  }  

  .topbar__black-inner { 
    padding-right: 0; 
    padding: 0.5rem 1rem; 
    flex-wrap: wrap;  
    justify-content: center;  
    gap: 0.8rem; 
    font-size: 0.72rem; 
    text-align: center;  
  }

  .header__inner {
    display: flex;
    flex-wrap: wrap; 
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem 0.5rem;
    padding: 0.75rem 1rem;
    min-height: auto;
    background-color: brown;
  }

  .header__cats-btn { 
    display: flex;  
    order: 1;
  }

  .header .brand { 
    order: 2; 
    margin: 0 auto;
  }

  .header .brand__img--header {
    height: 35px; 
  }

  .header__cta {
    display: flex;
    order: 3;
    gap: 0.9rem;
    align-items: center;
    margin-top: 0.25rem;
    margin-left: 0;
  }


  .header__phoneII {
    display: none !important; 
  }

  .header__search {
    order: 4;
    flex: 1 1 100%; 
    max-width: 100%;
    margin: 0.25rem auto 0 auto; 
  }

}

/* Ocultar dinámicamente el texto del botón de WhatsApp entre 633px y 768px */
@media screen and (min-width: 633px) and (max-width: 768px) {

  .header__inner {
    background-color: silver;
  }

  .header__phoneI {
    font-size: 0.85rem;
    gap: 0.4rem;
  }

  .header__phoneI i {
    font-size: 0.85rem;
    width: 38px;
    height: 38px;
  }

  .header__quote span {
    display: none; 
  }

  .header__quote {
    padding: 0.5rem;
    border-radius: 50%;
  }
  .header__quote {
    padding: .72rem 1.35rem;
    font-size: .9rem;
    border-radius: 50px;
    white-space: nowrap;
}
   
  .header__phoneII  {
    display: none !important; /* Mantiene tu regla de ocultar estos elementos */
  }

}

/* --------------------------------------------------------------------------
   RANGO 3: MÓVILES PEQUEÑOS (De 481px a 632px)
   -> Se oculta topbar y textos del teléfono. WhatsApp oculto por tu regla original.
-------------------------------------------------------------------------- */
@media screen and (min-width: 481px) and (max-width: 632px) {
  .topbar { 
    display: none !important; 
  }

  .header__inner {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    background-color: yellow;
  }

  .header__cats-btn { order: 1; }
  .header .brand { order: 2; margin: 0 auto; }
  .header .brand__img--header { height: 35px; }

  .header__cta {
    display: flex;
    order: 3;
    margin-left: 0;
  }

  .header__phoneI, .header__phoneII {
    font-size: 0.85rem;
    gap: 0.4rem;
  }

  .header__phoneI i, .header__phoneII i {
    font-size: 0.85rem;
    width: 38px;
    height: 38px;
  }

  .header__phoneI small,
  .header__phoneI strong,
  .header__phoneII small,
  .header__phoneII strong {
    display: none !important; /* Mantiene tu regla de ocultar estos elementos */
  }

  .header__quote {
    display: none !important; /* Mantiene tu regla de ocultar estos elementos */
  }
  
  .header__search {
    order: 4;
    flex: 1 1 100%;
    max-width: 100%;
    margin-top: 0.25rem;
  }
}

/* --------------------------------------------------------------------------
   RANGO 4: SMARTPHONES ULTRA-COMPACTOS (480px o menos)
   -> Diseño adaptado y optimizado para pantallas táctiles muy pequeñas.
-------------------------------------------------------------------------- */
@media screen and (max-width: 480px) {

   .topbar { 
    display: none !important; 
  }

  .header__inner {
    display: flex !important;
    flex-wrap: wrap !important; 
    align-items: center !important; 
    justify-content: space-between !important; 
    gap: 0.75rem 0.5rem !important; 
    padding: 0.75rem 1rem !important;
    min-height: auto !important;
    background-color: deeppink;
  }

  .header__cats-btn {
    display: flex !important;
    order: 1 !important;
    width: 36px !important;  
    height: 36px !important;
  }

  .header .brand {
    order: 2 !important;
    margin: 0 auto !important; 
  }

  .header .brand__img--header {
    height: 32px !important; 
  }

  .header__cta {
    display: flex !important;
    order: 3 !important;
    flex: none !important;
    gap: 0.85rem !important; 
    align-items: center !important;
    margin-top: 0 !important;
    margin-left: 0 !important;
  }

  .header__phoneI {
    font-size: 0.85rem !important;
    gap: 0.4rem !important;
  }

  .header__phoneI i, .header__phoneII i {
    width: 32px !important;
    height: 32px !important;
    font-size: 0.85rem !important;
  }

  .header__phoneI small, .header__phoneII small  {
    display: none !important; 
  }

  .header__phoneI strong, .header__phoneII strong {
    display: none !important;     
  }

  .header__quote {
    display: none !important; 
  }
  
  .header__search {
    order: 4 !important;
    flex: 1 1 100% !important; 
    max-width: 100% !important;
    margin: 0.25rem 0 0 0 !important;
  }
  
}

/* --------------------------------------------------------------------------
   RANGO EXTRA: SMARTPHONES ULTRA-COMPACTOS (De 320px a 365px)
   -> Reducción milimétrica para evitar que el teléfono y WhatsApp salten de línea.
-------------------------------------------------------------------------- */
@media screen and (max-width: 370px) {

  .header__inner {
    padding: 0.6rem 0.5rem !important; /* Reducimos el espacio de los bordes */
    gap: 0.5rem 0.25rem !important;
    background-color: darkgoldenrod;
  }

  .header__cats-btn {
    width: 32px !important;  /* Botón menú un poco más pequeño */
    height: 32px !important;
  }

   .header .brand__img--header {
    height: 26px !important; /* Encogemos el logo para ganar espacio horizontal */
  }

  .header__cta {
    gap: 0.5rem !important;  /* Juntamos más el teléfono y el WhatsApp */
  }

  .header__phone {
    gap: 0.25rem !important;
  }

  .header__phone i {
    width: 28px !important;  /* Icono de llamada más compacto */
    height: 28px !important;
    font-size: 0.75rem !important;
  }

  .header__phone strong {
    font-size: 0.75rem !important; /* El número de teléfono se adapta al espacio */
  }

}



/* --------------------------------------------------------------------------
   AJUSTE DE PRECISIÓN (De 634px a 651px)
   -> Evita que el teléfono y WhatsApp salten de línea en este rango crítico.
-------------------------------------------------------------------------- */
@media screen and (min-width: 633px) and (max-width: 651px) {

  .header__inner {
    padding: 0.75rem 0.5rem !important; /* Reducimos los márgenes laterales del contenedor */
    gap: 0.5rem 0.4rem !important;      /* Juntamos un poco más los elementos principales */
  }

  .header__cta {
    gap: 0.5rem !important; /* Reduce el espacio entre el teléfono y WhatsApp */
  }

  .header__phone {
    gap: 0.35rem !important;
    font-size: 0.8rem !important; /* Texto ligeramente más pequeño */
  }

  .header__phone i {
    width: 34px !important;  /* Icono de teléfono un poco más compacto */
    height: 34px !important;
    font-size: 0.8rem !important;
  }

  .header__phone strong {
    font-size: 0.85rem !important; /* Ajuste milimétrico al número de teléfono */
  }

}


@media (max-width: 860px) {
    .cm-container {
        width: calc(100% - 16px);
    }
}

@media (max-width: 480px) {
    .cm-container {
        width: calc(100% - 12px);
    }
}

/* En pantallas grandes actúa como el contenedor de Bootstrap */
@media screen and (min-width: 769px) {
  .site-main {
    max-width: 1320px; 
    border-bottom: 1px solid rgba(36, 55, 70, .12);
  }
}








/* --------------------------------------------------------------------------
   6. Adaptabilidad Responsive (@media queries)
   -------------------------------------------------------------------------- */
@media (max-width: 860px) {
    .cm-container {
        width: calc(100% - 16px);
    }

    .cm-home > .portada-catalogo {
        padding: 0;
    }

    .portada-catalogo > .cm-container {
        width: 100%;
        padding: 0;
    }

    .portada-catalogo > .cm-container > .portada-tabs {
        border-radius: 0;
    }

    .portada-catalogo > .cm-container > .portada-main {
        margin: 0;
        grid-template-columns: 1fr;
    }

    .portada-tab--cats {
        display: inline-flex;
        align-items: center;
        gap: 0.5rem;
    }

    .portada-categorias {
        display: none; /* Controlado dinámicamente vía JS en móvil */
        border-radius: 0;
    }

    .portada-catalogo > .cm-container > .finder {
        margin: 0;
        border-radius: 0;
        flex-direction: column;
        align-items: stretch;
    }

    .finder--footer {
        margin-top: 1rem;
    }

    .finder .btn {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .cm-container {
        width: calc(100% - 12px);
    }

    .portada-tabs {
        overflow-x: auto;
        white-space: nowrap;
    }

    .portada-tab {
        padding: 0.75rem 1rem;
        font-size: 0.85rem;
    }
}