/* Envelope Bag product page: gallery + configurator layout */

.product-page {
    display: grid;
    grid-template-columns: 1fr;
    grid-template-areas:
        "title"
        "price"
        "gallery"
        "rest";
    gap: var(--spacing-md);
    padding-top: var(--spacing-xl);
    max-width: var(--container-width);
    margin: 0 auto;
    padding-left: var(--spacing-md);
    padding-right: var(--spacing-md);
}

/* Gallery: compact 2x2 tile grid — four square tiles of equal
   standing rather than one oversized hero image. The primary
   (color-specific) shot leads reading order top-left; static
   lifestyle/detail shots fill the rest. */
.product-gallery {
    grid-area: gallery;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-sm);
    min-width: 0;
}

/* Mobile: stays transparent to the grid so title/price/rest place
   individually into the areas below, exactly as if unwrapped. */
.product-info {
    display: contents;
}

.product-title {
    grid-area: title;
    margin: 0;
    font-size: 28px;
    font-weight: 600;
    color: var(--color-text-primary);
}

.product-price {
    grid-area: price;
    margin: 0;
    font-size: 20px;
    font-weight: 500;
    color: var(--color-accent);
}

.product-configurator-rest {
    grid-area: rest;
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
    min-width: 0;
}

.product-description {
    margin: 0;
    font-size: 14px;
    line-height: 1.6;
    color: var(--color-text-secondary);
}

.product-includes__label {
    margin: 0 0 4px;
    font-size: 13px;
    font-weight: 500;
    color: var(--color-text-primary);
}

.product-includes__list {
    margin: 0;
    padding-left: 0;
    font-size: 13px;
    line-height: 1.6;
    color: var(--color-text-secondary);
}

/* Details: always expanded on this page — no toggle/accordion */
.product-details-heading {
    font-weight: 500;
    font-size: 14px;
    color: var(--color-text-primary);
    margin: 0;
    padding: var(--spacing-xs) 0;
    border-bottom: 1px solid var(--color-secondary-bg);
}

.product-details-container .product-details {
    max-height: none;
    overflow: visible;
    padding-top: var(--spacing-xs);
}

.product-details-container .product-details dl {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: var(--spacing-sm);
}

.product-details__row {
    display: grid;
    grid-template-columns: minmax(8rem, 1fr) 1fr;
    column-gap: 2rem;
}

.product-details__row dt {
    font-weight: 500;
}

.product-details__row dd {
    margin: 0;
}

.product-gallery-tile picture {
    display: block;
    width: 100%;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    background: var(--color-secondary-bg);
}

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

@media screen and (min-width: 992px) {
    .product-page {
        grid-template-columns: minmax(0, 1fr) minmax(320px, 420px);
        grid-template-areas: "gallery info";
        column-gap: var(--spacing-xl);
        align-items: start;
    }

    /* Desktop: title+price+rest become one grid cell (not three
       separate row tracks the gallery spans across) — otherwise a
       tall gallery inflates the title/price rows to match its own
       height, leaving dead space after each. One cell also lets the
       whole configurator stick together while the gallery scrolls. */
    .product-info {
        display: flex;
        flex-direction: column;
        gap: var(--spacing-md);
        grid-area: info;
        position: sticky;
        top: var(--spacing-lg);
        align-self: start;
        min-width: 0;
    }
}

/* Related Products — card styling (.shop-tile etc.) is reused verbatim from
   the homepage shop grid (styles.css) for visual consistency; only the
   section heading and grid container are page-local. */
.related-products {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: var(--spacing-xxl) var(--spacing-md) 7rem;
}

.related-products__heading {
    font-size: 20px;
    font-weight: 600;
    color: var(--color-text-primary);
    margin: 0 0 var(--spacing-md);
}

.related-products__grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--spacing-md);
}

@media screen and (max-width: 991px) {
    .related-products__grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media screen and (max-width: 768px) {
    .related-products {
        padding-top: 3.5rem;
        padding-bottom: 4.5rem;
    }

    .related-products__grid {
        grid-template-columns: 1fr;
    }
}

/* Swatches (bag color / strap color) */

.product-swatch-group {
    border: none;
    padding: 0;
    margin: 0;
}

.product-swatch-group__legend {
    font-weight: 500;
    font-size: 14px;
    color: var(--color-text-primary);
    margin: 0 0 8px 0;
    padding: 0;
}

.product-swatch-group__legend span {
    color: var(--color-accent);
}

.product-swatch-list {
    display: flex;
    gap: var(--spacing-xs);
    list-style: none;
    margin: 0;
    padding: 0;
}

.product-swatch {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 2px solid var(--swatch-border, transparent);
    background-color: var(--swatch-color);
    cursor: pointer;
    padding: 0;
    position: relative;
}

.product-swatch.active {
    box-shadow: 0 0 0 2px var(--color-background), 0 0 0 4px var(--color-text-primary);
}

.product-swatch:focus-visible {
    outline: 2px solid var(--color-accent);
    outline-offset: 3px;
}

/* Size / type toggles */

.product-toggle-group {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
}

.product-toggle-group__label {
    font-weight: 500;
    font-size: 14px;
    color: var(--color-text-primary);
    margin-right: 4px;
}

/* Size/Pack rows: fixed-width label so both button groups start
   at the same horizontal position. */
.product-option--inline {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.product-option--inline .product-option__label {
    flex: 0 0 3.25rem;
    margin-right: 0;
}

.size-btn,
.type-btn {
    flex: none;
    padding: 6px 14px;
    border: 1px solid var(--color-secondary-bg);
    border-radius: 999px;
    background: var(--color-background);
    color: var(--color-text-primary);
    font-size: 13px;
    cursor: pointer;
}

.size-btn:hover,
.type-btn:hover {
    border-color: var(--color-text-primary);
}

.size-btn.active,
.type-btn.active {
    background: var(--color-text-primary);
    color: var(--color-background);
    border-color: var(--color-text-primary);
}

.size-btn:focus-visible,
.type-btn:focus-visible {
    outline: 2px solid var(--color-accent);
    outline-offset: 2px;
}

.product-vat-note {
    font-size: 12px;
    color: var(--color-text-secondary);
    margin: 0;
}

.stock-message {
    font-size: 13px;
    color: var(--color-accent);
    margin: var(--spacing-xs) 0 0;
}

.stock-message:empty {
    display: none;
}
