/* ============================================================
   Guide pages - "Shop by bed type" circular category strip
   Shared stylesheet. Loaded in <head> on every guide/article page.
   Scoped with the gcc- prefix so it cannot affect other pages.
   ============================================================ */

/* Heading sits OUTSIDE the sticky strip, in normal flow. As soon as the
   reader scrolls it moves away, leaving only circles + names pinned at top. */
.gcc-heading {
    background: #fff;
    text-align: center;
    padding: 18px 20px 0;
}
.gcc-heading .gcc-title { margin: 0 0 10px; }

.gcc-section {
    background: #fff;
    border-bottom: 1px solid #f0f0f0;
    padding: 6px 0 10px;
    /* Pin to the very top of the viewport. On guide pages the site header is
       hidden while pinned (see body.gcc-pinned below), so the strip needs no
       offset and takes the minimum possible vertical space. */
    position: sticky;
    top: 0;
    z-index: 1100;
}

/* Paint-only "stuck" state: box-shadow / border colour never change the
   element's height, so toggling it causes no layout shift. */
.gcc-section.gcc-stuck {
    border-bottom-color: #e5e7eb;
    box-shadow: 0 6px 18px rgba(0, 0, 0, .12);
}

/* Guide pages only: hide the site's Home / Our Collection header while the
   category strip is pinned. visibility keeps its layout box (no reflow) and
   this rule lives in a stylesheet loaded solely by guide pages. */
body.gcc-pinned header.home-header { visibility: hidden; }

.gcc-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.gcc-title {
    margin: 0 0 18px;
    text-align: center;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: #8a6f43;
}

.gcc-viewport {
    position: relative;
}

/* Horizontal scroller: always scrollable when categories overflow */
.gcc-track {
    display: flex;
    flex-wrap: nowrap;
    gap: 26px;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x proximity;
    scroll-behavior: smooth;
    padding: 6px 4px 14px;
    scrollbar-width: thin;
    scrollbar-color: #dc2626 #f1f1f1;
}
.gcc-track::-webkit-scrollbar { height: 7px; }
.gcc-track::-webkit-scrollbar-track { background: #f1f1f1; border-radius: 99px; }
.gcc-track::-webkit-scrollbar-thumb { background: #dc2626; border-radius: 99px; }
.gcc-track::-webkit-scrollbar-thumb:hover { background: #b91c1c; }

.gcc-item {
    flex: 0 0 128px;
    width: 128px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    scroll-snap-align: start;
    -webkit-tap-highlight-color: transparent;
}

.gcc-circle {
    display: block;
    width: 112px;
    height: 112px;
    border-radius: 50%;
    overflow: hidden;
    border: 3px solid #eee;
    background: #fafafa;
    box-shadow: 0 3px 10px rgba(0, 0, 0, .07);
    transition: border-color .22s ease, transform .22s ease, box-shadow .22s ease;
}

.gcc-circle img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

.gcc-item:hover .gcc-circle,
.gcc-item:focus-visible .gcc-circle {
    border-color: #dc2626;
    transform: translateY(-3px) scale(1.04);
    box-shadow: 0 8px 18px rgba(220, 38, 38, .18);
}

.gcc-name {
    display: block;
    max-width: 128px;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.3;
    text-align: center;
    color: #333;
    transition: color .22s ease;
}
.gcc-item:hover .gcc-name,
.gcc-item:focus-visible .gcc-name { color: #dc2626; }

.gcc-item:focus-visible { outline: 2px solid #dc2626; outline-offset: 4px; border-radius: 12px; }

/* Desktop arrow buttons (progressive enhancement; scroller works without them) */
.gcc-arrow {
    position: absolute;
    top: 46px;
    z-index: 2;
    width: 34px;
    height: 34px;
    border: 1px solid #eee;
    border-radius: 50%;
    background: #fff;
    color: #dc2626;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .1);
    transition: background .2s, color .2s, border-color .2s;
}
.gcc-arrow:hover { background: #dc2626; color: #fff; border-color: #dc2626; }
.gcc-arrow:focus-visible { outline: 2px solid #dc2626; outline-offset: 2px; }
.gcc-prev { left: -6px; }
.gcc-next { right: -6px; }
.gcc-arrow[disabled] { opacity: .35; cursor: default; }
.gcc-arrow[disabled]:hover { background: #fff; color: #dc2626; border-color: #eee; }

/* Mobile: smaller circles, tighter spacing, swipe instead of arrows */
@media (max-width: 768px) {
    .gcc-heading { padding: 12px 12px 0; }
    .gcc-heading .gcc-title { margin-bottom: 8px; }
    .gcc-section { padding: 4px 0 8px; }
    .gcc-inner { padding: 0 12px; }
    .gcc-title { font-size: 11px; letter-spacing: 1.5px; }
    .gcc-track { gap: 14px; padding: 3px 2px 8px; }
    .gcc-item { flex: 0 0 80px; width: 80px; gap: 7px; }
    .gcc-circle { width: 70px; height: 70px; border-width: 2px; }
    .gcc-name { font-size: 11px; max-width: 80px; }
    .gcc-arrow { display: none; }
}

@media (prefers-reduced-motion: reduce) {
    .gcc-track { scroll-behavior: auto; }
    .gcc-circle { transition: none; }
}
