/* ==========================================================================
   Geträumte Taten – Product Widgets
   Brand Color: #558A91
   ========================================================================== */

/* --------------------------------------------------------------------------
   CSS Custom Properties
   -------------------------------------------------------------------------- */
:root {
    --gt-accent: #558A91;
    --gt-accent-dark: #467276;
    --gt-accent-light: #e8f2f3;
    --gt-text: #1a1a1a;
    --gt-text-light: #666666;
    --gt-border: #d0d0d0;
    --gt-bg-light: #f5f5f5;
    --gt-white: #ffffff;
    --gt-transition: 0.3s ease;
}

/* ==========================================================================
   1. PRODUCT GALLERY GRID
   ========================================================================== */

.gt-gallery-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
    gap: 8px;
    width: 100%;
}

/* When only 2 images */
.gt-gallery-count-2 {
    grid-template-rows: 1fr;
}

/* When only 3 images */
.gt-gallery-count-3 .gt-gallery-main {
    grid-row: 1 / 3;
}

.gt-gallery-item {
    position: relative;
    overflow: hidden;
    background: var(--gt-bg-light);
    cursor: pointer;
    aspect-ratio: 1 / 1;
}

.gt-gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform var(--gt-transition);
}

/* Zoom on hover */
.gt-gallery-item.gt-zoom-enabled:hover img {
    transform: scale(1.05);
}

.gt-zoom-lens {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: 200%;
    background-position: center;
    background-repeat: no-repeat;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    z-index: 2;
}

.gt-gallery-item.gt-zoom-enabled:hover .gt-zoom-lens {
    opacity: 1;
}

.gt-gallery-item.gt-zoom-enabled:hover img {
    opacity: 0;
}

/* Lightbox cursor */
.gt-gallery-item.gt-lightbox-enabled {
    cursor: zoom-in;
}

/* --------------------------------------------------------------------------
   Lightbox Overlay
   -------------------------------------------------------------------------- */
.gt-lightbox-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.92);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.gt-lightbox-overlay.active {
    opacity: 1;
}

.gt-lightbox-image-wrapper {
    max-width: 90vw;
    max-height: 85vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.gt-lightbox-image {
    max-width: 100%;
    max-height: 85vh;
    object-fit: contain;
    border-radius: 2px;
}

.gt-lightbox-close {
    position: absolute;
    top: 20px;
    right: 24px;
    background: none;
    border: none;
    color: var(--gt-white);
    font-size: 36px;
    cursor: pointer;
    line-height: 1;
    padding: 8px;
    z-index: 10;
    transition: opacity var(--gt-transition);
}

.gt-lightbox-close:hover {
    opacity: 0.7;
}

.gt-lightbox-prev,
.gt-lightbox-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--gt-white);
    font-size: 48px;
    cursor: pointer;
    padding: 16px;
    z-index: 10;
    transition: opacity var(--gt-transition);
}

.gt-lightbox-prev { left: 16px; }
.gt-lightbox-next { right: 16px; }

.gt-lightbox-prev:hover,
.gt-lightbox-next:hover {
    opacity: 0.7;
}

.gt-lightbox-counter {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    color: var(--gt-white);
    font-size: 14px;
    letter-spacing: 0.1em;
    opacity: 0.7;
}

/* ==========================================================================
   2. PRODUCT INFO BLOCK
   ========================================================================== */

.gt-product-info-block {
    padding: 0;
}

.gt-info-product-name {
    font-family: 'Copperplate', 'Cinzel', Georgia, serif;
    font-size: 22px;
    font-weight: 400;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--gt-text);
    margin: 0 0 8px 0;
    padding: 0;
    line-height: 1.3;
}

.gt-info-subtitle {
    font-family: Verdana, Geneva, sans-serif;
    font-size: 12px;
    color: var(--gt-text-light);
    margin: 0 0 16px 0;
    letter-spacing: 0.02em;
}

.gt-info-short-desc,
.gt-info-short-desc p {
    font-family: 'Helvetica Neue', 'Inter', Helvetica, Arial, sans-serif;
    font-size: 14px;
    line-height: 1.6;
    color: var(--gt-text);
    margin: 0 0 16px 0;
    letter-spacing: 0.02em;
}

.gt-info-long-desc,
.gt-info-long-desc p {
    font-family: 'Helvetica Neue', 'Inter', Helvetica, Arial, sans-serif;
    font-size: 13px;
    line-height: 1.7;
    color: var(--gt-text-light);
    margin: 0 0 24px 0;
    letter-spacing: 0.02em;
}

/* Price */
.gt-info-price-wrapper {
    margin: 0 0 24px 0;
}

.gt-info-price {
    font-family: 'Helvetica Neue', 'Inter', Helvetica, Arial, sans-serif;
    font-size: 20px;
    font-weight: 400;
    color: var(--gt-text);
    display: block;
    margin-bottom: 4px;
}

.gt-info-price .woocommerce-Price-amount {
    font-weight: 400;
}

.gt-info-tax-note {
    font-family: Verdana, Geneva, sans-serif;
    font-size: 10px;
    color: var(--gt-text-light);
    display: block;
}

.gt-info-tax-note a {
    color: var(--gt-accent);
    text-decoration: underline;
}

.gt-info-tax-note a:hover {
    color: var(--gt-accent-dark);
}

/* Meta row: Dimensions + Availability */
.gt-info-meta-row {
    display: flex;
    gap: 40px;
    padding-top: 16px;
    border-top: 1px solid #e5e5e5;
    margin-bottom: 24px;
}

.gt-info-dimensions,
.gt-info-availability {
    flex: 1;
}

.gt-info-meta-label {
    font-family: 'Copperplate', 'Cinzel', Georgia, serif;
    font-size: 11px;
    font-weight: 400;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--gt-text);
    display: block;
    margin-bottom: 8px;
}

.gt-info-meta-value {
    font-family: Verdana, Geneva, sans-serif;
    font-size: 12px;
    color: var(--gt-text);
    display: block;
}

.gt-info-availability-status {
    font-family: Verdana, Geneva, sans-serif;
    font-size: 12px;
    display: block;
    margin-bottom: 4px;
}

.gt-info-availability-status.in-stock {
    color: var(--gt-accent);
}

.gt-info-availability-status.on-backorder {
    color: #b8860b;
}

.gt-info-availability-status.out-of-stock {
    color: #999;
}

.gt-info-enquiry-link {
    font-family: Verdana, Geneva, sans-serif;
    font-size: 11px;
    color: var(--gt-accent);
    text-decoration: underline;
    display: inline-block;
}

.gt-info-enquiry-link:hover {
    color: var(--gt-accent-dark);
}

/* Delivery time (dynamic per variation) */
.gt-info-delivery-time {
    font-family: Verdana, Geneva, sans-serif;
    font-size: 11px;
    color: var(--gt-text-light);
    display: block;
    margin-top: 4px;
    font-style: italic;
}

.gt-info-delivery-time p {
    margin: 0;
    font-size: inherit;
    color: inherit;
}

/* ==========================================================================
   3. VARIATION SELECTOR
   ========================================================================== */

.gt-variation-selector {
    padding: 0;
}

.gt-selector-label {
    font-family: 'Copperplate', 'Cinzel', Georgia, serif;
    font-size: 13px;
    font-weight: 400;
    letter-spacing: 0.12em;
    text-transform: lowercase;
    color: var(--gt-text);
    margin: 0 0 12px 0;
}

/* Size Grid */
.gt-size-selector {
    margin-bottom: 24px;
}

.gt-size-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.gt-size-option {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--gt-accent);
    background: transparent;
    color: var(--gt-text);
    font-family: Verdana, Geneva, sans-serif;
    font-size: 13px;
    cursor: pointer;
    transition: all var(--gt-transition);
    padding: 0;
    line-height: 1;
}

.gt-size-option:hover {
    background: var(--gt-accent-light);
}

.gt-size-option.active {
    background: var(--gt-accent);
    border-color: var(--gt-accent);
    color: var(--gt-white);
}

.gt-size-option.disabled {
    opacity: 0.35;
    cursor: not-allowed;
    pointer-events: none;
}

.gt-size-option.out-of-stock {
    position: relative;
}

.gt-size-option.out-of-stock::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 4px;
    right: 4px;
    height: 1px;
    background: var(--gt-text-light);
    transform: rotate(-45deg);
}

/* Variant/Material List */
.gt-variant-selector {
    margin-bottom: 28px;
}

.gt-variant-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.gt-variant-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 12px;
    border: 1px solid transparent;
    background: transparent;
    cursor: pointer;
    transition: all var(--gt-transition);
    text-align: left;
    width: 100%;
}

.gt-variant-option:hover {
    background: var(--gt-accent-light);
    border-color: var(--gt-accent);
}

.gt-variant-option.active {
    border-color: var(--gt-accent);
    background: var(--gt-accent-light);
}

.gt-variant-thumb {
    width: 40px;
    height: 40px;
    object-fit: cover;
    border-radius: 2px;
    flex-shrink: 0;
}

.gt-variant-swatch {
    width: 40px;
    height: 40px;
    border-radius: 2px;
    background: var(--gt-bg-light);
    flex-shrink: 0;
}

.gt-variant-name {
    font-family: Verdana, Geneva, sans-serif;
    font-size: 12px;
    color: var(--gt-text);
    letter-spacing: 0.02em;
}

/* Action Buttons */
.gt-action-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 8px;
}

.gt-add-to-cart-btn {
    display: block;
    width: 100%;
    padding: 14px 24px;
    background: var(--gt-accent);
    color: var(--gt-white);
    border: none;
    font-family: 'Copperplate', 'Cinzel', Georgia, serif;
    font-size: 14px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    cursor: pointer;
    transition: background var(--gt-transition);
    text-align: center;
}

.gt-add-to-cart-btn:hover {
    background: var(--gt-accent-dark);
}

.gt-add-to-cart-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.gt-back-btn {
    display: block;
    width: 100%;
    padding: 12px 24px;
    background: transparent;
    color: var(--gt-text);
    border: 1px solid var(--gt-text);
    font-family: Verdana, Geneva, sans-serif;
    font-size: 13px;
    letter-spacing: 0.05em;
    cursor: pointer;
    transition: all var(--gt-transition);
    text-align: center;
    text-decoration: none;
}

.gt-back-btn:hover {
    background: var(--gt-text);
    color: var(--gt-white);
}

/* ==========================================================================
   4. EDITOR PLACEHOLDER
   ========================================================================== */

.gt-editor-placeholder {
    font-family: Verdana, Geneva, sans-serif;
}

/* ==========================================================================
   5. RESPONSIVE
   ========================================================================== */

/* Tablet */
@media (max-width: 1024px) {
    .gt-info-product-name {
        font-size: 20px;
    }

    .gt-info-meta-row {
        gap: 24px;
    }
}

/* Mobile */
@media (max-width: 767px) {

    /* Gallery: keep 2x2 grid but compact */
    .gt-gallery-grid {
        display: grid;
        grid-template-columns: 1fr 1fr;
        grid-template-rows: auto auto;
        gap: 4px;
    }

    .gt-gallery-item {
        aspect-ratio: 1 / 1;
    }

    /* Main image spans nothing special on mobile — all 4 are equal in 2x2 */
    .gt-gallery-count-3 .gt-gallery-main {
        grid-row: auto;
    }

    /* Disable zoom on mobile (touch) */
    .gt-gallery-item.gt-zoom-enabled:hover .gt-zoom-lens {
        opacity: 0;
    }

    .gt-gallery-item.gt-zoom-enabled:hover img {
        opacity: 1;
        transform: none;
    }

    /* Info block adjustments */
    .gt-info-product-name {
        font-size: 18px;
        letter-spacing: 0.1em;
    }

    .gt-info-meta-row {
        flex-direction: column;
        gap: 16px;
    }

    /* Lightbox nav */
    .gt-lightbox-prev,
    .gt-lightbox-next {
        font-size: 32px;
        padding: 12px;
    }

    .gt-lightbox-close {
        font-size: 28px;
        top: 12px;
        right: 16px;
    }

    /* Size grid: smaller boxes on mobile */
    .gt-size-option {
        width: 42px;
        height: 42px;
        font-size: 12px;
    }
}

/* Small mobile */
@media (max-width: 480px) {

    /* Even smaller gap on very small screens */
    .gt-gallery-grid {
        gap: 2px;
    }

    .gt-action-buttons {
        position: sticky;
        bottom: 0;
        background: var(--gt-white);
        padding: 12px 0;
        z-index: 10;
    }
}
