/* Page wrapper: cancels any theme styles on .entry-content.
   Side padding uses --gutter, defined in header.css so it always matches the header. */
:root {
    --subnavHeight: 60px; /* gold bar under the header */
    --stickyTop: calc(10vh + var(--subnavHeight)); /* header + gold bar: what covers the top of the screen */
}

.treatmentPage {
    margin: 0;
    padding: 0;
    max-width: none;
    width: 100%;
    overflow-x: clip; /* slide-in animations (autoAnims) can't cause sideways scrolling. clip (not hidden) keeps position: sticky working */
}


/* ---------- Gold bar under the header (markup in header.php) ---------- */

/* Black, like .headerSpacer: while the header slides down on load, the gold bar comes down with it
   instead of already being visible underneath */
.treatmentSubnavSpacer {
    height: var(--subnavHeight);
    background-color: black;
}

.header .treatmentSubnav {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    height: var(--subnavHeight);
    padding: 0 var(--gutter);
    box-sizing: border-box;
    background-color: #caab77;
    box-shadow: 0 6px 8px rgba(255, 255, 255, 0.3);
    display: flex;
    align-items: center;
}

.treatmentSubnavSwiper {
    width: 100%;
    height: 100%;
}

.treatmentSubnavSwiper .swiper-slide {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
}

/* Before Swiper starts (its JS runs at the end of the page) the slides would be 100% wide: only the first one
   shows and the rest pop in a few ms later. While the bar has .treatmentSubnavLoading (header.php; the template's
   JS removes it once Swiper is running), these widths copy the Swiper settings in template-treatment-detail.php
   (slidesPerView / spaceBetween per breakpoint), so the bar already looks final on the first paint. Keep both in sync.
   .treatmentSubnavFits2/3/4 (header.php) = every treatment fits with 2/3/4 per row. Plain classes: works on old phones. */
.treatmentSubnavLoading .swiper-slide {
    width: calc((100% - 10px) / 2);
    margin-right: 10px;
}

.treatmentSubnavLoading .swiper-slide:last-child {
    margin-right: 0; /* Swiper ignores the last gap when centering */
}

/* The bar always starts at the beginning, so "previous" starts dimmed */
.treatmentSubnavLoading .treatmentSubnavPrev {
    opacity: 0.4;
}

/* Fewer treatments than fit: centered (like Swiper's centerInsufficientSlides) and "next" dimmed too */
.treatmentSubnavLoading.treatmentSubnavFits2 .swiper-wrapper {
    justify-content: center;
}

.treatmentSubnavLoading.treatmentSubnavFits2 .treatmentSubnavNext {
    opacity: 0.4;
}

@media (min-width:700px){
.treatmentSubnavLoading .swiper-slide {
    width: calc((100% - 40px) / 3);
    margin-right: 20px;
}
.treatmentSubnavLoading.treatmentSubnavFits3 .swiper-wrapper {
    justify-content: center;
}
.treatmentSubnavLoading.treatmentSubnavFits3 .treatmentSubnavNext {
    opacity: 0.4;
}
}

@media (min-width:1300px){
.treatmentSubnavLoading .swiper-slide {
    width: calc((100% - 90px) / 4);
    margin-right: 30px;
}
.treatmentSubnavLoading.treatmentSubnavFits4 .swiper-wrapper {
    justify-content: center;
}
.treatmentSubnavLoading.treatmentSubnavFits4 .treatmentSubnavNext {
    opacity: 0.4;
}
}

.treatmentSubnavSwiper .swiper-slide a,
.treatmentSubnavCurrent {
    font-family: 'Baskervville';
    font-weight: 600;
    color: white;
    font-size: 1.05em;
    line-height: 1.1;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    text-align: center;
    text-decoration: underline;
    text-decoration-color: transparent;
    text-decoration-thickness: 2px;
    text-underline-offset: 5px;
    transition: text-decoration-color 0.2s ease-in-out;
}

/* The treatment you're on: plain text (not a link), always underlined */
.treatmentSubnavSwiper .swiper-slide a:hover,
.treatmentSubnavCurrent {
    text-decoration-color: white;
}

/* Small white chevrons, centered in the side gutters. Always visible: they hint the bar can be scrolled */
.treatmentSubnavPrev,
.treatmentSubnavNext {
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 30px;
    height: 30px;
    padding: 7px;
    background: none;
    border: 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.2s ease-in-out, transform 0.2s ease-in-out;
}

.treatmentSubnavPrev {
    left: calc(var(--gutter) / 2);
}

.treatmentSubnavNext {
    left: calc(100% - var(--gutter) / 2);
}

.treatmentSubnavPrev:hover,
.treatmentSubnavNext:hover {
    transform: translate(-50%, -50%) scale(1.25);
}

.treatmentSubnavPrev:active,
.treatmentSubnavNext:active {
    transform: translate(-50%, -50%) scale(0.9);
}

.treatmentSubnavPrev svg,
.treatmentSubnavNext svg {
    width: 9px;
    height: auto;
    display: block;
}

/* Nothing more on that side */
.treatmentSubnav .swiper-button-disabled {
    opacity: 0.4;
    cursor: default;
}

.treatmentSubnav .swiper-button-disabled:hover {
    transform: translate(-50%, -50%);
}


/* ---------- Hero + form ---------- */

.treatmentHero {
    position: relative;
    height: calc(100vh - var(--stickyTop)); /* header + gold bar + hero = exactly one screen. Fixed: the form is sized to fit (max-height queries) */
    background-color: black;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 50px;
    padding: 40px var(--gutter) 70px;
    box-sizing: border-box;
    overflow: hidden;
}

.treatmentHeroImg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: brightness(0.45);
}

.treatmentHeroText {
    position: relative;
    max-width: 55%;
}

.treatmentHeroText h1 {
    font-family: 'Baskervville';
    font-weight: 600;
    color: #caab77;
    font-size: 4.4em;
    line-height: 1.1;
    text-transform: uppercase;
    margin: 0;
}

.treatmentHeroText p {
    font-family: 'Baskervville';
    font-style: italic;
    color: white;
    font-size: 1.9em;
    margin: 30px 0 0;
}

/* The form card's design (.formCard) lives in header.css: it's shared with the home page */
.treatmentForm {
    position: relative;
    flex: none;
    scroll-margin-top: calc(var(--stickyTop) + 20px);
}

.treatmentHeroArrow {
    position: absolute;
    bottom: 25px;
    left: 50%;
    transform: translateX(-50%);
    width: 28px;
    display: block;
    transition: all 0.25s ease-in-out;
}

.treatmentHeroArrow:hover {
    transform: translateX(-50%) translateY(4px);
}

.treatmentHeroArrow svg {
    width: 100%;
    height: auto;
    display: block;
}


/* ---------- Price + summary ---------- */

/* Grid tracks are % of the full page width, so the price box can bleed into the left gutter */
.treatmentIntro {
    display: grid;
    grid-template-columns: var(--gutter) 22% 7% 1fr var(--gutter);
    align-items: center;
    padding: 110px 0 0;
    scroll-margin-top: var(--stickyTop);
}

.treatmentPrice {
    grid-column: 1 / 3;
}

.treatmentPrice p {
    margin: 0;
}

.treatmentPriceFrom {
    font-family: 'Baskervville';
    font-weight: 700;
    color: #caab77;
    font-size: 3.6em;
    line-height: 1;
    text-align: right;
    margin-bottom: 15px !important;
}

.treatmentPriceBox {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    background-color: #caab77;
    border-radius: 0 14px 14px 0;
    padding: 5px 30px 5px 40px;
}

.treatmentPriceBox img {
    width: 175px;
    height: auto;
    filter: brightness(0) invert(1); /* gold logo → white */
}

.treatmentPriceBox p {
    font-family: 'Baskervville';
    font-weight: 700;
    color: white;
    font-size: 7em;
    line-height: 1.1;
    white-space: nowrap;
}

/* No fixed price ('price' => null, e.g. Plasma Pen): "TRAS VALORACIÓN" instead of the number */
.treatmentPriceBox.treatmentPriceBoxText p {
    font-size: 2.6em;
    line-height: 1.1;
    white-space: normal;
    text-align: right;
    padding: 18px 0;
}

.treatmentSummary {
    grid-column: 4;
}

.treatmentSummary p {
    font-family: 'Baskervville';
    color: black;
    font-size: 1.4em;
    line-height: 1.3;
    text-align: justify;
    hyphens: auto;
    margin: 0 0 1.2em;
}

.treatmentSummary p:last-child {
    margin-bottom: 0;
}


/* ---------- Feature cards ---------- */

/* Each card: gold icon tab on top → gold title bar (a bit wider than the card) → white body with a gold border.
   The sizes are variables so the breakpoints only change these. */
.treatmentFeatures {
    --tabHeight: 70px;     /* how far the icon tab sticks out above the title bar */
    --tabWidth: 26%;
    --iconSize: 54px;
    --overhang: 8px;       /* how much wider the title bar is than the body, on each side */
    --radius: 14px;
    --border: 3px;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    column-gap: 7%;
    row-gap: calc(50px + var(--tabHeight));
    padding: calc(100px + var(--tabHeight)) var(--gutter) 0;
}

.treatmentFeature {
    display: flex;
    flex-direction: column;
}

.treatmentFeatureHead {
    position: relative;
    z-index: 1; /* above the body, which slides up under the bar */
    margin: 0 calc(var(--overhang) * -1);
}

.treatmentFeatureIcon {
    position: absolute;
    bottom: calc(100% - 1px); /* 1px overlap: no hairline between tab and bar */
    left: 50%;
    transform: translateX(-50%);
    width: var(--tabWidth);
    min-width: calc(var(--iconSize) + 30px);
    height: calc(var(--tabHeight) + 1px);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white; /* the icons use currentColor */
    background-color: #caab77;
    border-radius: var(--radius) var(--radius) 0 0;
}

.treatmentFeatureIcon svg {
    width: var(--iconSize);
    height: var(--iconSize);
    display: block;
}

.treatmentFeature h3 {
    font-family: 'Baskervville';
    font-weight: 700;
    color: white;
    background-color: #caab77;
    border-radius: var(--radius);
    font-size: 1.4em;
    line-height: 1.2;
    text-align: center;
    padding: 20px 15px;
    margin: 0;
}

.treatmentFeature p {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Baskervville';
    color: black;
    font-size: 1.25em;
    line-height: 1.3;
    text-align: center;
    border: var(--border) solid #caab77;
    border-top: 0;
    border-radius: 0 0 var(--radius) var(--radius);
    margin: calc(var(--radius) * -1) 0 0; /* tucks under the bar's rounded bottom */
    padding: calc(25px + var(--radius)) 20px 30px;
}


/* ---------- Wide image ---------- */

.treatmentImageRow {
    padding: 80px var(--gutter) 0;
}

.treatmentImage {
    aspect-ratio: 1408 / 420;
    border-radius: 22px;
    overflow: hidden;
    background-color: #e9e9e9; /* visible while the image is a placeholder */
}

.treatmentImage img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}


/* ---------- Accordions + sticky video ---------- */

.treatmentDetails {
    padding: 60px var(--gutter) 120px;
}

.treatmentDetails h2 {
    font-family: 'Baskervville';
    font-weight: 400;
    color: black;
    font-size: 3.4em;
    line-height: 1.25;
    max-width: 57%;
    margin: 0 0 40px;
}

.treatmentDetailsRow {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
}

.treatmentAccordions {
    display: flex;
    flex-direction: column;
    width: 57%;
}

.treatmentChevron {
    width: 14px;
    height: auto;
    flex: none;
    transition: transform 0.35s ease-in-out;
}

/* The chevron hangs in the gutter so the titles line up with the text */
.treatmentAccordionHead {
    display: flex;
    align-items: center;
    gap: 25px;
    margin-left: -39px;
    background: none;
    border: 0;
    padding: 8px 0;
    cursor: pointer;
    font-family: 'Baskervville';
    font-weight: 400;
    color: #caab77;
    font-size: 2.3em;
    text-align: left;
}

.treatmentAccordion.open .treatmentChevron {
    transform: rotate(90deg);
}

/* Height animates from 0 to the content height */
.treatmentAccordionBody {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows 0.4s ease-in-out;
}

.treatmentAccordion.open .treatmentAccordionBody {
    grid-template-rows: 1fr;
}

.treatmentAccordionInner {
    overflow: hidden;
    min-height: 0;
}

.treatmentAccordionInner p {
    font-family: 'Baskervville';
    color: black;
    font-size: 1.4em;
    line-height: 1.3;
    text-align: justify;
    hyphens: auto;
    margin: 0 0 1.1em;
}

.treatmentAccordionInner p:first-child {
    margin-top: 10px;
}

/* Sticks below the header + gold bar until the end of the accordions */
.treatmentAside {
    position: sticky;
    top: calc(var(--stickyTop) + 30px);
    width: 35%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 35px;
}

/* Portrait box. Never taller than the screen, so the button below stays visible */
.treatmentVideo {
    display: block;
    width: 100%;
    max-width: calc((100vh - var(--stickyTop) - 170px) * 2 / 3);
    aspect-ratio: 2 / 3;
    object-fit: cover;
    background-color: black;
    border-radius: 30px;
}

.treatmentAsideButton {
    display: flex;
    align-items: center;
    gap: 12px;
    font-family: 'Calibri';
    font-weight: 700;
    color: white;
    background-color: #caab77;
    font-size: 1.3em;
    letter-spacing: 0.5px;
    text-decoration: none;
    white-space: nowrap;
    padding: 10px 18px;
    border-radius: 4px;
    transition: background-color 0.2s ease-in-out;
}

.treatmentAsideButton:hover {
    background-color: black;
}

.treatmentAsideButton svg {
    width: 32px;
    height: auto;
    flex: none;
}

.treatmentAsideButton.hoverMoveArrow:hover svg {
    margin-left: 12px; /* header.css moves it 30px: too much inside a button */
}


/* ---------- Other categories (same cards as the home page) ---------- */

.treatmentOthers {
    display: grid;
    grid-template-columns: repeat(4, 1fr); /* the 4 other categories */
    gap: 32px;
    padding: 0 var(--gutter) 120px;
}

.treatmentOther {
    position: relative;
    display: block;
    height: 330px;
    overflow: hidden;
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.8);
    text-decoration: none;
}

.treatmentOther img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    filter: brightness(0.6);
    transition: all 0.45s ease-in-out;
}

.treatmentOther:hover img {
    filter: brightness(0.4);
}

.treatmentOtherText {
    position: absolute;
    left: 0;
    bottom: 0;
    width: 100%;
    height: 56%;
    background-color: white;
    display: flex;
    flex-direction: column;
    justify-content: space-evenly;
    align-items: center;
    padding: 10px 30px;
    box-sizing: border-box;
    text-align: center;
    transform-origin: bottom;
    transition: all 0.35s ease-in-out;
}

.treatmentOther:hover .treatmentOtherText {
    transform: scaleY(0);
}

.treatmentOtherName {
    font-family: 'Baskervville';
    font-weight: 600;
    color: #caab77;
    font-size: 1.7em;
    line-height: 1.1;
}

.treatmentOtherTagline {
    font-family: 'Baskervville';
    color: #333;
    font-size: 1.3em;
    line-height: 1.2;
}

.treatmentOtherButton {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1;
    font-family: 'Calibri';
    color: white;
    font-size: 1.4em;
    letter-spacing: 1px;
    border-bottom: 3px solid #caab77;
    opacity: 0;
    transition: all 0.45s ease-in-out;
}

.treatmentOther:hover .treatmentOtherButton {
    opacity: 1;
}


@media (max-width:1600px){

.treatmentOthers {
    grid-template-columns: repeat(2, 1fr);
}

.treatmentSubnavSwiper .swiper-slide a,
.treatmentSubnavCurrent {
    font-size: 0.9em;
}

.treatmentHeroText h1 {
    font-size: 3.2em;
}

.treatmentHeroText p {
    font-size: 1.6em;
}

.treatmentPriceFrom {
    font-size: 2.7em;
}

.treatmentPriceBox {
    padding: 5px 25px 5px 30px;
}

.treatmentPriceBox img {
    width: 130px;
}

.treatmentPriceBox p {
    font-size: 5.2em;
}

.treatmentPriceBox.treatmentPriceBoxText p {
    font-size: 2em;
}

.treatmentSummary p,
.treatmentAccordionInner p {
    font-size: 1.15em;
}

.treatmentFeatures {
    --tabHeight: 58px;
    --iconSize: 46px;
    --overhang: 6px;
    --radius: 12px;
    row-gap: calc(35px + var(--tabHeight));
    column-gap: 5%;
    padding-top: calc(70px + var(--tabHeight));
}

.treatmentFeature h3 {
    font-size: 1.15em;
    padding: 15px 12px;
}

.treatmentFeature p {
    font-size: 1.05em;
    padding: calc(20px + var(--radius)) 15px 22px;
}

.treatmentImageRow {
    padding-top: 60px;
}

.treatmentDetails h2 {
    font-size: 2.7em;
}

.treatmentAccordionHead {
    font-size: 1.9em;
}

.treatmentAsideButton {
    font-size: 1.05em;
}

.treatmentOther {
    height: 280px;
}

.treatmentOtherName {
    font-size: 1.4em;
}

.treatmentOtherTagline {
    font-size: 1.1em;
}

}


@media (max-width:1150px){

/* Hero: text on top, form below. Stacked, they can't fit in one screen, so the height is free again */
.treatmentHero {
    height: auto;
    min-height: calc(100vh - var(--stickyTop));
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    padding: 60px var(--gutter) 100px;
}

.treatmentHeroText {
    max-width: none;
}

.treatmentHeroText h1 {
    font-size: 2.6em;
}

.treatmentHeroText p {
    font-size: 1.3em;
    margin-top: 15px;
}

.treatmentForm {
    width: 100%;
    max-width: 480px;
}

/* Price on top (still bleeding into the left gutter), text below */
.treatmentIntro {
    grid-template-columns: var(--gutter) 1fr var(--gutter);
    row-gap: 40px;
    padding-top: 70px;
}

.treatmentPrice {
    grid-column: 1 / 3;
    justify-self: start;
}

.treatmentSummary {
    grid-column: 2;
}

.treatmentFeatures {
    grid-template-columns: repeat(2, 1fr);
    column-gap: 25px;
    row-gap: calc(30px + var(--tabHeight));
    padding-top: calc(50px + var(--tabHeight));
}

.treatmentImage {
    aspect-ratio: 16 / 7;
}

.treatmentDetails {
    padding: 50px var(--gutter) 80px;
}

.treatmentDetails h2 {
    max-width: none;
}

/* Video under the accordions, no longer sticky */
.treatmentDetailsRow {
    flex-direction: column;
    align-items: stretch;
    gap: 50px;
}

.treatmentAccordions {
    width: 100%;
}

.treatmentAside {
    position: static;
    width: 100%;
}

.treatmentVideo {
    max-width: 420px;
}

.treatmentOthers {
    grid-template-columns: 1fr;
    gap: 25px;
    padding-bottom: 80px;
}

/* No hover on touch screens: keep the white panel */
.treatmentOther {
    height: 300px;
}

}


@media (max-width:600px){

    .treatmentSubnavSwiper .swiper-slide a, .treatmentSubnavCurrent {
    text-underline-offset: 1px;
}

:root {
    --subnavHeight: 48px;
}

.treatmentSubnavSwiper .swiper-slide a, .treatmentSubnavCurrent {
    font-size: 0.75em;
}

.treatmentSubnavPrev,
.treatmentSubnavNext {
    width: 24px;
    padding: 5px;
}
me g
.treatmentSubnavPrev svg,
.treatmentSubnavNext svg {
    width: 7px;
}

.treatmentHero {
    padding: 40px var(--gutter) 80px;
    gap: 30px;
}

.treatmentHeroText h1 {
    font-size: 1.8em;
}

.treatmentHeroText p {
    font-size: 1em;
    margin-top: 8px;
}

.treatmentHeroArrow {
    width: 22px;
    bottom: 25px;
}

.treatmentIntro {
    row-gap: 30px;
    padding-top: 50px;
}

.treatmentPriceFrom {
    font-size: 1.8em;
}

.treatmentPriceBox {
    padding: 4px 20px 4px 22px;
}

.treatmentPriceBox img {
    width: 95px;
}

.treatmentPriceBox p {
    font-size: 3.4em;
}

.treatmentPriceBox.treatmentPriceBoxText p {
    font-size: 1.4em;
}

.treatmentSummary p,
.treatmentAccordionInner p {
    font-size: 1em;
    text-align: left;
}

.treatmentFeatures {
    --tabHeight: 36px;
    --tabWidth: 40%;
    --iconSize: 30px;
    --overhang: 4px;
    --radius: 9px;
    --border: 2px;
    column-gap: 14px;
    row-gap: calc(18px + var(--tabHeight));
    padding-top: calc(40px + var(--tabHeight));
}

.treatmentFeatureIcon {
    min-width: calc(var(--iconSize) + 18px);
}

.treatmentFeature h3 {
    font-size: 0.85em;
    padding: 10px 8px;
}

.treatmentFeature p {
    font-size: 0.85em;
    padding: calc(12px + var(--radius)) 10px 14px;
}

.treatmentImageRow {
    padding-top: 40px;
}

.treatmentImage {
    aspect-ratio: 4 / 3;
    border-radius: 12px;
}

.treatmentDetails {
    padding: 40px var(--gutter) 60px;
}

.treatmentDetails h2 {
    font-size: 1.6em;
    margin-bottom: 25px;
}

/* No room to hang the chevron in the gutter */
.treatmentAccordionHead {
    font-size: 1.3em;
    gap: 12px;
    margin-left: 0;
}

.treatmentChevron {
    width: 10px;
}

.treatmentAccordionInner {
    padding-left: 22px;
}

.treatmentVideo {
    border-radius: 18px;
}

.treatmentAsideButton {
    font-size: 0.9em;
    white-space: normal;
    text-align: center;
}

.treatmentOther {
    height: 260px;
}

.treatmentOtherName {
    font-size: 1.25em;
}

.treatmentOtherTagline {
    font-size: 1em;
}

}


/* Short desktop screens (laptops): the hero has a fixed 100vh height (the form tightens up too: see header.css) */
@media (min-width:1151px) and (max-height:900px){

.treatmentHero {
    padding-top: 25px;
    padding-bottom: 55px;
}

.treatmentHeroArrow {
    bottom: 15px;
}

}
