/*
 * RestoPrime mobile app shell.  It is intentionally mobile-only: desktop
 * retains the information-rich legal footer and header navigation.
 */
@media (max-width: 767.98px) {
  .rp-body {
    font-size: 15px;
    -webkit-font-smoothing: antialiased;
  }

  .rp-footer-main,
  .rp-footer-legal {
    display: none !important;
  }

  #rp-page-content {
    padding-bottom: calc(84px + env(safe-area-inset-bottom, 0px));
  }

  .rp-mobile-tabbar {
    position: fixed;
    /* Keep every KMRS modal, drawer and its dimmer above the app tabs. */
    z-index: 1020;
    right: 0;
    bottom: 0;
    left: 0;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    min-height: 70px;
    padding: 7px 5px calc(7px + env(safe-area-inset-bottom, 0px));
    border-top: 1px solid rgba(213, 225, 216, .95);
    background: rgba(255, 255, 255, .96);
    box-shadow: 0 -8px 28px rgba(11, 42, 25, .09);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
  }

  .rp-mobile-tab {
    position: relative;
    display: flex;
    min-width: 0;
    min-height: 53px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    border-radius: 12px;
    color: #758179 !important;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: -.01em;
    line-height: 1;
    text-decoration: none !important;
    transition: color .18s ease, background .18s ease, transform .18s ease;
  }

  .rp-mobile-tab > i,
  .rp-mobile-tab-icon > i {
    display: block;
    font-size: 20px;
    line-height: 1;
  }

  .rp-mobile-tab > span:last-child {
    overflow: hidden;
    max-width: 100%;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .rp-mobile-tab:hover,
  .rp-mobile-tab:focus {
    color: var(--rp-primary) !important;
  }

  .rp-mobile-tab:active {
    transform: scale(.94);
  }

  .rp-mobile-tab.is-active {
    color: var(--rp-primary) !important;
  }

  .rp-mobile-tab.is-active::before {
    position: absolute;
    top: 0;
    width: 24px;
    height: 3px;
    border-radius: 0 0 4px 4px;
    background: var(--rp-primary);
    content: '';
  }

  .rp-mobile-tab--cart {
    color: var(--rp-primary) !important;
  }

  .rp-mobile-tab-icon {
    position: relative;
    display: grid;
    width: 32px;
    height: 28px;
    place-items: center;
  }

  .rp-mobile-tab--cart .rp-mobile-tab-icon {
    width: 38px;
    height: 34px;
    margin-top: -15px;
    border: 4px solid #fff;
    border-radius: 13px;
    background: var(--rp-primary);
    box-shadow: 0 7px 17px rgba(7, 120, 59, .26);
    color: #fff;
  }

  .rp-mobile-tab--cart .rp-mobile-tab-icon > i {
    font-size: 19px;
  }

  .rp-mobile-cart-count {
    position: absolute;
    top: -7px;
    right: -8px;
    display: grid;
    min-width: 17px;
    height: 17px;
    padding: 0 4px;
    place-items: center;
    border: 2px solid #fff;
    border-radius: 99px;
    background: #ee5d4f;
    color: #fff;
    font-family: 'DM Sans', Arial, sans-serif;
    font-size: 9px;
    font-style: normal;
    font-weight: 800;
    line-height: 1;
  }

  .rp-mobile-cart-count.is-empty {
    display: none;
  }

  /* Make the legacy header's live cart action unmistakable as well. */
  .rp-site-header .top-menu .cart-handle {
    width: 40px;
    height: 40px;
    border-color: #cbded0;
    border-radius: 11px;
    background: #fff;
    box-shadow: 0 3px 10px rgba(17, 55, 33, .07);
  }

  .rp-site-header .top-menu .cart-handle > img {
    display: none;
  }

  .rp-site-header .top-menu .cart-handle::before {
    color: var(--rp-primary);
    content: '\f1c9';
    font-family: 'Material-Design-Iconic-Font';
    font-size: 19px;
    line-height: 1;
  }

  .rp-site-header .top-menu .cart-handle .badge {
    top: -6px;
    right: -6px;
    min-width: 18px;
    min-height: 18px;
    padding: 3px 5px;
    border: 2px solid #fff;
    background: #ee5d4f !important;
    color: #fff;
    font-size: 9px;
    font-weight: 800;
  }

  .rp-home .rp-hero-copy h1 {
    font-size: clamp(39px, 10.3vw, 43px);
    line-height: 1.12;
  }

  .rp-home .rp-hero-copy > p {
    max-width: 350px;
    font-size: 14px;
    line-height: 1.48;
  }

  .rp-home .rp-hero-search .form-control,
  .rp-home .rp-hero-search input,
  .rp-home .rp-hero-search .el-input__inner,
  .rp-home .rp-hero-search .el-input__wrapper,
  .rp-home .rp-hero-search .btn,
  .rp-home .rp-hero-search .el-button {
    min-height: 40px;
    font-size: 12px;
  }

  .rp-home .rp-hero-search .flex-enabled-locate .btn::after {
    font-size: 12px;
  }

  .rp-hero-chips a {
    min-height: 29px;
    padding: 7px 10px;
    border-radius: 8px;
    font-size: 10px;
  }

  .rp-hero-stats strong { font-size: 11px; }
  .rp-hero-stats span { font-size: 9px; }

  .rp-section-heading h2 { font-size: 22px; }
  .rp-section-heading > a { font-size: 12px; }

  .rp-card-brand strong,
  .rp-featured-card-body h3 { font-size: 11px; }

  .rp-card-brand em,
  .rp-restaurant-card-body p,
  .rp-featured-card-body p,
  .rp-card-delivery { font-size: 9px; }

  .rp-featured-card-body strong { font-size: 14px; }

  .rp-featured-card-body button {
    min-height: 27px;
    padding: 5px 9px;
    border-radius: 8px;
    box-shadow: 0 4px 9px rgba(5, 99, 47, .18);
    font-size: 9px;
  }

  .rp-button {
    min-height: 40px;
    padding: 10px 17px;
    border-radius: 10px;
    box-shadow: 0 6px 14px rgba(5, 99, 47, .2);
    font-size: 12px;
  }

  .rp-delivery-banner-copy .rp-button { font-size: 11px; }
}

/* Final mobile header normalization: keep one compact native cart glyph. */
@media (max-width: 767.98px) {
  .rp-site-header .top-menu .cart-handle {
    width: 34px !important;
    height: 34px !important;
    border-radius: 9px !important;
  }

  .rp-site-header .top-menu .cart-handle > img {
    display: block !important;
    width: 16px !important;
    height: 16px !important;
  }

  .rp-site-header .top-menu .cart-handle::before {
    display: none !important;
    content: none !important;
  }

  .rp-site-header .top-menu .cart-handle .badge {
    top: -5px !important;
    right: -5px !important;
    min-width: 16px !important;
    min-height: 16px !important;
    padding: 2px 4px !important;
    font-size: 8px !important;
  }

  .rp-mobile-tabbar {
    min-height: 64px;
    padding-top: 5px;
    padding-bottom: calc(5px + env(safe-area-inset-bottom, 0px));
  }

  .rp-mobile-tab {
    min-height: 49px;
  }

  #rp-page-content {
    padding-bottom: calc(76px + env(safe-area-inset-bottom, 0px));
  }
}

@media (max-width: 374.98px) {
  .rp-mobile-tabbar { padding-right: 2px; padding-left: 2px; }
  .rp-mobile-tab { font-size: 8px; }
  .rp-mobile-tab > i,
  .rp-mobile-tab-icon > i { font-size: 18px; }
}

@media (min-width: 768px) {
  .rp-mobile-tabbar { display: none; }
}
