

:root {
    --clr-bg: #eae4f6;
    --clr-bg-alt: #FFFFFF;

    --clr-purple-dark: #7763a1;
    --clr-purple: #a48fd3;
    --clr-purple-darkest: #453061;

    --border-radius: 0.7em;
    --color-bg-alt-hsl: 0, 0%, 100%;

    --h: 0; 
    --s: 0%;
    --l: 100%;
    --color-bg-alt: hsl(var(--h), var(--s), var(--l));

    --shadow: 0 10px 10px rgba(16, 11, 25, 0.1);

    /* gaps */
    --gap-small: 0.5em;
    --gap-medium: 2em;
    --gap-large: 4em;

    /* font-sizes */
    --fs-900: clamp(1.1rem, 2.5vw + 0.3rem, 3.2rem);
    --fs-800: 3.5rem;
    --fs-700: 1.5rem;
    --fs-600: 1rem;
    --fs-500: 1.3rem;
    --fs-400: 0.9375rem;
    --fs-300: clamp(0.45rem, 1.2vw + 0.2rem, 0.9rem);
    --fs-200: 0.875rem;
}

    @media (min-width: 35em) {
    :root {
        --fs-800: 5rem;
        --fs-700: 2.5rem;
        --fs-600: 1.5rem;
        --fs-500: 1.5rem;
        --fs-400: 1rem;
        --fs-300: clamp(0.5rem, 1vw + 0.5rem, 1.2rem);
    }
}

    @media (min-width: 64em) {
        :root {
            /* font-sizes */
            --fs-800: 6.25rem;
            --fs-700: 3.5rem;
            --fs-600: 2rem;
            --fs-500: 1.75rem;
            --fs-400: 1.125rem;
            --fs-300: clamp(0.5rem, 0.65vw + 0.3rem, 2rem);
        }
    }

/* ------------------- */
/* Reset               */
/* ------------------- */

/* Box sizing */
*,
*::before,
*::after {
    box-sizing: border-box;
    padding: 0;
    margin: 0;
}

/* Reset margins */
body,
h1,
h2,
h3,
h4,
h5,
p,
figure,
picture {
    margin: 0; 
}

h1 {
    font-weight: 400;
}
h2,
h3,
h4,
h5,
h6,
p,
a {
    font-weight: 500;
}


/* make images easier to work with */
img,
picture {
    max-width: 100%;
    display: block;
}

/* make form elements easier to work with */
input,
button,
textarea,
select {
    font: inherit;
}

/* buttons reset */
button {
    all: unset;
    cursor: pointer;
    font-weight: 500;
}

ul {
    list-style-type: none;
    padding-left: 0;
    margin: 0;
}

/* remove animations for people who've turned them off */
@media (prefers-reduced-motion: reduce) {  
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ------------------- */
/* Utility classes     */
/* ------------------- */

.flex {
    display: flex;
    gap: var(--gap, 1rem);
}

.grid {
    display: grid;
    gap: var(--gap, 1rem);
}

.d-block {
    display: block;
}

.flow > * + * {
    margin-top: var(--flow-space, 2rem);
}

.flow--space-small {
    --flow-space: .5rem;
}

.container {
    padding-inline: 2em;
    margin-inline: auto;
    max-width: 80rem;
}

/*fonts */
.letter-spacing-1 { letter-spacing: 4.75px; } 
.letter-spacing-2 { letter-spacing: 2.7px; } 
.letter-spacing-3 { letter-spacing: 2.35px; } 

.uppercase { text-transform: uppercase; }
.lowercase { text-transform: lowercase; }

.fs-900 { font-size: var(--fs-900); }
.fs-800 { font-size: var(--fs-800); }
.fs-700 { font-size: var(--fs-700); }
.fs-600 { font-size: var(--fs-600); }
.fs-500 { font-size: var(--fs-500); }
.fs-400 { font-size: var(--fs-400); }
.fs-300 { font-size: var(--fs-300); }
.fs-200 { font-size: var(--fs-200); }

.fs-900,
.fs-800,
.fs-700,
.fs-600 {
    line-height: 1.1;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
    white-space: nowrap;
  border: 0;
}

.skip-to-content {
    position: absolute;
    z-index: 9999;
    background: var(--clr-bg-alt);
    color: var(--clr-purple-darkest);
    padding: .5em 1em;
    margin-inline: auto;
    transform: translateY(-100%);
    transition: transform 250ms ease-in;
}

.skip-to-content:focus {
    transform: translateY(0);
}

.tab-list button:focus-visible {
  outline: 2px solid white;
  outline-offset: 2px;
}


.uppercase {
    text-transform: uppercase;
}

.lowercase {
    text-transform: lowercase;
}

html {
    scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
}

body {
    background-color: var(--clr-bg);
    color: var(--clr-purple-darkest);
    font-size: var(--fs-400);
    position: relative;
    font-family: "Montserrat", sans-serif;
    font-style: normal;
}

footer {
    width: 100%;
    height: 10em;
    background-color: var(--clr-purple);
}


.main-header {
    flex-direction: column-reverse;
    width: 100%;
    background-color: var(--clr-bg-alt);
    position: relative;
    z-index: 0;
    box-shadow: var(--shadow);
}

.main-header > * {
    display: flex;
    flex: 1;
}

.main-header div:first-child {
    flex: 1 1 10vh;
}

.main-header div:last-child {
    flex: 1 1 40vh;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background-image: linear-gradient(to right, var(--clr-purple-dark), var(--clr-purple));
    color: var(--clr-bg-alt);
    position: relative;
    padding: 2em 1.5em;
    gap: var(--gap-small);
}

.main-header > div:last-child > img {
    width: clamp(12em, 45vw + 5em, 22em);
    height: auto;
}

@media (min-width: 35em) {
    .main-header {
        flex-direction: row;
    }
    .main-header div:first-child {
        flex: 0 0 10%;
        padding: 0;
    }
    .main-header div:last-child {
        flex: 1 1 90%; 
        clip-path: polygon(0% 0%, 100% 0%, 100% 100%, 15% 100%);
        padding-left: 20%;
    }
    .main-header > div:last-child > img {
    width: clamp(10em, 22vw + 5em, 22em);
    height: auto;
}
}

@media (min-width: 64em) {
    .main-header div:first-child {
        flex: 0 0 30%; 
    }
    .main-header div:last-child {
        flex: 1 1 70%;  
    }
}

h2 {
    font-size: var(--fs-500);
}


/* ------------------- */
/* Components          */
/* ------------------- */
/* скроллбар */
/* WebKit (Chrome, Edge, Safari) */
::-webkit-scrollbar-thumb {
    background: var(--clr-purple-dark);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--clr-purple-darkest);
}

::-webkit-scrollbar-button {
    background-color: var(--clr-purple-dark);
}

/* Firefox */
html {
    scrollbar-color: var(--clr-purple-dark) transparent;
}

.btn-appointment {
    background: linear-gradient(to right, var(--clr-purple-darkest), var(--clr-purple));
    background-size: 200% 100%;
    background-position: right center;
    color: var(--clr-bg-alt);
    text-decoration: none;
    padding: 1em 2em;
    border-radius: var(--border-radius);
    transition: background-position 0.3s ease;
}

.btn-appointment:hover {
    background-position: left center;
}

.dot-indicators {
    display: flex;
    align-self: center;
    justify-self: center;
    gap: 5px;
}

.dot-indicators > * {
    cursor: pointer;
    border: 0;
    border-radius: 50%;
    padding: 12px;
    background-color: transparent;
    border: 2px solid var(--clr-purple-dark);
}


@media (min-width: 35em) {
    .dot-indicators > * {
    padding: .6em;
    border-width: 3px
}
}

.dot-indicators > *:hover,
.dot-indicators > *:focus-visible {
    background-color: var(--clr-bg-alt);
}

.dot-indicators > [aria-selected="true"] {
    background-color: var(--clr-purple-dark); 
    border-color: var(--clr-bg-alt);
}

.reviews-controls > * {
    border-color: var(--clr-bg);
}

.reviews-controls > *:hover,
.reviews-controls > *:focus-visible {
    background-color: var(--clr-purple);
    border-color: var(--clr-bg-alt);
}

.reviews-controls > [aria-selected="true"] {
    background-color: var(--clr-bg-alt); 
}

.reviews-carousel,
.images-carousel {
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.reviews-carousel::-webkit-scrollbar,
.images-carousel::-webkit-scrollbar {
  display: none;
}

section {
    width: 100%;
}

.images-carousel,
.reviews-carousel {
    touch-action: pan-y;
    user-select: none;
    -webkit-user-select: none;
}

/* Базовая сетка */
.grid-container--home {
    grid-template-areas: 
        ". btn ."
        "images images images"
        ". about ."
        ". services ."
        "reviews reviews reviews"
        ". tech ."
        "contacts contacts contacts";
    grid-template-columns: 1fr 90vw 1fr;
}

.btn-appointment {
    display: block;
    justify-self: center;
    align-self: center;
    grid-area: btn;
    position: relative;
    z-index: 500;
    box-shadow: var(--shadow);
    margin: 0;
}

@media (min-width: 35em) {
    .btn-appointment {
        justify-self: end;
        margin: 0; 
    }
}

@media (min-width: 64em) {
    .btn-appointment {
        margin: 0;
    }
}

@media (min-width: 64em) {
    .grid-container--home {
        grid-template-areas: 
            "images images images images"
            ". about btn ."
            ". services services ."
            "reviews reviews reviews reviews"
            ". tech tech ."
            "contacts contacts contacts contacts";
        grid-template-columns: 1fr 40vw 40vw 1fr;
    }

    .about {
        grid-area: about;
        justify-content: flex-start; 
    }

    .btn-appointment {
        justify-self: end; 
        align-self: center;  
        margin: 0;
    }
}

/*index page */
/* ------------------------------- */
/* Начальные изображения (карусель)*/
/* -------------------------------- */

.carousel-viewport {
    position: relative;
    z-index: 100;
    overflow: hidden;
    width: 100%;
    outline: 4px solid var(--clr-purple-dark);
    box-shadow: var(--shadow);
}

.images-wrapper {
    position: relative;
    display: inline-block;
    grid-area: images;
}

.images-carousel {
    position: relative;
    width: 100%;
    z-index: 1;
    scroll-behavior: smooth;
    transition: transform 0.5s ease;
    will-change: transform;
    gap: var(--gap-small);
}

.images-carousel > picture {
    flex: 0 0 90vw;
    width: 90vw;
    aspect-ratio: 16 / 10;  
    display: block;
    overflow: hidden;
    transition: opacity 0.8s ease;
}

.images-carousel > picture > img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center bottom;
    display: block;
}

@media (min-width: 35em) {
    .images-carousel > picture {
        flex: 0 0 80vw;
        width: 80vw;
    }
}

@media (min-width: 45em) {
    .images-carousel > picture {
        flex: 0 0 70vw;
        width: 60vw;
        max-height: 60vh;
    }
}

.images-carousel .prev,
.images-carousel .next {
    opacity: 0.5;
    transition: opacity 0.8s ease;
}
.images-carousel .active {
    opacity: 1;
}

.carousel-controls {
    position: absolute;
    bottom: var(--gap-small);
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    margin: 0;
}


/* Лаванда сверху секции */

.main-header {
    position: relative;
    z-index: auto;
}

.main-header > div > * {
    position: relative;
    z-index: 1000;
}

.has-lavender {
    position: relative;
    z-index: 100;
}
.has-lavender::before {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 0;
    width: 100%;
    aspect-ratio: 75 / 52;
    background-image: url('../assets/decorations/lavender-header-mobile.webp');
    background-size: 100% 100%;
    background-repeat: no-repeat;
    background-position: bottom left;
    z-index: 2;
    pointer-events: none;
}
@media (min-width: 35em) {
    .has-lavender::before {
        width: 45vw;
        height: 35vh;
        aspect-ratio: auto;
        background-image: url('../assets/decorations/lavender-header-desktop.webp');
        background-size: contain;
        background-position: bottom left;
    }
}
@media (min-width: 64em) {
    .has-lavender::before {
        width: 32vw;
        height: 40vh;
    }
}

/* ------------------- */
/* О студии            */
/* ------------------- */
.about {
    justify-content: space-between;
    grid-area: about;
}

.address-wrapper {
    position: relative;
    display: inline-block;
}

.address-link {
    color: var(--clr-purple-darkest);
    text-decoration: none;
    border-bottom: 1px dashed currentColor;
    background: none;
    border-top: none;
    border-left: none;
    border-right: none;
    padding: 0;
    font: inherit;
    cursor: pointer;
    transition: color 0.2s ease, border-color 0.2s ease;
}

.address-link:hover {
    color: var(--clr-purple-dark);
    border-bottom-color: var(--clr-purple-dark);
}

.address-link:focus-visible {
    outline: 2px solid var(--clr-purple-darkest);
    outline-offset: 3px;
    border-radius: 3px;
}

.address-menu {
    position: absolute;
    top: calc(100% + 0.4em);
    left: 0;
    background-color: var(--clr-bg-alt);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    padding: 0.5em 0;
    min-width: 12em;
    z-index: 100;
}

.address-menu[hidden] {
    display: none;
}

.address-menu a {
    display: block;
    padding: 0.6em 1em;
    color: var(--clr-purple-darkest);
    text-decoration: none;
    font-size: var(--fs-400);
    transition: background-color 0.2s ease;
}

.address-menu a:hover {
    background-color: var(--clr-bg);
}

/* ------------------- */
/* Услуги              */
/* ------------------- */
.services {
    background-color: var(--clr-bg-alt);
    grid-area: services;
    border-radius: var(--border-radius);
    padding: clamp(1.25rem, 6vw, 4rem); 
    
    margin-top: var(--gap-medium);
    margin-bottom: var(--gap-medium);
    margin-inline: auto;
    
    width: calc(100% - 2 * clamp(1rem, 6vw, 2rem));
    box-sizing: border-box;
    box-shadow: var(--shadow);
}

.services h2 {
    text-align: center;
    margin-bottom: var(--gap-medium);
}

/* ===== Сетка карточек (мобильные: 2 колонки) ===== */
.services-wrapper {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    width: 100%;
    align-items: stretch;
}

/* ===== Карточка услуги ===== */
.services__card-link {
    display: flex;
    flex-direction: column;
    width: 100%;  
    aspect-ratio: 4 / 5;
    border-radius: var(--border-radius);
    overflow: hidden;
    text-align: center;
    position: relative;
    text-decoration: none;
    color: inherit;
}

/* ===== Название услуги ===== */
.service-name {
    background-color: var(--clr-bg);
    min-height: 3.5em;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 0.5em 0.75em;
    position: relative;
    z-index: 90;
    font-size: var(--fs-300);
    font-weight: 600;
    line-height: 1.2;
    margin: 0;
    box-sizing: border-box;
}

/* ===== Изображение ===== */
.services__card-image {
    width: 100%;
    height: 100%;
    overflow: hidden;
    position: relative;
}

.services__card-image img {
    height: 100%;
    width: 100%;
    object-fit: cover;
    object-position: center bottom;
    z-index: 1;
    transition: transform 0.3s ease-in-out;
}

.services__card-image picture {
    display: block;
    width: 100%;
    height: 100%;
}

/* Градиент поверх изображения */
.services__card-image::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image: linear-gradient(to bottom, var(--clr-bg) 10%, transparent 100%);
    pointer-events: none;
    z-index: 1;
    top: 0;
}

/* Эффект зума при наведении */
.services__card-link:hover .services__card-image img,
.services__card-link:focus .services__card-image img,
.services__card-link:active .services__card-image img {
    transform: scale(1.1);
}

/* ===== Планшет ===== */
@media (min-width: 35em) {
    .services {
        margin-inline: -2em;
        width: calc(100% + 2em);
    }

    .services h2 {
        text-align: start;
    }
    
    .services-wrapper {
        grid-template-columns: 1fr 1fr;
        gap: 1.5rem;
        justify-items: center;
    }

    .services__card-link {
        max-width: 320px; 
    }
}

/* ===== Десктоп ===== */
@media (min-width: 64em) {
    .services-wrapper {
        grid-template-columns: repeat(4, 1fr);
        gap: var(--gap-medium);
        justify-items: center;
    }

    .services__card-link {
        max-width: 240px;
        aspect-ratio: 3 / 4;
    }
}

/* ------------------- */
/* Отзывы              */
/* ------------------- */

.reviews {
    grid-column: reviews;
    grid-template-areas: 
        '. header .'
        'content content content'
        '. tabs .';
    grid-template-columns: 1fr 80vw 1fr;
    background: var(--clr-purple-dark);
    color: var(--clr-bg-alt);
    padding-block: var(--gap-medium);
}

.reviews-carousel-wrapper {
    grid-area: content;
    overflow-x: hidden;
    width: 100%;
    min-height: 400px;
}

.reviews-carousel {
    display: flex;
    gap: var(--gap-small);
    transition: transform 0.4s ease;
    will-change: transform;
    align-items: stretch;
}

.reviews-carousel > div {
    flex: 0 0 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.5em;
    background-color: var(--clr-bg-alt);
    border-radius: var(--border-radius);
    box-sizing: border-box;
    box-shadow: var(--shadow);
}

.reviews-carousel > div picture {
    display: block;
    width: 100%;
    margin: auto 0;
}

.reviews-carousel > div img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 10px;
    pointer-events: none;
}

@media (min-width: 35em) {
    .reviews-carousel-wrapper {
        min-height: 500px;
    }
    .reviews-carousel > div {
        flex: 0 0 70%;
        padding: 1em;
    }
    .reviews-carousel > div picture {
        width: 70%;
    }
}

@media (min-width: 64em) {
    .reviews-carousel > div {
        flex: 0 0 50vw;
        padding: 1em;
    }
    .reviews-carousel > div picture {
        width: 60%;
    }
}

.reviews > h2 {
    grid-area: header;
}

.reviews-controls {
    grid-area: tabs;
}

/* ------------------- */
/* Про оборудование    */
/* ------------------- */
.tech {
    grid-area: tech;
    flex-direction: column;
}
@media (min-width: 64em) {
    .tech {
        width: 50%;
    }
}

.video {
    display: block;
    width: 100%;
    max-width: 360px;
    height: auto; 
    border-radius: var(--border-radius, 12px);
    box-shadow: var(--shadow, 0 4px 12px rgba(0,0,0,0.1));
}

/* ------------------- */
/* Обратная связь      */
/* ------------------- */

.contacts {
    grid-area: contacts;
    display: grid;
    grid-template-columns: 1fr 80vw 1fr;
    grid-template-areas:
        "heading heading heading"
        ".       content .";
    row-gap: var(--gap-medium);
    padding-block: var(--gap-medium);
}
.contacts > h2 {
    grid-area: heading;
    background-image: linear-gradient(to right, var(--clr-purple-dark), var(--clr-purple));
    color: var(--clr-bg-alt);
    padding: 1em 10vw;
    margin: 0;
}
.contacts > .contacts-content {
    grid-area: content;
    display: grid;
    gap: var(--gap-medium);
}

.contacts-content > p {
    margin: 0;
}

/* ===== Раскладка: соцсети + форма ===== */
.contacts-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    align-items: start;
}

/* ===== Соцсети ===== */
.contact-cards {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

.contact-card {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 1rem;
    align-items: center;
    border-radius: var(--border-radius);
    padding: 1rem;
}

.contact-card-icon {
    grid-row: 1 / -1;
    align-self: center;
}

.contact-card-info {
    display: grid;
    gap: 0.75rem;
}

.contact-card-row {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr auto;
    grid-auto-flow: column;
    gap: 0.5rem;
    align-items: center;
}

.contact-card-id {
    font-family: monospace;
    background: rgba(0, 0, 0, 0.04);
    padding: 0.2em 0.6em;
    border-radius: 4px;
    color: var(--clr-purple-darkest);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.contact-card-btn {
    background-color: var(--clr-purple-dark);
    color: var(--clr-bg-alt);
    border: none;
    border-radius: 4px;
    padding: 0.3em 1em;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    transition: background 0.2s;
    white-space: nowrap;
    font-size: var(--fs-400);
}

.contact-card-btn:hover {
    background-color: var(--clr-purple-darkest);
}

.copy-btn {
    height: 1.5em;
    aspect-ratio: 1;
    padding: 0;
    background-image: url(../assets/social/icon-copy.svg);
    background-repeat: no-repeat;
    background-position: center;
    background-size: 60% auto;
    background-color: var(--clr-purple);
}

.copy-btn.copied {
    background-color: rgb(91, 145, 77);
}

/* ===== Форма ===== */
.contact-form {
    width: 100%;
}

.form-columns {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

.form-column {
    display: contents;
}

.form-group {
    background-color: var(--clr-bg-alt);
    border-radius: var(--border-radius);
    padding: 1rem;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
    width: 100%;
}

.form-group label {
    display: block;
    margin-bottom: 0.25rem;
    font-weight: 500;
    color: var(--clr-purple-darkest);
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 0.6em;
    border: 1px solid var(--clr-purple-dark);
    border-radius: calc(var(--border-radius) / 2);
    font-family: inherit;
    background-color: var(--clr-bg-alt);
    transition: border-color 0.2s;
}

.form-group input:focus,
.form-group textarea:focus {
    border-color: var(--clr-purple);
    outline: none;
}

.form-group--checkbox {
    display: grid;
    grid-template-columns: auto 1fr;
    grid-template-areas:
        "check label"
        "error error";
    column-gap: 0.5rem;
    row-gap: 0.25rem;
    align-items: start;
    background: none;
    padding: 0;
    box-shadow: none;
    margin-bottom: 0;
}

.form-group--checkbox input[type="checkbox"] {
    grid-area: check;
    width: auto;
    margin-top: 0.2em;
}

.form-group--checkbox label {
    grid-area: label;
    margin-bottom: 0;
}

.form-group--checkbox .error-message {
    grid-area: error;
}

.submit-btn {
    background: linear-gradient(to right, var(--clr-purple-darkest), var(--clr-purple));
    background-size: 200% 100%;
    background-position: right center;
    transition: background-position 0.3s ease;

    color: var(--clr-bg-alt);
    border: none;
    border-radius: var(--border-radius);
    padding: 0.75em 0;
    cursor: pointer;
    font-size: 1rem;
    width: 100%;
    text-align: center;
}

.submit-btn:hover {
    background-position: left center;
}

.error-message {
    color: #d00;
    font-size: 0.85rem;
    display: none;
}

.form-feedback {
    font-size: 0.9rem;
    color: green;
    grid-column: 1 / -1;
}

/* ===== Планшет (35em) ===== */
@media (min-width: 35em) {
    .form-columns {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        grid-template-areas:
            "name     name     phone    phone"
            "comment  comment  comment  comment"
            "checkbox checkbox checkbox submit"
            "feedback feedback feedback feedback";
        gap: 1rem;
    }

    .form-column--contacts > .form-group:nth-child(1) { grid-area: name; }
    .form-column--contacts > .form-group:nth-child(2) { grid-area: phone; }

    .form-column--message > .form-group:not(.form-group--checkbox) {
        grid-area: comment;
    }
    .form-column--message > .form-group--checkbox {
        grid-area: checkbox;
        align-self: center;
    }
    .form-column--message > .submit-btn {
        grid-area: submit;
        width: 100%;
        white-space: nowrap;
        align-self: center;
    }
}

/* ===== Десктоп (64em) ===== */
@media (min-width: 64em) {
    .contacts {
        grid-template-columns: 1fr 40vw 40vw 1fr;
        grid-template-areas:
            "heading heading heading heading"
            ".       content content .";
    }

    .contacts-layout {
        grid-template-columns: 1fr 2fr;
        gap: 2rem;
    }
}

/* ===== Модальное окно ===== */
.modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.open { display: flex; }

.modal-content {
    background: var(--clr-bg-alt);
    border-radius: var(--border-radius);
    padding: 2rem 1.5rem 1.5rem;
    max-width: 500px;
    width: 90%;
    position: relative;
    max-height: 80vh;
    overflow-y: auto;
}
.modal-close {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    width: 2.2em;
    height: 2.2em;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: none;
    border: none;
    font-size: 1.4rem;
    cursor: pointer;
    color: var(--clr-purple-dark);
    transition: background-color 0.2s ease, color 0.2s ease;
}
.policy-text {
    color: var(--clr-purple-darkest);
    line-height: 1.55;
    max-height: 60vh;
    overflow-y: auto;
    padding-right: 0.5rem;
}
.policy-text p {
    margin: 0 0 0.8em 0;
}
.policy-text p:last-child {
    margin-bottom: 0;
}
.policy-text h4 {
    font-size: var(--fs-500);
    font-weight: 600;
    margin: 1.2em 0 0.5em;
    color: var(--clr-purple-dark);
}
.policy-text h4:first-child {
    margin-top: 0;
}
.policy-text ul,
.policy-text ol {
    margin: 0 0 0.8em 1.2em;
    padding: 0;
}
.policy-text li {
    margin-bottom: 0.4em;
}
.policy-text strong {
    font-weight: 600;
    color: var(--clr-purple-darkest);
}
.policy-text a {
    color: var(--clr-purple-dark);
    text-decoration: underline;
}
.modal-close:hover {
    background-color: var(--clr-bg);
    color: var(--clr-purple-darkest);
}
.modal-content h3 {
    margin-bottom: 1.2rem;
    padding-right: 2rem;
    color: var(--clr-purple-darkest);
}

/* -------------------------- */
/* Страницы прайса            */
/* -------------------------- */

.pricelist {
    padding-top: 2rem;
}

/* Главный заголовок страницы */
.pricelist-title {
    display: grid;
    grid-template-columns: 1fr 80vw 1fr;
    background-image: linear-gradient(to right, var(--clr-purple-dark), var(--clr-purple));
    color: var(--clr-bg-alt);
    padding: 1em 0;
}

.pricelist-title > h2 {
    grid-column: 2 / 3;
    margin: 0;
}

/* Блок предупреждений */
.warnings {
    background-color: var(--clr-bg-alt);
    border-radius: var(--border-radius);
    padding: var(--gap-medium);
    box-shadow: var(--shadow);

    border-left: 4px solid var(--clr-purple-dark);
    
    display: flex;
    flex-direction: column;
    gap: var(--gap-small);

    width: 100%;
    max-width: 400px; 
    box-sizing: border-box;
    margin: var(--gap-medium) 0;
}

.warnings h3 {
    color: var(--clr-purple-darkest);
    font-size: var(--fs-600);
    margin: 0 0 var(--gap-small) 0;
    font-weight: 700;
}

/* Кнопки внутри блока */
.warnings-link {
    display: flex;
    align-items: center;
    justify-content: space-between;

    width: 100%;
    padding: 0.8em 1.2em;
    box-sizing: border-box;

    background-color: transparent;
    border: 1px solid var(--clr-purple);
    border-radius: calc(var(--border-radius) / 1.5);
    color: var(--clr-purple-dark);

    font-size: var(--fs-400);
    font-weight: 500;
    font-family: inherit;
    text-align: left;
    cursor: pointer;

    transition: all 0.3s ease;
}

/* Стрелочка */
.warnings-link::after {
    content: '';
    display: inline-block;
    width: 0.4em;
    height: 0.4em;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(-45deg);
    transition: transform 0.3s ease, border-color 0.3s ease;
    flex-shrink: 0;
    margin-left: var(--gap-small);
}

.warnings-link:hover {
    background-color: var(--clr-purple);
    color: var(--clr-bg-alt);
    border-color: var(--clr-purple);
}
.warnings-link:active {
    transform: scale(0.98);
}
.warnings-link:focus-visible {
    outline: 2px solid var(--clr-purple-darkest);
    outline-offset: 2px;
}
/* ===== Раскладка блока "Важно!" и "Акции" ===== */

.important-info-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--gap-medium);
    margin-block: var(--gap-medium);
    width: 100%;
}

/* Стили для иконок */
.promo-icon {
    width: 1.5rem;
    height: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.promo-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.promo-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 1rem;
}

.promo-list li {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    font-size: var(--fs-400);
    line-height: 1.3;
}

.promo-list strong {
    color: var(--clr-purple-darkest);
}

@media (min-width: 64em) {
    .important-info-layout {
        grid-template-columns: minmax(280px, 1fr) 2fr; 
        align-items: stretch; 
        gap: var(--gap-medium);
        width: 95%; 
        max-width: 1400px; 
        margin-inline: auto; 
    }

    .warnings {
        margin: 0;
        height: 100%; 
        display: flex;
        flex-direction: column;
        justify-content: center; 
    }
    .warnings h3 {
        margin-bottom: var(--gap-medium); 
    }
    .promotions-zone,
    .promotions-zone[data-collapsed="true"] {
        background-color: var(--clr-bg-alt);
        border-radius: var(--border-radius);
        padding: var(--gap-medium);
        box-shadow: var(--shadow);
        border-left: 4px solid var(--clr-purple); 
        display: grid;
        grid-template-rows: auto 1fr !important; 
        flex-direction: column;
        max-width: min(900px, 70vw);
        margin-left: auto;
        margin-right: 0;
        height: 100%;
    }
    .promotions-zone .pricelist-heading {
        background: none;
        color: var(--clr-purple-darkest);
        padding: 0 0 var(--gap-medium) 0;
        cursor: default;
        pointer-events: none;
        text-align: left;
        justify-content: flex-start;
        display: block; 
    }
    
    .promotions-zone .pricelist-heading h3 {
        font-size: var(--fs-600);
        font-weight: 700;
        margin: 0;
    }

    .promotions-zone .pricelist-heading .arrow {
        display: none;
    }

    .promotions-zone .pricelist-items {
        padding-top: 0;
        min-height: auto; 
        flex-grow: 1; 
    }

    .promo-list {
        grid-template-columns: 1fr 1fr; 
        gap: 1.5rem 1rem; 
        align-items: start; 
    }
    .promo-list--single {
        grid-template-columns: 1fr;
    }

    .promo-list--single li {
        align-items: center;
}
}

/* -------------------------- */
/* Аккордеон зон              */
/* -------------------------- */

.pricelist-zone {
    display: grid;
    grid-template-rows: auto 1fr;
    transition: grid-template-rows 0.4s ease;
    margin-bottom: var(--gap-small);
}

.pricelist-zone[data-collapsed="true"] {
    grid-template-rows: auto 0fr;
}

.pricelist-items {
    display: flex;
    flex-direction: column;
    gap: var(--gap-small);
    overflow: hidden;
    min-height: 0;
    padding-top: var(--gap-small);
}

/* Кнопка-заголовок зоны */
.pricelist-heading {
    display: grid;
    grid-template-columns: 1fr 40vw auto 1fr;
    align-items: center;
    width: 100%;
    padding: 1em 0;
    border: none;
    cursor: pointer;
    font: inherit;
    text-align: left;
    background-image: linear-gradient(to right, var(--clr-purple-dark), var(--clr-purple));
    color: var(--clr-bg-alt);
}

.pricelist-heading h3 {
    grid-column: 2 / 3;
    margin: 0;
}

.pricelist-heading .arrow {
    grid-column: 3 / 4;
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    transition: transform 0.3s ease;
}

.pricelist-zone:not([data-collapsed="true"]) .pricelist-heading .arrow {
    transform: rotate(180deg);
}

/* Строки услуг */
.service-line {
    display: grid;
    grid-template-columns: 1fr 40vw 40vw 1fr;
    padding: 0.7em 0;
    border-radius: var(--border-radius);
    background: linear-gradient(
        to right,
        hsl(var(--h), var(--s), var(--l), 1) 0%,
        hsla(var(--h), var(--s), var(--l), 0.6) 100%
    );

    /* Появление снизу вверх */
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.pricelist-zone:not([data-collapsed="true"]) .service-line {
    opacity: 1;
    transform: translateY(0);
}

/* Каскадные задержки */
.pricelist-zone:not([data-collapsed="true"]) .service-line:nth-child(1) { transition-delay: 0.05s; }
.pricelist-zone:not([data-collapsed="true"]) .service-line:nth-child(2) { transition-delay: 0.10s; }
.pricelist-zone:not([data-collapsed="true"]) .service-line:nth-child(3) { transition-delay: 0.15s; }
.pricelist-zone:not([data-collapsed="true"]) .service-line:nth-child(4) { transition-delay: 0.20s; }
.pricelist-zone:not([data-collapsed="true"]) .service-line:nth-child(5) { transition-delay: 0.25s; }
.pricelist-zone:not([data-collapsed="true"]) .service-line:nth-child(6) { transition-delay: 0.30s; }
.pricelist-zone:not([data-collapsed="true"]) .service-line:nth-child(7) { transition-delay: 0.35s; }
.pricelist-zone:not([data-collapsed="true"]) .service-line:nth-child(8) { transition-delay: 0.40s; }

.service-line p {
    margin: 0;
}

.service-line p:first-child {
    grid-column: 2 / 3;
}

.service-line p:last-child {
    grid-column: 3 / 4;
}
.breadcrumb {
    display: grid;
    grid-template-columns: 1fr 80vw 1fr; 
    margin-top: var(--gap-small);
    margin-bottom: -1rem;
}

.back-link {
    grid-column: 2 / 3; 
    display: inline-flex;
    align-items: center;
    gap: 0.5em;
    color: var(--clr-purple-dark);
    text-decoration: none;
    font-size: var(--fs-400);
    font-weight: 500;
    font-family: inherit;
    transition: color 0.3s ease, transform 0.3s ease;
    width: fit-content;
}

.back-link::before {
    content: '←';
    font-size: 1.2em;
    line-height: 1;
    transition: transform 0.3s ease;
}
.back-link:hover {
    color: var(--clr-purple-darkest);
}
.back-link:hover::before {
    transform: translateX(-4px); 
}
.back-link:focus-visible {
    outline: 2px solid var(--clr-purple);
    outline-offset: 4px;
    border-radius: 4px;
}

/* ----------------------------------- */
/* Таблица цен для аппаратной коррекции*/
/* ----------------------------------- */
.price-table {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-block: var(--gap-medium);
    width: 100%;
}

/* Заголовок таблицы (скрыт на мобильных) */
.price-table__header {
    display: none;
}

/* ===== Мобильная версия: каждая процедура -- карточка ===== */
.price-table__row {
    background-color: var(--clr-bg-alt);
    border-radius: var(--border-radius);
    padding: 1.25rem 1.5rem;
    box-shadow: var(--shadow);
    border-left: 4px solid var(--clr-purple-dark);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.price-table__name {
    font-weight: 700;
    color: var(--clr-purple-darkest);
    font-size: var(--fs-500);
    margin-bottom: 0.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--clr-bg);
}

.price-table__cell {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 1rem;
    font-size: var(--fs-400);
    color: var(--clr-purple-darkest);
    padding: 0.15rem 0;
}

.price-table__cell::before {
    content: attr(data-label);
    color: var(--clr-purple-dark);
    font-weight: 500;
}

/* ===== Планшет и Десктоп (35em): таблица ===== */
@media (min-width: 35em) {
    .price-table {
        gap: 0.75rem;
    }

    .price-table__header {
        display: grid;
        grid-template-columns: 2fr 1fr 1fr 1fr 1fr;
        gap: 1rem;
        padding: 1rem 1.5rem;
        background-image: linear-gradient(to right, var(--clr-purple-dark), var(--clr-purple));
        color: var(--clr-bg-alt);
        font-weight: 600;
        font-size: var(--fs-400);
        text-align: center;
        align-items: center;
        box-shadow: var(--shadow);
    }

    .price-table__header > div:first-child {
        text-align: left;
    }

    .price-table__row {
        display: grid;
        grid-template-columns: 2fr 1fr 1fr 1fr 1fr;
        gap: 1rem;
        padding: 1rem 1.5rem;
        align-items: center;
        border-left: none;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
        transition: box-shadow 0.2s ease;
        border-radius: 0;
    }

    .price-table__row:hover {
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    }

    .price-table__name {
        font-size: var(--fs-400);
        margin-bottom: 0;
        padding-bottom: 0;
        border-bottom: none;
    }

    .price-table__cell {
        display: block;
        text-align: center;
        padding: 0;
        border: none;
    }

    .price-table__cell::before {
        display: none; 
    }
}