/* =========================================
   FRITTS — Product Page Styles (product.html)
   Loaded after design.css + main.css.
   ========================================= */

/* =========================================
   Header overrides for product page
   (always solid, higher z-index)
   ========================================= */
header {
    z-index: 200;
    background-color: var(--color-brand-dark-teal);
}

.logo img {
    width: var(--logo-width);
    height: var(--logo-height);
    object-fit: contain;
}

/* =========================================
   Body override — no scroll, full height
   ========================================= */
body {
    height: 100vh;
    height: 100svh;
    overflow-y: hidden;
    background-color: var(--color-brand-white);
    /* header height only — no white gap */
    padding-top: var(--header-height, 3.6em);
}

/* =========================================
   Product Hero Section
   ========================================= */
.product-hero {
    position: relative;
    width: var(--frame-w);
    height: calc(100vh - var(--header-height, 3.6em));
    height: calc(100svh - var(--header-height, 3.6em));
    overflow: hidden;
}

/* Ensure the wrapping .app-frame passes through body height so
   fixed-height children still resolve correctly. */
.app-frame:has(> .product-hero) {
    height: 100%;
}

.hero-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.hero-bg img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    transform-origin: center;
    transition: transform 1s cubic-bezier(0.22, 1, 0.36, 1);
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10;
    pointer-events: none;
    transition: opacity 0.6s ease;
}

.product-hero.sidebar-open .hero-overlay {
    opacity: 0;
}

.hero-text-content {
    position: absolute;
    top: 10%;
    left: 15%;
    max-width: 40%;
    pointer-events: auto;
    text-align: center;
}

.hero-headline {
    color: var(--color-brand-red);
    font-family: var(--font-family-primary);
    font-size: 2.4em;
    font-weight: 700;
    line-height: 1.25;
    margin-bottom: 0.5em;
}

.hero-subtext {
    color: var(--color-brand-white);
    font-family: var(--font-family-primary);
    font-size: 0.95em;
    opacity: 0.85;
    color: var(--color-brand-red);
}

/* =========================================
   Jetzt Vergleichen button
   ========================================= */
.btn-compare {
    position: absolute;
    top: -4em;
    left: 5%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 1em;
    background-color: var(--color-brand-red);
    color: var(--color-brand-white);
    text-decoration: none;
    font-size: 1.2em;
    font-weight: 700;
    padding: 0.8em 1.2em;
    border-radius: 1.5em 1.5em 0 0;
    z-index: 15;
    transition: opacity 0.5s ease, transform 0.3s ease;
    pointer-events: auto;
    cursor: pointer;
    box-shadow: 0 -0.25em 1.25em rgba(232, 65, 40, 0.4);
}

.btn-compare::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: -0.5em;
    height: 0.75em;
    background-color: var(--color-brand-red);;
}

.btn-compare:hover {
    transform: translateY(-0.25em);
}

.btn-compare-icon {
    width: 2.5em;
    height: 2.5em;
    background-color: var(--color-brand-dark-teal);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.5s ease;
}

.btn-compare-icon img {
    width: 1em;
    filter: brightness(0) invert(1);
    transform: rotate(180deg);
}

.product-hero.sidebar-open .btn-compare-icon {
    transform: rotate(0deg);
}

.btn-compare.comparison-open {
    z-index: 1055;
}

.btn-compare.comparison-open .btn-compare-icon {
    transform: rotate(180deg);
}

/* =========================================
   Comparison Backdrop (dark overlay behind comparison)
   ========================================= */
.comparison-backdrop {
    position: fixed;
    top: 0;
    left: var(--frame-offset, 0);
    width: var(--frame-w, 100%);
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.8s cubic-bezier(0.25, 1, 0.5, 1);
}

.comparison-backdrop.open {
    opacity: 1;
    pointer-events: auto;
}

/* =========================================
   Comparison Overlay Section
   ========================================= */
.comparison-section {
    position: fixed;
    bottom: 0;
    left: var(--frame-offset, 0);
    width: var(--frame-w, 100%);
    height: 75vh;
    background-color: var(--color-brand-red);
    z-index: 1000;
    transform: translateY(100%);
    transition: transform 0.8s cubic-bezier(0.25, 1, 0.5, 1);
    border-radius: 1.875em 1.875em 0 0;
    display: flex;
    flex-direction: column;
}

.comparison-section.open {
    transform: translateY(0);
    border-radius: 0;
}

.comparison-section-inner {
    flex: 1;
    overflow-y: auto;
    padding: 2.4em 5% 4em;
    -webkit-overflow-scrolling: touch;
}

.comparison-section-inner::-webkit-scrollbar {
    width: 0.25em;
}

.comparison-section-inner::-webkit-scrollbar-track {
    background: transparent;
}

.comparison-section-inner::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 0.125em;
}

.comparison-header {
    text-align: center;
    margin-bottom: 3em;
}

.comparison-subtitle {
    font-family: var(--font-family-primary);
    font-size: 1.1em;
    color: var(--color-brand-white);
    opacity: 0.9;
    margin-bottom: 0.5em;
}

.comparison-title {
    font-family: var(--font-family-primary);
    font-size: 2.8em;
    font-weight: 700;
    color: var(--color-brand-white);
    line-height: 1.2;
}

.comparison-icons {
    display: flex;
    justify-content: space-evenly;
    margin-bottom: 3em;
}

.comparison-icon-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1em;
}

.comparison-icon-circle {
    width: 5em;
    height: 5em;
    border-radius: 50%;
    border: 0.125em solid rgba(255, 255, 255, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease, border-color 0.3s ease;
}

.comparison-icon-circle:hover {
    transform: scale(1.1);
    border-color: rgba(255, 255, 255, 0.8);
}

.comparison-icon-circle img {
    width: 2.5em;
    height: 2.5em;
}

.comparison-icon-label {
    color: var(--color-brand-white);
    font-size: 0.85em;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.0625em;
}

.comparison-text-content {
    max-width: 50em;
    margin: 0 auto;
    color: var(--color-brand-white);
    font-size: 1.05em;
    line-height: 1.8;
    text-align: center;
}

.comparison-text-content .fade-in-block {
    opacity: 0;
    transform: translateY(1.875em);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.comparison-text-content .fade-in-block.visible {
    opacity: 1;
    transform: translateY(0);
}

.comparison-text-content p {
    margin-bottom: 1.5em;
}

.comparison-text-content strong {
    color: var(--color-brand-white);
    font-weight: 700;
}

.comparison-close {
    position: absolute;
    top: 1.2em;
    right: 2em;
    width: 2.5em;
    height: 2.5em;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 1.4em;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s ease;
    z-index: 51;
}

.comparison-close:hover {
    background: rgba(255, 255, 255, 0.35);
}

/* =========================================
   Accordion Sidebar
   ========================================= */
.accordion-wrapper {
    position: absolute;
    right: 0;
    top: 0;
    height: 100%;
    display: flex;
    z-index: 100;
}

.accordion-item {
    position: relative;
    height: 100%;
    width: 6.25em;
    min-width: 6.25em;
    flex-shrink: 0;
    overflow: hidden;
    transition: width 0.6s cubic-bezier(0.25, 1, 0.5, 1),
                min-width 0.6s cubic-bezier(0.25, 1, 0.5, 1);
    cursor: pointer;
    border-left: 1px solid rgba(255, 255, 255, 0.1);
}

.accordion-item.active {
    width: calc(0.35 * var(--frame-w) + 6.25em);
    min-width: calc(0.35 * var(--frame-w) + 6.25em);
    cursor: default;
}

/* Accordion background colors */
.bg-photo {
    background-color: var(--color-brand-dark-teal);
}

.bg-waerme {
    background-color: var(--color-brand-red);
}

.bg-wall {
    background-color: var(--color-brand-light-teal);
}

/* Tab strip — anchored to left of item */
.tab-strip {
    position: absolute;
    left: 0;
    top: 0;
    width: 6.25em;
    height: 100%;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    padding: 1.5em 1em;
    z-index: 2;
}

.tab-arrow {
    width: 2.75em;
    height: 2.75em;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.6s cubic-bezier(0.25, 1, 0.5, 1);
    transform: rotate(180deg);
    opacity: 0.5;
}

.tab-arrow img {
    width: 100%;
    object-fit: contain;
}

.accordion-item.active .tab-arrow {
    transform: rotate(0);
    opacity: 1;
}

.tab-text {
    color: var(--color-brand-white);
    font-weight: 700;
    font-size: 4.5vh;
    font-size: 4.5svh;
    letter-spacing: 0.125em;
    text-transform: uppercase;
    white-space: nowrap;
    transform: rotate(180deg);
    writing-mode: vertical-lr;
    -webkit-writing-mode: vertical-lr;
}

/* Expandable content — anchored to right */
.accordion-content {
    position: absolute;
    right: 0;
    top: 0;
    height: 100%;
    width: calc(0.35 * var(--frame-w));
    padding: 4em 3em 0em 3em;
    opacity: 0;
    transform: translateX(1.875em);
    transition: opacity 0.15s ease, transform 0.15s ease;
    display: flex;
    flex-direction: column;
    pointer-events: none;
    overflow: hidden;
    z-index: 1;
    box-sizing: border-box;
}

.accordion-item.active .accordion-content {
    opacity: 1;
    transform: translateX(0);
    pointer-events: auto;
    transition: opacity 0.4s ease 0.2s, transform 0.4s ease 0.2s;
}

/* Content header — always visible, never scrolls */
.content-header {
    flex-shrink: 0;
    padding-bottom: 1.5em;
}

/* Swap zone — fills remaining space, stacks image and details */
.content-swap-zone {
    flex: 1;
    position: relative;
    overflow: hidden;
    min-height: 0;
}

/* Content styling */
.content-category {
    font-size: 0.75em;
    color: var(--color-brand-white);
    margin-bottom: 0.5em;
}

.content-title {
    font-family: var(--font-family-primary);
    font-size: 2em;
    font-weight: 700;
    color: var(--color-brand-white);
    line-height: 1.2;
    margin-bottom: 1em;
    text-transform: uppercase;
    max-width: 12em;
}

.content-subtitle {
    font-size: 0.9em;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 1em;
}

.content-link {
    color: var(--color-brand-white);
    text-decoration: none;
    font-size: 0.85em;
    font-weight: var(--font-weight-regular, 400);
    display: inline-flex;
    align-items: center;
    gap: 0.4em;
}

.content-link__arrow {
    width: 0.8em;
    height: 0.8em;
    vertical-align: middle;
}

.content-link__arrow--back {
    transform: scaleX(-1);
}

.bg-photo .content-link {
    color: var(--color-brand-red);
}

/* Image wrapper fills swap zone; image anchored to its bottom */
.content-image-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
    opacity: 1;
    transform: translateY(var(--product-slide-distance, 2em));
    transition: opacity var(--product-slide-duration, 0.5s) ease, transform var(--product-slide-duration, 0.5s) var(--product-slide-easing, ease);
}

.accordion-item.active .content-image-wrapper {
    transform: translateY(0);
}

.content-image-wrapper img {
    position: absolute;
    left: 50%;
    bottom: 0;
    transform: translateX(-50%);
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.content-details {
    position: absolute;
    inset: 0;
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.95em;
    line-height: 1.6;
    padding: 0.5em 1em 5em 0;
    opacity: 0;
    transform: translateX(1.5em);
    transition: opacity var(--product-slide-duration, 0.5s) ease, transform var(--product-slide-duration, 0.5s) var(--product-slide-easing, ease);
    overflow-y: auto;
    pointer-events: none;
}

.content-details.is-visible {
    opacity: 1;
    transform: translateX(0);
    pointer-events: auto;
}

.content-image-wrapper.is-hidden {
    opacity: 0;
    transform: translateY(var(--product-slide-distance, 2em));
    pointer-events: none;
}

/* Fast close — prevent text bleeding over image */
.accordion-item:not(.active) .content-image-wrapper {
    opacity: 0;
    transform: translateY(var(--product-slide-distance, 2em));
    transition: opacity 0.1s ease, transform 0.1s ease;
}

.accordion-item:not(.active) .content-details {
    opacity: 0;
    transform: translateX(1.5em);
    transition: opacity 0.1s ease, transform 0.1s ease;
    overflow: hidden;
}

.content-details::-webkit-scrollbar {
    width: 0.25em;
}

.content-details::-webkit-scrollbar-track {
    background: transparent;
}

.content-details::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 0.125em;
}

.content-details ul {
    padding-left: 1.2em;
    margin: 1em 0;
}

.content-details li {
    margin-bottom: 0.5em;
}
