/* ============================================
   MOBILE ADAPTATION FOR CHERNYAEV SITE
   Полная адаптация под мобильные устройства
   ============================================ */

/* ============================================
   BASE MOBILE FIXES
   ============================================ */

@media (max-width: 768px) {
  /* Prevent horizontal scroll */
  html, body {
    overflow-x: hidden;
    width: 100%;
  }

  body {
    font-size: 16px; /* Prevents iOS zoom */
  }

  /* Container adjustments */
  .container {
    width: calc(100% - 8px);
    padding-left: 4px;
    padding-right: 4px;
  }

  /* Better spacing */
  section {
    padding: 40px 0 !important;
  }

  .section-heading {
    margin-bottom: 24px !important;
  }
}

/* ============================================
   MOBILE NAVIGATION - FIXED
   ============================================ */

@media (max-width: 768px) {
  .site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(247, 239, 228, 0.95);
    backdrop-filter: blur(10px);
  }

  .nav {
    flex-wrap: wrap;
    padding: 12px 16px;
    gap: 12px;
  }

  .brand {
    font-size: 0.9rem;
    white-space: nowrap;
  }

  /* Hamburger button */
  .nav-toggle {
    display: inline-grid !important;
    place-items: center;
    margin-left: auto;
    z-index: 1001;
    cursor: pointer;
    border: none;
  }

  /* Mobile menu overlay */
  .nav-links {
    display: flex !important;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(247, 239, 228, 0.98);
    backdrop-filter: blur(20px);
    z-index: 1000;
    flex-direction: column;
    justify-content: flex-start;
    align-items: stretch;
    gap: 0;
    padding: 80px 24px 40px;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(-20px);
    transition: all 0.3s ease;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* Open state - синхронизировано с JS */
  .nav-links.is-open {
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
    transform: translateY(0) !important;
  }

  /* Menu items */
  .nav-links a {
    font-size: 1.3rem !important;
    padding: 16px 24px !important;
    width: 100%;
    max-width: 100%;
    text-align: left !important;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    background: transparent !important;
    border-radius: 0 !important;
    white-space: normal !important;
    line-height: 1.4;
  }

  .nav-links a:hover,
  .nav-links a:active {
    background: rgba(255, 255, 255, 0.5) !important;
  }

  /* Hide preview on mobile */
  .nav-preview {
    display: none !important;
  }

  .nav-links::before {
    display: none !important;
  }

  /* УДАЛЕНО: body.menu-open блокировал прокрутку на мобильных устройствах */
}

/* ============================================
   HERO SECTION - MOBILE
   ============================================ */

@media (max-width: 1180px) {
  .hero-top-grid--new {
    grid-template-columns: 1fr !important;
    gap: 24px;
  }

  .hero-poster-card {
    min-height: 500px;
    max-height: 60vh;
  }
}

@media (max-width: 768px) {
  .hero {
    padding: 20px 0 40px !important;
  }

  .hero-scene-shell {
    padding: 16px;
    padding-left: calc(16px + 0.1cm);
    padding-right: calc(16px + 0.1cm);
    border-radius: 24px;
    margin-top: -0.2cm;
  }

  .hero-top-grid--new {
    gap: 20px;
  }

  .hero-poster-card {
    min-height: 430px;
    max-height: 430px;
    width: 100%;
    max-width: 100%;
    padding: 14px !important;
    border-radius: 20px;
    margin-top: 0;
    margin-bottom: 0;
    margin-left: auto;
    margin-right: 0;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;

  }

  /* Hide extra layers - keep only bottom layer */
  .hero-poster-card::before,
  .hero-poster-card::after {
    display: none !important;
  }

  .hero-poster-slides {
    width: 100%;
    height: 100%;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;

  }

  .hero-poster-slides img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    object-position: center !important;
    transition: opacity 2s ease-in-out !important;
  }

  .hero-poster-frame {
    
    position: absolute;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    opacity: 0;
    transition: opacity 2s ease-in-out;
  }

  .hero-poster-frame.is-active {
    opacity: 1;
    z-index: 1;
  }

  .hero-poster-card::after {
    display: none !important;
  }

@media (max-width: 1200px) and (orientation: landscape) {
  .hero-poster-frame:not(.is-active) {
    
    inset: 0;
    position: absolute !important;
    
    
    
    right: 0 !important;
    bottom: 0 !important;
    width: 100% !important;
    height: 100% !important;
    background-size: 100% 100% !important;
    background-position: center !important;
    border-radius: 20px !important;
    overflow: hidden !important;
  }

  .hero-poster-frame.is-active {
    position: absolute !important;
    inset: 0 !important;
    width: 100% !important;
    height: 100% !important;
    background-size: 100% 100% !important;
    background-position: center !important;
    border-radius: 20px !important;
    overflow: hidden !important;
  }

  /* Ландшафтная адаптация меню */
  .mobile-sidebar-header {
    padding: 20px 20px 20px 32px !important;
    border-bottom: 2px solid rgba(176, 123, 58, 0.2) !important;
    background: rgba(176, 123, 58, 0.08) !important;
  }
  .mobile-sidebar-header h2 {
    margin: 0 !important;
    font-size: 1.3rem !important;
    color: #2b1612 !important;
    font-weight: 700 !important;
  }
  .mobile-sidebar-header p {
    margin: 4px 0 0 !important;
    font-size: 0.85rem !important;
    color: #b07b3a !important;
    text-transform: uppercase !important;
    letter-spacing: 0.1em !important;
  }
  .mobile-sidebar-nav {
    display: flex !important;
    flex-direction: column !important;
    padding: 5px 0 !important;
  }
  .mobile-sidebar-nav a {
    display: block !important;
    width: 100% !important;
    padding: 5px 20px !important;
    color: rgba(43, 22, 18, 0.85) !important;
    text-decoration: none !important;
    font-size: 1.05rem !important;
    font-weight: 600 !important;
    transition: all 0.2s !important;
    border-left: 3px solid transparent !important;
    border-bottom: none !important;
    box-sizing: border-box !important;
  }
  .mobile-sidebar-nav a:hover,
  .mobile-sidebar-nav a:active {
    background: rgba(176, 123, 58, 0.12) !important;
    color: var(--text) !important;
    border-left-color: var(--honey) !important;
    padding-left: 20px !important;
  }
}

  .hero-title {
    font-size: clamp(1.8rem, 7vw, 2.5rem) !important;
    line-height: 1.2;
  }

  .hero-story-card {
    padding: 24px !important;
    gap: 16px;
    margin-top: 0;
    opacity: 1 !important;
    visibility: visible !important;
  }

  .hero-intro-copy {
    margin-top: 20px;
    opacity: 1 !important;
    visibility: visible !important;
  }

  .hero-actions {
    flex-direction: column;
    gap: 12px;
    width: 100%;
    align-items: flex-end;
  }

  .hero-actions .btn {
    width: 100%;
    text-align: center;
  }

  .hero-actions .btn-primary {
    margin-left: -0.2cm !important;
  }

  .hero-actions .btn-secondary {
    margin-right: 0;
    align-self: flex-end;
  }

  /* Formats carousel */
  .formats-carousel-card {
    margin-top: 0;
    padding: 20px 0;
    opacity: 1 !important;
    visibility: visible !important;
  }

  .formats-slider {
    grid-auto-columns: minmax(280px, 85%);
    gap: 16px;
    padding: 0 16px;
  }

  .formats-slide {
    min-height: 360px;
    padding: 16px;
  }

  .formats-slide img {
    height: 260px;
    object-fit: cover;
  }

  .formats-scrollbar {
    margin: 20px 16px 0;
  }
}

@media (max-width: 480px) {
  .hero-poster-card {
    min-height: 430px;
    max-height: 430px;
    width: 100%;
  }

  .hero-title {
    font-size: clamp(1.6rem, 6vw, 2rem) !important;
  }

  .hero-story-card {
    padding: 20px !important;
  }

  .formats-slider {
    grid-auto-columns: minmax(260px, 90%);
  }

  .formats-slide {
    min-height: 320px;
    padding: 12px;
  }

  .formats-slide img {
    height: 220px;
  }
}

/* ============================================
   VIDEO HERO SECTION
   ============================================ */

@media (max-width: 768px) {
  .video-feature-shell {
    padding: 0 !important;
  }

  .video-feature-card {
    border-radius: 20px;

  }

  .hero-video-shell {
    min-height: 300px;
    max-height: 50vh;
  }

  .video-poster-layer img {
    object-fit: cover;
  }

  .video-sound-toggle {
    bottom: 16px;
    right: 16px;
    width: 48px;
    height: 48px;
  }

  .video-fullscreen-btn {
    bottom: 16px;
    left: 16px;
    width: 48px;
    height: 48px;
  }
}

/* ============================================
   ABOUT SECTION
   ============================================ */

@media (max-width: 768px) {
  .about-grid,
  .about-grid-wide,
  .about-grid-profile {
    grid-template-columns: 1fr !important;
    gap: 16px !important;
  }

  .about-text-card,
  .glass-card {
    padding: 24px !important;
  }

  .about-lead {
    font-size: 1.05rem !important;
    line-height: 1.7;
  }

  .bullet-list {
    padding-left: 20px;
  }

  .bullet-list li {
    margin-bottom: 12px;
    line-height: 1.6;
  }
}

/* ============================================
   HELP SECTION
   ============================================ */

@media (max-width: 768px) {
  .help-grid {
    grid-template-columns: 1fr !important;
    gap: 20px !important;
  }

  .help-big {
    padding: 24px !important;
  }

  .help-big h3 {
    font-size: 1.4rem !important;
  }

  .help-big .lead {
    font-size: 1.1rem !important;
  }
}

/* ============================================
   WORKFLOW SECTION
   ============================================ */

@media (max-width: 768px) {
  .workflow-list,
  .workflow-list--4 {
    grid-template-columns: 1fr !important;
    gap: 20px !important;
  }

  .workflow-step {
    padding: 24px !important;
  }

  .workflow-step h3 {
    font-size: 1.2rem !important;
  }

  .step-index {
    font-size: 0.85rem;
  }
}

/* ============================================
   MOBILE MENU (SIDEBAR STYLE)
   ============================================ */

@media (max-width: 768px) {
  /* Show site header with brand */
  .site-header {
    position: relative;
    

    padding: 8px 0;
    background: transparent;
  }

  .nav-brandline {
    display: block !important;
    text-align: left;
    padding: 16px 70px 0 16px;
    background: transparent;
  }

  .brand {
    display: inline-block !important;
    font-size: 1.05rem;
    font-weight: 880;
    letter-spacing: 0.09em;
    color: #140c0a;
    text-decoration: none;
    line-height: 1.4;
    background: transparent;
    font-family: "Crash Bandicoot", cursive;
  }

  /* Hide desktop navigation */
  .nav {
    display: none !important;
  }

  /* Mobile menu toggle button */
  .mobile-menu-toggle {
    display: block;
    position: fixed;
    top: 16px;
    right: 16px;
    z-index: 1001;
    width: 50px;
    height: 50px;
    background: rgba(255, 250, 244, 0.95);
    border: 2px solid rgba(176, 123, 58, 0.3);
    border-radius: 8px;
    color: #2b1612;
    font-size: 24px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
  }

  .mobile-menu-toggle:active {
    transform: scale(0.95);
  }

  /* Mobile sidebar menu */
  .mobile-sidebar {
    position: fixed;
    top: 0;
    left: -300px;
    width: 280px;
    height: 100vh;
    background: linear-gradient(180deg, #fffaf4 0%, #f5ede3 100%);
    z-index: 1000;
    transition: left 0.3s ease;
    overflow-y: auto;
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.3);
  }

  .mobile-sidebar.is-open {
    left: 0;
  }

  /* Sidebar header */
  .mobile-sidebar-header {
    padding: 24px 20px;
    border-bottom: 2px solid rgba(176, 123, 58, 0.2);
    background: rgba(176, 123, 58, 0.08);
  }

  .mobile-sidebar-header h2 {
    margin: 0;
    font-size: 1.3rem;
    color: #2b1612;
    font-weight: 600;
  }

  .mobile-sidebar-header p {
    margin: 4px 0 0 0;
    font-size: 0.85rem;
    color: rgba(43, 22, 18, 0.7);
  }

  /* Sidebar navigation */
  .mobile-sidebar-nav {
    padding: 12px 0;
    display: flex;
    flex-direction: column;
  }

  .mobile-sidebar-nav a {
    display: block;
    width: 100%;
    padding: 5px 20px;
    color: rgba(43, 22, 18, 0.85);
    text-decoration: none;
    font-size: 1.05rem;
    font-weight: 600;
    transition: all 0.2s;
    border-left: 3px solid transparent;
    box-sizing: border-box;
  }

  .mobile-sidebar-nav a:hover,
  .mobile-sidebar-nav a:active {
    background: rgba(176, 123, 58, 0.12);
    color: #2b1612;
    border-left-color: #b07b3a;
  }

  /* Overlay */
  .mobile-sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
  }

  .mobile-sidebar-overlay.is-open {
    display: block;
  }

  /* Adjust toggle button when menu is open */
  .mobile-sidebar.is-open ~ .mobile-menu-toggle {
    right: 16px;
  }
}

/* Hide mobile menu on desktop */
@media (min-width: 769px) {
  .mobile-menu-toggle,
  .mobile-sidebar,
  .mobile-sidebar-overlay {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
  }

  /* Hide mobile brand text on desktop */
  .site-header .nav-brandline,
  .nav-brandline,
  .brand--top {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
  }
}

/* ============================================
   GALLERY SECTION - MOBILE INLINE
   ============================================ */

@media (max-width: 768px) {
  /* Gallery section - aligned with other sections */
  #gallery {
    padding-left: 16px;
    padding-right: 16px;
    padding-top: 20px;
    padding-bottom: 20px;
  }

  #gallery .container {
    padding-left: 0;
    padding-right: 0;
    margin-left: 0;
    margin-right: 0;
    width: 100%;
  }

  /* Override real-gallery styles for mobile */
  .real-gallery .gallery-item {
    padding: 0 !important;
    border: none !important;
    background: transparent !important;
    box-shadow: none !important;
    min-height: auto !important;
  }

  .real-gallery .gallery-item::before,
  .real-gallery .gallery-item::after {
    display: none !important;
    content: none !important;
  }

  .gallery-carousel-panel .carousel-center .gallery-item-overlay {
    position: absolute !important;
    transform: translate(-0.3cm, -0.3cm) !important;
    transform: translate(-0.3cm, -0.3cm) !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    padding: 20px !important;
    z-index: 10 !important;
    pointer-events: none !important;
    opacity: 1 !important;
    background: linear-gradient(180deg, rgba(0,0,0,0) 0%, rgba(0,0,0,0.75) 100%) !important;
  }

  .gallery-carousel-panel .carousel-center .gallery-item-overlay * {
    pointer-events: auto !important;
  }

  .real-gallery .gallery-item img {
    position: static !important;
    inset: auto !important;
    width: 100% !important;
    height: auto !important;
    background: transparent !important;
    border-radius: 0 !important;
  }

  /* Gallery heading - compact */
  #gallery .section-heading {
    text-align: center;
    margin-bottom: 12px;
    padding: 0;
  }

  #gallery .section-heading .eyebrow {
    padding: 0;
    margin: 0 0 4px 0;
    font-size: 0.75rem;
  }

  #gallery .section-heading h2 {
    padding: 0;
    margin: 0;
    font-size: 1.25rem;
    line-height: 1.2;
  }

  /* Gallery tabs wrapper */
  .gallery-tabs {
    width: 100%;
    overflow: visible;
  }

  /* Gallery tabs - two rows on portrait, one row on landscape */
  .gallery-tab-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: center;
    padding: 0 0 8px 0;
    margin: 0 0 12px 0;
    position: relative;
    

    z-index: 100;
    isolation: isolate;
  }

  .gallery-tab-buttons button {
    flex: 0 0 calc(50% - 3px);
    padding: 8px 12px !important;
    font-size: 0.8rem !important;
    white-space: nowrap;
    border-radius: 16px;
    text-align: center;
  }

  /* Landscape orientation - single row */
  @media (max-width: 1200px) and (orientation: landscape) {
    .gallery-tab-buttons {
      flex-wrap: nowrap;
      overflow-x: auto;
      overflow-y: hidden;
      -webkit-overflow-scrolling: touch;
      scroll-behavior: smooth;
      justify-content: flex-start;
      scrollbar-width: none;
      -ms-overflow-style: none;
    }

    .gallery-tab-buttons::-webkit-scrollbar {
      display: none;
    }

    .gallery-tab-buttons button {
      flex: 0 0 auto;
      min-width: auto;
    }
  }

  /* Gallery panels - vertical layout for mobile */
  .gallery-tab-panels {
    display: flex;
    flex-direction: column;
    gap: 0;
    width: 100%;
  }

  /* Single panel (category) - vertical stack */
  .gallery-carousel-panel {
    padding: 0 !important;
    margin: 0 !important;
    display: none !important;
    width: 100%;
    flex-direction: column !important;
    gap: 12px !important;
    position: relative;
    

    z-index: 1;
  }

  .gallery-carousel-panel[style*="display: grid"],
  .gallery-carousel-panel[style*="display: flex"] {
    display: flex !important;
    flex-direction: column !important;
    gap: 12px !important;
  }

  /* Main photo (center) - large and prominent */
  .gallery-carousel-panel .carousel-center {
    width: 100% !important;
    max-width: 100% !important;
    min-height: auto !important;
    height: auto !important;
    margin: 0 !important;
    transform: scale(1.0) !important;
    order: 0;
  }

  .gallery-carousel-panel .carousel-center {
    width: 100% !important;
    min-height: auto !important;
    height: auto !important;
    margin: 0 !important;
    padding: 0 !important;
    position: relative;
    cursor: pointer;
    box-shadow: 0 10px 40px rgba(96, 59, 39, 0.3);
  }

  .gallery-carousel-panel .carousel-center img {
    width: 100% !important;
    height: auto !important;
    max-height: 85vh !important;
    object-fit: contain !important;
    border-radius: 8px !important;
    display: block;
    background: transparent;
    position: static !important;
  }

  /* Side photos - smaller, dimmed, tucked under center */
  .gallery-carousel-panel .carousel-prev,
  .gallery-carousel-panel .carousel-next {
    display: none !important;
  }

  /* Expanded photos - horizontal swiper */
  .gallery-expanded-photos {
    display: none !important;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 0;
    margin: 0;
    padding: 0;

    z-index: -1;
    background: transparent;
    pointer-events: none;
    opacity: 0;
  }

  .gallery-expanded-photos.is-open {
    display: flex !important;
    height: 100vh !important;
    z-index: 999999 !important;
    pointer-events: auto !important;
    opacity: 1 !important;
  }

  /* Fullscreen on landscape orientation */
  @media (max-width: 1200px) and (orientation: landscape) {
    .gallery-expanded-photos {
      position: fixed;
      top: 0;
      left: 0;
      right: 0;
      bottom: 0;
      width: 100vw;
      height: 100vh;
      z-index: 9999;
      background: #000;
    }

    .gallery-expanded-item img {
      width: 100vw !important;
      height: 100vh !important;
      max-height: 100vh !important;
      object-fit: contain !important;
    }
  }

  /* Swiper container */
  .gallery-swiper-container {
    display: flex;
    height: auto;
    min-height: auto;
    transition: transform 0.3s ease-out;
    touch-action: pan-x;
    background: transparent;
    position: relative;
    

  }

  /* Close button */
  .gallery-close-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 40px;
    height: 40px;
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    border: none;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    z-index: 12;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  /* Navigation arrows */
  .gallery-nav-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    background: rgba(0, 0, 0, 0.5);
    color: #fff;
    border: none;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    z-index: 12;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
  }

  .gallery-nav-arrow:active {
    background: rgba(0, 0, 0, 0.8);
  }

  .gallery-nav-arrow.prev {
    left: 10px;
  }

  .gallery-nav-arrow.next {
    right: 10px;
  }

  .gallery-nav-arrow:disabled {
    opacity: 0.3;
    cursor: not-allowed;
  }

  /* Force hide carousel photos when expanded photos are open */
  .gallery-expanded-photos.is-open ~ .carousel-prev,
  .gallery-expanded-photos.is-open ~ .carousel-center,
  .gallery-expanded-photos.is-open ~ .carousel-next {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    height: 0 !important;
    overflow: hidden !important;
  }

  .gallery-expanded-item {
    flex: 0 0 100%;
    width: 100%;
    height: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    

    cursor: default;
    padding: 0 !important;
    margin: 0 !important;
    border: none !important;
    background: transparent !important;
    box-shadow: none !important;
    border-radius: 0 !important;
    min-height: auto !important;
    overflow: visible !important;
  }

  .gallery-expanded-item img {
    width: 100% !important;
    height: auto !important;
    max-height: none !important;
    display: block !important;
    border-radius: 0 !important;
    background: transparent !important;
    object-fit: contain !important;
    padding: 0 !important;
    margin: 0 !important;
    border: none !important;
    position: relative !important;
  }

  /* Collapse button */
  .gallery-collapse-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 12px 24px;
    background: #b07b3a;
    color: #fff;
    border: none;
    border-radius: 20px;
    font-size: 0.9rem;
    cursor: pointer;
    margin: 20px auto;
    transition: background 0.2s;
    align-self: center;
    position: relative;
    

    z-index: 2;
  }

  /* Collapse button - compact */
  .gallery-collapse-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 20px;
    background: #b07b3a;
    color: #fff;
    border: none;
    border-radius: 20px;
    font-size: 0.85rem;
    cursor: pointer;
    margin: 12px auto 0;
    transition: background 0.2s;
    align-self: center;
  }

  .gallery-collapse-btn:active {
    background: #9a6a2f;
  }

  /* Scroll to top button - don't overlap gallery */
  .scroll-top {
    bottom: 80px !important;
  }

  /* Grid gallery (if not carousel) */
  .gallery-grid:not(.gallery-carousel-panel),
  .real-gallery:not(.gallery-carousel-panel) {
    grid-template-columns: 1fr !important;
    gap: 16px !important;
  }

  .gallery-grid .gallery-item:not(.carousel-center):not(.carousel-prev):not(.carousel-next),
  .real-gallery .gallery-item:not(.carousel-center):not(.carousel-prev):not(.carousel-next) {
    min-height: auto !important;
  }

  .gallery-grid .gallery-item img,
  .real-gallery .gallery-item img {
    width: 100% !important;
    height: auto !important;
    border-radius: 12px !important;
  }
}

/* Smaller phones - even more compact */
@media (max-width: 480px) {
  #gallery {
    padding-top: 16px;
    padding-bottom: 16px;
  }

  #gallery .section-heading {
    margin-bottom: 10px;
  }

  #gallery .section-heading .eyebrow {
    font-size: 0.7rem;
    margin-bottom: 3px;
  }

  #gallery .section-heading h2 {
    font-size: 1.1rem;
  }

  .gallery-tab-buttons {
    padding: 0 10px 6px 10px;
    margin: 0 -10px 10px -10px;
    gap: 5px;
  }

  .gallery-tab-buttons button {
    padding: 5px 10px !important;
    font-size: 0.75rem !important;
    border-radius: 14px;
  }

  .gallery-carousel-panel .carousel-center {
    margin: 0 0 10px 0 !important;
  }

  .gallery-carousel-panel .carousel-center img {
    border-radius: 6px !important;
    height: 430px !important;
    min-height: 400px !important;
    max-height: 460px !important;
  }

  .gallery-expanded-photos {
    gap: 10px;
  }

  .gallery-expanded-photos .gallery-item img {
    border-radius: 6px !important;
    max-height: 45vh !important;
  }

  .gallery-collapse-btn {
    padding: 7px 16px;
    font-size: 0.8rem;
    margin: 10px auto 0;
  }
}

/* Very small phones - ultra compact (360x740 and similar) */
@media (max-width: 380px) {
  /* Prevent horizontal scroll */
  html, body {
    max-width: 100vw;
    overflow-x: hidden;
  }

  .container {
    width: 100%;
    max-width: 100%;
    padding-left: 8px;
    padding-right: 8px;
  }

  #gallery {
    padding-left: 8px;
    padding-right: 8px;
    padding-top: 12px;
    padding-bottom: 12px;
  }

  #gallery .container {
    padding-left: 0;
    padding-right: 0;
  }

  #gallery .section-heading {
    margin-bottom: 10px;
  }

  #gallery .section-heading .eyebrow {
    font-size: 0.7rem;
    margin-bottom: 3px;
    padding: 5px 10px;
  }

  #gallery .section-heading h2 {
    font-size: 1.1rem;
    line-height: 1.3;
  }

  /* Tab buttons - compact for 360px width */
  .gallery-tab-buttons {
    padding: 0 0 8px 0;
    margin: 0 0 12px 0;
    gap: 5px;
    max-width: 100%;
  }

  .gallery-tab-buttons button {
    padding: 6px 10px !important;
    font-size: 0.75rem !important;
    border-radius: 12px;
    min-height: 32px;
    flex: 0 0 calc(50% - 2.5px);
    max-width: calc(50% - 2.5px);
  }

  /* Carousel container */
  .mobile-carousel-container {
    width: 100% !important;
    max-width: 100% !important;
    margin: 12px 0 !important;
    padding: 0 !important;
  }

  .gallery-carousel-panel {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  .gallery-carousel-panel .carousel-center {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    border-radius: 16px !important;
  }

  .gallery-carousel-panel .carousel-center img {
    width: 100% !important;
    max-width: 100% !important;
    height: 430px !important;
    min-height: 400px !important;
    max-height: 460px !important;
    object-fit: cover !important;
    border-radius: 16px !important;
    display: block;
  }

  /* Expanded photos */
  .gallery-expanded-photos {
    gap: 8px;
  }

  .gallery-expanded-photos .gallery-item img {
    border-radius: 16px !important;
    max-height: 50vh !important;
  }

  .gallery-collapse-btn {
    padding: 8px 16px;
    font-size: 0.8rem;
    margin: 12px auto 0;
  }

  /* Navigation arrows - larger touch targets */
  .gallery-nav-arrow {
    width: 44px !important;
    height: 44px !important;
    font-size: 28px !important;
  }

  .gallery-nav-arrow.prev {
    left: 8px !important;
  }

  .gallery-nav-arrow.next {
    right: 8px !important;
  }
}

/* ============================================
   VIDEO SECTIONS
   ============================================ */

@media (max-width: 768px) {
  .video-feature-shell--single {
    padding: 0 !important;
  }

  .video-feature-card {
    margin-bottom: 20px;
  }

  .split-media-grid {
    grid-template-columns: 1fr !important;
    gap: 20px !important;
  }

  .media-copy-card {
    padding: 24px !important;
  }
}

/* ============================================
   REVIEWS SECTION - FIXED
   ============================================ */

@media (max-width: 768px) {
  .reviews-layout-grid {
    display: block !important;
  }

  .reviews-cards-grid {
    grid-template-columns: 1fr !important;
    gap: 16px !important;
    margin-bottom: 24px;
  }

  .review-card {
    padding: 20px !important;
  }

  .review-card p {
    font-size: 0.95rem;
    line-height: 1.6;
  }

  .review-card strong {
    font-size: 1rem;
  }

  /* Contact shell for reviews */
  .contact-shell {
    grid-template-columns: 1fr !important;
    gap: 24px !important;
    padding: 24px !important;
  }

  .contact-photo-wrapper {
    height: 250px !important;
    margin-top: 16px !important;
  }

  .form-card {
    padding: 24px !important;
  }
}

/* ============================================
   PRICING SECTION - FIXED
   ============================================ */

@media (max-width: 768px) {
  .pricing-enhanced-layout {
    grid-template-columns: 1fr !important;
    gap: 24px !important;
  }

  .pricing-visual {
    position: static !important;
  }

  .pricing-action-card {
    border-radius: 20px;
  }

  .pricing-action-image {
    height: 250px !important;
    object-fit: cover;
  }

  .pricing-cta {
    padding: 24px !important;
  }

  .pricing-table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .pricing-table {
    min-width: 100%;
  }

  .pricing-row {
    font-size: 0.9rem;
    padding: 12px 8px !important;
  }

  .pricing-row > div {
    padding: 8px !important;
  }
}

/* ============================================
   CONTACT FORM - FIXED
   ============================================ */

@media (max-width: 768px) {
  .contact-shell--simple {
    grid-template-columns: 1fr !important;
    gap: 24px !important;
    padding: 24px !important;
    border-radius: 20px;
  }

  .form-card {
    padding: 24px !important;
  }

  .form-card h3 {
    font-size: 1.3rem !important;
  }

  .form-card label {
    margin-bottom: 16px;
  }

  .form-card input,
  .form-card textarea,
  .form-card select {
    font-size: 16px !important; /* Prevents iOS zoom */
    padding: 12px !important;
    border-radius: 8px;
  }

  .form-card textarea {
    min-height: 120px;
  }

  .btn-primary {
    width: 100%;
    padding: 14px 24px !important;
    font-size: 1rem !important;
  }
}

/* ============================================
   SOSNICHOK SECTION
   ============================================ */

@media (max-width: 768px) {
  .section-heading {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 12px;
  }

  .section-heading img {
    width: 80px !important;
    height: auto;
  }

  .gallery-teaser-card {
    border-radius: 20px;
  }

  .gallery-teaser-cover {
    min-height: 200px !important;
    max-height: 250px !important;
  }

  .gallery-teaser-content {
    padding: 20px !important;
  }
}

/* ============================================
   FOOTER - FIXED
   ============================================ */

@media (max-width: 768px) {
  .footer,
  .contacts-footer {
    padding: 40px 16px !important;
  }

  .contacts-footer__intro {
    margin-bottom: 24px;
    text-align: center;
  }

  .contacts-links {
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: stretch;
  }

  .contact-link {
    display: flex !important;
    width: 100% !important;
    box-sizing: border-box !important;
    padding: 16px !important;
    font-size: 1rem !important;
    justify-content: flex-start !important;
    text-align: left;
  }

  .contact-link svg {
    width: 24px !important;
    height: 24px !important;
  }

  .contact-link.is-email {
    font-size: 0.9rem !important;
    word-break: break-all;
  }
}

/* ============================================
   MODAL / LIGHTBOX - FIXED
   ============================================ */

@media (max-width: 768px) {
  .lightbox {
    padding: 0;
  }

  .lightbox-card {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    border-radius: 0;
    padding: 0;
  }

  .lightbox-media {
    border-radius: 0;

    margin-bottom: 0;
  }

  .lightbox-image {
    max-height: 100vh !important;
    max-width: 100vw !important;
    width: 100% !important;
    height: auto !important;
    object-fit: contain !important;
  }

  .lightbox-nav {
    width: 50px !important;
    height: 50px !important;
    font-size: 40px !important;
    font-weight: 900 !important;
    background: transparent !important;
    color: white !important;
  }

  .lightbox-nav:hover {
    background: transparent !important;
    transform: translateY(-50%) scale(1) !important;
  }

  .lightbox-nav-prev {
    left: 8px !important;
  }

  .lightbox-nav-next {
    right: 8px !important;
  }

  .lightbox-video {
    max-height: 60vh !important;
  }

  .lightbox-close {
    top: 10px;
    right: 10px;
    width: 44px;
    height: 44px;
    font-size: 24px;
    z-index: 1002 !important;
  }

  .lightbox-title {
    font-size: 1.2rem !important;
  }

  .lightbox-desc {
    font-size: 0.95rem;
  }
}

/* ============================================
   BUTTONS & INTERACTIVE - FIXED
   ============================================ */

@media (max-width: 768px) {
  .btn {
    padding: 12px 24px !important;
    font-size: 1rem !important;
    border-radius: 8px;
    min-height: 44px; /* Touch target */
  }

  .btn-large {
    padding: 16px 32px !important;
    font-size: 1.1rem !important;
  }

  .btn-secondary {
    padding: 12px 24px !important;
  }

  /* Increase touch targets */
  button,
  a.btn,
  .clickable,
  [role="button"] {
    min-height: 44px;
    min-width: 44px;
  }

  /* Scroll to top button */
  .scroll-top {
    bottom: 20px !important;
    right: 20px !important;
    width: 48px !important;
    height: 48px !important;
    font-size: 20px !important;
  }
}

/* ============================================
   TYPOGRAPHY - MOBILE
   ============================================ */

@media (max-width: 768px) {
  h1 {
    font-size: clamp(2rem, 7vw, 2.5rem) !important;
    line-height: 1.2 !important;
  }

  h2 {
    font-size: clamp(1.6rem, 5vw, 2rem) !important;
    line-height: 1.3 !important;
  }

  h3 {
    font-size: clamp(1.3rem, 4vw, 1.6rem) !important;
    line-height: 1.4 !important;
  }

  h4 {
    font-size: 1.1rem !important;
  }

  p, li {
    font-size: 1rem;
    line-height: 1.7;
  }

  .lead {
    font-size: 1.1rem !important;
    line-height: 1.6;
  }

  .eyebrow {
    font-size: 0.85rem !important;
  }
}

@media (max-width: 480px) {
  h1 {
    font-size: clamp(1.8rem, 6vw, 2.2rem) !important;
  }

  h2 {
    font-size: clamp(1.4rem, 4.5vw, 1.8rem) !important;
  }

  p, li {
    font-size: 0.95rem;
  }
}

/* ============================================
   UTILITIES
   ============================================ */

@media (max-width: 768px) {
  .hide-mobile {
    display: none !important;
  }

  .show-mobile {
    display: block !important;
  }

  /* Prevent text selection on double-tap */
  * {
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0.1);
  }

  /* Better image rendering */
  img {
    max-width: 100%;
    height: auto;
  }

  /* Smooth scrolling */
  html {
    scroll-behavior: smooth;
  }
}

@media (max-width: 480px) {
  section {
    padding: 30px 0 !important;
  }

  .container {
    width: calc(100% - 24px);
    padding-left: 12px;
    padding-right: 12px;
  }
}

/* ============================================
   LANDSCAPE ORIENTATION FIXES
   ============================================ */

/* CRITICAL: Real mobile devices in landscape - use max-height to detect real phones */
@media (max-height: 600px) and (orientation: landscape) {
  .hero-top-grid--new {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 12px !important;
    align-items: stretch !important;
  }
}

@media (max-width: 1200px) and (orientation: landscape) {
  .hero-scene-shell {
    padding: 6px !important;
    margin-top: -0.15cm;
  }

  .hero-top-grid--new {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 12px !important;
    align-items: stretch !important;
  }

  .hero-poster-card {
    height: calc(430px + 1cm);
    min-height: calc(430px + 1cm);
    max-height: calc(430px + 1cm);
    width: 100%;
    aspect-ratio: auto;
    margin: 0;
    display: flex;
    flex-direction: column;
    padding: 14px;
    box-sizing: border-box;
  }

  .hero-poster-slides {
    height: 100%;
    inset: 0;
    flex: 1;
    border-radius: 20px;
    position: relative;
    
    overflow: hidden;




  }

  .hero-poster-frame:not(.is-active) {
    
    position: absolute;
    inset: 0;
    width: 100% !important;
    height: 100% !important;
    background-size: cover !important;
    background-position: center !important;
  }

  .hero-poster-frame.is-active {
    position: absolute !important;
    inset: 0 !important;
    width: 100% !important;
    height: 100% !important;
    background-size: cover !important;
    background-position: center !important;
    border-radius: 20px !important;
    overflow: hidden !important;
  }

  .hero-poster-slides img {
    object-fit: cover !important;
    height: 100% !important;
    width: 100% !important;
  }

  .hero-story-card {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 10px !important;

    font-size: 0.7rem;
    line-height: 1.2;
  }

  .hero-story-card .eyebrow {
    font-size: 0.6rem;
    margin-bottom: 2px;
  }

  .hero-story-card h2 {
    font-size: 1.4rem !important;
    margin: 0 0 2px 0;
    line-height: 1.1;
  }

  .hero-story-card p {
    font-size: 0.65rem;
    margin: 0 0 4px 0;
    line-height: 1.2;
  }

  .hero-story-card .badge-item {
    font-size: 0.65rem;
    padding: 2px 5px;
    margin: 1px;
  }

  .hero-story-card ul {
    margin: 3px 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 3px;
  }

  /* Hide ALL intro copy and actions from hero section in landscape */
  section#hero .hero-intro-copy,
  section#hero .hero-actions,
  section#hero .hero-intro-copy .hero-actions,
  .hero-scene-shell .hero-intro-copy,
  .hero-scene-shell .hero-actions,
  .hero-top-grid--new .hero-intro-copy,
  .hero-top-grid--new .hero-actions,
  .hero-story-card .hero-intro-copy,
  .hero-story-card .hero-actions,
  .hero-media-stack .hero-intro-copy,
  .hero-media-stack .hero-actions,
  .hero-intro-copy .hero-actions {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
  }

  /* Show ONLY in landscape wrapper */
  .landscape-intro-wrapper .hero-intro-copy,
  .landscape-intro-wrapper .hero-actions {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    pointer-events: auto !important;
  }

  .landscape-intro-wrapper .hero-actions {
    display: flex !important;
  }

  /* Show moved intro copy and actions before formats carousel */
  .landscape-intro-wrapper {
    display: block !important;
    margin-bottom: 12px;
    margin-top: -1.5cm;
    padding: 10px;
    background: rgba(255, 250, 244, 0.5);
    border-radius: 12px;
    text-align: center;
  }

  .landscape-intro-wrapper .hero-intro-copy {
    display: block !important;
    margin-bottom: 8px;
    text-align: center;
  }

  .landscape-intro-wrapper .hero-intro-copy .eyebrow {
    font-size: 0.43rem;
  }

  .landscape-intro-wrapper .hero-intro-copy .hero-title {
    font-size: 1.4rem !important;
    line-height: 1.2;
    margin: 4px 0;
  }

  .landscape-intro-wrapper .hero-intro-copy .lead {
    font-size: 0.47rem;
    line-height: 1.3;
    margin: 4px 0;
    text-align: center !important;
    margin-left: 2cm;
  }

  .landscape-intro-wrapper .hero-actions {
    display: flex !important;
    flex-direction: row;
    gap: 8px;
  }

  .landscape-intro-wrapper .hero-actions .btn {
    padding: 8px 16px;
    font-size: 0.7rem;
    width: auto;
  }

  .container {
    width: calc(100% - 12px);
    padding-left: 6px;
    padding-right: 6px;
  }

  .video-feature-card {
    max-height: 70vh;
  }

  .lightbox {
    padding: 0 !important;
    background: rgba(20,14,11,0.8) !important;
  }

  .lightbox-card {
    border-radius: 0 !important;
    padding: 0 !important;
    background: transparent !important;
    max-width: 85vw !important;
    margin: 0 auto !important;
  }

  .lightbox-media {
    border-radius: 0 !important;
    margin-bottom: 0 !important;
    position: relative !important;
    width: 100% !important;
    height: 100vh !important;
    background: transparent !important;
  }

  .lightbox-image,
  .lightbox-video {
    max-height: 100vh !important;
    max-width: 100% !important;
    width: 100% !important;
    height: 100vh !important;
    object-fit: contain !important;
    background: transparent !important;
  }

  .lightbox-nav {
    position: absolute !important;
    transform: translate(-0.3cm, -0.3cm) !important;
    transform: translate(-0.3cm, -0.3cm) !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
  }

  .lightbox-nav-prev {
    left: 12px !important;
  }

  .lightbox-nav-next {
    right: 12px !important;
  }

  .lightbox-close {
    right: 16px !important;
    left: auto !important;
  }

  /* Adjust gallery overlay button position for landscape */
  .gallery-carousel-panel .carousel-center .gallery-item-overlay {
    display: grid !important;
    align-items: end !important;
    padding-bottom: 15px !important;
  }

  .gallery-carousel-panel .carousel-center .gallery-item-open-btn {
    margin-bottom: 0 !important;
  }
}

/* ============================================
   TOUCH IMPROVEMENTS
   ============================================ */

@media (max-width: 768px) {
  /* Better touch feedback */
  button:active,
  .btn:active,
  a:active {
    transform: scale(0.98);
    transition: transform 0.1s;
  }

  /* Prevent double-tap zoom on buttons */
  button,
  .btn,
  [role="button"] {
    touch-action: manipulation;
  }

  /* Better scrolling */
  .gallery-carousel-panel,
  .formats-slider,
  .pricing-table-wrapper {
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
  }
}

/* ============================================
   PORTRAIT ORIENTATION SPECIFIC
   ============================================ */

@media (max-width: 768px) and (orientation: portrait) {
  .hero-actions .btn-primary {
    transform: translateX(-0.2cm) !important;
  }

  .lightbox-close {
    top: 140px !important;
  }

  .hero-actions .btn-secondary {
    transform: translateX(-0.2cm) !important;
  }

  .formats-slider {
    grid-auto-columns: 100% !important;
  }

  /* Shift "Свадьбы" button right by 0.1cm */
  .gallery-tab-buttons button:first-child {
    margin-left: 0.1cm !important;
  }

  /* Reduce spacing between gallery and video-events section */
  #video-events {
    padding-top: 0 !important;
    margin-top: 20px !important;
  }

  /* Match gallery photo height with video height (70vh) */
  .gallery-carousel-panel .carousel-center {
    min-height: auto !important;
    max-height: none !important;
    height: auto !important;
    border-radius: 20px !important;
    position: relative !important;
    padding: 0 !important;
    margin: 0 !important;
    transform: none !important;
    overflow: hidden !important;
    display: block !important;
    line-height: 0 !important;
  }

  .gallery-carousel-panel .carousel-center img {
    min-height: 400px !important;
    max-height: 460px !important;
    height: 430px !important;
    width: 100% !important;
    border-radius: 20px !important;
    object-fit: cover !important;
    display: block !important;
    padding: 0 !important;
    margin: 0 !important;
  }

  /* Hide overlay, button and title in mobile */
  .gallery-carousel-panel .carousel-center .gallery-item-overlay {
    display: none !important;
  }

  /* Gallery structure for mobile portrait */
  #gallery .gallery-tabs {
    display: flex !important;
    flex-direction: column !important;
    overflow-anchor: none !important;
  }

  .gallery-tab-buttons {
    order: 1 !important;
    overflow-anchor: none !important;
  }

  /* Fixed carousel container - always after tab buttons */
  .mobile-carousel-container {
    order: 2 !important;
    width: 100% !important;
    margin: 4px 0 12px 0 !important;
    position: relative !important;
    z-index: 1 !important;
  }

  .gallery-tab-panels {
    order: 2 !important;
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
    overflow-anchor: none !important;
  }

  .gallery-carousel-panel {
    margin: 0 !important;
    padding: 0 !important;
    border-radius: 20px !important;
    overflow: hidden !important;
    overflow-anchor: none !important;
  }

  #gallery {
    padding-bottom: 20px !important;
  }

  /* Gallery expanded photos - fullscreen lightbox for mobile portrait */
  .gallery-expanded-photos.is-open {
    position: fixed !important;
    inset: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    background: rgba(0, 0, 0, 0.95) !important;
    z-index: 999999 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    overflow: hidden !important;
  }

  .gallery-expanded-photos.is-open .gallery-swiper-container {
    width: 100% !important;
    height: 100% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
  }

  .gallery-expanded-photos.is-open .gallery-expanded-item {
    width: 100% !important;
    height: 100% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex-shrink: 0 !important;
  }

  .gallery-expanded-photos.is-open .gallery-expanded-item img {
    width: 100% !important;
    height: 100% !important;
    max-width: 100vw !important;
    max-height: 100vh !important;
    object-fit: contain !important;
    border-radius: 0 !important;
  }

  /* Close button for expanded photos */
  .gallery-expanded-photos .gallery-close-btn {
    position: fixed !important;
    top: 16px !important;
    right: 16px !important;
    width: 48px !important;
    height: 48px !important;
    background: rgba(0, 0, 0, 0.7) !important;
    color: #fff !important;
    border: 2px solid rgba(255, 255, 255, 0.8) !important;
    border-radius: 50% !important;
    font-size: 24px !important;
    z-index: 1000000 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
  }

  /* Navigation arrows for expanded photos */
  .gallery-expanded-photos .gallery-nav-arrow {
    position: fixed !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    width: 48px !important;
    height: 48px !important;
    background: rgba(0, 0, 0, 0.7) !important;
    color: #fff !important;
    border: 2px solid rgba(255, 255, 255, 0.8) !important;
    border-radius: 50% !important;
    font-size: 32px !important;
    z-index: 1000000 !important;
  }

  .gallery-expanded-photos .gallery-nav-arrow.prev {
    left: 16px !important;
  }

  .gallery-expanded-photos .gallery-nav-arrow.next {
    right: 16px !important;
  }

  /* Prevent body scroll when expanded photos are open */
  body:has(.gallery-expanded-photos.is-open) {
    overflow: hidden !important;
    position: fixed !important;
    width: 100% !important;
  }
}

/* Force landscape styles for testing - add ?test=landscape to URL */
html.test-landscape .hero-poster-card,
html.test-landscape .hero-poster-slides,
html.test-landscape .hero-poster-frame {
  /* Landscape hero styles */
}

/* Force landscape styles for testing - use ?test=landscape */
html.force-landscape .hero-poster-frame:not(.is-active),
html.force-landscape .hero-poster-frame {
  inset: 0 !important;
  position: absolute !important;
  right: 0 !important;
  bottom: 0 !important;
  width: 100% !important;
  height: 100% !important;
  background-size: 100% 100% !important;
  background-position: center !important;
  border-radius: 20px !important;
  overflow: hidden !important;
}

html.force-landscape .hero-poster-frame.is-active {
  inset: 0 !important;
  position: absolute !important;
  width: 100% !important;
  height: 100% !important;
  background-size: 100% 100% !important;
  background-position: center !important;
  border-radius: 20px !important;
  overflow: hidden !important;
}

/* Force landscape styles on narrow screens regardless of orientation */
@media (max-width: 600px) {
  .hero-poster-slides {
    inset: 0 !important;
    height: 100% !important;
    border-radius: 20px !important;
    position: relative !important;
  }
  .hero-poster-frame {
    inset: 0 !important;
    width: 100% !important;
    height: 100% !important;
    background-size: 100% 100% !important;
    background-position: center !important;
    position: absolute !important;
    border-radius: inherit !important;
    overflow: hidden !important;
  }
}


/* Landscape styles - override base styles */
@media (max-width: 1000px) and (orientation: landscape) {
  .hero-poster-card {
    min-height: 50vh !important;
    height: calc(430px + 0.5cm) !important;
    max-height: calc(430px + 0.5cm) !important;
    padding: 10px !important;
    border-radius: 20px !important;
  }
  .hero-poster-slides {
    inset: 0 !important;
    height: 100% !important;
    border-radius: 20px !important;
    position: relative !important;
    overflow: hidden !important;
  }
  .hero-poster-frame {
    inset: 0 !important;
    width: 100% !important;
    height: 100% !important;
    background-size: 100% 100% !important;
    background-position: center !important;
    position: absolute !important;
    border-radius: inherit !important;
    overflow: hidden !important;
  }
}

.hero-poster-slides {
}

/* FORCE LANDSCAPE MOBILE STYLES - highest priority */
@media (max-width: 1000px) and (orientation: landscape) {
  html body section#hero .hero-scene-shell .hero-top-grid--new .hero-media-stack .hero-photo-card.hero-poster-card,
  .hero-poster-card,
  section#hero .hero-poster-card {
    min-height: 50vh !important;
    height: calc(430px + 0.5cm) !important;
    max-height: calc(430px + 0.5cm) !important;
    padding: 10px !important;
    border-radius: 20px !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  html body section#hero .hero-scene-shell .hero-top-grid--new .hero-media-stack .hero-photo-card.hero-poster-card .hero-poster-slides,
  .hero-poster-slides {
    inset: 0 !important;
    height: 100% !important;
    width: 100% !important;
    border-radius: 20px !important;
    position: relative !important;
    overflow: hidden !important;
    margin: 0 !important;
    padding: 0 !important;
    display: block !important;
  }
  
  html body section#hero .hero-scene-shell .hero-top-grid--new .hero-media-stack .hero-photo-card.hero-poster-card .hero-poster-slides .hero-poster-frame,
  .hero-poster-frame {
    inset: 0 !important;
    width: 100% !important;
    height: 100% !important;
    background-size: 100% 100% !important;
    background-position: center !important;
    position: absolute !important;
    border-radius: inherit !important;
    overflow: hidden !important;
    margin: 0 !important;
    padding: 0 !important;
  }
}

/* TEST GREEN BG - removed */
@media (max-width: 1000px) and (orientation: landscape) { .hero { background: transparent !important; } }

/* FULLSCREEN LANDSCAPE MOBILE - ENHANCED */
@media (max-width: 1000px) and (orientation: landscape) {
  .hero-scene-shell {
    padding: 6px !important;
    min-height: 100vh !important;
    height: 100vh !important;
  }
  .hero-top-grid--new {
    grid-template-columns: 1fr 1fr !important;
    height: 100vh !important;
    align-items: stretch !important;
  }
  .hero-media-stack {
    height: 100% !important;
    display: flex !important;
    flex-direction: column !important;
  }
  .hero-poster-card {
    flex: 1 !important;
    height: 100% !important;
    min-height: 0 !important;
    max-height: none !important;
    border-radius: 20px !important;
    padding: 8px !important;
  }
  .hero-poster-slides {
    flex: 1 !important;
    height: 100% !important;
    min-height: 0 !important;
    border-radius: 20px !important;
    inset: 0 !important;
  }
  .hero-poster-frame {
    inset: 0 !important;
    width: 100% !important;
    height: 100% !important;
    background-size: 100% 100% !important;
    background-position: center !important;
    border-radius: inherit !important;
  }
}

/* ENHANCED FULLSCREEN LANDSCAPE - override everything */
@media (max-width: 1000px) and (orientation: landscape) {
  html, body {
    height: 100% !important;
    overflow: hidden !important;
  }
  
  .hero {
    min-height: 100vh !important;
    height: 100vh !important;
    padding: 20px 8px 8px 8px !important;
    box-sizing: border-box !important;
    display: flex !important;
    flex-direction: column !important;
  }
  
  .hero-scene-shell {
    flex: 1 !important;
    display: flex !important;
    flex-direction: column !important;
    padding: 6px !important;
    min-height: 0 !important;
    height: 100% !important;
    max-height: none !important;
  }
  
  .hero-top-grid--new {
    flex: 1 !important;
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 12px !important;
    min-height: 0 !important;
    height: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  .hero-media-stack {
    display: flex !important;
    flex-direction: column !important;
    min-height: 0 !important;
    height: 100% !important;
    padding: 8px !important;
    box-sizing: border-box !important;
  }
  
  .hero-photo-card.hero-poster-card,
  .hero-poster-card {
    display: flex !important;
    flex-direction: column !important;
    flex: 1 !important;
    min-height: 0 !important;
    height: auto !important;
    max-height: none !important;
    border-radius: 20px !important;
    padding: 8px !important;
    box-sizing: border-box !important;
    margin: 0 !important;
  }
  
  .hero-poster-slides {
    flex: 1 !important;
    display: flex !important;
    min-height: 0 !important;
    height: auto !important;
    border-radius: 16px !important;
    position: relative !important;
    overflow: hidden !important;
    margin: 0 !important;
    padding: 0 !important;
    inset: 0 !important;
  }
  
  .hero-poster-frame {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100% !important;
    height: 100% !important;
    background-size: 100% 100% !important;
    background-position: center !important;
    border-radius: inherit !important;
  }
}

/* Allow scrolling in landscape */
@media (max-width: 1000px) and (orientation: landscape) {
  html, body {
    overflow: auto !important;
    height: auto !important;
  }
  .hero {
    min-height: auto !important;
    height: auto !important;
    overflow: visible !important;
  }
  .hero-scene-shell {
    min-height: auto !important;
    height: auto !important;
    overflow: visible !important;
  }
}

/* Reviews in landscape - fit in viewport */
@media (min-width: 500px) {
  #reviews .reviews-layout-grid {
    display: grid !important;
  }
  
  #reviews .reviews-cards {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 15px !important;
  }
  
  #reviews .review-card {
    padding: 15px !important;
  }
  
  #reviews .review-card p {
    font-size: 0.9rem !important;
    line-height: 1.4 !important;
  }
  
  #reviews .review-card strong {
    font-size: 0.9rem !important;
  }
}

/* Landscape mode - 2 columns for reviews */
@media (max-width: 768px) and (orientation: landscape) {
  .reviews-layout-grid {
    display: grid !important;
  }

  .reviews-cards-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 12px !important;
  }

  .review-card {
    padding: 12px !important;
  }

  .review-card p {
    font-size: 0.85rem !important;
    line-height: 1.3 !important;
    word-wrap: break-word !important;
  }

  .review-card strong {
    font-size: 0.85rem !important;
  }
  
  /* Prevent horizontal overflow */
  .reviews-cards-grid, .review-card {
    max-width: 100% !important;
    overflow-x: hidden !important;
  }
}

/* Hero story card rounded corners */
.hero-story-card {
  border-radius: 20px !important;
  -webkit-border-radius: 20px !important;
}

/* =========================================================================
   MOBILE LANDSCAPE FIXES
   For horizontal phones with limited height
   ========================================================================= */
@media screen and (max-height: 600px) {
  /* 1. Навигация: полностью скрываем шапку в горизонтальном режиме, чтобы освободить весь экран для контента! */
  .site-header { display: none !important; }
  
  /* 2. Отступы: экономим вертикальное пространство */
  .section, .container { padding-top: 15px !important; padding-bottom: 15px !important; }
  .section-heading { margin-bottom: 15px !important; }
  
  /* 3. Главный экран (Hero): ограничиваем высоту огромного фото */
  .hero-poster-card, .hero-poster-slides img { max-height: 75vh !important; min-height: 0 !important; }
  .hero-poster-card { height: 75vh !important; }

  /* 4. Видео: ограничиваем высоту, чтобы видео помещалось целиком */
  .video-feature-card, .hero-video-shell, .hero-video, .video-poster-layer, .video-poster-layer img { max-height: 80vh !important; width: auto !important; margin: 0 auto; }

  /* 5. Блок Чем я полезен (длинный список): делаем 2 колонки, используем columns для текста */
  .help-grid ul.bullet-list, .about-grid ul.bullet-list { display: block !important; column-count: 2 !important; column-gap: 20px !important; }
  .help-grid ul.bullet-list li, .about-grid ul.bullet-list li { break-inside: avoid; page-break-inside: avoid; margin-bottom: 10px !important; }
  
  /* 6. Карточки (Форматы, Как это работает): заставляем их использовать ширину */
  .workflow-list { display: grid !important; grid-template-columns: 1fr 1fr !important; gap: 15px !important; align-items: start !important; }
  .workflow-step { min-width: 0 !important; }

  /* 7. Формы: ограничиваем высоту фото рядом с формой */
  .contact-photo-wrapper, .contact-photo-wrapper img { max-height: 45vh !important; }
}

/* =========================================================================
   TOUCH DEVICE OPTIMIZATIONS (Merged from touch.css)
   ========================================================================= */
* {
  -webkit-tap-highlight-color: rgba(0, 0, 0, 0.1);
}

a, button, input, textarea, select {
  -webkit-tap-highlight-color: rgba(176, 123, 58, 0.3);
}

.scroll-container, .overflow-scroll {
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
}

@media (max-width: 768px) {
  a:not(.no-touch-target),
  button:not(.no-touch-target),
  .clickable:not(.no-touch-target) {
    min-height: 44px;
    min-width: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .btn + .btn, a + a, button + button {
    margin-left: 8px;
  }

  button, .btn, input[type="submit"], input[type="button"] {
    touch-action: manipulation;
  }

  select {
    min-height: 44px;
    padding: 12px;
    font-size: 16px;
  }

  .carousel, .slider, .gallery-carousel-panel {
    touch-action: pan-x pan-y;
    -webkit-overflow-scrolling: touch;
  }

  .modal-close, .lightbox-close {
    min-width: 44px;
    min-height: 44px;
    font-size: 24px;
  }

  img {
    touch-action: manipulation;
  }
}

/* iOS Specifics */
@supports (-webkit-touch-callout: none) {
  input[type="text"], input[type="email"], input[type="password"], input[type="number"], input[type="tel"], input[type="url"], textarea, select {
    font-size: 16px !important;
  }
  button, input[type="submit"], input[type="button"] {
    -webkit-appearance: none;
    appearance: none;
  }
  select {
    -webkit-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%232b1612' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
  }
}

/* Android Specifics */
@media (max-width: 768px) {
  select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%232b1612' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
  }
  input, textarea {
    -webkit-appearance: none;
    appearance: none;
  }
}

/* =========================================================================
   EXCLUSIVE BREAKPOINTS OVERRULES (PREVENTS COLLISION)
   ========================================================================= */

/* -------------------------------------------------------------------------
   📱 SECTION 1: EXCLUSIVE MOBILE PORTRAIT (Вертикальный Телефон)
   Разрешение: до 480px по ширине (iPhone, Android в портретной ориентации)
   ------------------------------------------------------------------------- */
@media screen and (max-width: 768px) and (orientation: portrait) {
    /* ==========================================
       1. Предотвращение сдвигов и горизонтального скролла
       ========================================== */
    html, body {
      overflow-x: hidden !important;
      width: 100% !important;
      max-width: 100vw !important;
    }

    /* Заставляем контейнеры быть резиновыми и не выходить за экран */
    .container {
      width: 100% !important;
      max-width: 100% !important;
      padding-left: 12px !important;
      padding-right: 12px !important;
      box-sizing: border-box !important;
    }

    .hero-scene-shell {
      width: 100% !important;
      max-width: 100% !important;
      padding: 16px 12px !important;
      box-sizing: border-box !important;
      border-radius: 24px !important;
    }

    /* ==========================================
       2. Фикс главного фото (Hero): центрирование на любых экранах (от S24 до S25 Ultra)
       ========================================== */
    .hero-poster-card {
      margin-left: auto !important;
      margin-right: auto !important;
      width: 100% !important;
      max-width: 100% !important;
      height: 470px !important;
      min-height: 470px !important;
      max-height: 470px !important;
      box-sizing: border-box !important;
    }

    .hero-poster-frame {
      background-size: cover !important;
      background-position: center !important;
    }

    .hero-media-stack {
      width: 100% !important;
      max-width: 100% !important;
      display: flex !important;
      justify-content: center !important;
      align-items: center !important;
    }

    .hero-top-grid--new {
      width: 100% !important;
      max-width: 100% !important;
      display: flex !important;
      flex-direction: column !important;
      align-items: center !important;
      justify-content: center !important;
      gap: 16px !important;
    }

    /* ==========================================
       3. Фикс карточки текста и кнопок (Hero): центрирование и сжатие
       ========================================== */
    .hero-story-card {
      width: 100% !important;
      max-width: 100% !important;
      box-sizing: border-box !important;
      padding: 16px !important;
      margin: 0 auto !important;
      text-align: center !important;
    }

    /* Центрируем значки (badges) */
    .hero-story-badges {
      display: flex !important;
      flex-wrap: wrap !important;
      justify-content: center !important;
      align-items: center !important;
      gap: 8px !important;
      width: 100% !important;
    }

    .hero-story-badges .badge-item {
      width: auto !important;
      margin: 0 !important;
      justify-content: center !important;
    }

    /* Центрируем кнопки на 100% ширины */
    .hero-actions {
      display: flex !important;
      flex-direction: column !important;
      align-items: center !important;
      justify-content: center !important;
      gap: 10px !important;
      width: 100% !important;
      margin: 16px 0 0 0 !important;
    }

    .hero-actions .btn {
      width: 100% !important;
      max-width: 100% !important;
      margin: 0 !important;
      text-align: center !important;
      box-sizing: border-box !important;
    }

    /* Уменьшим шапку, чтобы элементы на 360px (S24) не выталкивали друг друга */
    .site-header {
      width: 100% !important;
      box-sizing: border-box !important;
    }

    /* ==========================================
       4. Настройка аккуратного верхнего меню
       На мобильном портрете возвращаем прежнее рабочее меню (боковую панель).
       Скрываем дублирующее верхнее десктопное меню.
       ========================================== */
    .site-header {
      display: block !important;
      padding: 0 !important;
      background: transparent !important;
      border: none !important;
      width: 100% !important;
      box-sizing: border-box !important;
    }

    .site-header .nav {
      display: none !important;
    }

    .site-header .nav-brandline {
      display: block !important;
      padding: 16px 70px 0 16px !important;
      background: transparent !important;
      width: 100% !important;
      box-sizing: border-box !important;
    }

    .mobile-menu-toggle {
      display: flex !important;
      visibility: visible !important;
      opacity: 1 !important;
      pointer-events: auto !important;
      position: fixed !important;
      top: 16px !important;
      right: 16px !important;
      z-index: 1001 !important;
    }
    
    .mobile-sidebar,
    .mobile-sidebar-overlay {
      visibility: visible !important;
      opacity: 1 !important;
    }


    /* ==========================================
       5. Фикс блока ОТЗЫВЫ: предотвращение сдвигов вправо и наложения слоев
       ========================================== */
    .reviews-layout-grid {
      display: block !important;
      width: 100% !important;
      max-width: 100% !important;
      box-sizing: border-box !important;
    }

    .reviews-cards-grid {
      display: flex !important;
      flex-direction: column !important;
      gap: 16px !important;
      width: 100% !important;
      max-width: 100% !important;
      padding: 0 !important;
      margin: 0 !important;
      box-sizing: border-box !important;
    }

    .reviews-cards-grid .review-card {
      width: 100% !important;
      max-width: 100% !important;
      min-height: auto !important; /* сбрасываем жесткую высоту */
      padding: 20px !important;
      margin: 0 auto !important;
      box-sizing: border-box !important;
      left: 0 !important;
      right: 0 !important;
      transform: none !important;
      border: 1px solid rgba(200, 149, 77, 0.2) !important;
      box-shadow: 0 4px 16px rgba(96, 59, 39, 0.08) !important;
      display: flex !important;
      flex-direction: column !important;
      gap: 12px !important;
    }

    .reviews-cards-grid .review-card img {
      width: 100% !important;
      max-width: 150px !important;
      height: auto !important;
      border-radius: 12px !important;
      margin: 0 auto 8px auto !important;
      display: block !important;
    }

    .reviews-cards-grid .review-card p {
      font-size: 0.95rem !important;
      line-height: 1.5 !important;
      text-align: left !important;
      margin: 0 !important;
    }

    .reviews-cards-grid .review-card strong {
      font-size: 0.9rem !important;
      margin-top: 4px !important;
    }

    /* ==========================================
       6. Фикс таблицы цен (Стоимость услуг): все в одну строку без переносов
       ========================================== */
    .pricing-enhanced-layout {
      display: flex !important;
      flex-direction: column !important;
      gap: 20px !important;
      width: 100% !important;
      max-width: 100% !important;
    }

    .pricing-table-wrapper {
      width: 100% !important;
      max-width: 100% !important;
      overflow-x: visible !important;
      box-sizing: border-box !important;
    }
    
    .pricing-table {
      width: 100% !important;
      min-width: 100% !important;
      border-radius: 16px !important;
      box-sizing: border-box !important;
    }

    .pricing-row {
      display: grid !important;
      grid-template-areas: 
        "service price"
        "description price" !important;
      grid-template-columns: 1fr auto !important;
      gap: 4px 16px !important;
      padding: 16px 12px !important;
      border-bottom: 1px solid rgba(176, 123, 58, 0.15) !important;
      box-sizing: border-box !important;
      width: 100% !important;
    }

    .pricing-row--head {
      display: grid !important;
      grid-template-areas: 
        "service price"
        "description price" !important;
      grid-template-columns: 1fr auto !important;
      gap: 4px 16px !important;
      padding: 12px 12px !important;
      box-sizing: border-box !important;
      width: 100% !important;
      background: linear-gradient(90deg, rgba(43,22,18,.94), rgba(106,67,54,.86)) !important;
      color: var(--cream) !important;
      text-transform: uppercase !important;
      letter-spacing: .08em !important;
      font-size: 0.72rem !important;
      border-radius: 16px 16px 0 0 !important;
      border-bottom: none !important;
    }

    html body .pricing-table .pricing-row--head > div:nth-child(1) {
      grid-area: service !important;
      font-weight: 700 !important;
      color: var(--cream) !important;
      text-align: left !important;
    }

    html body .pricing-table .pricing-row--head > div:nth-child(2) {
      grid-area: description !important;
      font-weight: 700 !important;
      color: rgba(255, 255, 255, 0.7) !important;
      text-align: left !important;
    }

    html body .pricing-table .pricing-row--head > div:nth-child(3) {
      grid-area: price !important;
      font-weight: 700 !important;
      color: var(--cream) !important;
      text-align: right !important;
      align-self: center !important;
    }

    .pricing-row > div:first-child {
      grid-area: service !important;
      font-weight: 700 !important;
      font-size: 0.95rem !important;
      color: #2b1612 !important;
      text-align: left !important;
      white-space: normal !important;
    }
    
    .pricing-row > .pricing-description {
      grid-area: description !important;
      font-weight: 500 !important;
      font-size: 0.8rem !important;
      color: rgba(43, 22, 18, 0.7) !important;
      text-align: left !important;
      white-space: normal !important;
      margin: 0 !important;
      padding: 0 !important;
    }
    
    .pricing-row > .pricing-price {
      grid-area: price !important;
      font-weight: 700 !important;
      font-size: 1.05rem !important;
      color: #2b1612 !important;
      text-align: right !important;
      align-self: center !important;
      white-space: nowrap !important;
    }

    /* ==========================================
       7. Фикс блока ФОТО (Галерея): увеличение высоты главного фото карусели
       Устраняем пустые пространства и скрываем выглядывающие фоновые слои.
       ========================================== */
    .gallery-carousel-panel {
      min-height: 430px !important;
      height: 430px !important;
      padding: 0 !important;
      margin: 4px 0 0 0 !important;
      background: transparent !important;
      border: none !important;
      box-shadow: none !important;
    }

    .gallery-carousel-panel .gallery-item {
      box-sizing: border-box !important;
      background: transparent !important;
      border: none !important;
      box-shadow: none !important;
      padding: 0 !important;
    }

    /* Главное активное фото по центру делаем аккуратно выше */
    .gallery-carousel-panel .carousel-center {
      min-height: 430px !important;
      height: 430px !important;
      background: transparent !important;
      border: none !important;
      box-shadow: 0 20px 60px rgba(96, 59, 39, 0.35) !important;
    }

    .gallery-carousel-panel .carousel-center img {
      min-height: 430px !important;
      height: 430px !important;
      background: transparent !important;
      border-radius: 20px !important;
      object-fit: cover !important;
    }

    /* Боковые слайды оставляем пропорциональными, чтобы не ломать 3D-сетку */
    .gallery-carousel-panel .carousel-prev,
    .gallery-carousel-panel .carousel-next {
      min-height: 350px !important;
      height: 350px !important;
      background: transparent !important;
      border: none !important;
      box-shadow: none !important;
    }
}

/* -------------------------------------------------------------------------
   📱 SECTION 2: EXCLUSIVE MOBILE LANDSCAPE (Горизонтальный Телефон)
   Разрешение: до 960px ширины при высоте до 600px
   ------------------------------------------------------------------------- */
@media screen and (orientation: landscape) and (max-height: 600px), screen and (min-width: 481px) and (max-width: 1024px) {
  /* 1. Восстановление гамбургер-меню и шапки на всех разрешениях */
  .site-header {
    display: block !important;
    padding: 0 !important;
    background: transparent !important;
    border: none !important;
    width: 100% !important;
    box-sizing: border-box !important;
    position: relative !important;
    z-index: 1000 !important;
  }
  .site-header .nav-brandline,
  .nav-brandline {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    padding: 16px 70px 0 28px !important;
    background: transparent !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }
  .brand--top,
  .brand {
    display: inline-block !important;
    visibility: visible !important;
    opacity: 1 !important;
    font-family: 'Futura PT', Futura, sans-serif !important;
    font-size: 1.05rem !important; /* Ровно такой же размер, как в вертикальной версии! */
    font-weight: 880 !important;
    letter-spacing: 0.09em !important;
    color: #140c0a !important;
  }
  .site-header .nav {
    display: none !important;
  }

  /* Идентичная стилизация гамбургер-кнопки на всех альбомных телефонах */
  .mobile-menu-toggle {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    pointer-events: auto !important;
    position: fixed !important;
    top: 16px !important;
    right: 16px !important;
    z-index: 100001 !important;
    width: 50px !important;
    height: 50px !important;
    background: rgba(255, 250, 244, 0.95) !important;
    border: 2px solid rgba(176, 123, 58, 0.3) !important;
    border-radius: 8px !important;
    color: #2b1612 !important;
    font-size: 24px !important;
    cursor: pointer !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2) !important;
    align-items: center !important;
    justify-content: center !important;
    transition: all 0.3s !important;
  }
  .mobile-menu-toggle:active {
    transform: scale(0.95) !important;
  }

  /* Идентичная стилизация сайдбара и оверлея на всех альбомных телефонах */
  .mobile-sidebar {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    pointer-events: auto !important;
    position: fixed !important;
    top: 0 !important;
    left: -300px !important;
    width: 280px !important;
    height: 100% !important;
    max-height: 100% !important;
    background: linear-gradient(180deg, #fffaf4 0%, #f5ede3 100%) !important;
    z-index: 100000 !important;
    transition: left 0.3s ease !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.3) !important;
  }
  .mobile-sidebar.is-open {
    left: 0 !important;
  }

  /* Стилизация внутренних элементов меню в альбомной версии */
  .mobile-sidebar-header {
    padding: 20px 20px 20px 32px !important;
    border-bottom: 2px solid rgba(176, 123, 58, 0.2) !important;
    background: rgba(176, 123, 58, 0.08) !important;
  }
  .mobile-sidebar-header h2 {
    margin: 0 !important;
    font-size: 1.3rem !important;
    color: #2b1612 !important;
    font-weight: 700 !important;
  }
  .mobile-sidebar-header p {
    margin: 4px 0 0 !important;
    font-size: 0.85rem !important;
    color: #b07b3a !important;
    text-transform: uppercase !important;
    letter-spacing: 0.1em !important;
  }
  .mobile-sidebar-nav {
    display: flex !important;
    flex-direction: column !important;
    padding: 5px 0 !important;
  }
  .mobile-sidebar-nav a {
    display: block !important;
    width: 100% !important;
    padding: 5px 20px !important;
    color: rgba(43, 22, 18, 0.85) !important;
    text-decoration: none !important;
    font-size: 1.05rem !important;
    font-weight: 600 !important;
    transition: all 0.2s !important;
    border-left: 3px solid transparent !important;
    border-bottom: none !important;
    box-sizing: border-box !important;
  }
  .mobile-sidebar-nav a:hover,
  .mobile-sidebar-nav a:active {
    background: rgba(176, 123, 58, 0.12) !important;
    color: var(--text) !important;
    border-left-color: var(--honey) !important;
    padding-left: 20px !important;
  }

  .mobile-sidebar-overlay {
    display: none !important;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    background: rgba(0, 0, 0, 0.5) !important;
    z-index: 99999 !important;
    visibility: visible !important;
    opacity: 1 !important;
    pointer-events: auto !important;
  }
  .mobile-sidebar-overlay.is-open {
    display: block !important;
  }

  /* 2. Настройка боковых колонок (Фото + Форматы) по высоте главного фото (440px) */
  .hero-top-grid--new {
    display: grid !important;
    grid-template-columns: 1fr 1.1fr !important;
    gap: 16px !important;
    align-items: stretch !important;
    margin-top: 4px !important;
    box-sizing: border-box !important;
  }

  html body section#hero .hero-scene-shell .hero-top-grid--new .hero-media-stack .hero-photo-card.hero-poster-card {
    height: 100% !important;
    min-height: 100% !important;
    max-height: none !important;
    flex: 1 1 auto !important;
    box-sizing: border-box !important;
    padding: 12px !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
  }
  html body section#hero .hero-scene-shell .hero-top-grid--new .hero-media-stack .hero-photo-card.hero-poster-card .hero-poster-slides {
    position: absolute !important;
    inset: 12px !important;
    height: auto !important;
    width: auto !important;
    border-radius: 20px !important;
    overflow: hidden !important;
    display: block !important;
  }
  html body section#hero .hero-scene-shell .hero-top-grid--new .hero-media-stack .hero-photo-card.hero-poster-card .hero-poster-slides .hero-poster-frame {
    position: absolute !important;
    inset: 0 !important;
    width: 100% !important;
    height: 100% !important;
    background-size: cover !important;
    background-position: center !important;
    border-radius: inherit !important;
    display: block !important;
  }
  html body section#hero .hero-scene-shell .hero-top-grid--new .hero-media-stack .hero-photo-card.hero-poster-card .hero-poster-slides img {
    object-fit: cover !important;
    height: 100% !important;
    width: 100% !important;
    border-radius: 20px !important;
  }

  /* 3. Карточка форматов на всю высоту главного фото */
  .hero-story-card {
    height: 100% !important;
    min-height: 100% !important;
    max-height: 100% !important;
    box-sizing: border-box !important;
    padding: 18px !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: flex-start !important;
    gap: 12px !important;
    background: radial-gradient(circle at top left, rgba(255, 244, 231, 0.86), transparent 34%), linear-gradient(180deg, rgba(255, 252, 247, 0.96), rgba(247, 237, 227, 0.93)) !important;
    border-radius: var(--radius) !important; /* Полное скругление 32px как на десктопе */
    border: 1px solid var(--line) !important;
    box-shadow: var(--shadow-soft) !important;
  }

  .hero-story-card > .eyebrow {
    font-size: 0.55rem !important;
    margin: 0 !important;
  }
  .hero-story-card h2 {
    font-size: 1.05rem !important;
    margin: 0 !important;
    line-height: 1.1 !important;
  }
  .hero-story-card p.lead.small {
    font-size: 0.62rem !important;
    line-height: 1.25 !important;
    margin: 0 !important;
    color: rgba(43, 22, 18, 0.8) !important;
  }

  /* Баджи в один столбик, как на десктопе */
  .hero-story-card ul.hero-story-badges {
    display: flex !important;
    flex-direction: column !important;
    flex-wrap: nowrap !important;
    align-items: flex-start !important;
    gap: 5px !important;
    width: 100% !important;
    padding: 0 !important;
    margin: 6px 0 !important;
    list-style: none !important;
  }
  .hero-story-card ul.hero-story-badges li {
    font-size: 0.68rem !important;
    font-weight: 760 !important;
    letter-spacing: 0.09em !important;
    text-transform: uppercase !important;
    color: var(--muted-strong) !important;
    background: rgba(255, 255, 255, 0.76) !important;
    border: 1px solid var(--line) !important;
    border-radius: 999px !important; /* Полное закругление 999px как на десктопе */
    padding: 5px 12px !important;
    margin: 0 !important;
    text-align: left !important;
    justify-content: flex-start !important;
    box-sizing: border-box !important;
    width: 100% !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    display: flex !important;
    align-items: center !important;
    min-height: 28px !important;
  }

  /* Стилизация интро-блока внутри правой карточки «Форматы» в ландшафтном режиме (как на десктопе) */
  html body section#hero .hero-scene-shell .hero-top-grid--new .hero-story-card .hero-intro-copy {
    display: flex !important;
    flex-direction: column !important;
    visibility: visible !important;
    opacity: 1 !important;
    pointer-events: auto !important;
    gap: 4px !important;
    margin-top: 8px !important;
    padding-top: 10px !important;
    border-top: 1px solid rgba(43, 22, 18, 0.15) !important;
  }
  html body section#hero .hero-scene-shell .hero-top-grid--new .hero-story-card .hero-intro-copy .eyebrow {
    font-size: 0.58rem !important;
    font-weight: 760 !important;
    letter-spacing: 0.09em !important;
    text-transform: uppercase !important;
    color: var(--muted) !important;
    margin: 0 !important;
  }
  html body section#hero .hero-scene-shell .hero-top-grid--new .hero-story-card .hero-intro-copy .hero-title {
    font-size: 1.05rem !important;
    font-weight: 880 !important;
    line-height: 1.15 !important;
    margin: 2px 0 !important;
    color: var(--coffee-black) !important;
    text-shadow: none !important;
  }
  html body section#hero .hero-scene-shell .hero-top-grid--new .hero-story-card .hero-intro-copy .lead {
    font-size: 0.65rem !important;
    line-height: 1.25 !important;
    color: var(--muted-strong) !important;
    margin: 0 !important;
  }

  /* Позиционирование и масштабирование кнопок внутри карточки */
  html body section#hero .hero-scene-shell .hero-top-grid--new .hero-story-card .hero-actions {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    pointer-events: auto !important;
    flex-direction: row !important;
    justify-content: flex-start !important;
    align-items: center !important;
    gap: 8px !important;
    margin: 6px 0 0 0 !important;
    width: 100% !important;
  }
  html body section#hero .hero-scene-shell .hero-top-grid--new .hero-story-card .hero-actions .btn {
    flex: 1 !important;
    padding: 0 12px !important;
    min-height: 34px !important;
    font-size: 0.68rem !important;
    font-weight: 720 !important;
    text-align: center !important;
    margin: 0 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-width: 0 !important;
  }

  /* Полностью скрываем внешний ландшафтный блок, так как все теперь находится внутри карточки */
  .landscape-intro-wrapper {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
  }

  /* Синхронизация фото-карусели форматов со стилем Samsung S25 Ultra на всех горизонтальных телефонах */
  .formats-carousel-card {
    position: relative !important;
    clear: both !important;
    margin-top: 6px !important;
    padding: 16px 0 !important;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }
  .formats-slider {
    display: grid !important;
    grid-auto-flow: column !important;
    grid-auto-columns: minmax(310px, 46%) !important; /* Ровно 46% как на S25 Ultra для отображения двух карточек бок о бок! */
    gap: 16px !important;
    padding: 0 16px !important;
    box-sizing: border-box !important;
  }
  .formats-slide {
    min-height: 380px !important;
    padding: 16px !important;
    box-sizing: border-box !important;
  }
  .formats-slide img {
    height: 300px !important;
    object-fit: cover !important;
    background: transparent !important;
  }

  /* 5. Общие ландшафтные оптимизации остальных секций */
  .section, .container { padding-top: 15px !important; padding-bottom: 15px !important; }
  .section-heading { margin-bottom: 15px !important; }
  .video-feature-card, .hero-video-shell, .video-poster-layer {
    position: relative !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: 80vh !important;
    width: 100% !important;
    max-width: 680px !important;
    margin: 0 auto !important;
    border-radius: 24px !important;
    overflow: hidden !important;
  }
  .video-poster-layer img {
    position: relative !important;
    display: block !important;
    width: 100% !important;
    height: auto !important;
    max-height: 80vh !important;
    object-fit: cover !important;
    border-radius: inherit !important;
  }
  video.hero-video {
    position: absolute !important;
    inset: 0 !important;
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    z-index: 1 !important;
    border-radius: inherit !important;
  }
  .help-grid ul.bullet-list, .about-grid ul.bullet-list { display: block !important; column-count: 2 !important; column-gap: 20px !important; }
  .help-grid ul.bullet-list li, .about-grid ul.bullet-list li { break-inside: avoid; page-break-inside: avoid; margin-bottom: 10px !important; }
  .workflow-list { display: grid !important; grid-template-columns: 1fr 1fr !important; gap: 15px !important; align-items: start !important; }
  .workflow-step { min-width: 0 !important; }
  .contact-photo-wrapper, .contact-photo-wrapper img { max-height: 45vh !important; }

  /* 6. Оптимизация блока ФОТО (Галерея) в горизонтальном режиме */
  /* Переводим вкладки (Свадьбы, Юбилеи, ...) строго в одну горизонтальную линию на всех телефонах */
  html body #gallery .gallery-tab-buttons {
    display: flex !important;
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    -webkit-overflow-scrolling: touch !important;
    scroll-behavior: smooth !important;
    justify-content: space-around !important; /* Распределяем по ширине в одну линию */
    scrollbar-width: none !important;
    -ms-overflow-style: none !important;
    padding: 0 16px 4px 16px !important;
    margin: 0 auto 12px auto !important;
    width: 100% !important;
    max-width: 900px !important;
    gap: 8px !important;
  }
  html body #gallery .gallery-tab-buttons::-webkit-scrollbar {
    display: none !important;
  }
  html body #gallery .gallery-tab-buttons button {
    flex: 1 1 auto !important;
    min-width: 0 !important;
    width: auto !important;
    padding: 6px 10px !important;
    font-size: 0.68rem !important; /* Уменьшаем шрифт, чтобы точно всё встало в один ряд */
    border-radius: 12px !important;
    text-align: center !important;
    white-space: nowrap !important;
  }

  /* Скрываем все панели галереи по умолчанию в альбомном режиме, нейтрализуя вертикальную сетку */
  html body #gallery .gallery-tab-panels {
    display: block !important;
  }
  html body #gallery .gallery-carousel-panel {
    display: none !important;
  }

  /* Применяем стили отображения и flex-карусели ТОЛЬКО к активной панели */
  html body #gallery .gallery-carousel-panel[style*="display: grid"],
  html body #gallery .gallery-carousel-panel[style*="display: flex"],
  html body #gallery .gallery-carousel-panel[style*="display: block"],
  html body #gallery .gallery-carousel-panel:not([style*="display: none"]) {
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    min-height: calc(100vh - 60px) !important;
    height: calc(100vh - 60px) !important;
    width: 100% !important;
    margin: 4px auto 0 auto !important;
    padding: 0 !important;
    overflow: hidden !important;
  }
  html body #gallery .gallery-carousel-panel .carousel-center {
    display: block !important;
    position: relative !important;
    flex: 0 0 100% !important;
    width: calc(100vw - 60px) !important;
    max-width: calc(2.26 * (100vh - 60px)) !important;
    min-height: calc(100vh - 60px) !important;
    height: calc(100vh - 60px) !important;
    margin: 0 auto !important;
    transform: none !important;
    opacity: 1 !important;
    z-index: 10 !important;
    border-radius: 20px !important;
    box-shadow: 0 16px 40px rgba(96, 59, 39, 0.35) !important;
  }
  html body #gallery .gallery-carousel-panel .carousel-center img {
    min-height: 100% !important;
    height: 100% !important;
    width: 100% !important;
    border-radius: 20px !important;
    object-fit: cover !important;
  }

  /* Заставляем оверлей с названием и кнопкой «Открыть» быть всегда видимым в альбомном режиме */
  html body #gallery .gallery-carousel-panel .carousel-center .gallery-item-overlay {
    display: flex !important; /* Используем flex для красивого горизонтального выравнивания */
    flex-direction: row !important;
    justify-content: space-between !important;
    align-items: center !important;
    position: absolute !important;
    inset: auto 0 0 0 !important;
    height: auto !important;
    padding: 12px 20px !important;
    background: linear-gradient(to top, rgba(43, 22, 18, 0.9) 0%, rgba(43, 22, 18, 0.6) 70%, transparent 100%) !important;
    opacity: 1 !important;
    visibility: visible !important;
    z-index: 10 !important;
    border-radius: 0 0 20px 20px !important; /* Скругление только снизу */
    pointer-events: auto !important;
  }

  html body #gallery .gallery-carousel-panel .carousel-center .gallery-item-title {
    display: block !important;
    font-size: 1.7rem !important; /* Увеличенный размер для альбомного вида */
    font-weight: 700 !important;
    color: #ffffff !important;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.6) !important;
    margin: 0 !important;
    padding: 0 !important;
    text-align: left !important;
    align-self: center !important;
  }

  html body #gallery .gallery-carousel-panel .carousel-center .gallery-item-open-btn {
    display: inline-block !important;
    padding: 10px 24px !important;
    font-size: 1.44rem !important;
    font-weight: 700 !important;
    background: linear-gradient(135deg, #d2a24c, #c89240) !important;
    color: #ffffff !important;
    border: none !important;
    border-radius: 30px !important;
    box-shadow: 0 4px 10px rgba(210, 162, 76, 0.4) !important;
    margin: 0 !important;
    cursor: pointer !important;
    align-self: center !important;
    pointer-events: auto !important;
  }

  /* Полностью скрываем боковые фотки-слайды и любые другие неактивные элементы */
  html body #gallery .gallery-carousel-panel .gallery-item:not(.carousel-center),
  html body #gallery .gallery-carousel-panel .carousel-prev,
  html body #gallery .gallery-carousel-panel .carousel-next {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
    width: 0 !important;
    height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  /* =========================================================================
     🎯 КРЕСТИКИ ЗАКРЫТИЯ (Close Crosses) для горизонтальной версии
     ========================================================================= */
  /* 0. Полноэкранный лайтбокс поверх гамбургер-кнопки только в открытом виде */
  html body .lightbox.open {
    z-index: 200000 !important;
  }

  /* Отключаем и скрываем крестик лайтбокса, когда он закрыт */
  html body .lightbox:not(.open) .lightbox-close {
    display: none !important;
    pointer-events: none !important;
    visibility: hidden !important;
  }

  /* 1. Крестик закрытия полноэкранного лайтбокса (фото и видео) - ТОЛЬКО в открытом виде */
  html body .lightbox.open .lightbox-close {
    position: fixed !important;
    top: 12px !important;
    right: 12px !important;
    left: auto !important;
    width: 44px !important;
    height: 44px !important;
    min-width: 44px !important;
    min-height: 44px !important;
    font-size: 24px !important;
    border-radius: 50% !important;
    background: rgba(0, 0, 0, 0.65) !important;
    border: 2px solid rgba(255, 255, 255, 0.8) !important;
    color: #ffffff !important;
    z-index: 100000000 !important; /* Убеждаемся, что поверх всего */
    pointer-events: auto !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4) !important;
    cursor: pointer !important;
    opacity: 1 !important;
    visibility: visible !important;
  }
  html body .lightbox.open .lightbox-close:active {
    transform: scale(0.9) !important;
  }

  /* 2. Крестик закрытия раскрытой галереи (gallery-close-btn) - ТОЛЬКО в открытом виде */
  html body .gallery-expanded-photos.is-open .gallery-close-btn {
    position: fixed !important;
    top: 12px !important;
    right: 12px !important;
    left: auto !important;
    width: 44px !important;
    height: 44px !important;
    min-width: 44px !important;
    min-height: 44px !important;
    font-size: 24px !important;
    border-radius: 50% !important;
    background: rgba(0, 0, 0, 0.65) !important;
    border: 2px solid rgba(255, 255, 255, 0.8) !important;
    color: #ffffff !important;
    z-index: 100000000 !important; /* Убеждаемся, что поверх всего */
    pointer-events: auto !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4) !important;
    cursor: pointer !important;
    opacity: 1 !important;
    visibility: visible !important;
  }
  html body .gallery-expanded-photos.is-open .gallery-close-btn:active {
    transform: scale(0.9) !important;
  }

  /* =========================================================================
     👴 РАЗДЕЛ ОБО МНЕ (Кто я) - нормализация слоев и текста в альбомном режиме
     ========================================================================= */
  html body section#about .about-grid-profile {
    grid-template-columns: 1fr !important;
    gap: 16px !important;
  }
  html body section#about .about-text-card,
  html body section#about .glass-card {
    padding: 24px !important;
  }
  html body section#about .about-lead {
    font-size: 1.05rem !important;
    line-height: 1.7 !important;
  }

  /* =========================================================================
     💬 РАЗДЕЛ ОТЗЫВЫ - нормализация слоев и текста в альбомном режиме
     ========================================================================= */
  html body #reviews .reviews-layout-grid {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }
  html body #reviews .reviews-cards-grid {
    grid-template-columns: 1fr !important;
    column-gap: 0 !important;
    row-gap: 20px !important;
    width: 100% !important;
  }
  html body #reviews .reviews-cards-grid .review-card {
    width: 100% !important;
    min-height: auto !important;
  }
  html body #reviews .reviews-form-sidebar {
    width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    margin-top: 30px !important;
    position: static !important;
  }
  html body #reviews .btn-all-reviews {
    width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
  }

  /* =========================================================================
     ✍️ БЛОК ОСТАВИТЬ ОТЗЫВ И ОСТАВИТЬ ЗАЯВКУ - 2-колоночная сетка и фото во всю высоту формы
     ========================================================================= */
  html body .contact-shell {
    display: grid !important;
    grid-template-columns: 1fr 1.15fr !important;
    gap: 24px !important;
    padding: 24px !important;
    align-items: stretch !important;
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }
  html body .contact-shell .contact-photo-wrapper {
    aspect-ratio: none !important;
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    max-height: none !important;
    flex: 1 1 auto !important;
    margin: 12px 0 0 0 !important;
    display: block !important;
    border-radius: 20px !important;
    overflow: hidden !important;
  }
  html body .contact-shell .contact-photo-wrapper img {
    width: 100% !important;
    height: 100% !important;
    max-height: none !important;
    object-fit: cover !important;
  }

  /* =========================================================================
     📞 РАЗДЕЛ КОНТАКТЫ - двухколоночная сетка на всех альбомных телефонах
     ========================================================================= */
  html body .contacts-links {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 12px !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }
  html body .contacts-links .contact-link.is-email {
    grid-column: auto !important;
  }
}

/* -------------------------------------------------------------------------
   📟 SECTION 3: EXCLUSIVE TABLET (Планшеты)
   Разрешение: от 481px до 1024px
   ------------------------------------------------------------------------- */
@media screen and (min-width: 481px) and (max-width: 1024px) {
  /* Адаптация высоты и ширины главного фото галереи для всех моделей планшетов */
  html body #gallery .gallery-carousel-panel:not([style*="display: none"]) {
    height: 520px !important;
    min-height: 520px !important;
    width: 100% !important;
  }
  html body #gallery .gallery-carousel-panel .carousel-center {
    height: 520px !important;
    min-height: 520px !important;
    max-height: 520px !important;
    width: calc(100vw - 60px) !important;
    max-width: 900px !important;
  }
  html body #gallery .gallery-carousel-panel .carousel-center img {
    height: 100% !important;
    min-height: 100% !important;
    width: 100% !important;
    object-fit: cover !important;
  }
}

/* Neutralize contact link shifting from a + a on mobile devices */
.contact-link {
  margin-left: 0 !important;
}
