/* stylemobile.css */

/* Desktop: hide mobile controls */
@media (min-width: 821px) {

    .mobile-menu-btn,
    .mobile-nav-backdrop {
        display: none !important;
    }
}

/* MOBILE / TABLET */
@media (max-width: 820px) {

    .page-container {
        padding: 14px;
    }

    .divider {
        margin: 16px 0;
    }

    /* HERO (image first, text below) */
    .hero {
        flex-direction: column-reverse;
        height: auto;
        gap: 14px;
    }

    .hero-right {
        height: 56vh;
        border-radius: 6px;
    }

    .hero-overlay {
        padding: 16px 12px;
    }

    .hero-top {
        position: relative;
        align-items: flex-start;
        gap: 10px;
    }

    .photo-engraved {
        gap: 10px;
        flex: 1 1 auto;
        min-width: 0;
        z-index: 6;
    }

    .photo-engraved span {
        font-size: 0.8rem;
        letter-spacing: 0.6px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 60vw;
    }

    .photo-engraved .v-line {
        height: 28px;
    }

    /* Mobile menu button */
    .mobile-menu-btn {
        z-index: 6;
        margin-left: auto;
        width: 42px;
        height: 42px;
        border-radius: 12px;
        border: 1px solid rgba(255, 255, 255, 0.22);
        background: rgba(0, 0, 0, 0.28);
        color: #fff;
        cursor: pointer;
        font-size: 1.2rem;
        line-height: 1;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        backdrop-filter: blur(6px);
        transition: opacity 0.25s, transform 0.2s;
    }

    .mobile-menu-btn:active {
        transform: translateY(1px);
    }

    /* Backdrop */
    .mobile-nav-backdrop {
        position: absolute;
        inset: 0;
        background: rgba(0, 0, 0, 0.35);
        opacity: 0;
        pointer-events: none;
        z-index: 4;
        border-radius: 6px;
        transition: opacity 0.25s;
    }

    body.is-mobile-nav-open .mobile-nav-backdrop {
        opacity: 1;
        pointer-events: auto;
    }

    /* Slide-in nav panel on the right side of the hero image */
    .hero-nav {
        position: absolute;
        top: 52px;
        right: 0;
        z-index: 5;

        width: min(260px, 72vw);
        max-height: calc(56vh - 64px);
        overflow: auto;

        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: 8px;

        padding: 12px 12px;
        border-radius: 14px;
        background: rgba(0, 0, 0, 0.30);
        backdrop-filter: blur(8px);

        transform: translateX(110%);
        opacity: 0;
        pointer-events: none;

        transition: transform 0.28s ease, opacity 0.2s ease;
    }

    body.is-mobile-nav-open .hero-nav {
        transform: translateX(0);
        opacity: 1;
        pointer-events: auto;
    }

    .hero-nav a,
    .hero-nav-btn {
        color: #fff;
        font-size: 0.98rem;
        letter-spacing: 0.3px;
        text-transform: lowercase;
        text-decoration: none;

        padding: 10px 10px;
        border-radius: 10px;

        background: rgba(255, 255, 255, 0.08);
        border: 1px solid rgba(255, 255, 255, 0.10);
        width: 100%;
        text-align: right;
    }

    .hero-nav a:hover,
    .hero-nav-btn:hover {
        opacity: 1;
    }

    .hero-nav-btn {
        cursor: pointer;
    }

    .nav-dropdown {
        width: 100%;
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
        position: static;
    }

    /* Presentations panel inside the mobile menu (not floating/fixed) */
    .presentations-panel {
        position: static;
        width: 100%;
        display: none;
        padding: 12px 12px;

        border-radius: 12px;
        background: rgba(255, 255, 255, 0.96);
        border: 1px solid rgba(17, 17, 17, 0.12);
        box-shadow: none;
        backdrop-filter: none;

        max-height: 46vh;
        overflow: auto;
    }

    .presentations-panel.is-open {
        display: block;
    }

    .presentations-title {
        font-size: 0.95rem;
        margin-bottom: 8px;
    }

    .presentation-item {
        padding: 10px 0;
    }

    .presentation-name {
        font-size: 0.98rem;
        color: #111;
    }

    .presentation-download {
        color: #111;
        border-bottom-color: #111;
        font-size: 0.92rem;
    }

    /* HERO text block */
    .hero-left {
        padding: 26px 12px;
    }

    .brand {
        font-size: 2.4rem;
        margin: 0 0 24px 0;
        top: 0;
    }

    .innovation-block {
        margin-top: 28px;
        max-width: 520px;
    }

    /* VISUALIZER (text -> video -> button) */
    .visualizer {
        padding: 84px 14px;
        gap: 18px;
        display: flex;
        flex-direction: column;
        align-items: stretch;
    }

    .visualizer-text {
        display: contents;
    }

    .visualizer-text h2 {
        order: 1;
    }

    .visualizer-text .subtitle {
        order: 2;
        margin-bottom: 6px;
    }

    .visualizer-text .divider:first-of-type {
        order: 3;
    }

    .visualizer-text .description {
        order: 4;
        max-width: none;
    }

    .visualizer-text .divider:last-of-type {
        order: 5;
    }

    .visualizer-video {
        order: 6;
        width: 100%;
    }

    .visualizer-text .try-link {
        order: 7;
        margin-top: 16px;
        align-self: flex-start;
    }

    .visualizer-video video {
        border-radius: 10px;
    }

    /* SECTION PADDINGS */
    .world-section {
        padding: 56px 14px;
        gap: 18px;
    }

    .works {
        padding: 56px 14px 90px;
        gap: 34px;
    }

    .forms {
        padding: 76px 14px;
    }

    .contacts {
        padding: 76px 14px;
        gap: 26px;
    }

    /* WORLD GRID */
    .world-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .world-card {
        grid-column: span 1;
    }

    .world-media {
        height: 210px;
        border-radius: 12px;
    }

    /* CAROUSELS (smaller arrows/dots + no overlap via padding) */
    .carousel-shell,
    .carousel-shell--center,
    .carousel-shell--forms {
        width: min(560px, 100%);
        padding: 0 40px;
    }

    .carousel-shell--modal {
        width: 100%;
        padding: 0 46px;
    }

    .carousel-arrow {
        width: 34px;
        height: 34px;
        border-radius: 10px;
    }

    .carousel-arrow--left {
        left: 10px;
    }

    .carousel-arrow--right {
        right: 10px;
    }

    .carousel-viewport {
        border-radius: 12px;
    }

    .carousel-slide {
        height: min(52vh, 520px);
    }

    .carousel-slide img {
        border-radius: 12px;
    }

    .carousel-dots {
        gap: 8px;
        margin-top: 12px;
    }

    .carousel-dot {
        width: 8px;
        height: 8px;
    }

    #tilesCarousel .carousel-dots {
        grid-template-columns: repeat(auto-fill, 8px);
        gap: 8px;
    }

    .carousel-dots--scroll {
        max-width: 92vw;
        margin-top: 10px;
    }

    /* SPLIT -> STACK */
    .carousel--split {
        grid-template-columns: 1fr;
        gap: 18px;
    }

    .carousel-info {
        max-width: none;
    }

    /* TILES */
    #tilesCarousel .carousel-slide {
        height: min(46vh, 440px);
    }

    /* FORMS */
    .forms-content {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .forms-figure {
        max-width: none;
    }

    .forms-figure__media {
        border-radius: 10px;
    }

    .forms-right {
        justify-content: flex-start;
    }

    .carousel-shell--forms {
        margin-right: 0;
        max-height: 520px;
    }

    .forms-video {
        width: 100%;
        height: 100%;
    }

    .forms-video__media {
        border-radius: 10px;
    }

    /* LINEAR GALLERY — no crop */
    .parent {
        max-width: none;
        height: auto;
        display: flex;
        flex-direction: column;
        gap: 16px;
    }

    .g-item {
        display: block;
    }

    .g-media {
        border-radius: 10px;
        overflow: hidden;
    }

    .g-media img {
        position: static;
        width: 100%;
        height: auto;
        object-fit: contain;
        transform: none;
        display: block;
    }

    .g-caption {
        font-size: 1.05rem;
        padding-top: 12px;
    }

    /* CONTACTS */
    .contacts-right {
        justify-content: flex-start;
    }

    .contacts-logo {
        width: min(300px, 100%);
        margin-top: 0;
        margin-right: 0;
    }

    .contacts-people__item{
        font-size: 1.1rem;
    }

    /* WORLD MODAL centered and clean */
    .modal.is-open {
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 12px;
    }

    .modal-panel {
        width: 100%;
        margin: 0;
        max-height: calc(100vh - 24px);
        overflow: hidden;
        border-radius: 14px;
    }

    .modal-head {
        padding: 16px 14px 8px 14px;
    }

    .modal-body {
        padding: 10px 14px 14px 14px;
    }

    .modal-close {
        width: 40px;
        height: 40px;
        border-radius: 10px;
    }

    .modal-carousel .carousel-shell--modal {
        padding: 0 44px;
    }

    .modal-carousel .carousel-arrow--left {
        left: 10px;
    }

    .modal-carousel .carousel-arrow--right {
        right: 10px;
    }

    .modal-carousel .carousel-slide {
        height: min(60vh, 520px);
    }
}

/* SMALL MOBILE */
@media (max-width: 600px) {

    .page-container {
        padding: 12px;
    }

    .hero-right {
        height: 58vh;
    }

    .hero-overlay {
        padding: 14px 10px;
    }

    .photo-engraved span {
        font-size: 0.9rem;
        max-width: 64vw;
    }

    .mobile-menu-btn {
        width: 40px;
        height: 40px;
        border-radius: 11px;
    }

    .hero-nav {
        width: min(250px, 78vw);
        top: 50px;
        padding: 10px 10px;
    }

    .hero-nav a,
    .hero-nav-btn {
        font-size: 0.94rem;
        padding: 9px 9px;
    }

    .presentations-panel {
        max-height: 44vh;
        padding: 10px 10px;
        border-radius: 12px;
    }

    .visualizer {
        padding: 72px 12px;
    }

    .world-section {
        padding: 50px 12px;
    }

    .works {
        padding: 50px 12px 84px;
    }

    .forms {
        padding: 68px 12px;
    }

    .contacts {
        padding: 68px 12px;
    }

    .carousel-shell,
    .carousel-shell--center,
    .carousel-shell--forms {
        padding: 0 34px;
    }

    .carousel-shell--modal {
        padding: 0 38px;
    }

    .carousel-arrow {
        width: 30px;
        height: 30px;
        border-radius: 9px;
    }

    .carousel-arrow--left {
        left: 8px;
    }

    .carousel-arrow--right {
        right: 8px;
    }

    .carousel-dots {
        gap: 6px;
        margin-top: 10px;
    }

    .carousel-dot {
        width: 6px;
        height: 6px;
    }

    #tilesCarousel .carousel-dots {
        grid-template-columns: repeat(auto-fill, 6px);
        gap: 6px;
    }

    .g-caption {
        font-size: 1rem;
    }

    .modal-panel {
        max-height: calc(100vh - 18px);
        border-radius: 12px;
    }

    .modal-head {
        padding: 14px 12px 8px 12px;
    }

    .modal-body {
        padding: 10px 12px 12px 12px;
    }


    /* REMOVE frame around forms videos */
    .carousel--forms .carousel-viewport,
    .carousel--forms .carousel-slide,
    .carousel--forms .forms-video__media {
        border-radius: 0 !important;
        background: transparent !important;
    }


}


@media (max-width: 768px) {
  .hero-image img {
    width: 100%;
    height: auto;          /* ключевое: высота по пропорции */
    object-fit: contain;   /* на всякий случай */
    display: block;
  }
}
