/* OLH custom search — modal-style UI */

:root {
  --olh-bg: #fff;
  --olh-fg: #1a1a1a;
  --olh-muted: #6b7280;
  --olh-border: #e5e7eb;
  --olh-accent: #111827;
  --olh-sale: #d92626;
  --olh-radius: 8px;
  --olh-shadow: 0 24px 64px rgba(0, 0, 0, .18);
  --olh-gap: 16px;
}

/* ---------- Search trigger button ---------- */
.olh-trigger {
  background: transparent;
  border: 0;
  padding: 8px;
  cursor: pointer;
  color: inherit;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.olh-trigger:hover {
  opacity: .7;
}

.olh-trigger svg {
  width: 22px;
  height: 22px;
}

/* ---------- Modal backdrop ---------- */
/* Sits between the page and the panel. Captures outside clicks so the
   first click only closes the modal — the underlying element doesn't fire. */
.olh-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 99998;
  /* one below the panel */
  background: rgba(20, 20, 20, .12);
  display: none;
  cursor: pointer;
  opacity: 0;
  transition: opacity .3s ease-out;
}

.olh-modal-backdrop.is-open {
  display: block;
  opacity: 0.96;
}

/* ---------- Modal: top-anchored full-width panel (Cartier-style) ---------- */
.olh-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  max-height: calc(100vh - 3rem);
  min-height: 13.125rem;
  overflow-y: auto;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 99999;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 2rem 2rem 2.5rem;
  box-sizing: border-box;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: opacity .3s ease-out, visibility .3s ease-out, transform .3s ease-out;
  border-bottom: 1px solid var(--olh-border);
}

.olh-modal.is-open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

body.olh-modal-open {
  overflow: hidden;
}

/* Inner wrap — width-constrained content inside the full-width panel */
.olh-modal__inner {
  position: relative;
  width: 100%;
  max-width: 1280px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
}

@media (max-width: 720px) {
  .olh-modal {
    padding: 1.5rem 1rem 2rem;
  }
}

/* Close button — top-right of the panel */
.olh-modal__close {
  position: absolute;
  top: 0;
  right: 0;
  background: transparent;
  border: 0;
  padding: 8px;
  cursor: pointer;
  color: var(--olh-fg);
  z-index: 2;
}

.olh-modal__close svg {
  width: 20px;
  height: 20px;
}

.olh-modal__close:hover {
  opacity: .6;
}

/* Logo header */
.olh-modal__logo {
  text-align: center;
  margin-bottom: 24px;
}

.olh-modal__logo-img {
  height: 100px;
  width: auto;
  display: inline-block;
  object-fit: contain;
}

.olh-modal__logo-text {
  font-family: serif;
  font-size: 1.5rem;
  letter-spacing: .04em;
}

/* ---------- Centered input ---------- */
.olh-modal__form {
  display: flex;
  width: 100%;
  max-width: 1140px;
  gap: 12px;
  margin: 0 auto 20px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--olh-fg);
  align-items: center;
  box-sizing: border-box;
}

.olh-modal__form input[type="search"] {
  flex: 1 1 auto;
  width: 100%;
  min-width: 320px;
  box-sizing: border-box;
  border: 0;
  outline: 0;
  background: transparent;
  padding: 0 20px 0 0;
  margin: 0;
  font-family: "Roboto", sans-serif !important;
  font-size: 1rem;
  line-height: 1.4;
  color: var(--olh-fg);
  -webkit-appearance: none;
  appearance: none;
}

.olh-modal__form input[type="search"]::placeholder {
  color: var(--olh-fg);
  opacity: 0.45;
}

.olh-modal__form input[type="search"]::-webkit-input-placeholder {
  color: var(--olh-fg);
  opacity: 0.45;
}

.olh-modal__form input[type="search"]::-webkit-search-cancel-button {
  -webkit-appearance: none;
}

.olh-modal__form input[type="search"]::-webkit-search-decoration,
.olh-modal__form input[type="search"]::-webkit-search-cancel-button {
  display: none;
}

.olh-modal__clear {
  background: transparent;
  border: 0;
  cursor: pointer;
  padding: 0 12px;
  color: var(--olh-muted);
  font-size: 1.1rem;
  display: none;
}

.olh-modal__clear.is-visible {
  display: block;
}

@media (max-width: 600px) {
  .olh-modal__form {
    gap: 8px;
  }

  .olh-modal__form input[type="search"] {
    min-width: 0;
    font-size: 0.875rem;
    padding: 0 8px 0 0;
  }

  .olh-modal__submit {
    height: 30px;
    padding: 0 10px;
    font-size: 0.625rem;
    letter-spacing: 0.06em;
  }
}

.olh-modal__submit {
  align-self: center;
  background: var(--olh-fg);
  color: #fff;
  border: 0;
  height: 34px;
  padding: 0 16px;
  font-size: .72rem;
  letter-spacing: .08em;
  font-weight: 600;
  cursor: pointer;
  text-transform: uppercase;
  border-radius: 2px;
}

.olh-modal__submit:hover {
  background: #000;
}

/* 3-column results layout */
.olh-modal__results {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 48px;
  align-items: start;
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
  width: 100%;
}

.olh-modal__results>* {
  padding: 0 32px;
  min-width: 0;
}

.olh-modal__results>*+* {
  border-left: 1px solid var(--olh-border);
}

@media (max-width: 960px) {
  .olh-modal__results {
    grid-template-columns: 1fr;
  }

  .olh-modal__results>* {
    padding: 0;
  }

  .olh-modal__results>*+* {
    border-left: 0;
    border-top: 1px solid var(--olh-border);
    padding-top: 24px;
    margin-top: 8px;
  }
}

.olh-col__head {
  font-size: .8rem;
  letter-spacing: .12em;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--olh-fg);
  margin: 0 0 16px;
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.olh-col__count {
  color: var(--olh-muted);
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
}

.olh-col__viewall {
  display: inline-block;
  margin-top: 12px;
  font-size: .85rem;
  color: var(--olh-fg);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* Products column */
.olh-prod-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

@media (max-width: 960px) {
  .olh-prod-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.olh-card {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  transition: opacity .15s ease;
}

.olh-card:hover {
  opacity: .82;
}

.olh-card__media {
  position: relative;
  aspect-ratio: 1 / 1;
  background: #fff;
  overflow: hidden;
  margin-bottom: 8px;
}

.olh-card__img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.olh-card__img--placeholder {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #f0f0f0 0%, #e8e8e8 100%);
}

.olh-card__badge {
  position: absolute;
  top: 8px;
  left: 8px;
  padding: 3px 8px;
  font-size: .65rem;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.olh-card__badge--sale {
  background: var(--olh-sale);
  color: #fff;
}

.olh-card__badge--oos {
  background: #6b7280;
  color: #fff;
  left: auto;
  right: 8px;
}

.olh-card__body {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.olh-card__title {
  font-size: .9rem;
  line-height: 1.3;
  margin: 0;
  font-weight: 500;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.olh-card__price {
  font-size: .85rem;
  color: var(--olh-muted);
}

.olh-card__price del {
  margin-right: 4px;
}

.olh-card mark {
  background: #fff3a8;
  color: inherit;
  padding: 0 1px;
}

/* Articles column */
.olh-articles {
  list-style: none;
  margin: 0;
  padding: 0;
}

.olh-articles li {
  border-bottom: 1px solid var(--olh-border);
}

.olh-articles li:last-child {
  border-bottom: 0;
}

.olh-articles a {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 12px 0;
  color: var(--olh-fg);
  text-decoration: none;
  font-size: .9rem;
  line-height: 1.4;
  transition: padding-left .15s ease;
}

.olh-articles__title {
  font-weight: 500;
}

.olh-articles__excerpt {
  font-size: .8rem;
  line-height: 1.45;
  color: var(--olh-muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.olh-articles__excerpt mark,
.olh-others__excerpt mark,
.olh-other-tile__excerpt mark {
  background: transparent;
  color: var(--olh-fg);
  font-weight: 600;
}

.olh-others__excerpt {
  font-size: .8rem;
  line-height: 1.45;
  color: var(--olh-muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.olh-other-tile__excerpt {
  font-size: .8rem;
  line-height: 1.45;
  color: var(--olh-muted);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-top: 2px;
}

.olh-articles a:hover {
  padding-left: 6px;
}

/* Others column (modal) */
.olh-others {
  list-style: none;
  margin: 0;
  padding: 0;
}

.olh-others__row {
  border-bottom: 1px solid var(--olh-border);
}

.olh-others__row:last-child {
  border-bottom: 0;
}

.olh-others__row a {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 0;
  color: var(--olh-fg);
  text-decoration: none;
  font-size: .9rem;
  transition: padding-left .15s ease;
}

.olh-others__row a:hover {
  padding-left: 6px;
}

.olh-others__title {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.olh-others__meta {
  font-size: .72rem;
  color: var(--olh-muted);
  text-transform: uppercase;
  letter-spacing: .06em;
}

.olh-others__kind {
  font-weight: 500;
}

.olh-others__row--page .olh-others__kind {
  color: #2563eb;
}

.olh-others__row--look .olh-others__kind {
  color: #c19420;
}

.olh-others__row--category .olh-others__kind {
  color: #15803d;
}

/* Empty-state: 3 columns (Best Sellers | Featured | Journal) */
.olh-featured {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 0;
  width: 100%;
  grid-column: 1 / -1;
}

.olh-featured>* {
  padding: 0 32px;
  min-width: 0;
}

.olh-featured>*+* {
  border-left: 1px solid var(--olh-border);
}

@media (max-width: 960px) {
  .olh-featured {
    grid-template-columns: 1fr;
  }

  .olh-featured>* {
    padding: 0;
  }

  .olh-featured>*+* {
    border-left: 0;
    border-top: 1px solid var(--olh-border);
    padding-top: 24px;
    margin-top: 8px;
  }
}

/* Best Sellers column — 2×2 product grid */
.olh-featured-best {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

/* Featured column — 2 products stacked or side-by-side */
.olh-featured-pair {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

/* Empty state product cards: tighter imagery */
.olh-featured .olh-card__media {
  aspect-ratio: 1 / 1;
  margin-bottom: 8px;
}

.olh-featured .olh-card__title {
  font-size: .85rem;
  line-height: 1.3;
}

.olh-featured .olh-card__price {
  font-size: .8rem;
}

/* States */
.olh-loading,
.olh-error,
.olh-empty {
  padding: 48px 0;
  text-align: center;
  color: var(--olh-muted);
  grid-column: 1 / -1;
}

.olh-error {
  color: var(--olh-sale);
}

/* /search page — vertical sections */
.olh-page__results {
  display: block;
}

.olh-section {
  padding: 24px 0 32px;
}

.olh-section__divider {
  border: 0;
  border-top: 1px solid var(--olh-border);
  margin: 8px 0;
}

.olh-section__head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 24px;
}

.olh-section__title {
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: .02em;
  text-transform: uppercase;
  margin: 0;
}

.olh-section__count {
  font-weight: 400;
  font-size: .9rem;
  color: var(--olh-muted);
  letter-spacing: 0;
  text-transform: none;
}

.olh-section__viewall {
  display: inline-block;
  margin-top: 24px;
  font-size: .85rem;
  color: var(--olh-fg);
  text-decoration: underline;
  text-underline-offset: 4px;
  letter-spacing: .04em;
}

button.olh-section__viewall,
button.olh-section__viewmore {
  background: transparent;
  border: 0;
  padding: 0;
  cursor: pointer;
  font-family: inherit;
}

button.olh-section__viewmore:hover {
  opacity: .7;
}

/* Products grid: 8 cards in 4 columns */
.olh-section__grid--products {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
}

@media (min-width: 720px) {
  .olh-section__grid--products {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (min-width: 1024px) {
  .olh-section__grid--products {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

/* Articles grid: image + title + excerpt cards */
.olh-section__grid--articles {
  display: grid;
  grid-template-columns: repeat(1, minmax(0, 1fr));
  gap: 24px;
}

@media (min-width: 640px) {
  .olh-section__grid--articles {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 960px) {
  .olh-section__grid--articles {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.olh-article-card {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  transition: opacity .15s ease;
}

.olh-article-card:hover {
  opacity: .82;
}

.olh-article-card__media {
  aspect-ratio: 16 / 10;
  background: #f5f5f5;
  overflow: hidden;
  margin-bottom: 12px;
}

.olh-article-card__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.olh-article-card__body {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.olh-article-card__title {
  font-size: 1rem;
  font-weight: 500;
  line-height: 1.35;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.olh-article-card__excerpt {
  font-size: .85rem;
  color: var(--olh-muted);
  line-height: 1.5;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Others grid (page): mixed pages + looks + categories as pill tiles */
.olh-section__grid--others {
  display: grid;
  grid-template-columns: repeat(1, minmax(0, 1fr));
  gap: 12px;
  margin-top: 48px;
}

.olh-section__grid--articles + .olh-section__grid--others {
  margin-top: 56px;
}

@media (min-width: 640px) {
  .olh-section__grid--others {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 960px) {
  .olh-section__grid--others {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.olh-other-tile {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 14px 18px;
  border: 1px solid var(--olh-border);
  border-radius: var(--olh-radius);
  text-decoration: none;
  color: var(--olh-fg);
  font-size: .9rem;
  transition: border-color .15s ease, background .15s ease;
}

.olh-other-tile:hover {
  border-color: var(--olh-fg);
  background: #fafafa;
}

.olh-other-tile__title {
  font-weight: 500;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.olh-other-tile__meta {
  font-size: .7rem;
  color: var(--olh-muted);
  text-transform: uppercase;
  letter-spacing: .08em;
}

.olh-other-tile__kind {
  font-weight: 600;
}

.olh-other-tile--page .olh-other-tile__kind {
  color: #2563eb;
}

.olh-other-tile--look .olh-other-tile__kind {
  color: #c19420;
}

.olh-other-tile--category .olh-other-tile__kind {
  color: #15803d;
}

/* Legacy /search page styles (kept) */
.olh-page {
  max-width: 1280px;
  margin: 0 auto;
  padding: 32px 20px 64px;
}

/* Tighten theme's huge top padding on the search page wrapper */
body.page-search #qodef-page-inner,
body.page-template-page-olh-search #qodef-page-inner,
body.page-template-page-search #qodef-page-inner {
  padding-top: 40px;
}

.olh-page__title {
  font-size: clamp(1.5rem, 2.5vw, 2rem);
  margin: 0 0 12px;
}

.olh-page__form input[type="search"] {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid var(--olh-border);
  border-radius: var(--olh-radius);
  font-size: 1rem;
}

.olh-page__status {
  color: var(--olh-muted);
  margin: 8px 0 16px;
  font-size: .9rem;
}

.olh-group {
  margin-bottom: 40px;
}

.olh-group__head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--olh-border);
  padding-bottom: 8px;
}

.olh-group__title {
  font-size: 1.25rem;
  margin: 0;
}

.olh-group__count {
  font-size: .8rem;
  color: var(--olh-muted);
  margin-left: 8px;
}

.olh-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--olh-gap);
}

@media (min-width: 640px) {
  .olh-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (min-width: 960px) {
  .olh-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}