/* cards.css */

.product-card-html, .service-card-html {
    display: none;
    background: white;
}

/* Мобильная версия: блок как модалка */
.mobile .product-card-html.active,
.mobile .service-card-html.active {
    display: block;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    z-index: 60;
    overflow-y: auto;
    padding: 80px 20px 20px; /* Отступ под шапку */
}

/* Кнопка закрытия для мобилки */
.close-product-btn {
    display: none;
}

.mobile .product-card-html.active .close-product-btn {
    display: block;
    position: fixed;
    top: 20px;
    right: 20px;
    font-size: 40px;
    color: var(--gr);
    cursor: pointer;
    z-index: 61;
}

#desktop-details-target {
    position: absolute;
    top: 0;
    right: -100%;
    width: 100%;
    height: 100%;
    background: var(--sup-lite);
    transition: right 0.6s ease;
    z-index: 45;
}

#desktop-details-target.visible {
    right: 0;
}

/* Стили контента */
.detail-info {
    justify-items: center;
}

.d-description {
    font-size: var(--p_font-size);
    padding: 20px 0;
    max-width: 500px;
}

.detail-content-wrapper {
    display: grid;
    grid-template-columns: 1fr 1fr; /* Фото слева, текст справа */
    gap: 40px;
}

.main-photo img {
    width: 100%;
    border-radius: 12px;
    border: 1px solid var(--lite-gr);
}

.gallery-thumbs {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.gallery-thumbs img {
    width: 60px;
    height: 60px;
    object-fit: cover;
    cursor: pointer;
    border-radius: 4px;
}

/* Десктопная панель деталей */
.detail-panel {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #fff;
    z-index: 45;
    transform: translateX(-100%);
    opacity: 0;
    visibility: hidden;
    padding: 50px 40px;
    box-sizing: border-box;
    overflow-y: auto;
}

/* Состояние открытия: выезжает слева */
.detail-panel.active {
    transform: translateX(0);
    opacity: 1;
    visibility: visible;
    transition: transform 0.8s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.6s ease;
}

/* Состояние закрытия: улетает влево */
.detail-panel.exiting {
    transform: translateX(-100%);
    opacity: 0;
    visibility: visible;
    transition: transform 0.8s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.5s ease;
}

/* Мобильная модалка */
.detail-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: #fff;
    z-index: 2000;
    overflow-y: auto;
    padding: 60px 20px 20px;

    /* Начальное состояние: спрятана СПРАВА за экраном */
    transform: translateX(100%);
    opacity: 0;
    visibility: hidden;
}

/* Выезжает справа налево */
.detail-modal.active {
    transform: translateX(0);
    opacity: 1;
    visibility: visible;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.4s ease;
}

/* Уезжает обратно вправо */
.detail-modal.exiting {
    transform: translateX(100%);
    opacity: 0;
    visibility: visible;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.4s ease;
}

/* Эффект ухода слайда */
.swiped-left {
    transform: translateX(-100%);
    opacity: 0;
    transition: transform 0.6s ease, opacity 0.6s ease;
}

/* Кнопка закрытия */
.close-detail {
    position: absolute;
    top: 0;
    right: 20px;
    font-size: 40px;
    cursor: pointer;
    color: var(--gr);
    z-index: 66;
}


.mobile .main-photo{
    height: 300px;
}

/* Сетка внутри деталей */
.detail-container {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

@media (min-width: 1001px) {
    .detail-container {
    display: flex;
    flex-wrap: wrap;
    }
}

.main-photo img {
    width: auto;
    max-width: 100%;
    height: 300px;
    border-radius: 8px;
}

/* Элементы деталей */

.d-intro {
    font-size: 28px;
    line-height: 1.4;
    font-weight: 300;
    color: var(--gr);
    margin: 60px 0;
    border-left: 3px solid var(--gr);
    padding-left: 15px;
    text-align: left;
}

.d-intro ul {
    margin-left: 20px;
}

.d-body {
    font-size: 1em;
    line-height: 1.6;
    color: var(--text-dark);
    margin-bottom: 60px;
    text-align: left;
}

.d-body p {
    margin-bottom: 1em;
}

.d-body ul {
    margin-left: 20px;
}

.d-html-extra {
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid var(--silv-lite);
    width: 100%;
}

.d-price {
    font-size: 28px;
    font-weight: 500;
    margin-bottom: 20px;
    color: var(--gr);
}

.d-title {
    color: var(--gr);
    font-size: 28px;
    font-weight: 400;
    text-transform: uppercase;
}

.d-description {
        font-size: var(--p_font-size);
}


.active-thumb {
    border: 2px solid var(--gr) !important;
    opacity: 1 !important;
}

/* --- АККОРДЕОН ДЛЯ УСЛУГ И КАТЕГОРИЙ --- */
.hor-card-wrapper {
    width: 100%;
    max-width: 700px;
    margin: 0 auto 20px;
    display: flex;
    flex-direction: column;
}

.accordion-wrapper {
    display: grid;
    grid-template-rows: 0fr; /* Изначально схлопнут */
    transition: grid-template-rows 0.5s ease-in-out;
}

.accordion-wrapper.expanded {
    grid-template-rows: 1fr; /* Плавно раскрывается под контент */
}

.accordion-inner {
    padding: 0 20px;
    overflow: hidden;
    background: #fff;
    border-radius: 0 0 14px 14px;
    opacity: 0;
    transition: opacity 0.3s ease, padding 0.4s ease;
}

.accordion-wrapper.expanded .accordion-inner {
    opacity: 1;
    border-top: none;
    position: relative;
    z-index: 1;
}

.service-card, .category-card {
    position: relative;
    z-index: 2; /* Карточка всегда поверх аккордеона */
}

/* Сетка связанных товаров внутри аккордеона */
.related-products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 15px;
    margin-top: 30px;
    border-top: 1px dashed var(--lite-gr);
    padding-top: 20px;
    margin-bottom: 120px;
}

.related-products-grid p {
    font-size: 16px !important;
}

.mini-product-card {
    background: var(--sup-lite);
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    margin-left: 0;
    min-height: 220px;
}

.mini-product-card .product-image {
    height: 120px;
}

.mini-product-card .product-image img {
    height: 100%;
    width: 100%;
    object-fit: cover;
}

.mini-product-card h4 {
    font-size: 16px;
    font-weight: 500;
    padding: 10px;
    color: var(--text-dark);
    margin: 0;
}

/* Состояние успешного добавления в заявку */
.submit-btn.added-success {
    background: var(--gr);
    transform: scale(0.98);
    box-shadow: none;
    transition: all 0.2s ease;
}

/* --- СТИЛИ ДЛЯ ДЕТАЛИЗАЦИИ СЛАЙДА --- */
@media (min-width: 1001px) {
    .d-slide .detail-media {
        grid-column: span 2;
        margin-bottom: -10px;
    }
}

/* 2. Контейнер фото */
.d-slide .main-photo {
    width: 100%;
    display: flex;
    justify-content: center;
}

/* 3. Сама картинка */
.d-slide .main-photo img {
    width: 100%;
    aspect-ratio: 1 / 1;
    max-height: 400px;
    object-fit: cover;
    object-position: center 30%;
    border-radius: 12px;
    border: none;
}


/* --- FULLSCREEN PHOTO LIGHTBOX --- */
.photo-lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: var(--litebox);
    z-index: 20000;
    display: none;
    justify-content: center;
    align-items: center;
    cursor: zoom-out;
}

.photo-lightbox.active {
    display: flex;
}

.lightbox-content {
    max-width: 90%;
    max-height: 90vh;

    display: flex;
    justify-content: center;
    align-items: center;
    cursor: default;
}

.lightbox-content img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 0 40px var(--bgr-b0);
}

/* Кнопка закрытия */
.close-lightbox {
    position: absolute;
    top: 0;
    right: 36px;
    font-size: 40px;
    color: #fff;
    cursor: pointer;
    z-index: 20001;
    transition: color 0.3s ease;
}

.close-lightbox:hover {
    color: var(--lite-gr);
}

.map-container {
    width: 100%;
    border-radius: 12px;
    overflow: hidden;
    margin-top: 30px;
}

.map-container iframe {
    width: 100% !important;
    border: none;
}

.social-links-grid {
    display: flex;
    gap: 15px;
    margin-top: 20px;
/*    justify-content: center;*/
}

.social-icon-link {
    transition: transform 0.2s;
}

.social-icon-link img {
    width: calc(var(--p_font-size) * 2);
    height: calc(var(--p_font-size) * 2);
    object-fit: contain;
}

.address-section .contact-info {
    padding: 0 20px;
    margin-bottom: -40px;
}

