/* Product page gallery & lightbox */
.product-gallery { max-width: 100%; }

.product-main-image {
    aspect-ratio: 1;
    background: var(--color-bg-alt);
    border-radius: var(--radius);
    border: 1px solid var(--color-border);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    cursor: zoom-in;
}

.product-main-image img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    padding: 16px;
}

.product-thumbnails {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 12px;
}

.product-thumb {
    width: 72px;
    height: 72px;
    padding: 4px;
    border: 2px solid var(--color-border);
    border-radius: var(--radius);
    background: #fff;
    cursor: pointer;
    overflow: hidden;
}

.product-thumb.active,
.product-thumb:hover {
    border-color: var(--color-primary);
}

.product-thumb img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.product-description {
    margin-top: 24px;
    color: var(--color-text-light);
    line-height: 1.8;
    font-size: 15px;
}

.product-description h2,
.product-description h3,
.product-description h4 {
    color: var(--color-text);
    margin: 16px 0 8px;
    font-size: 1.1em;
}

.product-description p { margin-bottom: 12px; }
.product-description ul, .product-description ol { margin: 8px 0 12px 20px; }
.product-description li { margin-bottom: 4px; }

/* Lightbox */
.lightbox {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.92);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.lightbox[hidden] { display: none; }

.lightbox-close {
    position: absolute;
    top: 16px;
    right: 20px;
    background: none;
    border: none;
    color: #fff;
    font-size: 36px;
    cursor: pointer;
    z-index: 2;
    line-height: 1;
}

.lightbox-inner {
    display: flex;
    width: 100%;
    max-width: 1400px;
    height: 90vh;
    gap: 16px;
}

.lightbox-main {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
}

.lightbox-main img {
    max-width: 100%;
    max-height: 90vh;
    object-fit: contain;
}

.lightbox-sidebar {
    width: 120px;
    flex-shrink: 0;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 4px;
}

.lightbox-sidebar button {
    width: 100px;
    height: 100px;
    padding: 4px;
    border: 2px solid transparent;
    border-radius: 6px;
    background: rgba(255,255,255,0.1);
    cursor: pointer;
    flex-shrink: 0;
}

.lightbox-sidebar button.active,
.lightbox-sidebar button:hover {
    border-color: #fff;
}

.lightbox-sidebar button img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.image-thumb-admin {
    text-align: center;
    border: 1px solid #e2e8f0;
    padding: 8px;
    border-radius: 6px;
}
.image-gallery-admin { display: flex; flex-wrap: wrap; gap: 12px; margin: 12px 0; }

@media (max-width: 768px) {
    .lightbox-inner { flex-direction: column; height: auto; max-height: 95vh; }
    .lightbox-sidebar {
        width: 100%;
        flex-direction: row;
        overflow-x: auto;
        overflow-y: hidden;
        height: auto;
    }
    .lightbox-sidebar button { width: 72px; height: 72px; }
}
