/* Стили блоков темы (вынесены из шаблонов, чтобы кэшировались браузером). Этап 2. */

/* ---- cta-calc-block.php ---- */
/* Контейнер и изоляция стилей */
.bento-cta-wrapper {
    width: 100%;
    max-width: 1200px;
    margin: 40px auto;
    padding: 0 20px;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* Сетка Бенто */
.bento-cta-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-auto-rows: 240px; /* Немного увеличили высоту для лучшего баланса с картинкой */
    gap: 20px;
}

/* Базовые стили карточки (Глассморфизм) */
.bento-card {
    position: relative;
    border-radius: 24px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.45);
    border: 1px solid rgba(255, 255, 255, 0.4);
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.06);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.bento-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 40px 0 rgba(31, 38, 135, 0.12);
}

/* Эффект заднего фона */
.bento-card-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    opacity: 0.12;
    mix-blend-mode: overlay;
    transition: transform 0.5s ease;
    z-index: 1;
}
.bento-card:hover .bento-card-bg {
    transform: scale(1.03);
}

/* Контент внутри карточек */
.bento-card-content {
    position: relative;
    z-index: 2;
    padding: 30px;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    box-sizing: border-box;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.35) 0%, rgba(255, 255, 255, 0.08) 100%);
}

/* Разметка сетки */
.bento-main-card {
    grid-column: span 2;
    grid-row: span 2;
    background: rgba(255, 255, 255, 0.6);
}
.bento-secondary-card {
    grid-column: span 1;
    grid-row: span 1;
}
.bento-small-card {
    grid-column: span 1;
    grid-row: span 1;
    background: rgba(255, 255, 255, 0.7);
}

/* Двухколоночный сплит для главной карточки */
.bento-main-split {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 30px;
    height: 100%;
    width: 100%;
}

.bento-main-text {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.bento-main-media {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100%;
}

/* Стилизация встроенного изображения */
.bento-product-img {
    max-width: 100%;
    max-height: 350px;
    object-fit: contain;
    border-radius: 16px;
    filter: drop-shadow(0 15px 25px rgba(0, 0, 0, 0.12));
    transition: transform 0.3s ease;
}

.bento-card:hover .bento-product-img {
    transform: scale(1.02);
}

/* Элементы оформления текста */
.bento-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    align-self: flex-start;
    background-color: #71979c;
    color: #fff;
    padding: 6px 14px;
    border-radius: 100px;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.04);
}

.bento-badge img.emoji {
    display: inline-block;
    width: 16px;
    height: 16px;
    vertical-align: -2px;
}

.bento-card h2 {
    font-size: 32px;
    line-height: 1.25;
    margin: 0 0 14px 0;
    color: #111;
    font-weight: 700;
}

.bento-card h3 {
    font-size: 20px;
    margin: 0 0 8px 0;
    color: #111;
    font-weight: 600;
}

.bento-card h4 {
    font-size: 18px;
    margin: 0 0 6px 0;
    color: #111;
    font-weight: 600;
}

.bento-card p {
    font-size: 15px;
    line-height: 1.55;
    color: #444;
    margin: 0 0 24px 0;
}

.bento-secondary-card p, .bento-small-card p {
    font-size: 14px;
    margin-bottom: 0;
}

/* Стили кнопки */
.bento-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    align-self: flex-start;
    background: #111;
    color: #fff !important;
    text-decoration: none !important;
    padding: 14px 28px;
    border-radius: 100px;
    font-weight: 600;
    font-size: 15px;
    transition: background 0.2s, transform 0.2s;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.bento-btn:hover {
    background: #333;
    transform: scale(1.02);
}

.bento-btn svg {
    transition: transform 0.2s;
}

.bento-btn:hover svg {
    transform: translateX(4px);
}

/* Иконки и теги */
.bento-icon-box {
    width: 44px;
    height: 44px;
    background: #eef2ff;
    color: #4f46e5;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: auto;
}

.bento-mini-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 12px;
}

.bento-mini-tags span {
    background: rgba(255, 255, 255, 0.6);
    padding: 4px 10px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 500;
    color: #333;
}

/* Адаптивность */
@media (max-width: 991px) {
    .bento-cta-grid {
        grid-template-columns: repeat(2, 1fr);
        grid-auto-rows: 220px;
    }
    .bento-main-card {
        grid-column: span 2;
    }
    .bento-card h2 {
        font-size: 28px;
    }
}

@media (max-width: 767px) {
    .bento-cta-grid {
        grid-template-columns: 1fr;
        grid-auto-rows: auto;
    }
    .bento-main-card, .bento-secondary-card, .bento-small-card {
        grid-column: span 1;
        grid-row: span 1;
    }
    .bento-main-split {
        flex-direction: column-reverse; /* Картинка будет сверху текста на мобильных */
        gap: 20px;
    }
    .bento-card-content {
        padding: 24px;
        min-height: auto;
    }
    .bento-main-media {
        height: auto;
    }
    .bento-product-img {
        max-height: 180px;
    }
    .bento-card h2 {
        font-size: 22px;
    }
}

/* ---- ceiling-interactive-block.php ---- */
/* Сетка Bento карточек под основным блоком */
.ceiling-bento-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-top: 30px;
    width: 100%;
}

.ceiling-bento-card {
    background: #ffffff;
    border: 1px solid #edf2f7;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.02);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.ceiling-bento-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.05);
}

/* Стиль черных контурных SVG иконок */
.ceiling-bento-icon {
    width: 36px;
    height: 36px;
    color: #1a1a1a;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ceiling-bento-icon svg {
    width: 100%;
    height: 100%;
}

.ceiling-bento-title {
    font-size: 19px;
    font-weight: 600;
    color: #1a1a1a;
    margin: 0 0 10px 0;
}

.ceiling-bento-text {
    font-size: 14px;
    color: #555555;
    line-height: 1.5;
    margin: 0;
}

/* Адаптив под планшеты и мобильные */
@media (max-width: 992px) {
    .ceiling-bento-grid {
        grid-template-columns: 1fr; /* Схлопываем в одну колонку */
        gap: 15px;
    }
    
    .ceiling-bento-card {
        padding: 24px;
    }
}


.bento-ceiling-container {
    box-sizing: border-box;
    background: #ffffff;
    border-radius: 24px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.04);
    padding: 40px;
    max-width: 1200px;
    width: 100%;
    margin: 20px auto;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.bento-ceiling-container * {
    box-sizing: border-box;
}

.ceiling-block-title {
    font-size: 28px;
    font-weight: 600;
    color: #1a1a1a;
    margin: 0 0 8px 0;
    line-height: 1.2;
}

.ceiling-block-subtitle {
    font-size: 16px;
    color: #767676;
    margin: 0 0 30px 0;
}

.ceiling-map-wrapper {
    position: relative;
    width: 100%;
    border-radius: 20px;
    overflow: hidden;
    background: linear-gradient(135deg, #e8ecef 0%, #f0f3f5 100%);
    /* Пропорции исходного десктопного блока (1120x650), под которые
       откалиброваны координаты точек. Фиксируем не высоту, а именно
       соотношение сторон - тогда обрезка картинки object-fit:cover
       будет одинаковой на любой ширине экрана, и точки не "уезжают". */
    aspect-ratio: 112 / 65;
    box-shadow: inset 0 0 100px rgba(0,0,0,0.05);
}

.ceiling-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.ceiling-hotspot {
    position: absolute;
    width: 20px;
    height: 20px;
    background-color: #ffffff;
    border-radius: 50%;
    border: 4px solid #1a1a1a;
    cursor: pointer;
    z-index: 10;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), background-color 0.3s ease;
}

.ceiling-hotspot::after {
    content: '';
    position: absolute;
    top: -7px; left: -7px; right: -7px; bottom: -7px;
    border-radius: 50%;
    border: 2px solid rgba(26, 26, 26, 0.4);
    animation: ceiling-pulse 2.5s infinite ease-in-out;
    pointer-events: none;
}

/* Увеличенная невидимая зона тапа для точки (44x44px - рекомендованный
   минимум для комфортного нажатия пальцем), сама точка визуально
   остаётся маленькой. */
.ceiling-hotspot::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 44px;
    height: 44px;
    transform: translate(-50%, -50%);
    border-radius: 50%;
}

@keyframes ceiling-pulse {
    0% { transform: scale(0.8); opacity: 1; }
    100% { transform: scale(1.8); opacity: 0; }
}

.ceiling-hotspot:hover {
    transform: scale(1.4);
    background-color: #1a1a1a;
    border-color: #ffffff;
}

.c-hotspot-ugol       { top: 21%; left: 21%; }
.c-hotspot-perimetr   { top: 6%; left: 45%; }
.c-hotspot-oblicovka  { top: 42%; left: 32%; }
.c-hotspot-karniz     { top: 27%; left: 82%; }
.c-hotspot-lines      { top: 28%; left: 67%; }
.c-hotspot-track      { top: 24%; left: 39%; }
.c-hotspot-lamps      { top: 25%; left: 56%; }
.c-hotspot-diffuzor   { top: 41%; left: 54.3%; }
.c-hotspot-truba      { top: 24%; left: 25.4%; }
.c-hotspot-svetilnik  { top: 35%; left: 52%; }

.ceiling-tooltip {
/* position:fixed - координаты вычисляет JS в системе координат экрана.
   Это позволяет: а) подсказке никогда не обрезаться overflow:hidden
   родительского блока, б) всегда оставаться в пределах видимой области
   экрана независимо от места точки. */
position: fixed;
background: rgb(255 255 255 / 23%);
backdrop-filter: blur(7px);
-webkit-backdrop-filter: blur(25px);
border: 1px solid rgb(255 255 255 / 20%);
border-radius: 16px;
padding: 18px;
width: 290px;
box-shadow: 0 30px 60px rgba(0, 0, 0, 0.1);
opacity: 0;
visibility: hidden;
pointer-events: none;
transform: translateY(12px);
transition: opacity 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94), transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94), visibility 0.3s ease;
z-index: 999;
}

/* Открытие/закрытие теперь управляется через JS-класс is-active
   (клик по точке), а не через :hover - это одинаково надёжно
   работает и на мышке, и на тач-экранах. */
.ceiling-tooltip.is-active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0);
}

.c-tooltip-tag {
    display: inline-block;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    background: #1a1a1a;
    color: #fff;
    padding: 4px 8px;
    border-radius: 6px;
    margin-bottom: 10px;
    font-weight: 600;
    line-height: 1;
}

.c-tooltip-title {
    font-size: 17px;
    font-weight: 600;
    color: #1a1a1a;
    margin: 0 0 6px 0;
}

.c-tooltip-text {
    font-size: 13px;
    color: #444444;
    line-height: 1.45;
    margin: 0 0 14px 0;
}

/* Кнопка-ссылка внутри подсказки в стиле Glassmorphism */
.c-tooltip-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 10px 14px;
    /* Полупрозрачный белый фон (85%) и эффект размытия */
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.6);
    color: #1a1a1a;
    text-decoration: none;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 500;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.02);
    transition: background 0.3s ease, border-color 0.3s ease, color 0.3s ease, box-shadow 0.3s ease;
}

/* Эффект при наведении на кнопку */
.c-tooltip-btn:hover {
    /* При наведении кнопка становится более плотной (95% белого) и немного «подсвечивается» */
    background: rgba(255, 255, 255, 0.95);
    border-color: rgba(26, 26, 26, 0.2);
    color: #000000;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.06);
}

.ceiling-mobile-list { display: none; }

@media (max-width: 992px) {
    .bento-ceiling-container { padding: 24px; }
    .ceiling-mobile-list { display: block; margin-top: 24px; }
    
    .c-mobile-item {
        background: #f8f9fa;
        border-radius: 14px;
        padding: 16px;
        margin-bottom: 12px;
        border: 1px solid #edf2f7;
    }
    .c-mobile-item h4 { font-size: 15px; margin: 0 0 4px 0; font-weight: 600; color: #1a1a1a; }
    .c-mobile-item p { font-size: 13px; color: #666; margin: 0 0 10px 0; line-height: 1.4; }
    .c-mobile-link { font-size: 13px; color: #1a1a1a; font-weight: 600; text-decoration: none; display: inline-block; }
}

/* --- Мобильная версия схемы: картинка крупнее и листается по горизонтали,
       чтобы точки не «кучковались» (правка заказчика) --- */
.ceiling-map-hint,
.c-sub-touch { display: none; }
@media (hover: none) {
    .c-sub-desktop { display: none; }
    .c-sub-touch { display: inline; }
}
@media (max-width: 767px) {
    .ceiling-map-scroll {
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
        margin: 0 -24px;
        padding: 0 24px 6px;
        scrollbar-width: thin;
    }
    .ceiling-map-scroll .ceiling-map-wrapper {
        width: 760px;          /* ~в 2 раза шире экрана: точки разнесены */
        max-width: none;
    }
    .ceiling-map-scroll .ceiling-hotspot {
        width: 24px;
        height: 24px;
    }
    .ceiling-map-hint {
        display: block;
        font-size: 13px;
        color: #767676;
        text-align: center;
        margin: -18px 0 10px;
    }
}
