/* =====================================
   CONTROLES MÓVILES OCULTOS EN PC
===================================== */

.mobile-header__button,
.mobile-overlay {
  display: none;
}


/* =====================================
   DISEÑO MÓVIL
===================================== */

@media (max-width: 1180px) {

  /* Encabezado: menú, logo y usuario */
  .header {
    width: 100%;
    min-height: 64px;
    padding: 6px 12px;

    display: grid;
    grid-template-columns: 48px minmax(0, 1fr) 48px;
    align-items: center;
    gap: 8px;

    flex-wrap: nowrap;
  }

  .banner {
    grid-column: 2;
    margin: 0;
    min-width: 0;
    justify-self: center;
  }

  .banner__logo {
    padding: 0;
    font-size: 1.65rem;
    white-space: nowrap;
  }

  .banner__logo .logo--img {
    width: 46px;
    height: 46px;
    margin-right: 8px;
  }

  .mobile-header__button {
    width: 46px;
    height: 46px;

    display: grid;
    place-items: center;

    padding: 0;
    border: 0;
    border-radius: 12px;

    background: transparent;
    color: white;

    font-size: 2rem;
    cursor: pointer;
  }

  .mobile-header__button:hover,
  .mobile-header__button:focus-visible {
    background: rgba(255, 255, 255, 0.18);
    outline: 2px solid white;
  }

  .mobile-header__user-icon {
    width: 36px;
    height: 36px;
    object-fit: contain;
    border-radius: 50%;
  }

  /* El navbar de PC continúa oculto en móvil */
  .navbar {
    display: none;
  }


  /* =====================================
     FONDO OSCURECIDO
  ===================================== */

  .mobile-overlay {
    position: fixed;
    inset: 0;
    z-index: 900;

    display: block;

    background: rgba(15, 17, 26, 0.58);

    opacity: 0;
    visibility: hidden;
    pointer-events: none;

    transition:
      opacity 0.25s ease,
      visibility 0.25s ease;
  }

  .mobile-overlay.is-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }


  /* =====================================
     PANEL LATERAL
  ===================================== */

  .mobile-drawer {
    position: absolute;
    top: 0;
    bottom: 0;

    width: min(340px, 88vw);
    padding: 20px;

    box-sizing: border-box;
    overflow-y: auto;

    background: #ffffff;
    box-shadow: 0 0 35px rgba(0, 0, 0, 0.26);

    transition: transform 0.28s ease;
  }

  .mobile-drawer--left {
    left: 0;
    transform: translateX(-100%);
  }

  .mobile-drawer--right {
    right: 0;
    transform: translateX(100%);
  }

  .mobile-overlay.is-open .mobile-drawer {
    transform: translateX(0);
  }

  .mobile-drawer__header {
    display: flex;
    align-items: center;
    justify-content: space-between;

    padding-bottom: 15px;
    border-bottom: 1px solid #e2e8f0;
  }

  .mobile-drawer__header h2 {
    margin: 0;
    color: #1a202c;
    font-size: 1.35rem;
  }

  .mobile-drawer__close {
    width: 42px;
    height: 42px;

    border: 0;
    border-radius: 10px;
    background: transparent;

    color: #475467;
    font-size: 2rem;
    cursor: pointer;
  }


  /* =====================================
     ENLACES DE NAVEGACIÓN
  ===================================== */

  .mobile-navigation {
    display: grid;
    gap: 8px;
    margin-top: 18px;
  }

  .mobile-navigation a {
    display: block;
    padding: 14px 16px;

    border-radius: 10px;

    color: #1a202c;
    text-decoration: none;
    font-size: 1rem;
    font-weight: 700;
  }

  .mobile-navigation a:hover,
  .mobile-navigation a:focus-visible {
    background: #edf2f7;
    color: #e60073;
  }


  /* =====================================
     OPCIONES DE USUARIO
  ===================================== */

  .mobile-account-options {
    display: grid;
    gap: 12px;
    margin-top: 18px;
  }

  .mobile-account-option {
    width: 100%;
    min-height: 76px;
    padding: 12px;

    display: grid;
    grid-template-columns: 48px minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;

    border: 1px solid #e2e8f0;
    border-radius: 14px;

    background: #f8fafc;
    color: #1a202c;

    text-align: left;
    font: inherit;
    cursor: pointer;

    transition:
      transform 0.2s ease,
      border-color 0.2s ease,
      background-color 0.2s ease;
  }

  .mobile-account-option:hover,
  .mobile-account-option:focus-visible {
    transform: translateY(-2px);
    border-color: #e60073;
    background: #ffffff;
  }

  .mobile-account-option img {
    width: 42px;
    height: 42px;
    object-fit: contain;
  }

  .mobile-account-option span {
    min-width: 0;
  }

  .mobile-account-option strong,
  .mobile-account-option small {
    display: block;
  }

  .mobile-account-option strong {
    margin-bottom: 3px;
    font-size: 1rem;
  }

  .mobile-account-option small {
    color: #667085;
    font-size: 0.78rem;
  }

  .mobile-cart-count {
    min-width: 24px;
    height: 24px;
    padding: 0 6px;

    display: grid;
    place-items: center;

    border-radius: 999px;
    background: #e60073;
    color: white;

    font-size: 0.78rem;
    font-weight: 700;
  }

  body.mobile-drawer-open {
    overflow: hidden;
  }
}


@media (max-width: 380px) {
  .banner__logo {
    font-size: 1.25rem;
  }

  .banner__logo .logo--img {
    width: 40px;
    height: 40px;
  }
}