/* =========================================================
   IMPRENTA BUIN — MENÚ MÓVIL PRINCIPAL MANUAL 2026
   CSS v1.2
   Misma apariencia aprobada en /pro/
   ========================================================= */

.ibu-mobile-app {
  display: none;
}

@media (max-width: 768px) {

  .ibu-mobile-app {
    --ibu-red: #ef003f;
    --ibu-red-hover: #c90035;
    --ibu-text: #17191c;
    --ibu-muted: #6e737b;
    --ibu-line: #e8eaed;
    --ibu-soft: #f6f7f8;
    --ibu-white: #ffffff;
  }

  .ibu-mobile-app,
  .ibu-mobile-app * {
    box-sizing: border-box;
  }

  .ibu-mobile-app {
    display: block;
  }

  .ibu-app-spacer {
    display: block;
    width: 100%;
    height: calc(88px + env(safe-area-inset-bottom, 0px));
    pointer-events: none;
  }

  /* BARRA INFERIOR */

  .ibu-app-bar {
    position: fixed;
    left: 50%;
    bottom: max(8px, env(safe-area-inset-bottom, 0px));
    z-index: 2147481500;

    width: min(calc(100% - 20px), 520px);
    height: 70px;

    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    align-items: center;
    gap: 2px;

    padding: 6px;

    background: #ffffff;
    border: 1px solid rgba(17, 24, 39, 0.08);
    border-radius: 20px;

    box-shadow:
      0 14px 34px rgba(17, 24, 39, 0.14),
      0 2px 8px rgba(17, 24, 39, 0.05);

    transform: translateX(-50%);

    transition:
      opacity 180ms ease,
      transform 180ms ease,
      visibility 180ms ease;
  }

  .ibu-app-bar__item {
    min-width: 0;
    height: 58px;

    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;

    padding: 0 2px;
    margin: 0;

    color: #525760;
    background: transparent;
    border: 0;
    border-radius: 14px;

    font: inherit;
    text-decoration: none;

    cursor: pointer;
    -webkit-tap-highlight-color: transparent;

    transition:
      color 160ms ease,
      background-color 160ms ease,
      transform 160ms ease;
  }

  .ibu-app-bar__item:hover,
  .ibu-app-bar__item:focus-visible {
    color: var(--ibu-red);
    background: #fff5f7;
    outline: none;
  }

  .ibu-app-bar__item:active {
    transform: scale(0.96);
  }

  .ibu-app-bar__icon {
    width: 23px;
    height: 23px;

    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .ibu-app-bar__icon svg {
    width: 23px;
    height: 23px;

    display: block;

    fill: none;
    stroke: currentColor;
    stroke-width: 1.9;
    stroke-linecap: round;
    stroke-linejoin: round;
  }

  .ibu-app-bar__label {
    max-width: 68px;

    color: currentColor;

    font-size: 9.5px;
    line-height: 1;
    font-weight: 760;
    letter-spacing: -0.1px;

    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .ibu-app-bar__item--quote {
    color: var(--ibu-red);
  }

  .ibu-app-bar__quote-icon {
    width: 35px;
    height: 35px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    background: var(--ibu-red);
    color: #ffffff;
    border-radius: 12px;

    box-shadow: 0 6px 14px rgba(239, 0, 63, 0.18);
  }

  .ibu-app-bar__quote-icon svg {
    width: 21px;
    height: 21px;
    display: block;
    fill: currentColor;
  }

  .ibu-app-bar__item--quote:hover,
  .ibu-app-bar__item--quote:focus-visible {
    color: var(--ibu-red-hover);
    background: transparent;
  }

  .ibu-app-bar__item--quote:hover .ibu-app-bar__quote-icon,
  .ibu-app-bar__item--quote:focus-visible .ibu-app-bar__quote-icon {
    background: var(--ibu-red-hover);
  }

  body.ib-search-open .ibu-app-bar,
  body.ib-menu-open .ibu-app-bar,
  body.ibu-products-open .ibu-app-bar {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translate(-50%, 14px);
  }

  /* PANEL PRODUCTOS */

  body.ibu-products-open {
    overflow: hidden;
  }

  .ibu-products-backdrop {
    position: fixed;
    inset: 0;
    z-index: 2147482500;

    background: rgba(12, 14, 18, 0.34);

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

    transition:
      opacity 200ms ease,
      visibility 200ms ease;
  }

  body.ibu-products-open .ibu-products-backdrop {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }

  .ibu-products-panel {
    position: fixed;
    left: 50%;
    bottom: 0;
    z-index: 2147482600;

    width: min(100%, 680px);
    max-height: min(84dvh, 760px);

    display: flex;
    flex-direction: column;

    background: var(--ibu-white);
    color: var(--ibu-text);

    border: 1px solid rgba(17, 24, 39, 0.08);
    border-bottom: 0;
    border-radius: 28px 28px 0 0;

    box-shadow: 0 -20px 54px rgba(17, 24, 39, 0.18);

    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translate(-50%, 102%);

    overflow: hidden;

    transition:
      transform 260ms cubic-bezier(.2, .8, .2, 1),
      opacity 180ms ease,
      visibility 180ms ease;
  }

  body.ibu-products-open .ibu-products-panel {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translate(-50%, 0);
  }

  .ibu-products-panel__handle {
    flex: 0 0 auto;
    width: 38px;
    height: 4px;
    margin: 9px auto 4px;
    background: #d9dce0;
    border-radius: 999px;
  }

  .ibu-products-panel__header {
    flex: 0 0 auto;
    min-height: 64px;

    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;

    padding: 8px 18px 10px;

    background: #ffffff;
    border-bottom: 1px solid var(--ibu-line);
  }

  .ibu-products-panel__eyebrow {
    display: block;
    margin-bottom: 4px;

    color: var(--ibu-red);

    font-size: 10px;
    line-height: 1;
    font-weight: 850;
    letter-spacing: 0.75px;
  }

  .ibu-products-panel__header h2 {
    margin: 0;

    color: var(--ibu-text);

    font-size: 25px;
    line-height: 1;
    font-weight: 800;
    letter-spacing: -0.65px;
  }

  .ibu-products-panel__close {
    flex: 0 0 42px;
    width: 42px;
    height: 42px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    padding: 0;

    background: var(--ibu-soft);
    color: #292d32;
    border: 1px solid var(--ibu-line);
    border-radius: 13px;

    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
  }

  .ibu-products-panel__close:hover,
  .ibu-products-panel__close:focus-visible {
    background: #eceef1;
    outline: none;
  }

  .ibu-products-panel__close svg {
    width: 18px;
    height: 18px;
    display: block;

    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
  }

  .ibu-products-panel__scroll {
    min-height: 0;

    padding: 18px 16px calc(22px + env(safe-area-inset-bottom, 0px));

    overflow-y: auto;
    overflow-x: hidden;

    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
  }

  .ibu-products-panel__intro {
    margin-bottom: 22px;
  }

  .ibu-products-panel__intro strong {
    display: block;
    margin-bottom: 5px;

    color: var(--ibu-text);

    font-size: 17px;
    line-height: 1.2;
    font-weight: 780;
    letter-spacing: -0.25px;
  }

  .ibu-products-panel__intro p {
    margin: 0;

    color: var(--ibu-muted);

    font-size: 13px;
    line-height: 1.45;
    font-weight: 500;
  }

  .ibu-products-section + .ibu-products-section {
    margin-top: 24px;
  }

  .ibu-products-section__head {
    display: flex;
    align-items: center;
    justify-content: space-between;

    margin-bottom: 10px;
  }

  .ibu-products-section__head h3 {
    margin: 0;

    color: var(--ibu-text);

    font-size: 15px;
    line-height: 1.2;
    font-weight: 720;
    letter-spacing: -0.2px;
  }

  /* CATEGORÍAS */

  .ibu-categories-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .ibu-category-card {
    min-width: 0;
    min-height: 52px;

    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;

    padding: 10px 12px;

    background: var(--ibu-soft);
    color: #282c31;

    border: 1px solid var(--ibu-line);
    border-radius: 14px;

    text-decoration: none;

    transition:
      background-color 160ms ease,
      border-color 160ms ease,
      color 160ms ease;
  }

  .ibu-category-card > span:first-child {
    min-width: 0;

    font-size: 12.7px;
    line-height: 1.18;
    font-weight: 680;
    letter-spacing: -0.12px;
  }

  .ibu-category-card:hover,
  .ibu-category-card:focus-visible {
    background: #fff5f7;
    color: var(--ibu-red);
    border-color: rgba(239, 0, 63, 0.2);
    outline: none;
  }

  .ibu-link-arrow {
    flex: 0 0 auto;

    color: var(--ibu-red);

    font-size: 22px;
    line-height: 1;
    font-weight: 500;
  }

  /* PRODUCTOS */

  .ibu-products-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .ibu-product-card {
    min-width: 0;

    display: block;

    background: #ffffff;
    color: var(--ibu-text);

    border: 1px solid var(--ibu-line);
    border-radius: 16px;

    overflow: hidden;
    text-decoration: none;

    transition:
      border-color 160ms ease,
      box-shadow 160ms ease,
      transform 160ms ease;
  }

  .ibu-product-card:hover,
  .ibu-product-card:focus-visible {
    border-color: rgba(239, 0, 63, 0.22);
    box-shadow: 0 8px 18px rgba(17, 24, 39, 0.07);
    outline: none;
    transform: translateY(-1px);
  }

  .ibu-product-card__media {
    width: 100%;
    aspect-ratio: 1.45 / 1;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 8px;

    background: var(--ibu-soft);
    border-bottom: 1px solid var(--ibu-line);

    overflow: hidden;
  }

  .ibu-product-card__media img {
    width: 100%;
    height: 100%;

    display: block;

    object-fit: contain;
  }

  .ibu-product-card__copy {
    min-height: 52px;

    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;

    padding: 10px 11px;
  }

  .ibu-product-card__copy strong {
    min-width: 0;

    color: inherit;

    font-size: 12.5px;
    line-height: 1.22;
    font-weight: 700;
    letter-spacing: -0.12px;
  }

  .ibu-products-all {
    min-height: 50px;

    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;

    margin-top: 18px;
    padding: 12px 16px;

    background: var(--ibu-red);
    color: #ffffff;

    border-radius: 14px;

    text-decoration: none;

    font-size: 13px;
    line-height: 1;
    font-weight: 760;

    transition:
      background-color 160ms ease,
      transform 160ms ease;
  }

  .ibu-products-all:hover,
  .ibu-products-all:focus-visible {
    background: var(--ibu-red-hover);
    color: #ffffff;
    outline: none;
  }

  .ibu-products-all:active {
    transform: scale(0.99);
  }

  .ibu-products-all svg {
    width: 17px;
    height: 17px;

    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
  }

  @media (max-width: 390px) {

    .ibu-app-bar {
      width: calc(100% - 14px);
      height: 68px;
      bottom: max(7px, env(safe-area-inset-bottom, 0px));
      padding-inline: 4px;
      border-radius: 18px;
    }

    .ibu-app-bar__item {
      height: 56px;
      gap: 3px;
    }

    .ibu-app-bar__icon,
    .ibu-app-bar__icon svg {
      width: 21px;
      height: 21px;
    }

    .ibu-app-bar__quote-icon {
      width: 33px;
      height: 33px;
      border-radius: 11px;
    }

    .ibu-app-bar__quote-icon svg {
      width: 20px;
      height: 20px;
    }

    .ibu-app-bar__label {
      max-width: 61px;
      font-size: 8.8px;
    }

    .ibu-products-panel {
      border-radius: 24px 24px 0 0;
    }

    .ibu-products-panel__header {
      padding-inline: 14px;
    }

    .ibu-products-panel__header h2 {
      font-size: 23px;
    }

    .ibu-products-panel__scroll {
      padding-inline: 13px;
    }

    .ibu-category-card {
      padding-inline: 10px;
    }

    .ibu-category-card > span:first-child {
      font-size: 12px;
    }

    .ibu-product-card__copy {
      padding-inline: 9px;
    }

    .ibu-product-card__copy strong {
      font-size: 11.9px;
    }
  }

  @media (prefers-reduced-motion: reduce) {

    .ibu-app-bar,
    .ibu-app-bar__item,
    .ibu-products-backdrop,
    .ibu-products-panel,
    .ibu-category-card,
    .ibu-product-card,
    .ibu-products-all {
      transition: none;
    }
  }
}
