/* =========================================================
   KATALOG SINGLE
   Optisch an das Mosertronik-Theme angelehnt.
   Kein Product-Grid-/Filter-CSS in dieser Datei.
   ========================================================= */

.catalog-single-shell {
    --catalog-accent: #ad0408;
    --catalog-accent-hover: #000000;
    --catalog-text: #333333;
    --catalog-heading: #222222;
    --catalog-muted: #666666;
    --catalog-border: #d6d6d6;
    --catalog-surface: #ffffff;
    --catalog-background: #e8e8e8;
    --catalog-soft: #f5f5f5;
    --catalog-body-font: "Open Sans", "Futura", Helvetica, Arial, Lucida, sans-serif;
    --catalog-heading-font: "Futura", Helvetica, Arial, Lucida, sans-serif;

    width: 100%;
    color: var(--catalog-text);
    font-family: var(--catalog-body-font);
}

.catalog-single-shell,
.catalog-single-shell * {
    box-sizing: border-box;
}

/* =========================================================
   NAVIGATION
   ========================================================= */

.catalog-single-nav {
    display: flex;
    justify-content: flex-start;
    margin: 0 0 24px;
}

.catalog-back-button {
    color: var(--catalog-accent);
    font-family: var(--catalog-body-font);
}

.catalog-back-button:hover,
.catalog-back-button:focus-visible {

}

/* =========================================================
   SINGLE LAYOUT
   ========================================================= */

.product-item-page {
    display: grid;
    grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr);
    gap: 32px;
    padding: 0 30px;
    background: var(--catalog-background);
    color: var(--catalog-text);
    line-height: 1.6;
}

.product-item-page.has-no-gallery {
    grid-template-columns: minmax(0, 1fr);
}

.gallery-column,
.details-column {
    min-width: 0;
}

.product-title {
    margin: 0 0 24px;
    color: var(--catalog-heading);
    font-family: var(--catalog-heading-font);
    font-size: 24px;
    font-weight: 800;
    line-height: 1.25;
}

/* =========================================================
   DESCRIPTION
   ========================================================= */

.tab-header {
    position: relative;
    top: 1px;
    display: inline-block;
    padding: 8px 24px;
    border: 1px solid var(--catalog-border);
    border-bottom: 0;
    background: var(--catalog-surface);
    color: var(--catalog-muted);
    font-size: 13px;
}

.description-content {
    padding: 24px;
    border: 1px solid var(--catalog-border);
    background: var(--catalog-surface);
    font-size: 15px;
}

.description-content > :first-child {
    margin-top: 0;
}

.description-content > :last-child {
    margin-bottom: 0;
}

.description-content h2,
.description-content h3,
.description-content h4 {
    color: var(--catalog-heading);
    font-family: var(--catalog-heading-font);
    font-weight: 800;
}

/* =========================================================
   GALLERY
   ========================================================= */

/* Auto-Formatierungs-Artefakte in der UI niemals layoutwirksam werden lassen. */
.catalog-single-shell > br,
.catalog-single-nav > br,
.product-item-page > br,
.product-item-page > p,
.gallery-column > br,
.gallery-column > p,
.main-image > br,
.main-image > p,
.main-image-button > br,
.thumbnail-grid > br,
.thumbnail-grid > p,
.product-lightbox > br,
.product-lightbox > p,
.lightbox-stage > br,
.lightbox-stage > p,
.variation-order-controls > br,
.variation-order-controls > p {
    display: none !important;
}


.product-item-page .gallery-column {
    display: flex;
    flex-direction: column;
    align-self: start;
    width: 100%;
    gap: 12px;
}

.product-item-page .main-image {
    width: 100%;
    margin: 0;
    overflow: hidden;
    border: 1px solid var(--catalog-border);
    border-radius: 4px;
    background: var(--catalog-surface);
}

.product-item-page .main-image-button {
    -webkit-appearance: none;
    appearance: none;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-width: 0;
    margin: 0;
    padding: 0;
    overflow: hidden;
    border: 0;
    border-radius: 0;
    background: var(--catalog-surface);
    box-shadow: none;
    line-height: 0;
    cursor: zoom-in;
}

.product-item-page .gallery-main-image {
    display: block;
    width: 100%;
    height: auto;
    max-width: 100%;
    max-height: 650px;
    margin: 0 auto;
    padding: 0;
    object-fit: contain;
    object-position: center center;
    transition: opacity .18s ease, transform .25s ease;
}

.product-item-page .gallery-main-image.is-switching {
    opacity: .3;
}

.product-item-page .main-image-button:hover .gallery-main-image {
    transform: scale(1.008);
}

.product-item-page .main-image-button:focus-visible,
.product-item-page .gallery-thumbnail:focus-visible,
.product-lightbox .lightbox-close:focus-visible {
    outline: 2px solid var(--catalog-accent);
    outline-offset: -2px;
}

.zoom-hint {
    position: absolute;
    right: 12px;
    bottom: 12px;
    display: block;
    padding: 7px 10px;
    border: 1px solid rgba(0, 0, 0, .08);
    border-radius: 4px;
    background: rgba(255, 255, 255, .94);
    color: var(--catalog-text);
    font-size: 12px;
    font-weight: 600;
    line-height: 1.2;
    opacity: 0;
    transform: translateY(3px);
    transition: opacity .18s ease, transform .18s ease;
}

.main-image-button:hover .zoom-hint,
.main-image-button:focus-visible .zoom-hint {
    opacity: 1;
    transform: none;
}

.product-item-page .thumbnail-grid {
    display: flex;
    flex-flow: row wrap;
    justify-content: flex-start;
    align-items: flex-start;
    gap: 10px;
    width: 100%;
    margin: 0;
    padding: 0;
}

.product-item-page .gallery-thumbnail {
    -webkit-appearance: none;
    appearance: none;
    flex: 0 0 78px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 78px;
    height: 78px;
    margin: 0;
    padding: 4px;
    overflow: hidden;
    border: 1px solid var(--catalog-border);
    border-radius: 4px;
    background: var(--catalog-surface);
    box-shadow: none;
    line-height: 0;
    cursor: pointer;
    transition: border-color .18s ease, box-shadow .18s ease;
}

.product-item-page .gallery-thumbnail:hover {
    border-color: #999999;
}

.product-item-page .gallery-thumbnail.is-active {
    border-color: var(--catalog-accent);
    box-shadow: inset 0 0 0 1px var(--catalog-accent);
}

.product-item-page .gallery-thumbnail img {
    display: block;
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    margin: 0;
    padding: 0;
    object-fit: contain;
    object-position: center center;
}

/* =========================================================
   LIGHTBOX
   Das Dialogfenster wird explizit in der Viewport-Mitte fixiert.
   Die Bildfläche zentriert das Bild unabhängig vom Seitenlayout.
   ========================================================= */

.product-lightbox[open] {
    position: fixed;
    inset: 50% auto auto 50%;
    transform: translate(-50%, -50%);
    display: block;
    width: min(94vw, 1200px);
    height: min(92dvh, 900px);
    max-width: none;
    max-height: none;
    margin: 0;
    padding: 0;
    overflow: hidden;
    border: 0;
    border-radius: 8px;
    background: var(--catalog-surface);
    box-shadow: 0 18px 60px rgba(0, 0, 0, .28);
}

.product-lightbox::backdrop {
    background: rgba(0, 0, 0, .72);
}

.product-lightbox .lightbox-stage {
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    width: 100%;
    height: 100%;
    padding: 54px 28px 28px;
    overflow: hidden;
}

.product-lightbox .lightbox-image {
    display: block;
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: 100%;
    margin: 0;
    object-fit: contain;
    object-position: center center;
    cursor: zoom-in;
    transform: scale(1);
    transform-origin: center center;
    transition: transform .25s ease;
}

.product-lightbox .lightbox-image.is-zoomed {
    cursor: zoom-out;
    transform: scale(2);
}

.product-lightbox .lightbox-close {
    -webkit-appearance: none;
    appearance: none;
    position: absolute;
    z-index: 2;
    top: 12px;
    right: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    margin: 0;
    padding: 0;
    border: 1px solid transparent;
    border-radius: 50%;
    background: transparent;
    color: var(--catalog-heading);
    box-shadow: none;
    font-family: Arial, sans-serif;
    font-size: 28px;
    font-weight: 400;
    line-height: 1;
    cursor: pointer;
    transition: background-color .18s ease, color .18s ease;
}

.product-lightbox .lightbox-close:hover {
    background: var(--catalog-accent);
    color: #ffffff;
}

/* =========================================================
   VARIATIONSPREISE
   ========================================================= */

.variation-pricing {
    margin-top: 0;
    padding: 24px;
    border: 1px solid var(--catalog-border);
    border-top: 0;
    background: var(--catalog-surface);
    font-size: 14px;
}

.variation-pricing h4 {
    margin: 0 0 10px;
    color: var(--catalog-heading);
    font-family: var(--catalog-heading-font);
    font-size: 18px;
    font-weight: 800;
}

.variation-pricing-note {
    margin: 0 0 20px;
    color: var(--catalog-muted);
}

.variation-customer-group {
    margin-bottom: 12px;
    color: var(--catalog-muted);
}

.variation-discount {
    display: inline-block;
    margin-left: 6px;
    padding: 2px 7px;
    border-radius: 999px;
    background: var(--catalog-soft);
    color: var(--catalog-accent);
    font-weight: 700;
}

.variation-price-list {
    display: grid;
    gap: 0;
}

.variation-price-item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: baseline;
    gap: 18px;
    padding: 13px 0;
    border-bottom: 1px solid #eeeeee;
}

.variation-price-meta,
.variation-price-value {
    margin: 0;
    padding: 0;
}

.variation-price-meta strong {
    display: block;
    margin: 0;
    color: var(--catalog-heading);
    font-size: 14px;
    line-height: 1.35;
}

.variation-price-meta span {
    display: block;
    margin-top: 3px;
    color: #777777;
    font-size: 12px;
    line-height: 1.35;
}

.variation-price-value {
    align-self: start;
    color: var(--catalog-accent);
    font-family: var(--catalog-heading-font);
    font-size: 18px;
    font-weight: 800;
    line-height: 1.35;
    text-align: right;
    white-space: nowrap;
}

.variation-price-table-wrap {
    width: 100%;
    overflow-x: auto;
}

.variation-price-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--catalog-surface);
}

.variation-price-table th,
.variation-price-table td {
    padding: 10px 12px;
    border-bottom: 1px solid #eeeeee;
    text-align: left;
    vertical-align: top;
    white-space: nowrap;
}

.variation-price-table thead th {
    color: var(--catalog-muted);
    font-size: 11px;
    text-transform: uppercase;
}

.variation-price-cell {
    color: var(--catalog-accent);
    font-weight: 700;
}

.variation-price-cell small {
    display: block;
    color: #777777;
    font-size: 10px;
    font-weight: 400;
}

.variation-price-not-defined {
    color: #aaaaaa;
    font-weight: 400;
}

/* =========================================================
   BESTELLAUSWAHL
   Select und Button haben exakt dieselbe Höhe.
   ========================================================= */

.variation-order-box {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--catalog-border);
}

.variation-order-box label {
    display: block;
    margin: 0 0 8px;
    color: var(--catalog-heading);
    font-size: 14px;
    font-weight: 700;
    line-height: 1.35;
}

.variation-order-controls {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    width: 100%;
}

.variation-order-box select {
    -webkit-appearance: auto;
    appearance: auto;
    display: block;
    width: 100%;
    min-width: 0;
    height: 48px;
    margin: 0;
    padding: 0 14px;
    border: 1px solid #aaaaaa;
    border-radius: 3px;
    background: var(--catalog-surface);
    color: var(--catalog-text);
    font-family: var(--catalog-body-font);
    font-size: 14px;
    line-height: 48px;
}

.variation-order-box select:focus {
    border-color: var(--catalog-accent);
    outline: 2px solid rgba(173, 4, 8, .18);
    outline-offset: 1px;
}

.variation-order-button {
    -webkit-appearance: none;
    appearance: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 130px;
    height: 48px;
    margin: 0;
    padding: 0 22px;
    border: 0;
    border-radius: 8px;
    background: var(--catalog-accent);
    color: #ffffff;
    box-shadow: none;
    font-family: var(--catalog-body-font);
    font-size: 15px;
    font-weight: 700;
    line-height: 1;
    text-align: center;
    white-space: nowrap;
    cursor: pointer;
    transition: background-color .2s ease, opacity .2s ease;
}

.variation-order-button:hover:not(:disabled),
.variation-order-button:focus-visible:not(:disabled) {
    background: var(--catalog-accent-hover);
}

.variation-order-button:disabled {
    background: #d5d5d5;
    color: #777777;
    cursor: not-allowed;
    opacity: 1;
}


.variation-empty {
    margin: 0;
    padding: 20px 24px;
    border: 1px solid var(--catalog-border);
    border-top: 0;
    background: var(--catalog-surface);
}

/* =========================================================
   RESPONSIVE
   ========================================================= */

@media (max-width: 900px) {
    .product-item-page {
        grid-template-columns: minmax(0, 1fr);
        padding: 20px;
    }

    .product-item-page .gallery-main-image {
        max-height: 70vh;
    }
}

@media (max-width: 600px) {
    .product-item-page {
        gap: 22px;
        padding: 14px;
    }

    .product-item-page .thumbnail-grid {
        gap: 8px;
    }

    .product-item-page .gallery-thumbnail {
        flex-basis: 68px;
        width: 68px;
        height: 68px;
    }

    .zoom-hint {
        opacity: .9;
        transform: none;
    }

    .product-lightbox[open] {
        width: 96vw;
        height: 92dvh;
    }

    .product-lightbox .lightbox-stage {
        padding: 52px 12px 12px;
    }

    .variation-price-item {
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 10px;
    }

    .variation-price-value {
        font-size: 16px;
    }

    .variation-order-controls {
        grid-template-columns: minmax(0, 1fr);
    }

    .variation-order-box select,
    .variation-order-button {
        width: 100%;
        min-width: 0;
    }
}

/* Produkt ohne Variationen: direkter Bestellen-Button. */
.variation-order-controls--single {
    display: flex;
    justify-content: flex-end;
}

.variation-order-box--single .variation-order-button {
    min-width: 150px;
}
