/* SGM Search Studio 2D — shared header modal and animated catalogue search. */
.sgm-search-live { position: relative; overflow: visible; }
.sgm-search-live__panel[hidden],
.sgm-search-live__popular[hidden] { display: none !important; }

.sgm-search-live__popular { display: flex; align-items: center; gap: 12px; min-width: 0; }
.sgm-search-live__popular-label { flex: 0 0 auto; color: #8a9097; font-size: 10px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; }
.sgm-search-live__popular-items { display: flex; flex-wrap: wrap; gap: 7px; min-width: 0; }
.sgm-search-live__popular-button { min-height: 32px; padding: 6px 12px; border: 1px solid #dfe2e4; border-radius: 10px; color: #555c64; background: #fff; cursor: pointer; font-size: 11px; transition: color .18s ease, border-color .18s ease, background .18s ease, transform .18s ease; }
.sgm-search-live__popular-button:hover { border-color: #8c9298; color: #16191c; transform: translateY(-1px); }
.sgm-search-live__popular-button.is-active { border-color: #1a1d20; color: #fff; background: #1a1d20; }

.sgm-search-live__panel { z-index: 12000; min-width: 0; overflow: hidden; border: 1px solid #dfe2e4; border-radius: 18px; color: #171b1f; background: #fff; box-shadow: 0 24px 60px rgba(16,22,26,.14); transform-origin: top center; }
.sgm-search-live__panel.is-open { animation: sgm-search-accordion-in .34s cubic-bezier(.2,.78,.25,1) both; }
.sgm-search-live__list { display: grid; gap: 24px; padding: 22px; }
.sgm-search-live__section { min-width: 0; }
.sgm-search-live__section-head { min-height: 36px; display: flex; align-items: baseline; justify-content: space-between; gap: 18px; margin-bottom: 11px; }
.sgm-search-live__section-head > small { flex: 0 0 auto; color: #92989f; font-size: 10px; }
.sgm-search-live__section-title { display: flex; align-items: baseline; gap: 13px; min-width: 0; }
.sgm-search-live__section-title h2 { margin: 0; color: #25292e; font-size: 19px; line-height: 1.2; font-weight: 600; letter-spacing: -.025em; }
.sgm-search-live__section-index { color: #92989f; font-size: 10px; font-weight: 700; letter-spacing: .08em; }
.sgm-search-live__section--organic { padding-top: 22px; border-top: 1px solid #e1e4e6; }
.sgm-search-live__cards { display: grid; min-width: 0; }
.sgm-search-live__product,
.sgm-search-live__all { min-width: 0; color: #171b1f; text-decoration: none; }
.sgm-search-live__product { display: grid; position: relative; overflow: hidden; border-radius: 14px; transition: transform .18s ease, background .18s ease, box-shadow .18s ease; }
.sgm-search-live__product:hover,
.sgm-search-live__product.is-active,
.sgm-search-live__all:hover,
.sgm-search-live__all.is-active { outline: none; transform: translateY(-2px); }
.sgm-search-live__product img { width: 100%; height: 100%; object-fit: cover; background: #f1f2f3; }
.sgm-search-live__copy { display: grid; align-content: center; gap: 4px; min-width: 0; }
.sgm-search-live__copy strong { overflow: hidden; color: #15181b; font-size: 14px; line-height: 1.3; text-overflow: ellipsis; white-space: nowrap; }
.sgm-search-live__copy small { color: #727981; font-size: 12px; }
.sgm-search-live__all { display: flex; grid-column: 1 / -1; align-items: center; justify-content: center; gap: 9px; min-height: 46px; border: 1px solid #dfe2e4; border-radius: 12px; font-size: 11px; font-weight: 700; transition: border-color .18s ease, background .18s ease, transform .18s ease; }
.sgm-search-live__all:hover, .sgm-search-live__all.is-active { border-color: #aeb3b8; background: #f7f8f8; }
.sgm-search-live__all svg { width: 15px; height: 15px; }
.sgm-search-live__state { padding: 34px 24px; color: #737a82; font-size: 13px; text-align: center; }
.sgm-search-live__state--loading { display: flex; align-items: center; justify-content: center; gap: 11px; }
.sgm-search-live__spinner { width: 18px; height: 18px; border: 2px solid #d9dde0; border-top-color: #1b1e21; border-radius: 50%; animation: sgm-search-spin .7s linear infinite; }

/* Header: centered Search Studio modal. */
body.sgm-search-modal-open { overflow: hidden; }
body .header-normal-search,
body .header-search { position: fixed !important; z-index: 15000; inset: 0 !important; width: auto !important; height: 100dvh; padding: clamp(12px,4vh,42px) 28px !important; overflow-y: auto; background: rgba(6,7,9,.62) !important; box-shadow: none !important; opacity: 0; transition: opacity .22s ease; backdrop-filter: blur(4px); }
body .header-normal-search.is-open,
body .header-search.is-open { opacity: 1; }
body .header-normal-search[hidden],
body .header-search[hidden] { display: none !important; }
body .header-normal-search-toggle,
body .header-hero-search-toggle { display: flex; }
.header-normal-search-container,
.header-hero-search-container { width: min(1120px,100%) !important; max-height: calc(100dvh - clamp(24px,8vh,84px)); margin: 0 auto !important; padding: 0 !important; overflow-x: hidden; overflow-y: auto; border: 1px solid rgba(255,255,255,.18) !important; border-radius: 22px !important; background: #fff !important; box-shadow: 0 38px 110px rgba(0,0,0,.32) !important; transform: translateY(-14px) scale(.985); transition: transform .3s cubic-bezier(.2,.78,.25,1); }
.is-open > .header-normal-search-container,
.is-open > .header-hero-search-container { transform: translateY(0) scale(1); }
.header-normal-search-form,
.header-hero-search-form { display: grid !important; grid-template-columns: minmax(0,1fr) 48px 48px; gap: 10px !important; padding: 22px 24px 25px; }
.header-normal-search-input,
.header-hero-search-input { grid-column: 1; min-width: 0; width: 100%; height: 58px !important; padding: 0 20px !important; border: 1px solid #dce0e3 !important; border-radius: 14px !important; outline: 0; color: #111417; background: #f7f8f8 !important; font-size: 17px !important; transition: border-color .2s ease, box-shadow .2s ease !important; }
.header-normal-search-input:focus,
.header-hero-search-input:focus { border-color: #858b92 !important; box-shadow: 0 0 0 3px rgba(25,28,31,.08) !important; }
.header-normal-search-submit,
.header-hero-search-submit,
.header-normal-search-close,
.header-hero-search-close { position: static !important; display: flex; align-items: center; justify-content: center; width: 48px !important; height: 58px !important; padding: 0 !important; border: 0 !important; border-radius: 14px !important; cursor: pointer; transition: color .18s ease, background .18s ease !important; }
.header-normal-search-submit,
.header-hero-search-submit { grid-column: 2; color: #fff !important; background: #171a1d !important; }
.header-normal-search-close,
.header-hero-search-close { grid-column: 3; color: #646b73 !important; background: #f1f2f3 !important; }
.header-normal-search-submit:hover,
.header-hero-search-submit:hover { color: #fff !important; background: #30343a !important; }
.header-normal-search-close:hover,
.header-hero-search-close:hover { color: #171a1d !important; background: #e5e7e9 !important; }
.header-normal-search-form .sgm-search-live__popular,
.header-hero-search-form .sgm-search-live__popular { grid-column: 1 / -1; padding: 3px 0 2px; }
.header-normal-search-form .sgm-search-live__panel,
.header-hero-search-form .sgm-search-live__panel { position: static !important; grid-column: 1 / -1; width: 100% !important; max-height: none; margin-top: 3px; box-shadow: none; }
.header-normal-search-form .sgm-search-live__cards--manual,
.header-hero-search-form .sgm-search-live__cards--manual,
.ap-search-form .sgm-search-live__cards--manual { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 13px; padding: 14px; border-radius: 16px; background: #eef2f4; }
.header-normal-search-form .sgm-search-live__product--manual,
.header-hero-search-form .sgm-search-live__product--manual,
.ap-search-form .sgm-search-live__product--manual { grid-template-columns: 112px minmax(0,1fr); align-items: center; min-height: 100px; background: #fff; }
.header-normal-search-form .sgm-search-live__product--manual:hover,
.header-hero-search-form .sgm-search-live__product--manual:hover,
.ap-search-form .sgm-search-live__product--manual:hover { background: #f8f9f9; box-shadow: 0 8px 22px rgba(24,29,33,.08); }
.header-normal-search-form .sgm-search-live__product--manual img,
.header-hero-search-form .sgm-search-live__product--manual img,
.ap-search-form .sgm-search-live__product--manual img { width: 112px; height: 100px; }
.header-normal-search-form .sgm-search-live__product--manual .sgm-search-live__copy,
.header-hero-search-form .sgm-search-live__product--manual .sgm-search-live__copy,
.ap-search-form .sgm-search-live__product--manual .sgm-search-live__copy { padding: 14px 17px; }
.header-normal-search-form .sgm-search-live__cards--organic,
.header-hero-search-form .sgm-search-live__cards--organic,
.ap-search-form .sgm-search-live__cards--organic { grid-template-columns: repeat(3,minmax(0,1fr)); gap: 10px 16px; }
.header-normal-search-form .sgm-search-live__product--organic,
.header-hero-search-form .sgm-search-live__product--organic,
.ap-search-form .sgm-search-live__product--organic { grid-template-columns: 62px minmax(0,1fr); align-items: center; gap: 11px; min-height: 68px; padding: 4px; border-bottom: 1px solid #e5e7e9; border-radius: 8px; }
.header-normal-search-form .sgm-search-live__product--organic:hover,
.header-hero-search-form .sgm-search-live__product--organic:hover,
.ap-search-form .sgm-search-live__product--organic:hover { background: #f4f5f6; }
.header-normal-search-form .sgm-search-live__product--organic img,
.header-hero-search-form .sgm-search-live__product--organic img,
.ap-search-form .sgm-search-live__product--organic img { width: 62px; height: 60px; border-radius: 7px; }

/* Listing: field stretches to full content width, then results unfold in flow. */
.ap-page-header-inner { flex-wrap: nowrap; transition: column-gap .42s cubic-bezier(.2,.78,.25,1); }
.ap-page-header-inner > :first-child { min-width: 0; max-width: calc(100% - 324px); overflow: hidden; white-space: nowrap; opacity: 1; transition: flex-basis .42s cubic-bezier(.2,.78,.25,1), max-width .42s cubic-bezier(.2,.78,.25,1), opacity .22s ease; }
.ap-page-header-inner.is-search-expanded { column-gap: 0; }
.ap-page-header-inner.is-search-expanded > :first-child { flex-basis: 0; max-width: 0; opacity: 0; }
.ap-header-search { flex: 0 0 300px; width: 300px; max-width: 100%; transition: width .42s cubic-bezier(.2,.78,.25,1), flex-basis .42s cubic-bezier(.2,.78,.25,1); }
.ap-header-search.is-expanded { flex-basis: 100%; width: 100%; }
.ap-search-form { display: grid; grid-template-columns: minmax(0,1fr) 42px 46px; gap: 7px; width: 100%; }
.ap-search-form input[type="search"] { grid-column: 1; width: 100%; min-width: 0; height: 46px; padding: 0 16px !important; }
.ap-search-form input[type="search"]::-webkit-search-cancel-button { display: none; -webkit-appearance: none; }
.ap-search-submit { position: static !important; grid-column: 3; display: grid; place-items: center; width: 46px; height: 46px; padding: 0; border: 0; border-radius: 12px; color: #fff; background: #181b1e; cursor: pointer; }
.ap-search-form .ap-search-icon { position: static; transform: none; color: currentColor; }
.sgm-search-live__clear { display: grid; grid-column: 2; place-items: center; width: 42px; height: 46px; padding: 0; border: 0; border-radius: 12px; color: #737a82; background: #f0f2f3; cursor: pointer; font-size: 21px; }
.ap-header-search:not(.is-expanded) .sgm-search-live__clear { display: none; }
.ap-header-search:not(.is-expanded) .ap-search-form { grid-template-columns: minmax(0,1fr) 46px; }
.ap-header-search:not(.is-expanded) .ap-search-submit { grid-column: 2; }
.ap-search-form .sgm-search-live__popular { grid-column: 1 / -1; padding: 8px 0 2px; }
.ap-header-search:not(.is-expanded) .sgm-search-live__popular { display: none !important; }
.ap-search-form .sgm-search-live__panel { position: static; grid-column: 1 / -1; width: 100%; max-height: none; margin-top: 6px; box-shadow: 0 18px 55px rgba(18,23,28,.09); }

/* Full result page follows the same numbered editorial hierarchy. */
.ap-search-recommended { margin: 0 0 30px; }
.ap-search-recommended-head, .ap-search-organic-head { display: flex; align-items: baseline; gap: 13px; min-height: 36px; margin-bottom: 12px; }
.ap-search-recommended-head span, .ap-search-organic-head span { color: #92989f; font-size: 10px; font-weight: 700; letter-spacing: .08em; }
.ap-search-recommended-head h2, .ap-search-organic-head h2 { margin: 0; color: #25292e; font-size: 19px; font-weight: 600; letter-spacing: -.025em; }
.ap-search-recommended .ap-products-grid { padding: 16px; border-radius: 16px; background: #eef2f4; }
.ap-search-organic-head { margin-top: 28px; }

@keyframes sgm-search-spin { to { transform: rotate(360deg); } }
@keyframes sgm-search-accordion-in { from { opacity: 0; transform: translateY(-10px) scaleY(.96); } to { opacity: 1; transform: translateY(0) scaleY(1); } }

@media (max-width: 1024px) {
	.header-normal-search-form .sgm-search-live__cards--organic,
	.header-hero-search-form .sgm-search-live__cards--organic,
	.ap-search-form .sgm-search-live__cards--organic { grid-template-columns: repeat(2,minmax(0,1fr)); }
}

@media (max-width: 768px) {
	body .header-normal-search,
	body .header-search { padding: 10px !important; }
	.header-normal-search-container,
	.header-hero-search-container { max-height: calc(100dvh - 20px); border-radius: 17px !important; }
	.header-normal-search-form,
	.header-hero-search-form { grid-template-columns: minmax(0,1fr) 44px 44px; gap: 7px !important; padding: 12px; }
	.header-normal-search-input,
	.header-hero-search-input { height: 52px !important; font-size: 15px !important; }
	.header-normal-search-submit,
	.header-hero-search-submit,
	.header-normal-search-close,
	.header-hero-search-close { width: 44px !important; height: 52px !important; border-radius: 12px !important; }
	.sgm-search-live__popular { align-items: flex-start; flex-direction: column; gap: 7px; }
	.sgm-search-live__popular-items { flex-wrap: nowrap; width: 100%; padding-bottom: 3px; overflow-x: auto; }
	.sgm-search-live__popular-button { flex: 0 0 auto; }
	.sgm-search-live__list { gap: 19px; padding: 14px; }
	.sgm-search-live__section-head { min-height: 31px; }
	.sgm-search-live__section-title { gap: 9px; }
	.sgm-search-live__section-title h2 { font-size: 17px; }
	.header-normal-search-form .sgm-search-live__cards--manual,
	.header-hero-search-form .sgm-search-live__cards--manual,
	.header-normal-search-form .sgm-search-live__cards--organic,
	.header-hero-search-form .sgm-search-live__cards--organic,
	.ap-search-form .sgm-search-live__cards--manual,
	.ap-search-form .sgm-search-live__cards--organic { grid-template-columns: 1fr; }
	.header-normal-search-form .sgm-search-live__cards--manual,
	.header-hero-search-form .sgm-search-live__cards--manual,
	.ap-search-form .sgm-search-live__cards--manual { padding: 10px; }
	.header-normal-search-form .sgm-search-live__product--manual,
	.header-hero-search-form .sgm-search-live__product--manual,
	.ap-search-form .sgm-search-live__product--manual { grid-template-columns: 86px minmax(0,1fr); min-height: 82px; }
	.header-normal-search-form .sgm-search-live__product--manual img,
	.header-hero-search-form .sgm-search-live__product--manual img,
	.ap-search-form .sgm-search-live__product--manual img { width: 86px; height: 82px; }
	.header-normal-search-form .sgm-search-live__product--organic,
	.header-hero-search-form .sgm-search-live__product--organic,
	.ap-search-form .sgm-search-live__product--organic { grid-template-columns: 62px minmax(0,1fr); }
	.ap-page-header-inner { align-items: stretch; }
	.ap-page-header-inner > :first-child { max-width: 100%; white-space: normal; opacity: 1; }
	.ap-page-header-inner.is-search-expanded { gap: 24px; }
	.ap-page-header-inner.is-search-expanded > :first-child { flex-basis: auto; max-width: 100%; opacity: 1; }
	.ap-header-search { flex-basis: 100%; width: 100%; }
	.ap-header-search.is-expanded { margin-top: 4px; }
}

@media (max-width: 430px) {
	.header-normal-search-form,
	.header-hero-search-form { grid-template-columns: minmax(0,1fr) 42px; }
	.header-normal-search-submit,
	.header-hero-search-submit { grid-column: 2; width: 42px !important; }
	.header-normal-search-close,
	.header-hero-search-close { position: absolute !important; top: 4px; right: 4px; z-index: 3; width: 28px !important; height: 28px !important; border-radius: 50% !important; }
	.sgm-search-live__copy strong { font-size: 13px; }
	.sgm-search-live__copy small { font-size: 11px; }
}

@media (prefers-reduced-motion: reduce) {
	.sgm-search-live__panel.is-open,
	.sgm-search-live__spinner { animation-duration: .01ms !important; }
	.ap-page-header-inner,
	.ap-page-header-inner > :first-child,
	.ap-header-search { transition-duration: .01ms !important; }
	body .header-normal-search,
	body .header-search,
	.header-normal-search-container,
	.header-hero-search-container { transition-duration: .01ms !important; }
}
