/* ============================================
   RESPONSIVE CSS - MOBILE MENU
   ============================================ */

/* ============================================
   LANGUAGE SWITCHER - ALWAYS VISIBLE
   ============================================ */
.lang-switcher {
  position: relative;
  z-index: 100;
}

.lang-switcher__btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background: transparent;
  border: 1px solid rgba(212, 175, 55, 0.4);
  border-radius: 8px;
  color: #D4AF37;
  cursor: pointer;
  transition: all 0.3s ease;
}

.lang-switcher__btn:hover {
  border-color: #D4AF37;
  background: rgba(212, 175, 55, 0.1);
}

.lang-switcher__code {
  font-weight: 600;
  font-size: 0.9rem;
  color: #D4AF37;
}

.lang-switcher__arrow {
  font-size: 0.6rem;
  transition: transform 0.3s ease;
  color: #D4AF37;
}

.lang-switcher.open .lang-switcher__arrow {
  transform: rotate(180deg);
}

.lang-switcher__dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 180px;
  background: rgba(20, 20, 20, 0.98);
  border: 1px solid rgba(212, 175, 55, 0.4);
  border-radius: 8px;
  padding: 8px 0;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.3s ease;
  z-index: 1000;
  list-style: none;
  margin: 0;
}

.lang-switcher.open .lang-switcher__dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.lang-switcher__item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  cursor: pointer;
  transition: background 0.2s ease;
}

.lang-switcher__item:hover {
  background: rgba(212, 175, 55, 0.15);
}

.lang-switcher__item--active {
  background: rgba(212, 175, 55, 0.1);
}

.lang-switcher__item--active::after {
  content: "✓";
  margin-left: auto;
  color: #D4AF37;
}

.lang-switcher__flag {
  font-size: 1.25rem;
  line-height: 1;
}

.lang-switcher__label {
  font-size: 0.95rem;
  color: #e8e8e8;
}

/* ============================================
   MOBILE MENU STYLES
   ============================================ */

/* Гамбургер кнопка */
.icon-menu {
  display: none;
  width: 30px;
  height: 22px;
  position: relative;
  cursor: pointer;
  background: none;
  border: none;
  z-index: 1001;
}

.icon-menu span,
.icon-menu::before,
.icon-menu::after {
  content: "";
  position: absolute;
  left: 0;
  width: 100%;
  height: 2px;
  background-color: #D4AF37;
  transition: all 0.3s ease;
}

.icon-menu::before { top: 0; }
.icon-menu span { top: 50%; margin-top: -1px; }
.icon-menu::after { bottom: 0; }

/* Анімація гамбургера при відкритті */
.menu-open .icon-menu span {
  transform: scale(0);
}

.menu-open .icon-menu::before {
  top: 50%;
  transform: rotate(-45deg);
  margin-top: -1px;
}

.menu-open .icon-menu::after {
  bottom: 50%;
  transform: rotate(45deg);
  margin-bottom: -1px;
}

/* ============================================
   MOBILE: 320px - 767px
   ============================================ */
@media (max-width: 767px) {
  /* Header */
  .header__container {
    min-height: 5rem;
    padding: 0.75rem;
  }
  
  .logo img {
    height: 60px;
  }
  
  .header {
    position: relative;
  }
  
  /* Показуємо гамбургер на мобільних */
  .icon-menu {
    display: block;
  }
  
  /* Dropdown меню */
  .menu__body {
    position: absolute;
    top: 100%;
    right: 1rem;
    width: 220px;
    max-width: calc(100vw - 2rem);
    margin-top: 0.5rem;
    background: rgba(10, 10, 10, 0.75);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(212, 175, 55, 0.4);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.7);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.25s ease;
    z-index: 1000;
    padding: 0.5rem 0;
  }
  
  .menu-open .menu__body {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
  }
  
  .menu__list {
    list-style: none;
    padding: 0;
    margin: 0;
  }
  
  .menu__item {
    border-bottom: 1px solid rgba(212, 175, 55, 0.1);
  }
  
  .menu__item:last-child {
    border-bottom: none;
  }
  
  .menu__link {
    display: block;
    padding: 0.875rem 1.25rem;
    color: #e8e8e8;
    text-decoration: none;
    transition: background 0.2s ease;
    font-size: 1rem;
  }
  
  .menu__link:hover {
    background: rgba(212, 175, 55, 0.15);
    color: #D4AF37;
  }
  
  /* Кнопка "Замовити" в меню */
  .menu__body .actions-header__button {
    display: block;
    margin: 0.75rem 1.25rem;
    padding: 0.75rem 1.5rem;
    text-align: center;
    background: transparent;
    border: 2px solid #D4AF37;
    color: #D4AF37;
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.3s ease;
  }
  
  .menu__body .actions-header__button:hover {
    background: #D4AF37;
    color: #0a0a0a;
  }
}

/* ============================================
   DESKTOP: 768px+
   Скрываем переключатель языка из меню
   ============================================ */
@media (min-width: 768px) {
  .menu__body .lang-switcher {
    display: none !important;
  }
  
  /* Hide pagination indicators on desktop */
  .services__pagination {
    display: none !important;
  }
}

/* ============================================
   TABLET: 768px - 1023px
   ============================================ */
@media (min-width: 768px) and (max-width: 1023px) {
  .header__container {
    min-height: 6rem;
  }
  
  .logo img {
    height: 80px;
  }
}

/* ============================================
   OTHER RESPONSIVE STYLES
   ============================================ */

/* Mobile font sizes */
@media (max-width: 767px) {
  body {
    font-size: 1rem;
  }
  
  .title {
    font-size: 2rem;
  }
  
  .button {
    min-height: 44px;
    padding: 0.875rem 1.75rem;
  }
  
  /* Hero button - make it narrower and adjust text */
  .main__button {
    max-width: 90%;
    margin-left: auto;
    margin-right: auto;
    padding: 0.875rem 0.75rem;
    font-size: 0.9rem;
    text-align: center;
    white-space: normal;
    line-height: 1.3;
  }
}

/* Hero section */
@media (max-width: 767px) {
  .main__container {
    padding-top: 8rem;
  }
  
  .main__title {
    font-size: 2.5rem;
  }
  
  .main__text {
    font-size: 1rem;
  }
  
  /* Services section - horizontal carousel showing 2 items */
  .services__row {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    gap: 0.75rem;
    padding: 0 0 1rem 0;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none; /* Firefox */
    justify-content: flex-start;
  }
  
  .services__row::-webkit-scrollbar {
    display: none; /* Chrome, Safari */
  }
  
  .services__column {
    flex: 0 0 90%;
    min-width: 90%;
    max-width: 90%;
    scroll-snap-align: center;
  }
  
  .services__column:first-child {
    margin-left: 5%;
  }
  
  .item-services {
    height: 100%;
    display: flex;
    flex-direction: column;
    padding: 1rem;
    align-items: center;
    justify-content: center;
  }
  
  .item-services__top {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    margin-bottom: 0.75rem;
    width: 100%;
  }
  
  .item-services__image {
    width: 100%;
    height: 160px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.75rem;
  }
  
  .item-services__image img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
  }
  
  /* Carousel navigation buttons - HIDE on mobile for homepage services (but NOT on assortment page) */
  body:not(.assortment) .page__services .carousel-nav {
    display: none !important;
  }
  
  /* Also hide on tablets (768px - 991px) - but NOT on assortment page */
  @media (min-width: 768px) and (max-width: 991px) {
    body:not(.assortment) .carousel-nav {
      display: none !important;
    }
  }
  
  /* Pagination indicators for services carousel */
  .services__pagination {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 1rem;
    padding: 0.5rem 0;
  }
  
  .services__dot {
    width: 32px;
    height: 4px;
    background: rgba(212, 175, 55, 0.3);
    border-radius: 2px;
    transition: all 0.3s ease;
  }
  
  .services__dot.active {
    background: #D4AF37;
    width: 40px;
  }
  
  .item-services__title {
    font-size: 1.1rem;
    margin-bottom: 0.6rem;
    text-align: center;
    font-weight: 600;
    width: 100%;
  }
  
  .item-services__text {
    font-size: 0.8rem;
    margin-bottom: 0.75rem;
    line-height: 1.4;
    flex-grow: 1;
    text-align: center;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    width: 100%;
  }
  
  .item-services__button {
    padding: 0.65rem 1.25rem;
    font-size: 0.85rem;
    margin-top: auto;
    width: auto;
    display: inline-block;
    text-align: center;
  }
  
  /* News section - horizontal carousel */
  .news__row {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x proximity;
    gap: 1rem;
    padding: 0 0 1rem 0;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    justify-content: flex-start;
    overscroll-behavior-x: contain;
  }
  
  .news__row::-webkit-scrollbar {
    display: none;
  }
  
  .news__column {
    flex: 0 0 85%;
    min-width: 85%;
    max-width: 85%;
    scroll-snap-align: center;
  }
  
  .news__column:first-child {
    margin-left: 7.5%;
  }
  
  /* Carousel navigation buttons */
  .carousel-nav {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 1.5rem;
  }
  
  .carousel-nav__btn {
    width: 44px;
    height: 44px;
    border: 2px solid #D4AF37;
    background: transparent;
    color: #D4AF37;
    border-radius: 8px;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.3s ease;
  }
  
  .carousel-nav__btn:active {
    background: rgba(212, 175, 55, 0.2);
  }
  
  /* Brand carousel on assortment page - ONLY for assortment page */
  
  /* Центруємо всі дочірні елементи через контейнер */
  .assortment .services__container {
    display: block;
    text-align: center;
  }

  .assortment .brand-carousel {
    position: relative;
    overflow: visible;
    margin: 2rem 0 0;
    display: block;
  }
  
  .assortment .brand-carousel__viewport {
    position: relative !important;
    left: auto !important;
    right: auto !important;
    transform: none !important;
    min-height: 180px;
    overflow: visible;
    /* Ширина встановлюється JS — слайди центруються відносно неї */
  }
  
  .assortment .brand-slide {
    position: center;
    left: 50%; 
    top: 50%;
    margin-left: -75px;
    margin-top: -75px;
    transition: all 0.35s ease;
    will-change: transform, opacity;
  }
  
  .assortment .brand-slide a {
    display: block;
    width: 150px !important;
    height: 150px !important;
    padding: 8px;
    border: 1px solid #D4AF37;
    border-radius: 12px;
    background: #1a1a1a;
    transition: transform 0.3s ease;
  }
  
  .assortment .brand-slide img {
    width: 100% !important;
    height: 100% !important;
    object-fit: contain;
    border-radius: 8px;
  }
  
  /* Navigation buttons for brand carousel - ONLY for assortment */
  .assortment .carousel-nav {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 1.5rem;
    width: 100%;
    padding-left: 41px;
  }
  
  
  .assortment .carousel-nav .brand-carousel__btn {
    width: 44px;
    height: 44px;
    border: 2px solid #D4AF37;
    background: transparent;
    color: #D4AF37;
    border-radius: 8px;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    position: static !important;
    left: auto !important;
    right: auto !important;
  }
  
  .assortment .carousel-nav .brand-carousel__btn:active {
    background: rgba(212, 175, 55, 0.2);
  }
  
  /* View all brands button - ONLY for assortment */
  .assortment .brand-viewall {
    text-align: center;
    margin-top: 2rem;
  }
  
  .assortment .brand-viewall .button {
    padding: 0.75rem 1.5rem;
    font-size: 0.9rem;
  }
  
  /* Hide original services row on mobile when carousel is active - ONLY for assortment */
  .assortment .services__row {
    display: none;
  }
}

/* ============================================
   DESKTOP: 768px+ - Brand carousel
   ============================================ */
@media (min-width: 768px) {
  /* Центруємо всі дочірні елементи через контейнер */
  .assortment .services__container {
    display: block;
    text-align: center;
  }

  .assortment .brand-carousel {
    --brand-gap: 52px;
    position: relative;
    overflow: visible;
    margin: 2rem 0 0;
    display: block;
  }
  
  .assortment .brand-carousel__viewport {
    position: relative !important;
    left: auto !important;
    right: auto !important;
    transform: none !important;
    min-height: 280px;
    overflow: visible;
  }
  
  .assortment .brand-slide {
    position: absolute;
    left: 50%; 
    top: 50%;
    margin-left: -130px;
    margin-top: -130px;
    transition: all 0.35s ease;
    will-change: transform, opacity;
  }
  
  .assortment .brand-slide a {
    display: block;
    width: 260px !important;
    height: 260px !important;
    padding: 12px;
    border: 2px solid #D4AF37;
    border-radius: 16px;
    background: #1a1a1a;
    transition: transform 0.3s ease;
  }
  
  .assortment .brand-slide img {
    width: 100% !important;
    height: 100% !important;
    object-fit: contain;
    border-radius: 12px;
  }
  
  /* Navigation buttons for brand carousel */
  .assortment .carousel-nav {
    display: flex !important;
    justify-content: center !important;
    gap: 1.5rem !important;
    margin-top: 2rem !important;
    width: 100% !important;
  }
  
  .assortment .carousel-nav .brand-carousel__btn {
    width: 50px !important;
    height: 50px !important;
    border: 2px solid #D4AF37 !important;
    background: transparent !important;
    color: #D4AF37 !important;
    border-radius: 8px !important;
    font-size: 1.5rem !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    position: static !important;
    left: auto !important;
    right: auto !important;
    transform: none !important;
    top: auto !important;
  }
  
  .assortment .carousel-nav .brand-carousel__btn:hover {
    background: rgba(212, 175, 55, 0.2) !important;
  }
  
  /* View all brands button */
  .assortment .brand-viewall {
    text-align: center;
    margin-top: 2rem;
  }
  
  .assortment .brand-viewall .button {
    padding: 0.875rem 2rem;
    font-size: 1rem;
  }
  
  /* Keep services__row hidden on desktop - carousel handles display */
  .assortment .services__row {
    display: none;
  }
}

/* Footer */
@media (max-width: 767px) {
  .footer__container {
    grid-template-columns: 1fr;
    gap: 1.5rem;
    text-align: center;
  }
  
  .footer__policy,
  .footer__copyright {
    justify-self: center;
  }
  
  .footer__logo img {
    height: 80px;
    margin: 0 auto;
  }
}
