/* Approved layout integration. Existing theme owns colour/language preferences. */
.sm-header .sm-brand { align-items: center; min-width: 0; }
.sm-header .sm-layout-logo { width: auto; height: 32px; max-height: 32px; max-width: 180px; object-fit: contain; }
.sm-layout-hero-grid { grid-template-columns: minmax(0, 1fr) minmax(180px, 280px); gap: 40px; }
.sm-layout-hero-logo { display: flex; flex-direction: column; align-items: center; justify-content: center; width: 100%; max-width: 280px; margin-inline-start: auto; }
.sm-layout-hero-logo .sm-layout-logo { width: 100%; max-height: 280px; object-fit: contain; }
.sm-layout-hero-logo .sm-brand-name { font-size: clamp(28px, 3vw, 44px); line-height: 1.1; }
.sm-layout-hero-logo .sm-brand-kana { display: block; margin-top: 12px; }
.sm-layout-title-ja, .sm-layout-title-en { display: block; overflow-wrap: anywhere; }
.sm-layout-title-en { display: none; margin-top: .3em; font-size: .82em; font-weight: 500; line-height: 1.4; }
html.sm-language-en .sm-layout-title-en { display: block; }
.sm-header-search[hidden] { display: none; }
.sm-search-result-content > [data-sm-inventory-card-offers] { margin-top: 12px; }
.sm-layout-advanced, .sm-layout-surface { min-width: 0; }
.sm-layout-advanced h1, .sm-layout-surface h1 { margin: 0 0 18px; font-size: clamp(26px, 3.5vw, 40px); line-height: 1.3; overflow-wrap: anywhere; }
.sm-layout-advanced .sm-layout-search, .sm-layout-surface .sm-layout-search { width: 100%; }
.sm-layout-advanced .sm-layout-search input[type="search"], .sm-layout-surface .sm-layout-search input[type="search"] { flex: 1 1 260px; }
.sm-layout-tabs { align-items: center; }
.sm-layout-filter { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); align-items: end; gap: 12px; }
.sm-layout-filter label { min-width: 0; }
.sm-layout-filter label > span { display: block; margin-bottom: 5px; font-size: 12px; color: var(--sm-muted); }
.sm-layout-filter :is(input,select,button) { width: 100%; min-width: 0; max-width: 100%; }
.sm-layout-filter > label:first-child { grid-column: span 2; }
.sm-layout-tabs a, .sm-layout-search input, .sm-layout-search select, .sm-layout-search button { max-width: 100%; }
.sm-layout-advanced .sm-grid { display: grid; gap: 20px; }
.sm-layout-advanced :is(input,select), .sm-layout-surface :is(input,select) { background: var(--sm-card); color: var(--sm-text); }
.sm-layout-search button { border: 1px solid var(--sm-line); border-radius: 8px; background: var(--sm-card); color: var(--sm-text); cursor: pointer; }
.sm-theme :is(.sm-layout-tabs a,.sm-layout-search button,.sm-header-tools button):focus-visible { outline: 3px solid var(--sm-cyan); outline-offset: 3px; }
@media (max-width: 720px) {
    .sm-layout-hero-grid { grid-template-columns: minmax(0, 1fr); }
    .sm-layout-hero-logo { display: none; }
    .sm-header .sm-layout-logo { max-width: 120px; }
    .sm-layout-filter { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .sm-layout-filter > button { grid-column: 1 / -1; }
    .sm-layout-advanced .sm-layout-search, .sm-layout-surface .sm-layout-search { gap: 8px; }
    .sm-layout-advanced .sm-layout-search input[type="search"], .sm-layout-surface .sm-layout-search input[type="search"] { flex-basis: 100%; width: 100%; }
}
@media (max-width: 360px) {
    .sm-header-inner { flex-wrap: wrap; height: auto; min-height: 60px; padding-block: 10px; }
    .sm-header-tools { margin-inline-start: auto; }
    .sm-layout-filter { grid-template-columns: minmax(0, 1fr); }
    .sm-layout-filter > label:first-child { grid-column: auto; }
}
