/* =========================================================
   NIKOM TECHNO - responsive layer
   Loaded AFTER style.css. Desktop (>1220px) is untouched.
   Breakpoints: 1220 (small laptop) / 900 (tablet) / 600 (phone)
   ========================================================= */

/* Hidden on desktop, shown from 900px down */
.menu-toggle, .cat-toggle { display: none; }

html { -webkit-text-size-adjust: 100%; }
img { max-width: 100%; }

/* ---------------------------------------------------------
   <= 1220px : fluid shell, desktop artwork scaled down
   --------------------------------------------------------- */
@media (max-width: 1220px) {
  body { background-size: auto; }
  #shell { width: auto; max-width: 1184px; padding-left: 10px; padding-right: 10px; box-sizing: border-box; }
  #header, #intro, #content { width: auto; }
  #intro { height: auto; }
  #intro .intro-image img { width: 100%; height: auto; }
}

/* ---------------------------------------------------------
   <= 900px : tablet + phone  (new layout, mobile menu)
   --------------------------------------------------------- */
@media (max-width: 900px) {
  body { font-size: 14px; line-height: 1.5; background-image: none; background-color: #1d1f20; }
  #shell { padding: 0 0 20px; }
  .no-text-mobile { display: none; }

  /* ---------- HEADER ---------- */
  #header {
    position: sticky; top: 0; z-index: 1000;
    display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px;
    height: auto; padding: 8px 12px;
    background: #474a4b; border-bottom: 3px solid #00a1a6;
    box-sizing: border-box;
  }
  /* logo: crop the visible mark out of the 592x279 artwork */
  h1#logo_bg, h1#logo_en {
    position: static; order: 1; flex: 0 0 auto;
    width: 150px; height: 64px; margin: 0;
    background-size: 370px auto; background-position: -122px -22px;
    background-repeat: no-repeat;
  }
  h1#logo_bg a, h1#logo_en a { width: 150px; height: 64px; margin: 0; }

  .menu-toggle {
    order: 2; margin-left: auto;
    display: inline-flex; flex-direction: column; justify-content: center; align-items: center; gap: 5px;
    width: 46px; height: 46px; padding: 0;
    background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.35); border-radius: 8px;
    cursor: pointer; -webkit-tap-highlight-color: transparent;
  }
  .menu-toggle span {
    display: block; width: 22px; height: 2px; background: #fff; border-radius: 2px;
    transition: transform .3s ease, opacity .2s ease;
  }
  .menu-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .menu-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
  .menu-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
  .menu-toggle:focus-visible { outline: 3px solid #00a1a6; outline-offset: 2px; }

  #lang { position: static; order: 3; float: none; margin: 0; display: flex; gap: 14px; flex: 1 1 100%; }
  #lang a.bg, #lang a.en, #lang a { float: none; width: auto; height: auto; margin: 0; color: #fff; font-family: Arial, sans-serif; font-size: 13px; }

  #main-search { order: 4; float: none; margin: 0; flex: 1 1 100%; position: relative; }
  #main-search .search { width: 100%; max-width: 420px; background: #fff; border-radius: 6px; display: flex; align-items: center; }
  #main-search .search input.text { float: none; flex: 1; width: auto; min-width: 0; height: 40px; line-height: 40px; font-size: 16px; /* 16px stops iOS zoom */ padding: 0 10px; }
  #main-search .search input.submit { float: none; flex: 0 0 40px; width: 40px; height: 40px; margin: 0; background-position: center; background-repeat: no-repeat; }
  #main-search .autocomplete { left: 0; right: 0; width: auto; max-width: 420px; background-image: none; padding-top: 4px; }
  #main-search .autocomplete ul li a { width: auto; height: auto; }

  /* ---------- MOBILE MENU: slide-down + fade ---------- */
  #menu {
    float: none; order: 5; flex: 1 1 100%; width: 100%;
    max-height: 0; overflow: hidden; opacity: 0; visibility: hidden;
    transform: translateY(-8px);
    transition: max-height .4s ease, opacity .3s ease, transform .3s ease, visibility 0s linear .4s;
  }
  #menu.is-open {
    max-height: 480px; opacity: 1; visibility: visible; transform: none;
    transition: max-height .4s ease, opacity .3s ease, transform .3s ease, visibility 0s;
  }
  #menu ul { margin: 4px 0 6px; height: auto; display: block; }
  #menu ul li { width: auto; height: auto; margin: 0; border-top: 1px solid rgba(255,255,255,.12); }
  #menu ul li a,
  #menu ul li a:hover, #menu ul li a.active {
    background: none; width: auto; height: auto; padding: 0 12px;
    min-height: 48px; line-height: 48px; color: #fff; text-shadow: none; font-size: 16px;
    transition: background .2s ease, padding-left .2s ease;
  }
  #menu ul li a:hover, #menu ul li a.active { background: rgba(0,161,166,.25); padding-left: 20px; }
  /* stagger items as the menu opens */
  #menu.is-open ul li { animation: navItemIn .35s ease both; }
  #menu.is-open ul li:nth-child(2) { animation-delay: .04s; }
  #menu.is-open ul li:nth-child(3) { animation-delay: .08s; }
  #menu.is-open ul li:nth-child(4) { animation-delay: .12s; }
  #menu.is-open ul li:nth-child(5) { animation-delay: .16s; }
  #menu.is-open ul li:nth-child(6) { animation-delay: .20s; }
  @keyframes navItemIn { from { opacity: 0; transform: translateX(-12px); } to { opacity: 1; transform: none; } }

  #header .intro-slogan { display: none; }

  /* ---------- INTRO ---------- */
  #intro { height: 140px; overflow: hidden; }
  .intro-home { height: 140px !important; }
  #intro .intro-image img { width: 100%; height: 140px; object-fit: cover; }
  #intro .intro-text { display: none; }
  #intro a.catalog {
    right: 12px; bottom: 12px; width: auto; height: auto; padding: 10px 18px;
    background: #00a1a6; border-radius: 6px; font-size: 15px; line-height: 1.2; letter-spacing: 0;
  }

  /* ---------- CONTENT ---------- */
  #content { overflow-x: hidden; border-radius: 0; min-height: 0; padding-bottom: 16px; background-image: none; }
  .content-home { height: auto !important; background: #fff !important; }
  h2.pagetitle { height: auto; min-height: 30px; margin: 10px 12px; padding-left: 14px; line-height: 1.3; font-size: 17px; }
  #textpage { width: auto; padding: 0 12px 16px; box-sizing: border-box; }
  .editor { width: auto; }
  .editor .user-input, #contact_form { width: auto !important; max-width: 100%; }
  #contact_form input.text, #contact_form textarea, #contact_form select { width: 100% !important; max-width: 100%; box-sizing: border-box; }
  #contact_form .row { padding: 6px 0; }
  #contact_form input.submit { height: 44px !important; line-height: 40px !important; }
  .cf-turnstile { max-width: 100%; overflow: hidden; margin-bottom: 10px; }

  /* contact page map + directions form (inline fixed sizes in template) */
  .view-right-part { margin: 0 !important; }
  .map, #map-window { max-width: 100%; }
  #map { width: 100% !important; height: 320px !important; }
  #map_direction .row { width: auto !important; float: none !important; }
  #map_direction .cell1, #map_direction .cell2 { width: auto !important; float: none !important; margin: 0 !important; text-align: left; }
  #map_direction input.text, #map_direction input.submit { width: 100% !important; box-sizing: border-box; }
  #message, #message .top, #message .bottom { width: auto; max-width: 936px; }
  #message .center { width: auto; }

  /* home */
  #visual { float: none; width: 420px; height: 330px; padding: 16px 0 0 12px; box-sizing: content-box; }
  #home-carousel { float: none; width: 444px; margin-left: 12px; }

  /* left menu = category list */
  #left-menu { float: none; width: auto; padding: 0 12px; }
  #left-menu ul { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 6px; }
  #left-menu ul li, #left-menu ul li a { width: auto; margin: 0; }
  #left-menu ul li a span { width: auto; padding: 12px 14px; min-height: 20px; background-size: 100% 100%; }
  #left-menu ul li a,
  #left-menu ul li a:hover, #left-menu ul li a.active { background: none; }
  #left-menu ul li a span { background: #eef1f2; border-radius: 8px; }
  #left-menu ul li a:hover span, #left-menu ul li a.active span { background: #00a1a6; color: #fff; }

  /* ---------- COLLAPSIBLE CATEGORIES ---------- */
  .cat-title-replaced { display: none; }
  .cat-toggle {
    display: flex; align-items: center; gap: 10px; width: calc(100% - 24px); min-height: 52px;
    margin: 12px 12px 0; padding: 8px 14px; text-align: left; cursor: pointer;
    background: #fff; border: 1px solid #cfd8dc; border-radius: 10px;
    box-shadow: 0 2px 6px rgba(0,0,0,.08); -webkit-tap-highlight-color: transparent;
    font-family: inherit; font-size: 15px; color: #222;
  }
  .cat-toggle .cat-label { font-weight: bold; white-space: nowrap; }
  .cat-toggle .cat-current { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #00868b; font-size: 14px; }
  .cat-toggle .cat-chevron {
    flex: 0 0 auto; width: 10px; height: 10px; margin: 0 4px 4px 0;
    border-right: 2px solid #00a1a6; border-bottom: 2px solid #00a1a6; transform: rotate(45deg);
    transition: transform .3s ease; margin-top: -4px;
  }
  .cat-toggle[aria-expanded="true"] { border-color: #00a1a6; }
  .cat-toggle[aria-expanded="true"] .cat-chevron { transform: rotate(-135deg); margin-top: 4px; }
  .cat-toggle:focus-visible { outline: 3px solid #00a1a6; outline-offset: 2px; }
  #left-menu { max-height: 0; overflow: hidden; opacity: 0; padding-top: 0; padding-bottom: 0; transition: max-height .4s ease, opacity .3s ease, padding .3s ease; }
  #left-menu.is-open { max-height: 1400px; opacity: 1; padding-top: 10px; padding-bottom: 6px; }

  #content-with-menu { float: none; width: auto; padding: 0 12px; box-sizing: border-box; }

  /* ---------- PRODUCT LISTING : card grid ---------- */
  #listing ul { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 12px; }
  #listing ul li {
    float: none; width: auto; height: auto; margin: 0; overflow: hidden;
    display: flex; align-items: stretch; gap: 8px;
    background: #fff; border: 1px solid #dfe5e8; border-radius: 10px;
    box-shadow: 0 2px 6px rgba(0,0,0,.06);
    transition: box-shadow .2s ease, transform .2s ease;
  }
  #listing ul li:hover { box-shadow: 0 6px 16px rgba(0,0,0,.14); transform: translateY(-2px); }
  #listing ul li span.fl { flex: 0 0 120px; float: none; display: flex; align-items: center; justify-content: center; background: #f5f7f8; }
  #listing ul li span.fl img { margin: 6px !important; width: 108px; max-width: 100%; height: auto; }
  #listing ul li span.list-text { float: none; flex: 1; width: auto; min-width: 0; padding: 6px 10px 10px 0; display: flex; flex-direction: column; }
  #listing ul li span.list-title { height: auto; min-height: 28px; font-size: 14px; line-height: 1.3; }
  #listing ul li span.list-desc { height: auto; max-height: 52px; padding-right: 0; font-size: 13px; line-height: 1.35; }
  #listing ul li span.list-link { float: none; margin-top: auto; padding-top: 8px; }
  #listing ul li span.list-link a { width: auto; height: auto; min-height: 36px; line-height: 36px; padding: 0 14px; background: #00a1a6; color: #fff; border-radius: 6px; display: inline-block; font-size: 13px; letter-spacing: 0; }
  #listing ul li span.icons { position: absolute; right: 8px; top: 8px; padding: 0; float: none; }
  #listing ul li { position: relative; }
  #listing ul li span.cl { display: none; }

  #paging ul li { display: inline-block; padding: 3px; }
  #paging ul li a, #paging ul li span { display: inline-block; min-width: 34px; min-height: 34px; line-height: 34px; padding: 0 8px; box-sizing: border-box; }

  /* ---------- PRODUCT VIEW ---------- */
  .view-left-part, .view-right-part { float: none; width: auto !important; padding: 0 12px; box-sizing: border-box; }
  /* the picture / rotation block is built from fixed pixel sizes;
     mobile.js scales it with transform so jquery.reel keeps working */
  #detail-view { float: none; margin: 0 0 12px; transform-origin: 0 0; }
  .changable-section { float: none; width: auto; padding: 0; }
  .changable-section h3, .changable-section h3.title { float: none !important; width: auto !important; max-width: 100%; min-width: 100%; height: auto; min-height: 32px; box-sizing: border-box; }
  #detail-contacts .row .cell1 { float: none; width: auto; text-align: left; }
  #detail-contacts .row .cell2 { float: none; width: auto; }
  #detail-contacts .row .cell2 input.text,
  #detail-contacts .row .cell2 textarea,
  #detail-contacts .row .cell2 input.submit { width: 100%; box-sizing: border-box; font-size: 16px; }
  #detail-contacts .row .cell2 input.text { height: 40px; }
  .user-input { width: auto !important; }

  #similar-products { margin-top: 10px; }
  .similar-carousel, .similar-carousel .inner-carousel, .similar-carousel .inner-similar-carousel, .similar-carousel ul { width: 100%; }
  .similar-carousel ul li { width: calc(100% - 12px); background: #fff; border: 1px solid #dfe5e8; border-radius: 10px; box-sizing: border-box; }
  .similar-carousel ul li span.list-text { width: calc(100% - 128px); }

  /* forms on text pages */
  input[type=text], input[type=email], input[type=tel], textarea, select { font-size: 16px; max-width: 100%; box-sizing: border-box; }
  .editor img { max-width: 100%; height: auto; }

  /* helper wizard */
  #helper, #helper .main { width: auto; }
  #helper .main { height: auto; background-size: cover; }
  #helper .main .main-picture, #helper .main .main-question { float: none; width: auto; padding: 12px; box-sizing: border-box; }
  #helper .pages { width: auto; max-width: 100%; overflow: hidden; }

  /* ---------- FOOTER ---------- */
  #footer { display: flex; flex-direction: column; gap: 16px; padding: 20px 14px; color: #fff; background: #2a2c2d; box-sizing: border-box; }
  #footer .menu, #footer .contacts, #footer .iso, #footer #nikom_op, #footer .created { float: none; margin: 0; padding: 0; width: auto; height: auto; }
  #footer .menu ul { display: flex; flex-wrap: wrap; gap: 4px 18px; }
  #footer .menu ul li { display: block; padding: 0; }
  #footer .menu ul li a { display: block; padding: 8px 0; font-size: 15px; }
  #footer .created { display: flex; align-items: center; justify-content: space-between; padding-top: 8px; border-top: 1px solid rgba(255,255,255,.15); }
  #footer .created a, #footer .created a.dobg-logo { float: none; }
  #footer .contacts { background: #3a3d3e; border-radius: 10px; padding: 14px 16px; }
  #footer .contacts h3 { padding: 0 0 6px; color: #00c3c9; font-size: 17px; line-height: 1.3; }
  #footer .contacts p { padding: 0; color: #fff; font-size: 14px; line-height: 1.6; }
  #footer .iso { display: flex; justify-content: center; }
  #footer .iso a.nikom_iso { float: none; margin: 0; }
  #footer #nikom_op { height: 70px; width: 100%; max-width: 260px; background-position: left center; }
  #footer .cl { display: none; }
}
}

/* ---------------------------------------------------------
   <= 600px : phones
   --------------------------------------------------------- */
@media (max-width: 600px) {
  h1#logo_bg, h1#logo_en { width: 124px; height: 54px; background-size: 310px auto; background-position: -102px -18px; }
  h1#logo_bg a, h1#logo_en a { width: 124px; height: 54px; }
  #intro, .intro-home { height: 96px !important; }
  #intro .intro-image img { height: 96px; }
  #intro a.catalog { font-size: 13px; padding: 8px 12px; }

  #left-menu ul { grid-template-columns: repeat(2, 1fr); }
  #listing ul { grid-template-columns: 1fr; }
  #listing ul li span.fl { flex-basis: 112px; }
  #footer .contacts, #footer #nikom_op { flex-basis: 100%; }
}

@media (max-width: 380px) {
  #left-menu ul { grid-template-columns: 1fr; }
  #listing ul li span.fl { flex-basis: 96px; }
  #listing ul li span.fl img { width: 84px; }
}

/* ---------------------------------------------------------
   Touch: tooltips are hover-only and hang off-screen
   --------------------------------------------------------- */
@media (hover: none) {
  #detail-view .buttons ul li:hover a span.tooltips,
  #home-carousel .inner-carousel ul li:hover a span.tooltip { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  #menu, #menu.is-open, .menu-toggle span, #listing ul li, #left-menu, .cat-toggle .cat-chevron { transition: none; }
  #menu.is-open ul li { animation: none; }
}

.map-directions { margin: 8px 0 0; }
.map-directions a { display: inline-block; padding: 8px 14px; background: #00a1a6; color: #fff; border-radius: 6px; font-size: 14px; }
.map-directions a:hover { text-decoration: none; background: #00868b; }
