/* =========================================
   ABARANAM — Product detail page
   ========================================= */

.product-detail {
    display: grid;
    grid-template-columns: 1.05fr 1fr;
    gap: var(--space-16);
    align-items: start;
    padding-block: var(--space-16);
}

/* ===== Gallery ===== */
.product-gallery {
    position: sticky;
    top: calc(var(--header-h) + var(--space-6));
    display: grid;
    gap: var(--space-4);
}

.gallery-main {
    position: relative;
    aspect-ratio: 1;
    overflow: hidden;
    background: var(--color-bg-alt);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
}

.gallery-main img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Column count is set per piece in product.js — a piece with two frames gets
   two columns, not two tiles stranded in a four-column grid. */
.gallery-thumbs {
    display: grid;
    grid-template-columns: repeat(var(--thumb-cols, 4), 1fr);
    gap: var(--space-3);
}

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

.gallery-thumb {
    aspect-ratio: 1;
    overflow: hidden;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    transition: border-color var(--transition-base);
}

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

.gallery-thumb.is-active {
    border-color: var(--color-accent);
    border-width: 2px;
}

/* ===== Summary ===== */
.product-summary .product-cat {
    font-size: var(--text-xs);
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--color-accent-dark);
}

.product-summary h1 {
    font-size: clamp(1.85rem, 4vw, var(--text-4xl));
    margin: var(--space-3) 0;
}

.product-code {
    font-size: var(--text-xs);
    letter-spacing: 0.1em;
    color: var(--color-text-muted);
}

.product-price {
    margin-block: var(--space-5) var(--space-2);
    font-family: var(--font-heading);
    font-size: var(--text-xl);
    color: var(--color-primary-dark);
}

.price-note {
    font-size: var(--text-xs);
    color: var(--color-text-muted);
    margin-top: calc(-1 * var(--space-3));
    margin-bottom: var(--space-6);
}

.product-desc {
    color: var(--color-text-light);
    margin-bottom: var(--space-8);
}

/* ===== Options ===== */
.option-group {
    margin-bottom: var(--space-6);
}

.option-group h3 {
    font-family: var(--font-body);
    font-size: var(--text-xs);
    font-weight: 600;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--color-text-light);
    margin-bottom: var(--space-3);
}

/* ===== Why this piece =====
   One line typed into /admin/ is one row here. Its own class rather than the
   footer's link list, which it used to borrow through an inline style
   override -- restyling the footer would have quietly restyled this. */
.why-list {
    display: grid;
    gap: var(--space-2);
    margin: 0;
    padding: 0;
    list-style: none;
    color: var(--color-text-light);
    font-size: var(--text-sm);
}

.why-list li {
    position: relative;
    padding-left: var(--space-4);
    line-height: 1.6;
}

/* A small accent dot, matching the bullets in .prose. */
.why-list li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.62em;
    width: 5px;
    height: 5px;
    border-radius: var(--radius-full);
    background: var(--color-accent);
}

/* ===== Actions ===== */
.product-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-4);
    margin-bottom: var(--space-6);
}

.product-actions .btn {
    flex: 1 1 200px;
    padding-block: var(--space-4);
}

.stock-line {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-size: var(--text-sm);
    margin-bottom: var(--space-6);
}

.stock-dot {
    width: 8px;
    height: 8px;
    border-radius: var(--radius-full);
    background: var(--color-success);
}

.stock-line.is-low .stock-dot {
    background: var(--color-accent-dark);
}

.stock-line.is-out .stock-dot {
    background: var(--color-error);
}

.stock-line.is-preorder .stock-dot {
    background: var(--color-accent-dark);
}

/* ===== Assurance strip ===== */
.assurance {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: var(--space-5);
    margin-top: var(--space-8);
    padding-top: var(--space-8);
    border-top: 1px solid var(--color-border);
}

.assurance div {
    font-size: var(--text-xs);
    color: var(--color-text-light);
}

.assurance strong {
    display: block;
    font-family: var(--font-heading);
    font-size: var(--text-base);
    font-weight: 600;
    color: var(--color-primary-dark);
    margin-bottom: 2px;
}

/* ===== Not found ===== */
.product-missing {
    display: none;
}

body.is-missing .product-detail,
body.is-missing .related-section {
    display: none;
}

body.is-missing .product-missing {
    display: block;
}

/* ===== Responsive ===== */
@media (max-width: 900px) {
    .product-detail {
        grid-template-columns: 1fr;
        gap: var(--space-10);
        padding-block: var(--space-10);
    }

    .product-gallery {
        position: static;
    }
}
