/* =========================================================================
   RYN Motors — Gear Page Styles
   Light theme to match main site. Green accent: #22c55e
   ========================================================================= */

/* ----- Reset & Base ----- */
.ryn-gear-page {
    background-color: #ffffff;
    color: #1a1a1a;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    padding-bottom: 80px;
}

.ryn-gear-page *,
.ryn-gear-page *::before,
.ryn-gear-page *::after {
    box-sizing: border-box;
}


/* ----- Hero Banner ----- */
.ryn-gear-hero {
    text-align: center;
    padding: 50px 20px 40px;
}

.ryn-gear-hero__inner {
    max-width: 800px;
    margin: 0 auto;
}

.ryn-gear-hero__title {
    font-size: 28px;
    font-weight: 700;
    letter-spacing: 3px;
    text-transform: uppercase;
    margin: 0 0 8px;
    color: #1a1a1a;
}

.ryn-gear-hero__subtitle {
    font-size: 14px;
    font-weight: 400;
    color: #666666;
    margin: 0 0 28px;
    line-height: 1.5;
}

.ryn-gear-hero__badge {
    display: inline-flex;
    align-items: center;
    gap: 14px;
}

.ryn-gear-hero__discount {
    font-size: 32px;
    font-weight: 800;
    color: #22c55e;
    line-height: 1;
}

.ryn-gear-hero__discount-note {
    font-size: 12px;
    font-weight: 700;
    color: #1a1a1a;
    text-transform: uppercase;
    letter-spacing: 1px;
    line-height: 1.3;
    text-align: left;
}


/* ----- Content Container ----- */
.ryn-gear-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}


/* ----- Section Headers ----- */
.ryn-gear-section {
    padding-top: 40px;
}

.ryn-gear-section__title {
    font-size: 16px;
    font-weight: 600;
    text-transform: capitalize;
    color: #1a1a1a;
    margin: 0 0 0;
    padding-bottom: 10px;
    border-bottom: 1px solid #ddd;
    margin-bottom: 20px;
}


/* ----- Product Row (horizontal scroll) ----- */
.ryn-gear-grid {
    display: flex;
    gap: 20px;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x proximity;
    padding-bottom: 8px;
    /* Hide scrollbar on desktop, show on hover */
    scrollbar-width: thin;
    scrollbar-color: #ccc transparent;
}

.ryn-gear-grid::-webkit-scrollbar {
    height: 6px;
}

.ryn-gear-grid::-webkit-scrollbar-track {
    background: transparent;
}

.ryn-gear-grid::-webkit-scrollbar-thumb {
    background-color: #ccc;
    border-radius: 3px;
}


/* ----- Product Card ----- */
.ryn-gear-card {
    background-color: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-width: 240px;
    max-width: 260px;
    flex-shrink: 0;
    scroll-snap-align: start;
    transition: box-shadow 0.2s;
}

.ryn-gear-card:hover {
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

.ryn-gear-card__image {
    width: 100%;
    aspect-ratio: 1 / 1;
    background-color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.ryn-gear-card__image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 12px;
}

.ryn-gear-card__body {
    padding: 16px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.ryn-gear-card__name {
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    color: #1a1a1a;
    margin: 0 0 2px;
    line-height: 1.3;
}

.ryn-gear-card__cert {
    font-size: 10px;
    color: #888888;
    margin: 0 0 12px;
    font-weight: 400;
    line-height: 1.3;
}


/* ----- Pricing ----- */
.ryn-gear-card__pricing {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-bottom: 14px;
}

.ryn-gear-card__msrp {
    font-size: 12px;
    color: #888888;
}

.ryn-gear-card__msrp-label {
    font-weight: 400;
}

.ryn-gear-card__msrp-value {
    text-decoration: line-through;
    margin-left: 4px;
}

.ryn-gear-card__ryn-price {
    display: flex;
    align-items: baseline;
    gap: 6px;
}

.ryn-gear-card__ryn-price-label {
    font-size: 12px;
    color: #1a1a1a;
    font-weight: 500;
}

.ryn-gear-card__price {
    font-size: 20px;
    font-weight: 700;
    color: #22c55e;
}


/* ----- Variation Selectors & Add to Cart Row ----- */
.ryn-gear-card__actions {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.ryn-gear-card__options {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.ryn-gear-card__color-select,
.ryn-gear-card__size-select {
    display: flex;
    flex-direction: column;
}

.ryn-gear-card__color-select label,
.ryn-gear-card__size-select label {
    display: none; /* Labels hidden, placeholders serve the purpose */
}

.ryn-gear-select {
    padding: 8px 28px 8px 10px;
    background-color: #ffffff;
    border: 1px solid #ccc;
    border-radius: 4px;
    color: #1a1a1a;
    font-size: 13px;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' fill='%23666' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
    min-width: 0;
    max-width: 130px;
}

.ryn-gear-select:focus {
    outline: none;
    border-color: #22c55e;
}


/* ----- Add to Cart Button ----- */
.ryn-gear-card__add-to-cart {
    padding: 8px 16px;
    background-color: #22c55e;
    color: #ffffff;
    border: none;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s, opacity 0.2s;
    white-space: nowrap;
}

.ryn-gear-card__add-to-cart:hover:not(:disabled) {
    background-color: #1db04e;
}

.ryn-gear-card__add-to-cart:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.ryn-gear-card__add-to-cart.ryn-gear--loading {
    pointer-events: none;
    opacity: 0.6;
}

.ryn-gear-card__add-to-cart.ryn-gear--added {
    background-color: #16a34a;
}


/* ----- Details Link ----- */
.ryn-gear-card__details-link {
    display: block;
    font-size: 12px;
    color: #1a1a1a;
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 2px;
    transition: color 0.2s;
}

.ryn-gear-card__details-link:hover {
    color: #22c55e;
}


/* ----- Empty State ----- */
.ryn-gear-empty {
    text-align: center;
    padding: 80px 20px;
    color: #666666;
    font-size: 18px;
}


/* ----- Cart Notification Toast ----- */
.ryn-gear-toast {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background-color: #ffffff;
    border: 1px solid #22c55e;
    border-radius: 8px;
    padding: 14px 20px;
    display: flex;
    align-items: center;
    gap: 14px;
    z-index: 9999;
    transform: translateY(120%);
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
}

.ryn-gear-toast.ryn-gear-toast--visible {
    transform: translateY(0);
    opacity: 1;
}

.ryn-gear-toast__content {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.ryn-gear-toast__message {
    font-size: 14px;
    color: #1a1a1a;
}

.ryn-gear-toast__clear {
    background: none;
    border: none;
    padding: 0;
    font-size: 12px;
    color: #999;
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 2px;
    text-align: left;
    transition: color 0.2s;
}

.ryn-gear-toast__clear:hover {
    color: #ef4444;
}

.ryn-gear-toast__checkout {
    display: inline-block;
    padding: 8px 20px;
    background-color: #22c55e;
    color: #ffffff;
    text-decoration: none;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.ryn-gear-toast__checkout:hover {
    background-color: #1db04e;
    color: #ffffff;
}

.ryn-gear-toast__dismiss {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background-color: #ffffff;
    border: 1px solid #ddd;
    color: #999;
    font-size: 14px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: border-color 0.2s, color 0.2s;
}

.ryn-gear-toast__dismiss:hover {
    border-color: #999;
    color: #1a1a1a;
}


/* =========================================================================
   Gear Checkout Styles
   ========================================================================= */
.ryn-gear-checkout {
    background-color: #ffffff;
    color: #1a1a1a;
    padding: 40px 20px 80px;
}

.ryn-gear-checkout__inner {
    max-width: 960px;
    margin: 0 auto;
}

.ryn-gear-checkout h2,
.ryn-gear-checkout h3 {
    color: #1a1a1a;
}

.ryn-gear-checkout #place_order {
    background-color: #22c55e;
    color: #ffffff;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    border: none;
    border-radius: 4px;
    padding: 14px 32px;
    font-size: 16px;
    cursor: pointer;
}

.ryn-gear-checkout #place_order:hover {
    background-color: #1db04e;
}

.ryn-gear-checkout .shop_table .order-total .amount {
    color: #22c55e;
    font-size: 20px;
    font-weight: 700;
}


/* =========================================================================
   Gear Thank You Page
   ========================================================================= */
.ryn-gear-thankyou {
    background-color: #ffffff;
    color: #1a1a1a;
    padding: 60px 20px 80px;
    text-align: center;
}

.ryn-gear-thankyou__inner {
    max-width: 700px;
    margin: 0 auto;
}

.ryn-gear-thankyou__checkmark {
    width: 64px;
    height: 64px;
    border: 3px solid #22c55e;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 24px;
}

.ryn-gear-thankyou__checkmark svg {
    width: 32px;
    height: 32px;
    stroke: #22c55e;
}

.ryn-gear-thankyou h2 {
    font-size: 28px;
    color: #1a1a1a;
    margin: 0 0 8px;
}

.ryn-gear-thankyou__order-number {
    font-size: 14px;
    color: #888888;
    margin-bottom: 32px;
}


/* =========================================================================
   Responsive
   ========================================================================= */
@media (max-width: 768px) {
    .ryn-gear-hero__title {
        font-size: 22px;
    }

    .ryn-gear-hero__badge {
        flex-direction: column;
        gap: 4px;
        text-align: center;
    }

    .ryn-gear-hero__discount {
        font-size: 26px;
    }

    .ryn-gear-hero__discount-note {
        text-align: center;
    }

    .ryn-gear-card {
        min-width: 200px;
        max-width: 220px;
    }

    .ryn-gear-section {
        padding-top: 30px;
    }

    .ryn-gear-toast {
        left: 16px;
        right: 16px;
        bottom: 16px;
    }

    .ryn-gear-card__actions {
        flex-direction: column;
        align-items: stretch;
    }

    .ryn-gear-card__add-to-cart {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .ryn-gear-hero {
        padding: 32px 16px 28px;
    }

    .ryn-gear-card {
        min-width: 180px;
        max-width: 200px;
    }
}

/* =============================================================
   GEAR DETAIL POPUPS (Popup Maker)
   =============================================================
   Popup Maker wraps content in #pum-<ID>. Each gear detail popup
   is one-per-product (per Sean's call). The shell layout is
   identical across them: two helmet-style images stacked on the
   left, title + cert + Details/Sizing tabs on the right.
   Per-popup rules live below; selectors are scoped via #pum-<ID>
   so a tweak to popup X never leaks into popup Y.
   ============================================================= */

/* -------- Gear detail popups (all) -------------------------------- */

/* Override the 640x380 custom size — the two-column layout needs
   more room than that. Responsive: 90vw on smaller screens. */
[id^="pum-"][data-popmake*="pop-sizing-"] .pum-container.popmake {
    width: 90vw !important;
    max-width: 820px !important;
    height: auto !important;
    min-height: 480px;
    padding: 32px 36px !important;
    border-radius: 6px !important;
    box-sizing: border-box;
}

/* Root container → flex row (outer already has directionDesktop:"row"
   but Spectra's default may break under Popup Maker's own CSS, so
   force it explicitly). */
[id^="pum-"][data-popmake*="pop-sizing-"] .uagb-is-root-container > .uagb-container-inner-blocks-wrap {
    display: flex !important;
    flex-direction: row !important;
    gap: 28px;
    align-items: flex-start;
}

/* Left column: fixed width regardless of internal layout. */
[id^="pum-"][data-popmake*="pop-sizing-"] .uagb-is-root-container > .uagb-container-inner-blocks-wrap > .wp-block-uagb-container:first-child {
    flex: 0 0 28%;
    max-width: 28%;
}
/* Stack children vertically ONLY when the author didn't set a Spectra
   grid layout. If the container has .uagb-layout-grid (Sean sets this in
   the builder for non-helmet popups to show color swatches in a grid),
   don't fight it — Spectra's own grid rules drive layout. */
[id^="pum-"][data-popmake*="pop-sizing-"] .uagb-is-root-container > .uagb-container-inner-blocks-wrap > .wp-block-uagb-container:first-child:not(.uagb-layout-grid) > .uagb-container-inner-blocks-wrap,
[id^="pum-"][data-popmake*="pop-sizing-"] .uagb-is-root-container > .uagb-container-inner-blocks-wrap > .wp-block-uagb-container:first-child:not(.uagb-layout-grid) {
    display: flex !important;
    flex-direction: column !important;
    gap: 12px;
}

/* Right column: takes the rest. Force column direction so title,
   subtitle, tabs, and content stack top-to-bottom. Spectra's default
   flex direction depends on how the container was authored, so we
   pin it explicitly here. */
[id^="pum-"][data-popmake*="pop-sizing-"] .uagb-is-root-container > .uagb-container-inner-blocks-wrap > .wp-block-uagb-container:last-child,
[id^="pum-"][data-popmake*="pop-sizing-"] .uagb-is-root-container > .uagb-container-inner-blocks-wrap > .wp-block-uagb-container:last-child > .uagb-container-inner-blocks-wrap {
    flex: 1 1 auto;
    min-width: 0;
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch;
    gap: 6px;
}

/* Uniform image sizing so swapping between the A and B photos
   doesn't shift the layout. */
[id^="pum-"][data-popmake*="pop-sizing-"] .wp-block-uagb-image,
[id^="pum-"][data-popmake*="pop-sizing-"] .wp-block-uagb-image__figure {
    margin: 0 !important;
    width: 100%;
}
[id^="pum-"][data-popmake*="pop-sizing-"] .wp-block-uagb-image img {
    width: 100%;
    height: auto;
    display: block;
}

/* Tab buttons: the Popup Maker editor already styled these's builder.
   Do NOT override shape, color, padding, typography. Only fix the
   wrapper layout so the buttons sit left-aligned in a row with a
   little bottom margin before the content. */
[id^="pum-"][data-popmake*="pop-sizing-"] .uagb-tabs__panel {
    display: flex !important;
    gap: 10px;
    list-style: none;
    padding: 0 !important;
    margin: 0 0 16px !important;
}

/* Tab borders: neutral outline at rest, green outline when active. */
[id^="pum-"][data-popmake*="pop-sizing-"] .uagb-tab {
    border: 2px solid var(--ast-global-color-7);
}
[id^="pum-"][data-popmake*="pop-sizing-"] .uagb-tab.uagb-tabs__active {
    border-color: var(--ast-global-color-0);
}

/* Close button — tighten and move in a touch from the default. */
[id^="pum-"][data-popmake*="pop-sizing-"] .pum-close {
    top: 12px !important;
    right: 14px !important;
    font-size: 1.4rem !important;
    background: transparent !important;
    color: #333 !important;
    box-shadow: none !important;
    padding: 0 !important;
    line-height: 1;
    border: none !important;
    font-weight: 300;
}

/* Mobile: collapse to single column so the popup is usable on
   narrow screens. */
@media (max-width: 680px) {
    [id^="pum-"][data-popmake*="pop-sizing-"] .uagb-is-root-container > .uagb-container-inner-blocks-wrap {
        flex-direction: column !important;
    }
    [id^="pum-"][data-popmake*="pop-sizing-"] .uagb-is-root-container > .uagb-container-inner-blocks-wrap > .wp-block-uagb-container:first-child {
        flex: 1 1 auto;
        max-width: 60%;
        margin: 0 auto 16px;
    }
    [id^="pum-"][data-popmake*="pop-sizing-"] .pum-container.popmake {
        padding: 24px !important;
    }
}


/* Spectra emits per-block inline CSS (including grid-template-columns) only
   for blocks on the main page. Blocks inside Popup Maker posts don't get
   discovered, so .uagb-layout-grid containers get display:grid but default
   to 1-column because grid-template-columns is never emitted.

   The tricky part: Spectra's layout-grid is applied to the OUTER container,
   which has only one child (.uagb-container-inner-blocks-wrap) — that's
   what actually wraps the images. Grid-template-columns on the outer
   doesn't reach the images. Put the 2-column grid on the inner wrap (where
   the images live) and force the outer back to block so the wrap spans
   full width. */
[id^="pum-"][data-popmake*="pop-sizing-"] .uagb-layout-grid {
    display: block !important;
}
[id^="pum-"][data-popmake*="pop-sizing-"] .uagb-layout-grid > .uagb-container-inner-blocks-wrap {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 10px;
    width: 100%;
}

/* =========================================================================
   Image thumbnail as clickable button (for lightbox)
   ========================================================================= */
.ryn-gear-card__image-btn {
    background: transparent;
    border: 0;
    margin: 0;
    padding: 0;
    font: inherit;
    color: inherit;
    cursor: zoom-in;
    display: block;
    position: relative;
    width: 100%;
    text-align: inherit;
}
.ryn-gear-card__image-btn:focus-visible {
    outline: 2px solid var(--ast-global-color-0, #22c55e);
    outline-offset: 2px;
}
.ryn-gear-card__image-btn img {
    display: block;
    width: 100%;
    height: auto;
}
.ryn-gear-card__zoom-hint {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    font-size: 12px;
    padding: 4px 8px;
    border-radius: 3px;
    opacity: 0;
    transition: opacity 0.15s ease;
    pointer-events: none;
}
.ryn-gear-card__image-btn:hover .ryn-gear-card__zoom-hint,
.ryn-gear-card__image-btn:focus-visible .ryn-gear-card__zoom-hint {
    opacity: 1;
}

/* =========================================================================
   Lightbox — overlay the full-size product image
   ========================================================================= */
.ryn-gear-lightbox {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.88);
    z-index: 999999;
    padding: 40px;
    box-sizing: border-box;
    cursor: zoom-out;
}
.ryn-gear-lightbox.is-open {
    display: flex;
    align-items: center;
    justify-content: center;
}
.ryn-gear-lightbox__stage {
    max-width: 95vw;
    max-height: 90vh;
    overflow: auto;
    cursor: auto;
}
.ryn-gear-lightbox__img {
    display: block;
    max-width: none;
    max-height: 90vh;
    width: auto;
    height: auto;
}
.ryn-gear-lightbox__close {
    position: fixed;
    top: 20px;
    right: 20px;
    background: transparent;
    border: 2px solid #fff;
    color: #fff;
    width: 40px;
    height: 40px;
    font-size: 28px;
    line-height: 1;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
}
.ryn-gear-lightbox__close:hover,
.ryn-gear-lightbox__close:focus-visible {
    background: #fff;
    color: #000;
}
body.ryn-lightbox-lock { overflow: hidden; }

@media (max-width: 600px) {
    .ryn-gear-lightbox { padding: 10px; }
    .ryn-gear-lightbox__close { top: 10px; right: 10px; }
}

/* =========================================================================
   Back to Gear link on checkout
   ========================================================================= */
.ryn-gear-back {
    margin: 0 0 16px;
}
.ryn-gear-back__link {
    display: inline-block;
    padding: 8px 14px;
    border: 1px solid var(--ast-global-color-7, #ddd);
    border-radius: 4px;
    color: var(--ast-global-color-3, #333);
    text-decoration: none;
    font-size: 14px;
    transition: background 0.15s ease, border-color 0.15s ease;
}
.ryn-gear-back__link:hover,
.ryn-gear-back__link:focus {
    background: var(--ast-global-color-7, #f3f4f6);
    border-color: var(--ast-global-color-0, #22c55e);
    color: var(--ast-global-color-0, #22c55e);
    text-decoration: none;
}

/* =========================================================================
   Italian-fulfillment notice (cart, checkout, thank-you)
   ========================================================================= */
.ryn-gear-lead-time-notice {
    background: #fff8e1;
    border: 1px solid #f6c744;
    border-left: 4px solid #f6c744;
    padding: 14px 18px;
    border-radius: 4px;
    margin: 0 0 24px;
    font-size: 15px;
    line-height: 1.5;
    color: #3a2e00;
}
.ryn-gear-lead-time-notice strong {
    color: #1a1a1a;
}
