/* /css/components/modal.css */

body.modal-open {
    overflow: hidden; /* контент нельзя скроллить */
    padding-right: 0 !important; /* фикс для прыжка при скрытии скролла */
}

.modal-details-overlay {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(180deg, rgb(0 0 0 / 0%) 0%, rgb(0 0 0) 100%) ;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    opacity: 0;
    pointer-events: none;
    --start-x: 50%;
    --start-y: 50%;
    clip-path: circle(0% at var(--start-x) var(--start-y));
    transition: clip-path 0.4s cubic-bezier(0.25, 1, 0.5, 1), opacity 0.7s cubic-bezier(0.25, 1, 0.5, 1);
}

.modal-details-overlay.active {
    opacity: 1;
    pointer-events: all;
    clip-path: circle(150% at var(--start-x) var(--start-y));
}


/* --- Анимации для ДЕСКТОПА --- */
@keyframes modal-content-in {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes modal-content-out {
    from {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
    to {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }
}

/* --- НОВЫЕ Анимации для МОБИЛЬНЫХ --- */
@keyframes modal-content-in-mobile {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes modal-content-out-mobile {
    from {
        transform: translateY(0);
        opacity: 1;
    }
    to {
        transform: translateY(100%);
        opacity: 0;
    }
}


.modal-details-content {
    width: 90%;
    max-width: 1100px;
    height: 90%;
    max-height: 85vh;
    background: #121212;
    border-radius: 1.5rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    color: var(--text-color);
    position: relative;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    opacity: 0;
    overflow-x: hidden;
}

.modal-details-content::before {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: -0.1px;
    height: 3rem; /* регулируй — меньше для тонкого эффекта */
    pointer-events: none; /* не мешает кликам */
    z-index: 10; /* выше контента */
    background: linear-gradient(180deg, rgb(18, 18, 18) 0%, rgba(18, 18, 18, 0) 100%);
    border-top-left-radius: 1.5rem;
    border-top-right-radius: 1.5rem;
}


.modal-details-overlay.active .modal-details-content {
    animation: modal-content-in 0.5s cubic-bezier(0.25, 1, 0.5, 1) 0.2s forwards;
}

.modal-details-content.is-closing {
    animation: modal-content-out 0.4s cubic-bezier(0.5, 0, 0.75, 0) forwards;
}

.modal-content-container {
    padding: 2.5rem 3.5rem;
    overflow-y: auto;
    flex-grow: 1;
}

.modal-close-btn {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    background: rgba(255, 255, 255, 0.202);
    border: 1px solid rgba(255, 255, 255, 0.168);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-color);
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 11; /* Ставим выше градиента */
}

.modal-close-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1) rotate(90deg);
}

.modal-content-container::-webkit-scrollbar {
    width: 8px;
}
.modal-content-container::-webkit-scrollbar-track {
    background: transparent;
}
.modal-content-container::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}
.modal-content-container::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

.modal-header {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 2rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 1.5rem;
}

.modal-icon-bg {
    flex-shrink: 0;
    width: 50px;
    height: 50px;
    border-radius: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(145deg, var(--warm), var(--cool));
    color: #fff;
}

.modal-icon-bg svg { width: 24px; height: 24px; }

.modal-header h2 {
    font-family: "sansation", sans-serif;
    font-size: clamp(1.8rem, 4vw, 2.5rem);
    margin: 0;
    color: #fff;
}

.modal-layout {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 3rem;
}

.modal-main h3 {
    font-family: "sansation", sans-serif;
    font-size: 1.5rem;
    margin-top: 2rem;
    margin-bottom: 1rem;
    color: var(--text-color);
}

.modal-main p {
    margin-top: 0;
    line-height: 1.7;
    color: var(--text-color-muted);
    max-width: 65ch;
}

.modal-sidebar {
    background: rgba(255, 255, 255, 0.03);
    padding: 1.5rem;
    border-radius: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.08);
    align-self: flex-start;
}

.modal-sidebar h3 {
    font-family: "sansation", sans-serif;
    font-size: 1.2rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #999;
    margin-top: 0;
    margin-bottom: 1rem;
}

.modal-sidebar h3:not(:first-of-type) {
    margin-top: 2.5rem;
}

.features-list, .price-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.features-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.features-list li {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.95rem;
    color: var(--text-color-muted);
}

.features-list svg {
    width: 20px;
    height: 20px;
    color: var(--cool);
    flex-shrink: 0;
}

.price-list li {
    justify-content: space-between;
    padding: 0.75rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.price-list li:first-child {
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}
.tariff-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.price-list .price {
    font-weight: 600;
    color: #fff;
    padding-left: 1rem;
}
.price-list li small {
    display: block;
    font-size: 0.75rem;
    color: #999;
    margin-top: 4px;
}

.project-examples {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-top: 1.5rem;
}
#albums{
    display: block !important;
    
}
#book3d{
    height: auto !important;
}
#web-examples{
    display: block;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.project-example-item img {
    width: 100%;
    height: 210px;
    object-fit: cover;
    border-radius: 0.75rem;
    /* margin-bottom: 0.75rem; */
}

#invimg img{
    height: 600px !important;
}

@media (max-width: 670px){
    #invimg img {
        height: 84% !important;
    }
}

.project-example-item p {
    font-size: 0.85rem;
    color: #aaa;
    margin: 0;
    line-height: 1.4;
    text-decoration: none;
    display: inline-block;
}

/* Новый список примеров ботов для мобильных устройств */
.bot-examples-list-mobile {
    display: none; /* Скрываем по умолчанию */
    list-style: none;
    padding: 0;
    margin: 1.5rem 0 0 0;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    display: none;
}

.bot-examples-list-mobile li {
    display: flex;
    align-items: center;
    background-color: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 1rem;
    padding: 1rem 1rem;
    transition: background-color 0.3s ease;
}


.bot-examples-list-mobile li a {
    color: #fff;
    text-decoration: none;
    font-weight: 600;
    font-size: 1rem;
    display: block;
    margin-bottom: 0.25rem;
}

.bot-examples-list-mobile li p {
    margin: 0 !important; /* Убираем лишние отступы у параграфа */
    font-size: 0.85rem !important;
    color: #a0a0a0 !important;
    line-height: 1.5;
}

.modal-footer {
    padding: 1.5rem 3.5rem;
    background: rgba(0,0,0,0.2);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    flex-shrink: 0;
}

.modal-footer p {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--text-color);
}

.modal-cta-button {
    position: relative;
    overflow: hidden;
    background: var(--accent-color);
    color: var(--bg-color);
    padding: 0.75rem 1.5rem;
    border-radius: 2rem;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
}

.modal-cta-button::before {
    content: "";
    position: absolute;
    top: 0;
    left: -75%;
    width: 50%;
    height: 100%;
    background: linear-gradient(
        120deg,
        rgba(255, 255, 255, 0) 0%,
        rgba(122, 122, 122, 0.4) 50%,
        rgba(255, 255, 255, 0) 100%
    );
    transform: skewX(-25deg);
}

.modal-cta-button:hover::before {
    animation: shine 0.75s ease forwards;
}

@keyframes shine {
    0% {
        left: -75%;
    }
    100% {
        left: 125%;
    }
}

.modal-cta-button:hover {
    background: #e0e0e0;
    transform: scale(1.05);
}

@media (max-width: 900px) {
    .modal-layout {
        grid-template-columns: 1fr;
        gap: 2.5rem;
    }
    .tariff-head{
        display: flex !important;
        flex-direction: row !important;
        align-items: flex-start !important;
        gap: 0.5rem;
    }
    #titleshop{
        width: 200px !important;
    }
    .price-list .price {
        padding-left: 10px !important;
    }
}

/* =====================================================
=== РЕДИЗАЙН МОДАЛЬНОГО ОКНА ДЛЯ МОБИЛЬНЫХ (767px) ===
=====================================================
*/
@media (max-width: 767px) {
    /* 1. Оверлей: меняем анимацию на простой fade и выравниваем контент по низу */
    .modal-details-overlay {
        align-items: flex-end; /* Прижимаем модалку к низу */
        clip-path: none; /* Убираем сложную анимацию круга */
        transition: opacity 0.3s ease-in-out; /* Простая анимация прозрачности */
    }

    .modal-details-overlay.active {
        clip-path: none;
    }

    /* 2. Контент: делаем из него "нижнюю шторку" (bottom sheet) */
    .modal-details-content {
        width: 100%; /* На всю ширину экрана */
        height: auto; /* Высота по содержимому */
        max-height: 90dvh; /* Не выше 90% высоты экрана */
        margin: 0;
        border-radius: 1.5rem 1.5rem 0 0; /* Скругляем только верхние углы */
        border: none;
        border-top: 1px solid rgba(255, 255, 255, 0.1);
        box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.5); /* Тень падает вверх */
        overflow: hidden; /* Важно для анимации и скругленных углов */
    }
    

    
    /* Убираем верхний градиент, он здесь не нужен */
    .modal-details-content::before {
        display: none;
    }

    /* 3. Анимации: меняем на выезжание снизу */
    .modal-details-overlay.active .modal-details-content {
        /* Применяем новую анимацию для мобильных */
        animation: modal-content-in-mobile 0.4s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
    }

    .modal-details-content.is-closing {
        /* Применяем новую анимацию для мобильных */
        animation: modal-content-out-mobile 0.3s cubic-bezier(0.6, 0, 0.8, 0.2) forwards;
    }

    /* 4. Внутренние отступы и элементы */
    .modal-content-container {
        /* Увеличиваем верхний отступ, чтобы контент не лез под "ручку" и кнопку, добавляем нижний для iOS */
        padding: 1rem 1.5rem calc(2rem + env(safe-area-inset-bottom));
    }

    .modal-header {
        padding-bottom: 1rem;
        margin-bottom: 1.5rem;
        padding-left: 0; /* Убираем лишние отступы */
        padding-right: 0;
    }
    
    .modal-header h2 {
        font-size: 1.2rem;
    }

    .modal-icon-bg {
        width: 45px;
        height: 45px;
    }

    .modal-main p {
        font-size: 13px
    }

    #book3d{
        height: auto !important;
    }


    .modal-close-btn {
        top: 1rem;
        right: 1rem;
        width: 36px;
        height: 36px;
    }

    .modal-footer {
        padding: 1.25rem 1.5rem calc(1.25rem + env(safe-area-inset-bottom));
        flex-direction: column;
        align-items: stretch;
        text-align: center;
        background: rgba(0,0,0,0.3);
    }
    
    .project-examples {
        gap: 0.5rem;
        grid-template-columns: 1fr 1fr 1fr !important;
    }
    .project-example-item img {
        height: 160px;
        object-fit: cover;
    }
    #atamura {
        height: auto !important;

    }
    .price-list p{
        color: #7e7e7e !important;
        font-size: 10px !important;
        margin-bottom: 0;
    }
    .modal-sidebar p{
        color: #7e7e7e !important;
        font-size: 10px !important;
        margin-top: 10px !important;
    }
    [data-service-content="bots"] .project-examples {
        display: none; 
    }
    [data-service-content="bots"] .bot-examples-list-mobile {
        display: flex;
    }
}

@media (max-width: 1230px){
    .tariff-head{
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    .price-list .price {
        padding-left: 0;
    }
    #titleshop{
        width: 200px !important;
    }
}

@media (max-width: 670px){
    .project-example-item img{
    height: 150px;
    }
    #web-examples p{
        font-size: 9px !important;
    }
}