/* Homepage V2: banners, product lines and the live WooCommerce catalog. */

.gm-home-v2 {
    --gm-home-canvas: #0b0b0f;
    --gm-home-panel: #202025;
    --gm-home-card: #25252a;
    --gm-home-raised: #2c2c32;
    --gm-home-border: rgba(255, 255, 255, .13);
    --gm-home-muted: #a7a7af;
    min-height: 100vh;
    padding-top: 64px;
    overflow: clip;
    color: #f7f7f8;
    background: var(--gm-home-canvas);
    letter-spacing: 0;
}

.admin-bar .gm-home-v2 { padding-top: 64px; }

.gm-home-v2 *,
.gm-home-v2 *::before,
.gm-home-v2 *::after { box-sizing: border-box; }

.gm-home-shell {
    width: min(100%, 1512px);
    margin: 0 auto;
    padding-right: 24px;
    padding-left: 24px;
}

.gm-home-banners { padding-top: 24px; }

.gm-home-banner-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.65fr) minmax(320px, .85fr);
    gap: 14px;
}

.gm-home-banner {
    position: relative;
    display: flex;
    min-height: 300px;
    overflow: hidden;
    color: #fff;
    background: #17171c;
    border: 1px solid rgba(255, 255, 255, .11);
    border-radius: 6px;
    isolation: isolate;
}

.gm-home-banner--custom {
    min-height: 130px;
    margin-top: 10px;
}

.gm-home-banner-image {
    position: absolute;
    inset: 0;
    z-index: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    transition: transform .45s ease;
}

.gm-home-banner:hover .gm-home-banner-image { transform: scale(1.025); }

.gm-home-eyebrow {
    display: block;
    margin-bottom: 12px;
    color: var(--orange);
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 600;
    line-height: 1.4;
    letter-spacing: 0;
    text-transform: uppercase;
}

.gm-lines { padding-top: 24px; }
.gm-home-catalog { padding-top: 44px; }

.gm-lines { padding-bottom: 8px; }

.gm-lines-frame { position: relative; }

.gm-section-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 22px;
}

.gm-section-head h2 {
    margin: 0;
    color: #f7f7f8;
    font-family: var(--font-head);
    font-size: 34px;
    font-weight: 700;
    line-height: 1.12;
    letter-spacing: 0;
}

.gm-slider-controls,
.gm-catalog-tools {
    display: flex;
    align-items: center;
    gap: 8px;
}

.gm-icon-button,
.gm-quick-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
    color: #f7f7f8;
    background: var(--gm-home-panel);
    border: 1px solid var(--gm-home-border);
    border-radius: 5px;
    font-size: 18px;
    transition: color .15s ease, border-color .15s ease, background .15s ease;
}

.gm-icon-button:hover,
.gm-icon-button:focus-visible,
.gm-quick-button:hover,
.gm-quick-button:focus-visible {
    color: #0c0c0e;
    background: var(--orange);
    border-color: var(--orange);
    outline: none;
}

.gm-lines-track {
    display: grid;
    grid-auto-columns: clamp(210px, calc(18.1818% - 8px), 270px);
    grid-auto-flow: column;
    gap: 10px;
    overflow-x: auto;
    padding: 4px 1px 2px;
    scroll-behavior: smooth;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
}

.gm-lines-track::-webkit-scrollbar { display: none; }

.gm-line-control {
    position: absolute;
    top: 50%;
    z-index: 4;
    width: 40px;
    height: 40px;
    min-width: 40px;
    min-height: 40px;
    transform: translateY(-50%);
    box-shadow: 0 8px 22px rgba(0, 0, 0, .32);
}

.gm-line-control--prev { left: 8px; }
.gm-line-control--next { right: 8px; }
.gm-line-control[hidden] { display: none; }

.gm-line-link {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 116px;
    padding: 14px;
    color: #f7f7f8;
    background: var(--gm-home-panel);
    border: 1px solid var(--gm-home-border);
    border-radius: 5px;
    scroll-snap-align: start;
    transition: border-color .15s ease, transform .15s ease, background .15s ease;
}

.gm-line-link:hover,
.gm-line-link:focus-visible,
.gm-line-link.is-active {
    background: var(--gm-home-raised);
    border-color: var(--orange);
    outline: none;
    transform: none;
}

.gm-line-index,
.gm-line-count {
    color: var(--gm-home-muted);
    font-family: var(--font-mono);
    font-size: 10px;
    line-height: 1.35;
    letter-spacing: 0;
    text-transform: uppercase;
}

.gm-line-name {
    margin: 16px 0;
    font-family: var(--font-head);
    font-size: 17px;
    font-weight: 700;
    line-height: 1.25;
}

.gm-home-catalog {
    padding-bottom: 100px;
    scroll-margin-top: 84px;
}

.gm-home-catalog > .gm-home-shell {
    width: min(100%, 1480px);
    padding-right: 32px;
    padding-left: 32px;
}

.gm-home-catalog-layout {
    display: grid;
    grid-template-columns: 240px minmax(0, 1fr);
    gap: 32px;
    align-items: start;
}

.gm-home-filters {
    position: sticky;
    top: 84px;
    padding: 20px;
    background: var(--gm-home-panel);
    border: 0;
    border-radius: 6px;
}

.admin-bar .gm-home-filters { top: 116px; }

.gm-filter-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 18px;
    color: #f7f7f8;
    font-family: var(--font-head);
    font-size: 18px;
    font-weight: 700;
}

.gm-filter-close {
    display: none;
    width: 44px;
    height: 44px;
    color: inherit;
    border: 1px solid var(--gm-home-border);
    border-radius: 5px;
}

.gm-home-v2 .filter-group {
    margin: 0;
    padding: 16px 0;
    border-top: 1px solid var(--gm-home-border);
}

.gm-home-v2 .filter-label {
    margin: 0 0 10px;
    color: var(--gm-home-muted);
    letter-spacing: 0;
}

.gm-home-v2 .filter-option {
    min-height: 40px;
    padding: 8px 7px;
    color: rgba(255,255,255,.82);
    letter-spacing: 0;
}

.gm-home-v2 .filter-option:hover { background: var(--gm-home-raised); }

.gm-home-v2 .filter-empty {
    margin: 0;
    padding: 8px 7px 4px;
    color: var(--gm-home-muted);
    font-size: 12px;
    line-height: 1.45;
}

.gm-home-v2 .filter-price-range label,
.gm-home-v2 .filter-check-box { background: var(--gm-home-card); }

.gm-home-v2 .filter-price-range input { color: #f7f7f8; }

.gm-home-v2 .filter-check {
    min-height: 44px;
    color: rgba(255,255,255,.82);
}

.gm-home-v2 .filter-actions {
    display: grid;
    gap: 10px;
}

.gm-home-v2 .filter-reset {
    min-height: 40px;
    justify-content: center;
    color: var(--gm-home-muted);
    letter-spacing: 0;
}

.gm-active-filters {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 30px;
    flex-wrap: wrap;
}

.gm-active-filters.is-empty { display: none; }

.gm-active-clear {
    color: var(--gm-home-muted);
    font-family: var(--font-mono);
    font-size: 10px;
    letter-spacing: 0;
    text-transform: uppercase;
}

.gm-active-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 28px;
    padding: 5px 8px;
    color: #0b0b0d;
    background: var(--orange);
    border: 0;
    border-radius: 4px;
    font-family: inherit;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
}

.gm-active-clear {
    padding: 10px 4px;
    background: transparent;
    border: 0;
    font-family: inherit;
    cursor: pointer;
}

.gm-home-sort {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--gm-home-muted);
    font-size: 12px;
}

.gm-home-sort select {
    min-height: 44px;
    padding: 0 36px 0 12px;
    color: #f7f7f8;
    background: var(--gm-home-panel);
    border: 1px solid var(--gm-home-border);
    border-radius: 5px;
}

.gm-filter-toggle {
    display: none;
    min-height: 44px;
    align-items: center;
    gap: 7px;
    padding: 0 13px;
    color: #f7f7f8;
    background: var(--gm-home-panel);
    border: 1px solid var(--gm-home-border);
    border-radius: 5px;
}

.gm-filter-toggle span {
    min-width: 20px;
    height: 20px;
    padding: 0 5px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #0b0b0d;
    background: var(--orange);
    border-radius: 3px;
    font-size: 10px;
    font-weight: 700;
}

.gm-home-result-count {
    min-height: 28px;
    margin: 0;
    color: var(--gm-home-muted);
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0;
    text-transform: uppercase;
}

.gm-home-result-count strong { color: #f7f7f8; }

.gm-home-results-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px 16px;
    min-height: 34px;
    margin-bottom: 10px;
}

.gm-home-products {
    min-width: 0;
}

.gm-page-link:focus-visible {
    outline: 2px solid var(--orange);
    outline-offset: 3px;
}

.gm-home-empty {
    min-height: 280px;
    padding: 42px;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    flex-direction: column;
    background: var(--gm-home-panel);
    border: 1px solid var(--gm-home-border);
    border-radius: 6px;
}

.gm-home-empty a { color: var(--orange); }

.gm-home-pagination {
    display: flex;
    max-width: 100%;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 22px;
}

.gm-page-gap {
    display: inline-flex;
    width: 24px;
    height: 40px;
    align-items: center;
    justify-content: center;
    color: var(--gm-home-muted);
    font-family: var(--font-mono);
}

.gm-page-link {
    display: inline-flex;
    width: 40px;
    height: 40px;
    align-items: center;
    justify-content: center;
    color: var(--gm-home-muted);
    background: var(--gm-home-panel);
    border-radius: 4px;
    font-family: var(--font-mono);
    font-size: 12px;
}

.gm-page-link:hover,
.gm-page-link.is-current {
    color: #0b0b0d;
    background: var(--orange);
}

.gm-home-v2.is-loading .gm-home-results {
    opacity: .55;
    pointer-events: none;
}

.gm-home-v2.is-loading .gm-filter-form {
    cursor: progress;
}

.gm-home-quick-actions {
    position: fixed;
    right: 20px;
    bottom: 22px;
    z-index: 45;
    display: grid;
    gap: 8px;
    opacity: 0;
    transform: translateY(12px);
    pointer-events: none;
    transition: opacity .2s ease, transform .2s ease;
}

.gm-home-quick-actions.is-visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.gm-home-quick-actions .gm-quick-button {
    color: #0b0b0d;
    background: var(--orange);
    border-color: var(--orange);
}

.gm-home-filter-backdrop { display: none; }

html[data-theme="light"] .gm-home-v2 {
    --gm-home-canvas: #f2f3f5;
    --gm-home-panel: #fff;
    --gm-home-card: #fff;
    --gm-home-raised: #eceef1;
    --gm-home-border: rgba(20, 20, 24, .14);
    --gm-home-muted: #66676e;
    color: #17171a;
}

html[data-theme="light"] .gm-home-banner {
    color: #17171a;
    background: #fff;
    border-color: rgba(17, 18, 23, .14);
    box-shadow: 0 12px 30px rgba(17, 18, 23, .07);
}

html[data-theme="light"] .gm-home-banner-image {
    filter: none;
}

html[data-theme="light"] .gm-section-head h2,
html[data-theme="light"] .gm-line-link,
html[data-theme="light"] .gm-filter-head,
html[data-theme="light"] .gm-home-result-count strong,
html[data-theme="light"] .gm-filter-toggle,
html[data-theme="light"] .gm-home-sort select,
html[data-theme="light"] .gm-icon-button { color: #17171a; }

html[data-theme="light"] .gm-home-v2 .filter-option,
html[data-theme="light"] .gm-home-v2 .filter-check { color: #313137; }

html[data-theme="light"] .gm-home-v2 .filter-price-range input { color: #17171a; }

@media (min-width: 901px) {
    .gm-home-v2.is-enhanced .filter-apply { display: none; }
}

@media (max-width: 1240px) {
    .gm-home-banner-grid { grid-template-columns: minmax(0, 1.45fr) minmax(300px, .9fr); }
}

@media (max-width: 900px) {
    .gm-home-banner-grid { grid-template-columns: 1fr; }
    .gm-home-banner { min-height: 320px; }
    .gm-home-banner--pro { min-height: 300px; }
    .gm-home-banner--custom { min-height: 210px; }
    .gm-home-catalog-layout { grid-template-columns: 1fr; }
    .gm-home-results-head { align-items: flex-start; flex-direction: column; }
    .gm-home-v2.is-enhanced .gm-filter-toggle { display: inline-flex; }
    .gm-home-v2.is-enhanced .gm-home-filters {
        position: fixed;
        top: 0;
        right: 0;
        z-index: 1002;
        width: min(390px, 92vw);
        height: 100dvh;
        padding: 22px;
        overflow-y: auto;
        border-radius: 0;
        transform: translateX(102%);
        transition: transform .25s ease;
    }
    .admin-bar .gm-home-v2.is-enhanced .gm-home-filters { top: 0; }
    .gm-home-v2.is-enhanced .gm-home-filters.is-open { transform: translateX(0); }
    .gm-home-v2.is-enhanced .gm-filter-close { display: inline-flex; align-items: center; justify-content: center; }
    .gm-home-v2.is-enhanced .gm-home-filter-backdrop {
        position: fixed;
        inset: 0;
        z-index: 1001;
        display: block;
        visibility: hidden;
        background: rgba(0,0,0,.66);
        opacity: 0;
        transition: opacity .2s ease, visibility 0s linear .2s;
    }
    .gm-home-v2.is-enhanced .gm-home-filter-backdrop.is-open {
        visibility: visible;
        opacity: 1;
        transition-delay: 0s;
    }
    body.gm-home-filters-open { overflow: hidden; }
}

@media (max-width: 680px) {
    .gm-home-v2 { padding-top: 64px; }
    .gm-home-shell { padding-right: 12px; padding-left: 12px; }
    .gm-home-banners { padding-top: 12px; }
    .gm-home-banner-grid { gap: 9px; }
    .gm-home-banner { min-height: 260px; }
    .gm-home-banner--pro { min-height: 250px; }
    .gm-home-banner--custom { min-height: 205px; margin-top: 9px; }
    .gm-lines { padding-top: 18px; }
    .gm-home-catalog { padding-top: 36px; }
    .gm-section-head { align-items: flex-start; flex-direction: column; }
    .gm-section-head--catalog { gap: 14px; }
    .gm-section-head h2 { font-size: 28px; }
    .gm-catalog-tools { width: 100%; justify-content: space-between; }
    .gm-home-sort { flex: 1; justify-content: flex-end; }
    .gm-home-sort > span { display: none; }
    .gm-home-sort select { width: min(100%, 190px); }
    .gm-lines-track { grid-auto-columns: minmax(180px, 72vw); }
    .gm-line-link { min-height: 108px; }
    .gm-home-products { gap: 10px; }
    .gm-home-quick-actions { right: 12px; bottom: 14px; }
}

@media (max-width: 480px) {
    .gm-home-catalog > .gm-home-shell { padding-right: 16px; padding-left: 16px; }
}

@media (prefers-reduced-motion: reduce) {
    .gm-home-banner-image,
    .gm-line-link,
    .gm-home-filters,
    .gm-home-quick-actions { transition: none; }
    .gm-lines-track { scroll-behavior: auto; }
}
