/*
 * RestoPrime homepage-only refinement layer.
 * It deliberately sits after custom.css so it can make the reference layout
 * precise without changing any shared discovery, cart, or merchant styles.
 */

/* Make the KMRS autocomplete read as one clear search control.  The existing
 * Vue submit handler is retained; only its presentation changes. */
.rp-home .rp-hero-search {
  position: relative;
  min-height: 48px;
}

.rp-home .rp-hero-search > .d-flex {
  width: 100%;
  min-height: 40px;
}

.rp-home .rp-hero-search .search-geocomplete {
  width: calc(100% - 78px) !important;
}

.rp-home .rp-hero-search .el-input__wrapper {
  position: relative;
  padding-left: 34px !important;
}

.rp-home .rp-hero-search .el-input__wrapper::before {
  position: absolute;
  top: 50%;
  left: 12px;
  color: #30443a;
  content: '\f1c3';
  font-family: 'Material-Design-Iconic-Font';
  font-size: 16px;
  line-height: 1;
  transform: translateY(-50%);
}

/* The location shortcut remains part of the mounted native component but the
 * dedicated address search is the visible primary action in the reference. */
.rp-home .rp-hero-search .el-input__suffix {
  display: none;
}

.rp-home .rp-hero-search .flex-enabled-locate {
  width: 72px;
  margin-left: 6px;
}

.rp-home .rp-hero-search .flex-enabled-locate .btn {
  width: 72px;
  padding: 0 !important;
  font-size: 0 !important;
}

.rp-home .rp-hero-search .flex-enabled-locate .btn > i {
  display: none;
}

.rp-home .rp-hero-search .flex-enabled-locate .btn::after {
  content: 'Search';
  font-size: 11px;
}

/* Desktop type and controls were intentionally compact in the first fidelity
 * pass.  These values preserve the reference proportions while making the
 * data-backed cards comfortable to read on normal laptop/desktop screens. */
@media (min-width: 768px) {
  .rp-home .rp-hero-copy > p {
    font-size: 16px;
  }

  .rp-home .rp-hero-search .el-input__inner {
    font-size: 12.5px;
  }

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

  .rp-home .rp-hero-chips a {
    padding: 7px 12px;
    border-radius: 9px;
    font-size: 11px;
  }

  .rp-home .rp-hero-stats span {
    font-size: 10px;
  }

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

  .rp-home-widgets .rp-cuisine-card {
    gap: 8px;
    font-size: 11px;
  }

  .rp-home-widgets .rp-cuisine-card b {
    font-size: 11px;
  }

  .rp-home-widgets .rp-section-heading h2 {
    font-size: 22px;
  }

  .rp-home-widgets .rp-section-heading > a {
    font-size: 12px;
  }

  .rp-home-widgets .rp-restaurant-card,
  .rp-home-widgets .rp-featured-card {
    border-radius: 13px;
    box-shadow: 0 7px 17px rgba(18, 49, 31, .06);
  }

  .rp-home-widgets .rp-card-photo {
    height: 138px;
  }

  .rp-home-widgets .rp-card-photo > span:not(.rp-heart) {
    padding: 4px 7px;
    border-radius: 12px;
    font-size: 9px;
  }

  .rp-home-widgets .rp-restaurant-card-body,
  .rp-home-widgets .rp-featured-card-body {
    padding: 10px 11px 11px;
  }

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

  .rp-home-widgets .rp-card-brand em,
  .rp-home-widgets .rp-restaurant-card-body p,
  .rp-home-widgets .rp-featured-card-body p,
  .rp-home-widgets .rp-card-delivery,
  .rp-home-widgets .rp-featured-card-body > div > span {
    font-size: 9.5px;
  }

  .rp-home-widgets .rp-card-delivery b {
    padding: 4px 6px;
    border-radius: 5px;
    font-size: 8.5px;
  }

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

  .rp-home-widgets .rp-featured-card-body button,
  .rp-home-widgets .rp-delivery-banner-copy .rp-button {
    min-height: 27px;
    padding: 5px 10px;
    border-radius: 7px;
    box-shadow: 0 3px 8px rgba(5, 99, 47, .14);
    font-size: 10px;
  }

  .rp-home-widgets .rp-featured-card-body button:hover,
  .rp-home-widgets .rp-delivery-banner-copy .rp-button:hover {
    box-shadow: 0 6px 13px rgba(5, 99, 47, .2);
  }
}

/* The homepage cards are backed by KMRS' native cart endpoint.  This turns a
 * successful add into a clear, compact quantity state without creating a
 * second browser-only cart. */
.rp-featured-card.is-in-cart {
  border-color: rgba(8, 120, 59, .35);
  box-shadow: 0 8px 21px rgba(8, 120, 59, .12);
}

/* The whole product card is a direct route to its restaurant menu. The
 * native-item add action stays above this link, so browsing and cart actions
 * do not conflict. */
.rp-featured-card { position: relative; }

.rp-featured-card .rp-featured-card-link {
  position: absolute;
  z-index: 1;
  inset: 0;
  border-radius: inherit;
  outline: 0;
}

.rp-featured-card .rp-featured-card-link:focus-visible {
  box-shadow: inset 0 0 0 3px var(--rp-primary);
}

.rp-featured-card .rp-featured-add-button {
  position: relative;
  z-index: 2;
}

.rp-featured-card .rp-featured-add-button {
  display: inline-flex;
  min-width: 0;
  align-items: center;
  justify-content: center;
  gap: 3px;
  white-space: nowrap;
}

.rp-featured-card .rp-featured-add-button > i {
  font-size: 1.05em;
}

.rp-featured-card .rp-featured-add-quantity {
  display: none;
  min-width: 14px;
  padding: 0 3px;
  border-radius: 999px;
  background: var(--rp-primary);
  color: #fff;
  font-size: .88em;
  line-height: 1.45;
}

.rp-featured-card .rp-featured-add-button.is-in-cart {
  border: 1px solid rgba(8, 120, 59, .2);
  background: #e8f7ec;
  box-shadow: none;
  color: var(--rp-primary);
}

.rp-featured-card .rp-featured-add-button.is-in-cart .rp-featured-add-quantity {
  display: inline-block;
}

.rp-featured-card .rp-featured-add-button.is-in-cart:hover {
  background: #dff3e5;
}

/* The reference contains exactly nine category chips: All, seven live
 * cuisines, then More.  Preserve the PHP-provided live category links. */
.rp-home-widgets .rp-cuisine-strip {
  grid-template-columns: repeat(9, minmax(0, 1fr));
}

/* Prevent the mounted, modal-only native item component from consuming layout
 * space now that it is no longer placed in a display:none ancestor. */
.rp-home-dialog-host {
  position: relative;
  z-index: 1050;
}

.rp-home-dialog-host > .modal:not(.show) {
  display: none;
}

/* The small left-side app artwork references the existing original theme
 * image twice to better reproduce the paired-phone composition in the brief. */
@media (min-width: 768px) {
  .rp-mobile-phone-art {
    position: relative;
    overflow: visible;
  }

  .rp-mobile-phone-art::after {
    position: absolute;
    top: 40px;
    left: 127px;
    width: 91px;
    height: 159px;
    border: 6px solid #1a261f;
    border-radius: 18px;
    background: #0b2118 url('../images/restoprime-hero-noodles.webp') center/cover no-repeat;
    box-shadow: 0 11px 20px rgba(7, 47, 28, .18);
    content: '';
    transform: rotate(8deg);
  }
}

@media (max-width: 767.98px) {
  .rp-home .rp-hero-search > .d-flex {
    flex-direction: row !important;
    align-items: center !important;
  }

  .rp-home .rp-hero-search .search-geocomplete {
    width: calc(100% - 70px) !important;
  }

  .rp-home .rp-hero-search .flex-enabled-locate,
  .rp-home .rp-hero-search .flex-enabled-locate .btn {
    width: 64px !important;
  }

  .rp-home .rp-hero-search .flex-enabled-locate {
    margin-top: 0 !important;
    margin-left: 6px;
  }
}
@media (max-width: 767px) {
  .rp-hero { background-image: url('../images/restoprime-hero-noodles-mobile.webp'); }
}
