/* === NSD Mobile Bottom Dock === */
@media (max-width:991px){
  :root{
    --nsdDockActiveColor: #005FCC;
  }

  body{
    padding-bottom:calc(74px + env(safe-area-inset-bottom));
  }

  .nsdK4mP8xQ2vMobileDock{
    position:fixed;
    left:0;
    right:0;
    bottom:0;
    z-index:9999;
    display:grid;
    grid-template-columns:repeat(5,minmax(0,1fr));
    align-items:start;
    /* Fluid horizontal gap so items breathe on wide phones, tighten on narrow. */
    column-gap:clamp(1px, 0.5vw, 6px);
    background:rgba(255,255,255,0.98);
    backdrop-filter:blur(10px);
    -webkit-backdrop-filter:blur(10px);
    border-top:1px solid rgba(0,0,0,0.08);
    box-shadow:0 -4px 16px rgba(0,0,0,0.06);
    padding:8px clamp(2px, 1.5vw, 8px) calc(8px + env(safe-area-inset-bottom));
  }

  /* Shared item box — works for both <a> and <button>. */
  .nsdK4mP8xQ2vMobileDockItem{
    min-width:0;               /* critical: lets grid cell shrink below content width */
    width:100%;
    min-height:58px;
    display:flex;
    flex-direction:column;
    align-items:center;
    justify-content:flex-start;
    gap:4px;
    padding:0;
    margin:0;
    text-decoration:none;
    color:#000000;
    background:transparent;
    border:0;
    font:inherit;
    cursor:pointer;
    box-sizing:border-box;
    appearance:none;
    -webkit-appearance:none;
    -webkit-tap-highlight-color:transparent;
  }
  .nsdK4mP8xQ2vMobileDockItem:active{
    background:transparent;
  }
  /* Button trigger must never keep a focus/active background. */
  button.nsdK4mP8xQ2vMobileDockItem:focus,
  button.nsdK4mP8xQ2vMobileDockItem:focus-visible,
  button.nsdK4mP8xQ2vMobileDockItem:active{
    background:transparent!important;
    outline:none;
    box-shadow:none!important;
  }
  button.nsdK4mP8xQ2vMobileDockItem:focus .nsdK4mP8xQ2vMobileDockIcon,
  button.nsdK4mP8xQ2vMobileDockItem:active .nsdK4mP8xQ2vMobileDockIcon{
    background:transparent!important;
  }

  .nsdK4mP8xQ2vMobileDockIcon{
    /* Icon frame scales with viewport width, clamped to sane bounds. */
    width:clamp(30px, 9vw, 38px);
    height:clamp(30px, 9vw, 38px);
    display:flex;
    align-items:center;
    justify-content:center;
    border-radius:12px;
    flex-shrink:0;
    transition:background 0.2s ease;
  }

  .nsdX9vP2Lm7QaIcon{
    width:clamp(28px, 8.5vw, 36px);
    height:clamp(28px, 8.5vw, 36px);
    object-fit:contain;
    display:block;
    image-rendering:-webkit-optimize-contrast;
    image-rendering:high-quality;
    transition:transform 0.2s ease;
  }

  .nsdK4mP8xQ2vMobileDockLabel{
    /* Font shrinks on narrow screens so long labels ("Categorías") fit whole. */
    font-size:clamp(10px, 3.1vw, 14px);
    line-height:1.05;
    font-weight:600;
    text-align:center;
    color:#000000;
    max-width:100%;
    /* Allow wrap to a second line instead of clipping when still too long. */
    white-space:normal;
    overflow-wrap:break-word;
    word-break:break-word;
    transition:color 0.2s ease;
  }

  /* === ACTIVE STATE === */
  .nsdK4mP8xQ2vMobileDockItem--active .nsdK4mP8xQ2vMobileDockIcon{
    background:rgba(26,115,232,0.12);
  }
  .nsdK4mP8xQ2vMobileDockItem--active .nsdX9vP2Lm7QaIcon{
    transform:scale(1.1);
  }
  .nsdK4mP8xQ2vMobileDockItem--active .nsdK4mP8xQ2vMobileDockLabel{
    color:var(--nsdDockActiveColor);
  }
  /* Trigger button is an action, not a page — never show active styling. */
  button.nsdK4mP8xQ2vMobileDockItem--active .nsdK4mP8xQ2vMobileDockIcon{
    background:transparent!important;
  }
  button.nsdK4mP8xQ2vMobileDockItem--active .nsdX9vP2Lm7QaIcon{
    transform:none!important;
  }
  button.nsdK4mP8xQ2vMobileDockItem--active .nsdK4mP8xQ2vMobileDockLabel{
    color:#000000!important;
  }

  /* Press feedback (kept from original). */
  .nsdK4mP8xQ2vMobileDockItem:active .nsdX9vP2Lm7QaIcon{
    transform:scale(1.4);
  }
}

@media (min-width:992px){
  .nsdK4mP8xQ2vMobileDock{
    display:none!important;
  }
}