  /* Скрываем блок CL23 "История бренда" по умолчанию */
  #rec1569246061 {
    display: none !important;
  }

  /* Класс, который включает отображение */
  #rec1569246061.history-visible {
    display: block !important;
  }



document.addEventListener('DOMContentLoaded', function () {
  var historySelector = '#rec1569246061'; // ID блока CL23 "История бренда"
  var triggerHash = '#history';           // якорь для ссылки из меню

  function showHistory() {
    var block = document.querySelector(historySelector);
    if (!block) return;

    block.classList.add('history-visible');

    // Плавный скролл к блоку
    block.scrollIntoView({
      behavior: 'smooth',
      block: 'start'
    });
  }

  function hideHistory() {
    var block = document.querySelector(historySelector);
    if (!block) return;
    block.classList.remove('history-visible');
  }

  // На каждом открытии страницы — скрываем блок
  hideHistory();

  // Если сразу зашли по ссылке вида .../#history
  if (window.location.hash === triggerHash) {
    showHistory();
  }

  // Реакция на клики по ссылкам с #history (гамбургер-меню и любые другие)
  document.addEventListener('click', function (e) {
    var link = e.target.closest('a');
    if (!link) return;

    var href = link.getAttribute('href');
    if (!href) return;

    if (href === triggerHash || href.endsWith(triggerHash)) {
      // Даём Tilda закрыть меню и сразу показываем блок
      setTimeout(showHistory, 50);
    }
  });

  // Подстраховка по изменению hash
  window.addEventListener('hashchange', function () {
    if (window.location.hash === triggerHash) {
      showHistory();
    } else {
      hideHistory();
    }
  });
});



  /* Скрываем блок "Визуальный почерк" по умолчанию */
  #rec1573572921 {
    display: none !important;
  }

  /* Класс, который включает отображение */
  #rec1573572921.visual-style-visible {
    display: block !important;
  }



document.addEventListener('DOMContentLoaded', function () {
  var visualSelector = '#rec1573572921'; // ID блока "Визуальный почерк"
  var triggerHash = '#visualstyle';      // якорь для ссылки из меню

  function showVisual() {
    var block = document.querySelector(visualSelector);
    if (!block) return;

    block.classList.add('visual-style-visible');

    // Плавный скролл к блоку
    block.scrollIntoView({
      behavior: 'smooth',
      block: 'start'
    });
  }

  function hideVisual() {
    var block = document.querySelector(visualSelector);
    if (!block) return;
    block.classList.remove('visual-style-visible');
  }

  // На каждом открытии страницы — скрываем блок
  hideVisual();

  // Если сразу зашли по ссылке вида .../#visualstyle
  if (window.location.hash === triggerHash) {
    showVisual();
  }

  // Реакция на клики по ссылкам с #visualstyle (гамбургер и др.)
  document.addEventListener('click', function (e) {
    var link = e.target.closest('a');
    if (!link) return;

    var href = link.getAttribute('href');
    if (!href) return;

    if (href === triggerHash || href.endsWith(triggerHash)) {
      // Даём Tilda закрыть меню и затем показываем блок
      setTimeout(showVisual, 50);
    }
  });

  // Подстраховка по изменению hash
  window.addEventListener('hashchange', function () {
    if (window.location.hash === triggerHash) {
      showVisual();
    } else {
      hideVisual();
    }
  });
});


  
  /* Скрываем слайдер по умолчанию */
  #rec1573960561 {
    display: none !important;
  }

  /* Класс, который включает отображение */
  #rec1573960561.slider-visible {
    display: block !important;
  }



document.addEventListener('DOMContentLoaded', function () {
  var sliderSelector = '#rec1573960561'; // ID слайдера

  function showSlider() {
    var block = document.querySelector(sliderSelector);
    if (!block) return;

    block.classList.add('slider-visible');

    // Плавный скролл к слайдеру
    block.scrollIntoView({
      behavior: 'smooth',
      block: 'start'
    });
  }

  // Обрабатываем клики по ссылке #showslider
  document.addEventListener('click', function (e) {
    var link = e.target.closest('a');
    if (!link) return;

    var href = link.getAttribute('href') || link.getAttribute('data-href');
    if (!href) return;

    if (href === '#showslider') {
      e.preventDefault();
      showSlider();
    }
  });
});



  /* Скрываем блок контактов по умолчанию */
  #rec1584353161 {
    display: none !important;
  }

  /* Класс, который включает отображение блока */
  #rec1584353161.contacts-visible {
    display: block !important;
  }



document.addEventListener('DOMContentLoaded', function () {
  var contactsSelector = '#rec1584353161'; // Новый ID блока "Контакты"
  var triggerHash = '#showcontacts';       // якорь из меню

  function showContacts() {
    var block = document.querySelector(contactsSelector);
    if (!block) return;

    block.classList.add('contacts-visible');

    // Плавный скролл к блоку
    block.scrollIntoView({
      behavior: 'smooth',
      block: 'start'
    });
  }

  // Обрабатываем клики по ссылке #showcontacts
  document.addEventListener('click', function (e) {
    var link = e.target.closest('a');
    if (!link) return;

    var href = link.getAttribute('href') || link.getAttribute('data-href');
    if (!href) return;

    if (href === triggerHash) {
      e.preventDefault();
      // Даем гамбургеру закрыться
      setTimeout(showContacts, 50);
    }
  });
});



  /* 1. Обмен и возврат — скрыт по умолчанию */
  #rec1602534881 {
    display: none !important;
  }
  #rec1602534881.section-visible {
    display: block !important;
  }

  /* 2. Уход за изделиями — скрыт по умолчанию */
  #rec1602677731 {
    display: none !important;
  }
  #rec1602677731.section-visible {
    display: block !important;
  }

  /* 3. Оплата и доставка — скрыт по умолчанию */
  #rec1606834481 {
    display: none !important;
  }
  #rec1606834481.section-visible {
    display: block !important;
  }

  /* 4. Kavia muses — скрыт по умолчанию */
  #rec1622153731 {
    display: none !important;
  }
  #rec1622153731.section-visible {
    display: block !important;
  }



document.addEventListener('DOMContentLoaded', function () {
  // Соответствие хука → ID блока
  var sectionsMap = {
    '#showexchange': '#rec1602534881',   // Обмен и возврат
    '#showcare':     '#rec1602677731',   // Уход за изделиями
    '#showpayment':  '#rec1606834481',   // Оплата и доставка
    '#showmuses':    '#rec1622153731'    // Kavia muses
  };

  function showSection(hash) {
    var selector = sectionsMap[hash];
    if (!selector) return;

    var block = document.querySelector(selector);
    if (!block) return;

    // Показать блок
    block.classList.add('section-visible');

    // Плавный скролл к нему
    block.scrollIntoView({
      behavior: 'smooth',
      block: 'start'
    });
  }

  // Обработка кликов по ссылкам-хукам
  document.addEventListener('click', function (e) {
    var link = e.target.closest('a');
    if (!link) return;

    var href = link.getAttribute('href') || link.getAttribute('data-href');
    if (!href) return;

    if (sectionsMap[href]) {
      e.preventDefault();
      // Небольшая задержка, чтобы закрылись попапы/меню (гамбургер)
      setTimeout(function () {
        showSection(href);
      }, 60);
    }
  });

  // Если пользователь сразу зашел по URL с нужным hash (Редко, но на всякий случай)
  if (sectionsMap[window.location.hash]) {
    setTimeout(function () {
      showSection(window.location.hash);
    }, 100);
  }
});




