/* Hupacha Exemplaren — Frontend Styles v7 */

/* ─── Mode selector ─── */
.hex-mode-selector {
    display: inline-flex;
    flex-direction: column;
    margin-bottom: 20px;
}

.hex-mode-option {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6px 16px;
    border: 2px solid #e0e0e0;
    margin-top: -2px;
    cursor: pointer;
    transition: border-color 0.2s, background-color 0.2s;
    user-select: none;
}

.hex-mode-option:first-child {
    margin-top: 0;
    border-radius: 6px 6px 0 0;
}

.hex-mode-option:last-child {
    border-radius: 0 0 6px 6px;
}

.hex-mode-option:only-child {
    border-radius: 6px;
}

.hex-mode-option:hover {
    border-color: #C5A352;
    background-color: rgba(197, 163, 82, 0.04);
    z-index: 1;
}

.hex-mode-option.hex-mode-active {
    border-color: #C5A352;
    background-color: rgba(197, 163, 82, 0.08);
    z-index: 2;
}

.hex-mode-option input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}

.hex-mode-label {
    font-size: 0.95em;
    font-weight: 500;
    color: #333;
}

/* ─── Intro text ─── */
.hex-intro {
    font-size: 0.9em;
    color: #555;
    margin: 0 0 15px;
    line-height: 1.5;
}

/* ─── Gallery section ─── */
.hex-gallery-section {
    margin-bottom: 20px;
}

/* ─── Swatch row ─── */
.hex-swatch-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.hex-swatch {
    position: relative;
    width: calc(33.333% - 7px);
    aspect-ratio: 1;
    border: 2px solid #ddd;
    border-radius: 6px;
    overflow: hidden;
    cursor: pointer;
    padding: 3px;
    background: #fff;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.hex-swatch img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    border-radius: 3px;
}

.hex-swatch.hex-selectable:hover {
    border-color: #C5A352;
}

.hex-swatch.hex-swatch-selected {
    border-color: #C5A352;
    box-shadow: 0 0 0 2px #C5A352;
}

.hex-swatch.hex-unavailable {
    cursor: pointer;
    opacity: 0.6;
    filter: grayscale(30%);
}

.hex-swatch.hex-unavailable:hover {
    border-color: #ddd;
}

/* Swatch badge */
.hex-swatch-badge {
    position: absolute;
    bottom: 3px;
    left: 3px;
    right: 3px;
    padding: 2px 0;
    font-size: 0.6em;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-align: center;
    border-radius: 0 0 3px 3px;
}

.hex-swatch-badge.hex-status-sold {
    background: rgba(220, 53, 69, 0.9);
    color: #fff;
}

.hex-no-image {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    color: #999;
    font-size: 1.2em;
}

/* ─── Tooltip (above swatches, persistent DOM) ─── */
.hex-tooltip-placeholder {
    position: relative;
}

.hex-tooltip {
    position: relative;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
    margin-bottom: 12px;
    padding: 0;
    opacity: 0;
    max-height: 0;
    overflow: hidden;
    transition: opacity 0.35s ease, max-height 0.35s ease, padding 0.35s ease, margin-bottom 0.35s ease;
}

.hex-tooltip--visible {
    opacity: 1;
    max-height: 800px;
    padding: 8px;
    margin-bottom: 12px;
}

.hex-tooltip--overflow {
    overflow: visible;
}

/* Tooltip image wrap */
.hex-tooltip__img-wrap {
    position: relative;
    width: 100%;
    overflow: hidden;
    border-radius: 4px;
    cursor: pointer;
}

.hex-tooltip__img {
    width: 100%;
    height: auto;
    display: block;
}

/* Expand icon — desktop only */
.hex-tooltip__expand-wrap {
    position: absolute;
    bottom: 8px;
    right: 8px;
}

.hex-tooltip__expand {
    width: 20px;
    height: 20px;
    color: #fff;
    opacity: 0.8;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.4));
    transition: opacity 0.15s ease, transform 0.15s ease;
    pointer-events: none;
}

.hex-tooltip__img-wrap:hover .hex-tooltip__expand {
    opacity: 1;
    transform: scale(1.15);
}

/* Tooltip nav buttons (prev/next within tooltip) */
.hex-tooltip__nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 2;
    background: rgba(255, 255, 255, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 6px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    opacity: 0.7;
    cursor: pointer;
    transition: opacity 0.2s ease, background 0.2s ease;
    backdrop-filter: blur(4px);
    padding: 0;
}

.hex-tooltip__nav:hover {
    opacity: 1;
    background: rgba(255, 255, 255, 0.45);
}

.hex-tooltip__nav svg {
    width: 18px;
    height: 18px;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.3));
}

.hex-tooltip__nav--prev { left: 6px; }
.hex-tooltip__nav--next { right: 6px; }

/* Tooltip info */
.hex-tooltip__info {
    position: relative;
    padding: 8px 4px 4px;
}

/* Image count — top-right of info area */
.hex-tooltip__img-count {
    position: absolute;
    top: 8px;
    right: 4px;
    padding: 2px 8px;
    background: rgba(0, 0, 0, 0.55);
    color: #fff;
    border-radius: 3px;
    font-size: 0.7em;
}

.hex-tooltip__name {
    font-size: 0.9em;
    font-weight: 600;
    color: #333;
    margin-bottom: 2px;
}

.hex-tooltip__desc {
    font-size: 0.8em;
    color: #666;
    line-height: 1.4;
    margin-bottom: 4px;
}

.hex-tooltip__price {
    font-size: 0.9em;
    font-weight: 600;
    color: #C5A352;
}

/* Sold badge in tooltip */
.hex-tooltip__sold-badge {
    display: inline-block;
    padding: 3px 12px;
    background: rgba(220, 53, 69, 0.9);
    color: #fff;
    font-size: 0.8em;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-radius: 3px;
}

/* Tooltip arrow — points DOWN to swatch row */
.hex-tooltip__arrow {
    position: absolute;
    bottom: -8px;
    width: 14px;
    height: 14px;
    background: #fff;
    border-right: 1px solid #ddd;
    border-bottom: 1px solid #ddd;
    transform: rotate(45deg);
}

/* ─── Inquiry section ─── */
.hex-inquiry-section {
    margin-bottom: 20px;
}

.hex-no-form {
    color: #999;
    font-style: italic;
    font-size: 0.9em;
}

/* CF7 submit button spacing */
.hex-inquiry-section .wpcf7-submit {
    margin-top: 15px;
}

/* ─── Lightbox ─── */
body.hex-lightbox-open {
    overflow: hidden;
}

.hex-lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 999999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.25s ease;
    pointer-events: none;
}

.hex-lightbox--visible {
    opacity: 1;
    pointer-events: auto;
}

.hex-lightbox__backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    cursor: pointer;
}

.hex-lightbox__content {
    position: relative;
    max-width: 80vw;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: default;
}

.hex-lightbox__img-container {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hex-lightbox__img {
    display: block;
    max-width: 80vw;
    max-height: 65vh;
    object-fit: contain;
    border-radius: 4px;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.2);
}

.hex-lightbox__nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 2;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 6px;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    opacity: 0.6;
    cursor: pointer;
    transition: opacity 0.2s ease, background 0.2s ease;
    backdrop-filter: blur(4px);
}

.hex-lightbox__nav:hover {
    opacity: 1;
    background: rgba(255, 255, 255, 0.25);
}

.hex-lightbox__nav svg {
    width: 22px;
    height: 22px;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.3));
}

.hex-lightbox__nav--prev { left: 12px; }
.hex-lightbox__nav--next { right: 12px; }

.hex-lightbox__label-wrap {
    text-align: center;
    margin-top: 12px;
}

.hex-lightbox__label {
    display: inline-block;
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 0.3px;
    color: rgba(255, 255, 255, 0.9);
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 6px;
    padding: 6px 16px;
    backdrop-filter: blur(4px);
}

/* Sold badge in lightbox */
.hex-lightbox__sold-badge {
    display: inline-block;
    padding: 6px 16px;
    background: rgba(220, 53, 69, 0.9);
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-radius: 6px;
}

/* Lightbox thumbnail strip */
.hex-lightbox__thumbs {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 12px;
}

.hex-lightbox__thumb {
    max-width: 123px;
    max-height: 123px;
    object-fit: contain;
    border-radius: 4px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    cursor: pointer;
    opacity: 0.5;
    transition: opacity 0.2s, border-color 0.2s;
}

.hex-lightbox__thumb:hover {
    opacity: 0.8;
    border-color: rgba(255, 255, 255, 0.6);
}

.hex-lightbox__thumb--active {
    opacity: 1;
    border-color: #C5A352;
    box-shadow: 0 0 0 1px #C5A352;
}

/* ─── Responsive ─── */
@media (max-width: 480px) {
    .hex-swatch {
        width: calc(33.333% - 7px);
    }

    .hex-mode-option {
        padding: 10px 12px;
    }

    .hex-tooltip {
        max-width: 100%;
    }

    .hex-tooltip__nav {
        width: 28px;
        height: 28px;
    }

    .hex-tooltip__nav svg {
        width: 16px;
        height: 16px;
    }

    .hex-lightbox__nav--prev { left: 8px; }
    .hex-lightbox__nav--next { right: 8px; }

    .hex-lightbox__thumb {
        max-width: 64px;
        max-height: 64px;
    }
}
