/* Site search (design plan 1.14). Sandbox only; markup comes from so-skin-search.php.
   Results page: products in a grid, guides and articles in a plain list. Footer form and header link. */

/* ---- Results page ---- */
.so-srch { padding-bottom: 4.5rem; }
.so-srch-head { border-bottom: 1px solid var(--so-border, #e2e0d8); margin-bottom: 2.5rem; padding: 3rem 0 2.25rem; }
.so-srch-title { color: var(--so-green-dark, #1f3026); font-family: var(--so-font-display, Georgia, serif); font-size: clamp(1.75rem, 3.2vw, 2.5rem); font-weight: 400; letter-spacing: -.01em; line-height: 1.15; margin: 0 0 .5rem; overflow-wrap: anywhere; }
.so-srch-count { color: var(--wm-muted, #657067); font-size: 1rem; margin: 0 0 1.25rem; }

.so-srch-form { display: flex; gap: 8px; max-width: 560px; width: 100%; }
.so-srch-input { background: #fff; border: 1px solid var(--so-border, #d9d9d2); border-radius: 6px; color: var(--so-text, #1f3026); flex: 1 1 auto; font: inherit; font-size: 16px; height: 48px; margin: 0; min-width: 0; padding: 0 14px; }
.so-srch-input:focus-visible { border-color: var(--so-green, #2f5d46); outline: 2px solid var(--so-green, #2f5d46); outline-offset: 1px; }
.so-srch-button { background: var(--so-green-dark, #1f3026); border: 1px solid var(--so-green-dark, #1f3026); border-radius: 6px; color: #fff; cursor: pointer; flex: 0 0 auto; font: inherit; font-size: 15px; font-weight: 600; height: 48px; margin: 0; padding: 0 22px; }
.so-srch-button:hover, .so-srch-button:focus-visible { background: var(--so-green, #2f5d46); border-color: var(--so-green, #2f5d46); }
.so-srch-button:focus-visible { outline: 2px solid var(--so-green-dark, #1f3026); outline-offset: 2px; }

.so-srch-section { margin-bottom: 3.5rem; }
.so-srch-h2 { color: var(--so-green-dark, #1f3026); font-family: var(--so-font-display, Georgia, serif); font-size: 1.5rem; font-weight: 400; line-height: 1.2; margin: 0 0 1.25rem; }

.so-srch-products { display: grid; gap: 2.25rem 1.75rem; grid-template-columns: repeat(4, minmax(0, 1fr)); list-style: none; margin: 0; padding: 0; }
.so-srch-product { margin: 0; }
.so-srch-product-link { color: inherit; display: block; text-decoration: none; }
.so-srch-product-img { aspect-ratio: 3 / 2; background: var(--so-warm, #f7f5f0); border-radius: 6px; display: block; overflow: hidden; }
.so-srch-product-img img { display: block; height: 100%; object-fit: cover; width: 100%; }
.so-srch-product-name { color: var(--so-green-dark, #1f3026); display: block; font-family: var(--so-font-display, Georgia, serif); font-size: 1.15rem; line-height: 1.25; margin-top: .8rem; }
.so-srch-product-link:hover .so-srch-product-name { text-decoration: underline; text-underline-offset: 3px; }
.so-srch-product-link:focus-visible { outline: 2px solid var(--so-green, #2f5d46); outline-offset: 4px; }
.so-srch-product-price { color: var(--wm-muted, #657067); display: block; font-size: .95rem; margin-top: .3rem; }
.so-srch-product-price del { opacity: .75; text-decoration: line-through; }
.so-srch-product-price ins { color: var(--so-green-dark, #1f3026); font-weight: 600; text-decoration: none; }

.so-srch-list { list-style: none; margin: 0; max-width: 46rem; padding: 0; }
.so-srch-item { border-top: 1px solid var(--so-border, #e2e0d8); margin: 0; padding: 1.1rem 0; }
.so-srch-item:last-child { border-bottom: 1px solid var(--so-border, #e2e0d8); }
.so-srch-item-title { font-family: var(--so-font-display, Georgia, serif); font-size: 1.2rem; font-weight: 400; line-height: 1.3; margin: 0 0 .3rem; }
.so-srch-item-title a { color: var(--so-green-dark, #1f3026); }
.so-srch-item-title a:hover { color: var(--so-green, #2f5d46); }
.so-srch-item-text { color: var(--wm-muted, #657067); font-size: .95rem; line-height: 1.55; margin: 0; }
.so-srch-more { margin: 1.25rem 0 0; }
.so-srch-more a, .so-srch-links a { color: var(--so-green, #2f5d46); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }

.so-srch-empty { max-width: 40rem; }
.so-srch-empty p { color: var(--wm-muted, #657067); margin: 0 0 1.25rem; }
.so-srch-links { list-style: none; margin: 0; padding: 0; }
.so-srch-links li { border-top: 1px solid var(--so-border, #e2e0d8); margin: 0; }
.so-srch-links li:last-child { border-bottom: 1px solid var(--so-border, #e2e0d8); }
.so-srch-links a { align-items: center; display: flex; min-height: 52px; }

@media (max-width: 980px) { .so-srch-products { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 600px) {
  .so-srch { padding-bottom: 3rem; }
  .so-srch-head { margin-bottom: 1.75rem; padding: 1.75rem 0 1.5rem; }
  .so-srch-button { padding: 0 16px; }
  .so-srch-products { gap: 1.5rem 14px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .so-srch-product-name { font-size: 1.02rem; }
  .so-srch-product-price { font-size: .875rem; }
  .so-srch-section { margin-bottom: 2.5rem; }
}

/* ---- Footer form ---- */
.so-footer-search { border-top: 1px solid var(--so-footer-line, #333); padding: 1.75rem 0; }
.so-footer-search-inner { align-items: center; display: flex; flex-wrap: wrap; gap: 12px 24px; justify-content: center; }
.so-footer-search-label { color: var(--so-gold-pale, #fff); font-family: var(--so-font-display, Georgia, serif); font-size: 1.15rem; margin: 0; }
.so-footer-search .so-srch-form { max-width: 440px; }
.so-footer-search .so-srch-input { background: rgba(255,255,255,.06); border-color: rgba(247,243,234,.35); color: #fff; }
.so-footer-search .so-srch-input::placeholder { color: rgba(247,243,234,.6); }
.so-footer-search .so-srch-input:focus-visible { border-color: #fff; outline-color: #fff; }
.so-footer-search .so-srch-button { background: var(--so-gold-pale, #f3e8cc); border-color: var(--so-gold-pale, #f3e8cc); color: var(--so-green-dark, #1f3026); }
.so-footer-search .so-srch-button:hover, .so-footer-search .so-srch-button:focus-visible { background: #fff; border-color: #fff; }
.so-footer-search .so-srch-button:focus-visible { outline-color: #fff; }
@media (max-width: 600px) {
  .so-footer-search { padding: 1.5rem 0; }
  .so-footer-search-inner { padding: 0 16px; }
  .so-footer-search .so-srch-form { max-width: none; }
}

/* ---- Header link ---- */
.so-search-link { align-items: center; color: var(--so-text, #1f3026); display: inline-flex; height: 44px; justify-content: center; margin-right: -.5rem; width: 44px; }
/* The icon is added by script (the header template has no hook). Hold its place until then so the menu does not
   move 26px when it arrives. */
.so-header-actions:not(:has(.so-search-link))::before { content: ""; flex: none; height: 44px; margin-right: -.5rem; width: 44px; }
.so-search-link:hover { color: var(--so-green, #2f5d46); }
.so-search-link:focus-visible { outline: 2px solid var(--so-green, #2f5d46); outline-offset: -4px; }

/* ---- Header search box (opens under the header from the search button) ---- */
.so-header-search { background: #fff; border-bottom: 1px solid var(--so-border, #d9d9d2); box-shadow: 0 10px 24px rgba(31,48,38,.08); left: 0; padding: 14px 0; position: absolute; right: 0; top: 100%; z-index: 9; }
.so-header-search[hidden] { display: none; }
.so-header-search-inner { align-items: center; display: flex; gap: 8px; justify-content: center; }
.so-header-search .so-srch-form { max-width: 620px; }
.so-header-search-close { background: none; border: 0; color: var(--so-text, #1f3026); cursor: pointer; flex: 0 0 auto; font-size: 26px; height: 44px; line-height: 1; width: 44px; }
.so-header-search-close:focus-visible { outline: 2px solid var(--so-green, #2f5d46); outline-offset: -4px; }
@media (max-width: 600px) { .so-header-search { padding: 10px 0; } .so-header-search-inner { padding: 0 12px; } }
