/* eetZA Step 16: address-first, compact mobile discovery */

body.step16-discovery-page {
  /* The discovery route used to own a tinted legacy canvas here. Because this
     bundle is emitted after <body>, that canvas could paint for one frame on
     date/category navigation before the current Home/Browse theme arrived. */
  background: var(--color-canvas, #f3f0eb);
}

body.step16-discovery-page .page-shell {
  width: min(100% - 24px, 1180px) !important;
  max-width: 1180px !important;
  padding: 12px 0 108px !important;
  overflow: visible !important;
}

.address-first-card,
.discovery-search-shell,
.discovery-section {
  box-sizing: border-box;
}

.address-first-card {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 14px;
  margin: 0 0 10px;
  border: 1px solid rgba(236, 138, 61, .26);
  border-radius: 20px;
  background: linear-gradient(135deg, rgba(255, 255, 255, .92), rgba(255, 241, 226, .9));
  box-shadow: 0 8px 24px rgba(87, 48, 20, .07);
}

.address-first-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 14px;
  background: rgba(255, 128, 30, .12);
  font-size: 21px;
}

.address-first-copy { min-width: 0; }
.address-first-copy .eyebrow { margin: 0 0 2px; }
.address-first-copy h1 {
  margin: 0;
  font-size: clamp(20px, 4vw, 27px);
  line-height: 1.03;
  letter-spacing: -.035em;
}
.address-first-copy p:last-child {
  margin: 5px 0 0;
  max-width: 54rem;
  color: var(--muted, #65737c);
  font-size: 13px;
  line-height: 1.35;
}
.address-first-button {
  min-height: var(--eetza-control-height-max,34px) !important;
  padding: 8px 13px !important;
  white-space: nowrap;
}

.discovery-search-shell {
  position: sticky;
  top: 64px;
  z-index: 36;
  margin: 0 0 14px;
  padding: 12px;
  border: 1px solid rgba(226, 211, 196, .9);
  border-radius: 20px;
  background: rgba(255, 255, 255, .86);
  box-shadow: 0 10px 28px rgba(73, 42, 19, .075);
  -webkit-backdrop-filter: blur(18px) saturate(1.15);
  backdrop-filter: blur(18px) saturate(1.15);
}

.discovery-search-form > h1 {
  margin: 0 0 9px;
  font-size: 20px;
  line-height: 1;
  letter-spacing: -.03em;
}

.discovery-search-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.discovery-search-input {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  align-items: center;
  gap: 6px;
  min-width: 0;
  min-height: var(--eetza-control-height-max,34px);
  padding: 0 11px;
  border: 1px solid var(--line, #f0d9dc);
  border-radius: 14px;
  background: var(--paper, #fff);
  color: var(--muted, #65737c);
}
.discovery-search-input > span[aria-hidden="true"] {
  font-size: 23px;
  line-height: 1;
  transform: translateY(-1px);
}
.discovery-search-input input {
  width: 100%;
  min-width: 0;
  height: var(--eetza-control-height-max,34px);
  padding: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink, #171a1d);
  font: inherit;
  font-size: 14px;
}
.discovery-search-button {
  min-width: 76px !important;
  min-height: var(--eetza-control-height-max,34px) !important;
  padding: 8px 14px !important;
  border-radius: var(--eetza-pill-radius, 12px) !important;
}

.discovery-category-chips {
  display: flex;
  gap: 7px;
  margin: 9px -2px 0;
  padding: 1px 2px 3px;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  scrollbar-width: none;
  scroll-snap-type: x proximity;
}
.discovery-category-chips::-webkit-scrollbar { display: none; }
.discovery-chip {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 5px;
  min-height: 32px;
  padding: 6px 10px;
  border: 1px solid var(--line, #f0d9dc);
  border-radius: var(--eetza-pill-radius, 12px);
  background: rgba(255, 255, 255, .82);
  color: var(--ink, #171a1d);
  font-size: 11.5px;
  font-weight: 800;
  text-decoration: none;
  scroll-snap-align: start;
  white-space: nowrap;
}
.discovery-chip:hover,
.discovery-chip:focus-visible,
.discovery-chip.is-active {
  border-color: rgba(232, 112, 22, .55);
  background: rgba(255, 132, 39, .12);
  color: var(--brand, var(--color-brand));
}

.discovery-filter-drawer { margin-top: 6px; }
.discovery-filter-drawer > summary {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  color: var(--muted, #65737c);
  cursor: pointer;
  font-size: 11.5px;
  font-weight: 800;
  list-style: none;
}
.discovery-filter-drawer > summary::-webkit-details-marker { display: none; }
.discovery-filter-drawer > summary::after { content: '⌄'; margin-left: 5px; }
.discovery-filter-drawer[open] > summary::after { transform: rotate(180deg); }
.discovery-filter-fields {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr)) auto;
  gap: 8px;
  align-items: end;
  padding-top: 8px;
}
.discovery-filter-fields label {
  display: grid;
  gap: 4px;
  color: var(--muted, #65737c);
  font-size: 10px;
  font-weight: 800;
}
.discovery-filter-fields select {
  width: 100%;
  min-width: 0;
  min-height: var(--eetza-control-height-max,34px);
  padding: 0 9px;
  border: 1px solid var(--line, #f0d9dc);
  border-radius: 12px;
  background: var(--paper, #fff);
  color: var(--ink, #171a1d);
  font: inherit;
  font-size: 12px;
}
.discovery-filter-actions { display: flex; gap: 6px; }
.discovery-filter-actions .btn {
  min-height: var(--eetza-control-height-max,34px) !important;
  padding: 7px 10px !important;
  border-radius: 12px !important;
  font-size: 11.5px !important;
}

.discovery-section {
  margin: 0 0 19px;
  scroll-margin-top: 152px;
}
.discovery-section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
  margin: 0 2px 9px;
}
.discovery-section-heading > div { min-width: 0; }
.discovery-section-heading .eyebrow { margin: 0 0 2px; }
.discovery-section-heading h2 {
  margin: 0;
  font-size: clamp(21px, 4vw, 29px);
  line-height: 1.02;
  letter-spacing: -.04em;
}
.discovery-section-heading p:not(.eyebrow) {
  margin: 4px 0 0;
  color: var(--muted, #65737c);
  font-size: 12.5px;
  line-height: 1.35;
}
.discovery-heading-link,
.discovery-heading-button {
  flex: 0 0 auto;
  padding: 5px 2px;
  border: 0;
  background: transparent;
  color: var(--brand, var(--color-brand));
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  font-weight: 900;
  text-decoration: none;
  white-space: nowrap;
}
.discovery-subheading { margin: 15px 0 8px; }
.discovery-subheading h3 { margin: 0; font-size: 18px; }

.discovery-horizontal-rail {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(190px, 222px);
  gap: 10px;
  margin: 0 -12px;
  padding: 1px 12px 8px;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  scrollbar-width: none;
}
.discovery-horizontal-rail::-webkit-scrollbar { display: none; }

.discovery-product-card,
.discovery-seller-card {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line, #f0d9dc);
  border-radius: 17px;
  background: var(--paper, #fff);
  box-shadow: 0 7px 18px rgba(73, 42, 19, .055);
}
.discovery-product-image,
.discovery-seller-image {
  position: relative;
  display: block;
  overflow: hidden;
  background: #f3e8dc;
}
.discovery-product-image { aspect-ratio: 1.42 / 1; }
.discovery-seller-image { aspect-ratio: 1.6 / 1; }
.discovery-product-image img,
.discovery-seller-image img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  transition: transform .22s ease;
}
.discovery-product-card:hover img,
.discovery-seller-card:hover img { transform: scale(1.025); }
.discovery-product-badge,
.discovery-discount-badge,
.discovery-seller-image .marketplace-status {
  position: absolute;
  top: 7px;
  left: 7px;
  max-width: calc(100% - 14px);
  padding: 4px 7px;
  border-radius: var(--eetza-pill-radius, 12px);
  background: rgba(255, 255, 255, .91);
  color: #3b291c;
  box-shadow: 0 3px 10px rgba(44, 25, 13, .12);
  font-size: 9.5px;
  font-weight: 900;
  line-height: 1;
  white-space: nowrap;
  backdrop-filter: blur(8px);
}
.discovery-discount-badge {
  right: 7px;
  left: auto;
  background: rgba(216, 67, 35, .92);
  color: #fff;
}
.discovery-seller-image .marketplace-status.is-open { color: #176c39; }
.discovery-seller-image .marketplace-status.is-closed { color: #81594c; }
.discovery-product-body,
.discovery-seller-body { padding: 9px 10px 10px; }
.discovery-product-name,
.discovery-seller-title {
  display: block;
  overflow: hidden;
  color: var(--ink, #171a1d);
  font-weight: 900;
  line-height: 1.15;
  text-decoration: none;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.discovery-product-name { font-size: 14px; }
.discovery-seller-title { font-size: 15px; }
.discovery-seller-name {
  display: block;
  margin-top: 3px;
  overflow: hidden;
  color: var(--muted, #65737c);
  font-size: 11px;
  font-weight: 700;
  text-decoration: none;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.discovery-product-meta,
.discovery-seller-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 7px;
  margin-top: 8px;
  color: var(--muted, #65737c);
  font-size: 10.5px;
}
.discovery-product-meta strong { color: var(--brand, var(--color-brand)); font-size: 14px; }
.discovery-product-meta span,
.discovery-seller-meta span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.discovery-card-action {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 8px;
  color: var(--brand, var(--color-brand));
  font-size: 11px;
  font-weight: 900;
  text-decoration: none;
}

/* Order again is a shortcut, so keep it at roughly half the height of the
   standard discovery seller card while retaining the same useful details. */
.discovery-order-again-section .discovery-horizontal-rail {
  grid-auto-columns: minmax(230px, 310px);
}
.discovery-order-again-section .discovery-seller-card {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  height: 122px;
}
.discovery-order-again-section .discovery-seller-image {
  height: 100%;
  aspect-ratio: auto;
}
.discovery-order-again-section .discovery-seller-body {
  display: flex;
  min-width: 0;
  flex-direction: column;
  justify-content: center;
  padding: 9px 11px;
}
.discovery-order-again-section .discovery-seller-title {
  font-size: 14px;
}
.discovery-order-again-section .discovery-seller-meta {
  margin-top: 6px;
  font-size: 9.5px;
}
.discovery-order-again-section .discovery-card-action {
  margin-top: 7px;
  font-size: 10.5px;
}
.discovery-order-again-section .discovery-recognition-badge {
  display: none;
}
.discovery-order-again-section .discovery-seller-image .marketplace-status {
  top: 7px;
  left: 7px;
  padding: 4px 6px;
  font-size: 8.5px;
}

.discovery-result-grid,
.discovery-seller-grid {
  display: grid;
  gap: 11px;
}
.discovery-result-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.discovery-seller-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.discovery-results-section {
  padding: 14px;
  border: 1px solid var(--line, #f0d9dc);
  border-radius: 20px;
  background: rgba(255, 255, 255, .72);
}
.compact-empty-state {
  padding: 22px 15px !important;
  border-radius: 18px !important;
}
.compact-empty-state h2,
.compact-empty-state h3 { margin-top: 0; }

.marketplace-seller-page .marketplace-order-card[id] { scroll-margin-top: 132px; }
.marketplace-seller-page .marketplace-order-card:target {
  outline: 3px solid rgba(238, 111, 18, .22);
  outline-offset: 3px;
}

@media (max-width: 880px) {
  .discovery-result-grid,
  .discovery-seller-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 680px) {
  body.step16-discovery-page .page-shell {
    width: min(100% - 18px, 720px) !important;
    padding-top: 9px !important;
  }
  .address-first-card {
    grid-template-columns: 38px minmax(0, 1fr);
    gap: 9px;
    padding: 11px;
    border-radius: 17px;
  }
  .address-first-icon { width: 38px; height: 38px; border-radius: 12px; }
  .address-first-copy h1 { font-size: 20px; }
  .address-first-copy p:last-child { font-size: 11.5px; }
  .address-first-button {
    grid-column: 1 / -1;
    width: 100% !important;
    min-height: var(--eetza-control-height-max,34px) !important;
  }
  .discovery-search-shell {
    top: 61px;
    margin-bottom: 13px;
    padding: 10px;
    border-radius: 17px;
  }
  .discovery-search-form > h1 { margin-bottom: 8px; font-size: 18px; }
  .discovery-search-row { gap: 6px; }
  .discovery-search-input { min-height: var(--eetza-control-height-max,34px); border-radius: 13px; }
  .discovery-search-input input { height: var(--eetza-control-height-max,34px); font-size: 13px; }
  .discovery-search-button {
    min-width: 68px !important;
    min-height: var(--eetza-control-height-max,34px) !important;
    padding: 7px 10px !important;
    font-size: 11.5px !important;
  }
  .discovery-category-chips { margin-top: 7px; }
  .discovery-chip { min-height: 30px; padding: 5px 9px; font-size: 10.5px; }
  .discovery-filter-fields { grid-template-columns: 1fr 1fr; }
  .discovery-filter-fields label:first-child { grid-column: 1 / -1; }
  .discovery-filter-actions { align-self: end; }
  .discovery-section { margin-bottom: 17px; }
  .discovery-section-heading { margin-bottom: 7px; }
  .discovery-section-heading h2 { font-size: 22px; }
  .discovery-horizontal-rail {
    grid-auto-columns: minmax(174px, 66vw);
    gap: 8px;
    margin-inline: -9px;
    padding-inline: 9px;
  }
  .discovery-order-again-section .discovery-horizontal-rail {
    grid-auto-columns: minmax(220px, 66vw);
  }
  .discovery-order-again-section .discovery-seller-card {
    grid-template-columns: 104px minmax(0, 1fr);
    height: 116px;
  }
  .discovery-product-card,
  .discovery-seller-card { border-radius: 15px; }
  .discovery-result-grid,
  .discovery-seller-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .discovery-results-section { padding: 10px; border-radius: 17px; }
}

@media (max-width: 390px) {
  .discovery-order-again-section .discovery-horizontal-rail { grid-auto-columns: minmax(210px, 68vw); }
  .discovery-order-again-section .discovery-seller-card { grid-template-columns: 96px minmax(0, 1fr); height: 110px; }
  .discovery-filter-fields { grid-template-columns: 1fr; }
  .discovery-filter-fields label:first-child { grid-column: auto; }
  .discovery-result-grid,
  .discovery-seller-grid { grid-template-columns: 1fr 1fr; }
  .discovery-product-body,
  .discovery-seller-body { padding: 8px; }
  .discovery-product-name { font-size: 12.5px; }
  .discovery-seller-title { font-size: 13.5px; }
  .discovery-product-meta,
  .discovery-seller-meta { font-size: 9.5px; }
}

@media (prefers-reduced-motion: reduce) {
  .discovery-product-image img,
  .discovery-seller-image img { transition: none; }
  .discovery-product-card:hover img,
  .discovery-seller-card:hover img { transform: none; }
}


/* Step 35AM: product-rail titles remain explicit, visible and typographically
   identical to the Recommended nearby heading. */
.discovery-rail-heading {
  align-items: end;
}
.discovery-rail-heading > .discovery-rail-title {
  display: block !important;
  flex: 1 1 auto;
  min-width: 0;
  margin: 0;
  overflow: hidden;
  color: var(--ink, #171a1d) !important;
  font-family: inherit;
  font-size: clamp(21px, 4vw, 29px);
  font-weight: 900;
  line-height: 1.02;
  letter-spacing: -.04em;
  text-overflow: ellipsis;
  white-space: nowrap;
  opacity: 1 !important;
  visibility: visible !important;
}
/* Step 35BQ: ratings stay textual when empty, while genuine ratings show
   only the earned number of yellow stars. Numeric rating and review count
   remain black for clarity. */
.discovery-seller-rating {
  display: inline-flex !important;
  width: auto !important;
  max-width: 100%;
  align-items: center;
  gap: 2px;
  overflow: visible !important;
  color: #171a1d !important;
  text-overflow: clip !important;
  white-space: nowrap !important;
}
.discovery-seller-rating-value,
.discovery-seller-review-count {
  display: inline !important;
  width: auto !important;
  overflow: visible !important;
  color: #171a1d !important;
  text-overflow: clip !important;
  white-space: nowrap !important;
}
.discovery-seller-stars {
  display: inline !important;
  width: auto !important;
  overflow: visible !important;
  color: #171a1d !important;
  letter-spacing: 0;
  line-height: 1;
  text-overflow: clip !important;
  white-space: nowrap !important;
}
.discovery-seller-rating.has-rating .discovery-seller-stars {
  color: #ffd321 !important;
  text-shadow: 0 1px 0 rgba(91, 62, 0, .16);
}

/* Step 35DV: one public rating language everywhere. Rated sellers show only
   the earned number of yellow stars; unrated sellers keep one neutral star. */
[data-eetza-rating],
.eetza-rating {
  display: inline-flex !important;
  align-items: center !important;
  gap: 2px !important;
  max-width: 100% !important;
  white-space: nowrap !important;
}
.eetza-rating-stars {
  display: inline-block !important;
  width: auto !important;
  overflow: visible !important;
  color: #81766f !important;
  font-size: .92em !important;
  font-weight: 900 !important;
  letter-spacing: -.055em !important;
  line-height: 1 !important;
  white-space: nowrap !important;
}
[data-eetza-rating].has-rating .eetza-rating-stars,
.eetza-rating.has-rating .eetza-rating-stars {
  color: #ffd21a !important;
  text-shadow: 0 1px 0 rgba(91, 62, 0, .18) !important;
}
.eetza-rating-empty-stars {
  color: rgba(255,255,255,.68) !important;
  text-shadow: 0 1px 3px rgba(0,0,0,.35) !important;
}
.marketplace-favourite-rating .eetza-rating-stars {
  font-size: .9em !important;
}
html.eetza-store-detail-page body.seller-detail-page .store-rating-stars {
  display: inline-block !important;
  color: #ffd21a !important;
  font-size: 15px !important;
  font-weight: 900 !important;
  letter-spacing: -.08em !important;
  line-height: 1 !important;
  text-shadow: 0 2px 6px rgba(0,0,0,.52) !important;
  white-space: nowrap !important;
}
html.eetza-store-detail-page body.seller-detail-page .store-rating.has-no-rating .store-rating-stars {
  color: rgba(255,255,255,.8) !important;
}
html.eetza-store-detail-page body.seller-detail-page .store-rating-value {
  display: inline-block !important;
}
html.eetza-store-detail-page body.seller-detail-page .store-review-stars .eetza-rating-stars {
  color: #ffd21a !important;
  font-size: inherit !important;
  letter-spacing: .01em !important;
  text-shadow: none !important;
}
html.eetza-store-detail-page body.seller-detail-page .store-review-stars .eetza-rating-empty-stars {
  color: #cfc5be !important;
  text-shadow: none !important;
}


/* Step 35EF: remove repeated orange action labels without changing the
   established compact rail and all-store card structure. */
.discovery-card-action {
  display: none !important;
}
.discovery-seller-card[data-card-url] {
  cursor: pointer;
}
