/* Components — dealer.international
   Depends on: base.css

   Buttons — single source of truth.
   Variants:
     .btn-primary       — green fill, white text. Default CTA.
     .btn-outline-light — white fill, green border, black text. CTA on light surfaces.
     .btn-outline       — transparent + green border + white text. CTA on dark surfaces (header).
     .btn-ghost         — transparent + white text, no shadow. Tertiary on dark surfaces (header).
     .btn-auth-dark     — black pill CTA for the auth entry surface.

   Modifiers:
     .btn-full          — width: 100%.

   Always pair the variant with the modifier (e.g. `class="btn-primary btn-full"`).
   When upgrading a Storefront-rendered button (e.g. .single_add_to_cart_button),
   add the variant class — base.css neutralizes Storefront's .button/.button.alt
   defaults so the variant wins without per-module specificity battles. */

.btn-primary,
.btn-outline,
.btn-outline-light,
.btn-ghost,
.btn-auth-dark,
.btn-telegram {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    height: var(--btn-height);
    padding: 0 20px;
    border-radius: var(--btn-radius-pill);
    font-family: var(--font-family);
    font-size: var(--font-size-btn);
    font-weight: var(--font-weight-medium);
    line-height: 1;
    text-decoration: none;
    text-transform: none;
    letter-spacing: 0;
    cursor: pointer;
    border: none;
    box-shadow: var(--btn-shadow);
    transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease, opacity 0.15s ease;
}

.btn-primary:disabled,
.btn-outline:disabled,
.btn-outline-light:disabled,
.btn-ghost:disabled,
.btn-auth-dark:disabled,
.btn-telegram:disabled,
.btn-primary.disabled,
.btn-outline.disabled,
.btn-outline-light.disabled,
.btn-ghost.disabled,
.btn-auth-dark.disabled,
.btn-telegram.disabled {
    opacity: var(--btn-disabled-opacity);
    cursor: not-allowed;
    pointer-events: none;
}

.btn-full {
    width: 100%;
}

/* Button — Primary */
.btn-primary {
    background-color: var(--color-primary);
    color: var(--color-white);
}

body.dealer-focus-modality-ready.dealer-using-keyboard .btn-primary:focus {
    background-color: var(--color-black);
    color: var(--color-white);
}

.btn-primary:hover {
    background-color: var(--color-primary);
    color: var(--color-black);
}

.btn-primary:active {
    background-color: var(--color-primary);
    color: var(--color-white);
}

/* Button — Telegram (black pill with brand glyph, used for Telegram CTAs) */
.btn-telegram {
    gap: 10px;
    background-color: var(--color-black);
    color: var(--color-white);
}

.btn-telegram:hover {
    background-color: var(--color-header);
    color: var(--color-white);
}

.btn-telegram:active {
    background-color: var(--color-black);
    color: var(--color-white);
}

body.dealer-focus-modality-ready.dealer-using-keyboard .btn-telegram:focus {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

/* Button — Outline-light (light backgrounds: catalog load-more, OOS notify CTA) */
.btn-outline-light {
    background-color: var(--color-white);
    color: var(--color-black);
    border: 1px solid var(--color-primary);
    box-shadow: none;
}

.btn-outline-light:hover {
    background-color: var(--color-primary);
    color: var(--color-white);
    border-color: var(--color-primary);
}

.btn-outline-light:active {
    background-color: var(--color-primary);
    color: var(--color-white);
    border-color: var(--color-primary);
}

body.dealer-focus-modality-ready.dealer-using-keyboard .btn-outline-light:focus {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

/* Button — Outline (dark backgrounds) */
.btn-outline {
    background-color: transparent;
    color: var(--color-white);
    border: 1px solid var(--color-primary);
}

body.dealer-focus-modality-ready.dealer-using-keyboard .btn-outline:focus {
    background-color: var(--color-black);
    color: var(--color-white);
    border-color: transparent;
}

.btn-outline:hover {
    background-color: var(--color-primary);
    color: var(--color-black);
    border-color: transparent;
}

.btn-outline:active {
    background-color: var(--color-primary);
    color: var(--color-white);
    border-color: transparent;
}

.btn-outline:disabled,
.btn-outline.disabled {
    background-color: transparent;
    color: var(--color-white);
    border: 1px solid var(--color-outline-disabled-border);
}

/* Button — Ghost (dark backgrounds) */
.btn-ghost {
    background-color: transparent;
    color: var(--color-white);
    box-shadow: none;
}

body.dealer-focus-modality-ready.dealer-using-keyboard .btn-ghost:focus {
    background-color: var(--color-black);
    color: var(--color-white);
}

.btn-ghost:hover {
    background-color: var(--color-primary);
    color: var(--color-black);
}

.btn-ghost:active {
    background-color: var(--color-primary);
    color: var(--color-white);
}

/* Button — Auth dark (light auth screens) */
.btn-auth-dark {
    background-color: var(--color-black);
    color: var(--color-white);
    border-radius: var(--btn-radius-pill);
}

.btn-auth-dark:hover,
.btn-auth-dark:active {
    background-color: var(--color-black);
    color: var(--color-white);
}

body.dealer-focus-modality-ready.dealer-using-keyboard .btn-auth-dark:focus {
    outline: 2px solid var(--color-black);
    outline-offset: 3px;
}

/* Text link — shared UI text action for anchors and button-like links.
   Use for small inline actions such as size charts, reset links, returns links,
   and notify text triggers. Do not use for nav menus, product-card media/title
   links, icon-only links, or CTA buttons. */
.dealer-text-link {
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    width: auto;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--link-text-color);
    font-family: var(--font-family);
    font-size: var(--font-size-small);
    font-weight: var(--font-weight-medium);
    line-height: 1.2;
    text-align: left;
    text-decoration-line: underline;
    text-decoration-thickness: var(--link-text-decoration-thickness);
    text-underline-offset: var(--link-text-underline-offset);
    text-transform: none;
    letter-spacing: 0;
    box-shadow: none;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
    transition: color 0.15s ease;
}

.dealer-text-link:hover {
    color: var(--link-text-hover-color);
}

body.dealer-focus-modality-ready.dealer-using-keyboard .dealer-text-link:focus {
    color: var(--link-text-hover-color);
    outline: var(--focus-outline-width) solid var(--color-primary);
    outline-offset: var(--focus-outline-offset);
}

.dealer-text-link--plain {
    text-decoration: none;
}

/* Modal — shared dialog shell.
   Used by simple info modals and product form modals. Module-specific CSS owns
   only the content inside the shared panel. */
.dealer-modal {
    position: fixed;
    inset: 0;
    z-index: 9000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.dealer-modal[hidden] {
    display: none;
}

.dealer-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    cursor: pointer;
}

.dealer-modal__panel {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 540px;
    max-height: calc(100vh - 32px);
    overflow-y: auto;
    padding: 28px 24px;
    background: var(--color-white);
    border-radius: 8px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
}

.dealer-modal__close {
    position: absolute;
    top: 16px;
    right: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--color-black);
    cursor: pointer;
}

.dealer-modal__close:hover {
    background: rgba(0, 0, 0, 0.06);
}

.dealer-modal__close:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

.dealer-modal__title {
    margin: 0 32px 16px 0;
    color: var(--color-black);
    font-family: var(--font-family);
    font-size: 22px;
    font-weight: var(--font-weight-semibold);
    line-height: 1.2;
}

.dealer-modal__intro {
    margin: 0 0 20px;
    color: var(--color-black);
    font-family: var(--font-family);
    font-size: 14px;
    font-weight: var(--font-weight-light);
    line-height: 1.5;
}

body.dealer-info-modal-open {
    overflow: hidden;
}

.dealer-info-modal__grip {
    display: none;
}

.dealer-info-modal__content {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin: 0 0 20px;
}

.dealer-info-modal__content p {
    margin: 0;
    color: var(--color-black);
    font-family: var(--font-family);
    font-size: 14px;
    font-weight: var(--font-weight-light);
    line-height: 1.55;
}

.dealer-info-modal__more {
    display: inline-flex;
    align-self: flex-start;
}

@media (min-width: 768px) {
    .dealer-modal__panel {
        padding: 32px;
    }

    .dealer-modal__title {
        font-size: 26px;
    }
}

@keyframes dealer-info-sheet-in {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

@media (max-width: 767px) {
    .dealer-info-modal {
        align-items: flex-end;
        padding: 0;
    }

    .dealer-info-modal__panel {
        max-width: 100%;
        max-height: 92vh;
        padding: 18px 20px 28px;
        border-radius: 16px 16px 0 0;
        box-shadow: 0 -8px 30px rgba(0, 0, 0, 0.18);
        animation: dealer-info-sheet-in 0.22s ease-out;
    }

    .dealer-info-modal__grip {
        display: block;
        width: 36px;
        height: 4px;
        margin: 0 auto 12px;
        background: rgba(0, 0, 0, 0.18);
        border-radius: 999px;
    }

    .dealer-info-modal .dealer-modal__close {
        top: 10px;
        right: 10px;
    }

    .dealer-info-modal__title {
        margin-bottom: 14px;
        font-size: 22px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .dealer-info-modal__panel {
        transition: none;
        animation: none;
    }
}

/* Product list - shared layout shell for product-card collections.
   Owns only list/viewport layout: columns, gaps, horizontal rail behavior,
   and list reset. The individual card UI stays in product-card.css. */
.dealer-product-list {
    --product-list-gap: 20px;
    --product-list-visible-mobile: 2;
    --product-list-visible-tablet: 3;
    --product-list-visible-desktop: 6;
    --product-list-padding-inline: 0px;

    width: 100%;
    min-width: 0;
}

.dealer-product-list__viewport {
    overflow-x: auto;
    overflow-y: visible;
    min-width: 0;
    scrollbar-width: none;
    scroll-snap-type: x mandatory;
    scroll-padding-inline: var(--product-list-padding-inline);
    -webkit-overflow-scrolling: touch;
}

.dealer-product-list__viewport::-webkit-scrollbar {
    display: none;
}

.dealer-product-list__items {
    display: flex;
    gap: var(--product-list-gap);
    min-width: 0;
    margin: 0;
    padding: 0 var(--product-list-padding-inline);
    list-style: none;
}

.dealer-product-list__items > .dealer-product-card {
    flex: 0 0 auto;
    width: calc((100% - ((var(--product-list-visible-mobile) - 1) * var(--product-list-gap))) / var(--product-list-visible-mobile));
    min-width: 0;
    scroll-snap-align: start;
}

/* Catalogs are real grids at every breakpoint, not horizontal rails. */
.dealer-product-list--catalog.dealer-product-list__items {
    display: grid;
    grid-template-columns: repeat(var(--product-list-visible-mobile), minmax(0, 1fr));
    padding: 0;
}

.dealer-product-list--catalog.dealer-product-list__items > .dealer-product-card {
    width: 100%;
    scroll-snap-align: none;
}

@media (min-width: 768px) {
    .dealer-product-list {
        --product-list-gap: 25px;
    }

    .dealer-product-list__items > .dealer-product-card {
        width: calc((100% - ((var(--product-list-visible-tablet) - 1) * var(--product-list-gap))) / var(--product-list-visible-tablet));
    }

    .dealer-product-list--catalog.dealer-product-list__items {
        grid-template-columns: repeat(var(--product-list-visible-tablet), minmax(0, 1fr));
    }
}

@media (min-width: 1024px) {
    .dealer-product-list {
        --product-list-gap: 30px;
    }

    .dealer-product-list__viewport {
        overflow: visible;
        scroll-snap-type: none;
    }

    .dealer-product-list__items {
        display: grid;
        grid-template-columns: repeat(var(--product-list-visible-desktop), minmax(0, 1fr));
    }

    .dealer-product-list__items > .dealer-product-card {
        width: 100%;
        scroll-snap-align: none;
    }

    .dealer-product-list--catalog.dealer-product-list__items {
        --product-list-visible-desktop: 5;
        grid-template-columns: repeat(var(--product-list-visible-desktop), minmax(0, 1fr));
    }
}

/* Promo banner */
.promo-banner {
    background: linear-gradient(var(--color-promo-start), var(--color-promo-end));
    color: var(--color-promo-text);
}

/* =========================================================================
   Breadcrumbs — Yoast-backed cross-surface component.
   Yoast renders the trail, inserts the "/" separator and emits the
   BreadcrumbList JSON-LD. We own only the <nav> shell and the visual style.
   Source of truth: docs/systems/BREADCRUMBS-SYSTEM.md
   ========================================================================= */
.dealer-breadcrumbs {
    margin: 16px 0;
    font-family: var(--font-family);
    font-size: 13px;
    font-weight: var(--font-weight-light);
    line-height: 1.4;
    color: var(--color-header);
}

/* Single line; scrolls horizontally on narrow screens instead of wrapping.
   Small vertical padding keeps link focus outlines from being clipped by the
   horizontal scroll container (overflow-x:auto forces overflow-y to auto). */
.dealer-breadcrumbs__inner {
    overflow-x: auto;
    white-space: nowrap;
    padding-block: 2px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}

.dealer-breadcrumbs__inner::-webkit-scrollbar {
    display: none;
}

.dealer-breadcrumbs a {
    color: var(--color-header);
    text-decoration: none;
}

.dealer-breadcrumbs a:hover,
.dealer-breadcrumbs a:focus-visible {
    color: var(--color-primary);
    text-decoration: underline;
    text-underline-offset: var(--link-text-underline-offset);
}

/* Current page (Yoast wraps the last crumb in .breadcrumb_last) is intentionally
   styled the same as every other crumb — same weight and colour, uniform trail. */

/* +5px breathing room between crumbs. Yoast nests each crumb in a <span>
   inside one wrapper <span>; the "/" separators are the text nodes between
   them, so margin on the crumb spans widens the gap on both sides. */
.dealer-breadcrumbs__inner > span > span {
    margin-inline: 2.5px;
}

.dealer-breadcrumbs__inner > span > span:first-child {
    margin-inline-start: 0;
}

.dealer-breadcrumbs__inner > span > span:last-child {
    margin-inline-end: 0;
}
