/**
 * ============================================================
 * GSUK Product Gallery — Single-row Thumbnail Strip
 * ============================================================
 * Overrides WooCommerce's default thumbnail grid (which wraps into
 * multiple rows once there are more than ~4 images) so thumbnails
 * stay in ONE row, scrollable via the left/right arrow buttons added
 * by gsuk-gallery-thumbnails.js — matching the Figma design.
 *
 * The actual thumbnails (<ol class="flex-control-nav flex-control-
 * thumbs">) are WooCommerce's own native gallery markup — nothing
 * about how they work (click to change main image, zoom, etc.) is
 * touched, only their layout/width.
 *
 * Colours: #467FF7 matches the site's existing buttons (Buy Now /
 * Specifications / Delivery Costs) exactly — not a placeholder.
 *
 * Responsive: thumbnail width and arrow size both shrink on smaller
 * screens (see the media queries at the bottom) so the strip doesn't
 * feel oversized on mobile, and the row still scrolls the same way
 * (touch-swipe works natively via overflow-x, arrows work identically).
 */

.gsuk-thumb-strip {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
}

/* The scrollable row itself */
.gsuk-thumb-strip .flex-control-nav.flex-control-thumbs {
    display: flex !important;
    flex-wrap: nowrap !important;
    overflow-x: auto;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch; /* smooth momentum scroll on iOS */
    gap: 10px;
    list-style: none;
    padding: 0;
    margin: 0;
    flex: 1 1 auto;
    min-width: 0; /* allows the flex item to actually shrink/scroll */

    /* Hide the native scrollbar — the arrow buttons are the intended
       way to navigate, dragging/swiping still works if someone tries it */
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.gsuk-thumb-strip .flex-control-nav.flex-control-thumbs::-webkit-scrollbar {
    display: none;
}

.gsuk-thumb-strip .flex-control-nav.flex-control-thumbs li {
    flex: 0 0 auto !important;
    width: 110px !important;
    margin: 0 !important; /* overrides WooCommerce's default li margin */
}

.gsuk-thumb-strip .flex-control-nav.flex-control-thumbs li img {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    cursor: pointer;
    display: block;
}

/* Arrow buttons — enabled state matches the exact Figma blue.
   !important is required — a theme/global button style was otherwise
   adding an unwanted reddish border (confirmed 29 July) and winning
   over the plain background colour. */
.gsuk-thumb-arrow {
    flex: 0 0 auto;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #24346A !important;
    color: #fff !important;
    border: none !important;
    outline: none !important;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    line-height: 1;
    padding: 0;
    transition: background-color 0.15s ease, opacity 0.15s ease;
}

.gsuk-thumb-arrow:hover:not(:disabled) {
    opacity: 0.85;
}

/* Disabled state (nothing more to scroll in that direction) — a
   genuinely muted grey, not just a faded version of the blue,
   matching the reference design's "greyed out" look */
.gsuk-thumb-arrow:disabled {
    background: #e2e2e2 !important;
    color: #9b9b9b !important;
    cursor: not-allowed;
}

/* ============================================================
   Responsive adjustments
   ============================================================ */

/* Tablets */
@media (max-width: 782px) {
    .gsuk-thumb-strip .flex-control-nav.flex-control-thumbs li {
        width: 90px !important;
    }

    .gsuk-thumb-arrow {
        width: 30px;
        height: 30px;
        font-size: 16px;
    }
}

/* Phones */
@media (max-width: 480px) {
    .gsuk-thumb-strip {
        gap: 6px;
    }

    .gsuk-thumb-strip .flex-control-nav.flex-control-thumbs li {
        width: 68px !important;
    }

    .gsuk-thumb-arrow {
        width: 26px;
        height: 26px;
        font-size: 14px;
    }
}