/* ============================================
product.css
Clothing product links, product detail pages and the photo gallery.

Uses only the site palette and fonts declared on :root in css/style.css.
Loaded by shop/clothing/index.html (card links) and every product page.
============================================ */

/* ── LISTING CARDS: image, name and button link to the product page ── */

.product-link {
display: block;
}

/* .product-img clips overflow, so draw the focus ring inside the image. */
.product-link:focus-visible {
outline-offset: -3px;
}

.product-name a {
color: inherit;
text-decoration: none;
transition: color 0.2s;
}

.product-name a:hover,
.product-name a:focus-visible {
color: var(--electric);
}

/* ── PRODUCT DETAIL LAYOUT ── */

.product-detail {
display: grid;
grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
gap: 3rem;
align-items: start;
}

.product-info .shop-category {
margin-bottom: 0.75rem;
}

.product-info .section-title {
margin-bottom: 0.75rem;
}

.product-price {
margin-bottom: 1.25rem;
}

.product-actions {
display: flex;
gap: 1rem;
flex-wrap: wrap;
margin-top: 1.5rem;
}

/* ── PHOTO GALLERY ──
Native horizontal scroll-snap: swipe, trackpad and keyboard all work with
no JavaScript. gallery.js adds the arrows, thumbnails and counter. */

.gallery-stage {
position: relative;
border: 1px solid var(--border);
background: var(--surface);
}

.gallery-track {
display: flex;
overflow-x: auto;
scroll-snap-type: x mandatory;
overscroll-behavior-x: contain;
scrollbar-width: none;
}

.gallery-track::-webkit-scrollbar {
display: none;
}

.gallery-slide {
flex: 0 0 100%;
margin: 0;
aspect-ratio: 1;
scroll-snap-align: start;
}

.gallery-slide img {
display: block;
width: 100%;
height: 100%;
object-fit: contain;
}

.gallery-btn {
position: absolute;
top: 50%;
transform: translateY(-50%);
z-index: 2;
display: flex;
align-items: center;
justify-content: center;
width: 2.75rem;
height: 2.75rem;
background: rgba(0, 0, 0, 0.7);
border: 1px solid var(--electric);
color: var(--electric);
font-family: var(--font-mono);
font-size: 1rem;
cursor: pointer;
transition: background 0.2s, color 0.2s;
}

.gallery-btn[hidden] {
display: none;
}

.gallery-btn--prev {
left: 0.75rem;
}

.gallery-btn--next {
right: 0.75rem;
}

.gallery-btn:hover,
.gallery-btn:focus-visible {
background: var(--electric);
color: var(--void);
}

.gallery-btn:disabled {
opacity: 0.35;
background: rgba(0, 0, 0, 0.7);
color: var(--electric);
cursor: default;
}

.gallery-count {
margin: 0.75rem 0;
font-family: var(--font-mono);
font-size: 0.85rem;
letter-spacing: 0.2em;
text-align: center;
color: var(--muted);
}

.gallery-thumbs {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(4.5rem, 1fr));
gap: 0.5rem;
list-style: none;
}

.gallery-thumb {
display: block;
width: 100%;
aspect-ratio: 1;
padding: 0;
background: var(--surface);
border: 1px solid var(--border);
opacity: 0.65;
cursor: pointer;
transition: opacity 0.2s, border-color 0.2s;
}

.gallery-thumb img {
display: block;
width: 100%;
height: 100%;
object-fit: cover;
}

.gallery-thumb:hover,
.gallery-thumb[aria-current="true"] {
opacity: 1;
border-color: var(--electric);
}

/* ── RESPONSIVE ── */

@media (max-width: 899px) {
.product-detail {
grid-template-columns: minmax(0, 1fr);
gap: 2rem;
}
}

@media (forced-colors: active) {
.gallery-btn,
.gallery-thumb {
border-color: buttontext;
}
.gallery-thumb[aria-current="true"] {
border-color: highlight;
}
}
