/* ===================== */
/* АНИМАЦИИ ДЛЯ СООБЩЕНИЙ */
/* ===================== */

@keyframes fadeInOut {
    0% {
        opacity: 0;
        transform: translateY(20px);
    }
    10% {
        opacity: 1;
        transform: translateY(0);
    }
    90% {
        opacity: 1;
        transform: translateY(0);
    }
    100% {
        opacity: 0;
        transform: translateY(20px);
    }
}

/* Базовые стили для защищённых изображений */
.project-gallery img,
.thumbnails img,
.similar-project-image img,
.option-visual-card img,
.catalog-card img {
    user-select: none !important;
    -webkit-user-drag: none !important;
    -moz-user-drag: none !important;
    -o-user-drag: none !important;
    pointer-events: auto !important;
}

/* ===================== */
/* ДОПОЛНИТЕЛЬНАЯ ЗАЩИТА ИЗОБРАЖЕНИЙ (ИСПРАВЛЕННЫЙ ВАРИАНТ) */
/* ===================== */

/* Запрещаем контекстное меню для всех изображений */
img {
    -webkit-touch-callout: none !important;  /* iOS Safari */
    -webkit-user-select: none !important;    /* Safari */
    -moz-user-select: none !important;       /* Firefox */
    -ms-user-select: none !important;        /* Internet Explorer/Edge */
    user-select: none !important;            /* Стандартный синтаксис */
    pointer-events: auto !important;         /* Разрешаем клики, но не перетаскивание */
    
    /* Для WebKit браузеров (Chrome, Safari, Edge) */
    -webkit-user-drag: none !important;
    
    /* Для Firefox */
    -moz-user-select: none !important;
    -moz-user-drag: none !important;
}

/* Специально для изображений в корзине */
.cart-item-thumb,
.cart-widget-items img,
.cart-item img {
    -webkit-user-drag: none !important;
    -moz-user-drag: none !important;
}

/* Для изображений на главной странице */
.project-card-new img,
.project-image-new img,
.hero-visual img,
.projects-grid img {
    -webkit-user-drag: none !important;
    -moz-user-drag: none !important;
}

/* Для похожих проектов */
.similar-project-image img,
.similar-project-card img,
.similar-projects-grid img {
    -webkit-user-drag: none !important;
    -moz-user-drag: none !important;
}


/* ====================== */
/* HEADER & NAVIGATION */
/* ====================== */
.header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 0;
  overflow: hidden;
  z-index: 1000;
  background: rgba(32, 32, 32, 0);
  transition: all 0.5s ease;
}

/* Always visible state */
.header-permanent {
  height: 60px;
  background: rgba(40, 40, 40, 0.95) !important;
  backdrop-filter: blur(10px) !important;
  -webkit-backdrop-filter: blur(10px) !important;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2) !important;
  align-items: center;
}

.header-visible {
  height: 60px;
  background: rgba(40, 40, 40, 0.95);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.header-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  padding: 0 20px;
}

.logo {
  padding-left: 20px;
  margin-right: 0;
  margin-top: 10px;
  font-size: 24px;
  font-weight: bold;
  color: white;
  text-decoration: none;
  transition: color 0.3s ease;
}

.header-visible .logo {
  opacity: 1;
}

.header-permanent .logo {
  opacity: 1;
}

.logo:hover {
  color: #dab672;
}

body.project-page {
  padding-top: 60px;
}

/* ====================== */
/* КОРЗИНА В ШАПКЕ */
/* ====================== */
.cart-container {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
  margin-top: 15px;
  padding-right: 60px;
}

.cart-icon {
  order: 2;
  position: relative;
  cursor: pointer;
}

.cart-icon svg {
  width: 28px;
  height: 28px;
  color: white;
  transition: transform 0.3s ease;
}

.cart-icon:hover svg {
  transform: scale(1.1);
}

.cart-count {
  position: absolute;
  top: -8px;
  right: -8px;
  background: #dab672;
  color: #000;
  font-size: 0.8rem;
  font-weight: bold;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cart-total {
  order: 1;
  color: #dab672;
  font-weight: 600;
  font-size: 1.1rem;
  min-width: 10px;
  margin-top: -5px;
}

/* ====================== */
/* БУРГЕР-МЕНЮ */
/* ====================== */
.menu-toggle {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 1001;
  width: 45px;
  height: 45px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(32, 32, 32, 0.7);
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.5s ease;
  box-shadow: none !important;
  border: none !important;
  padding: 0;
}

.burger-icon {
  width: 28px;
  height: 28px;
  color: white;
  display: block;
}

.menu-toggle:hover .burger-icon {
  transform: scale(1.1);
}

.side-menu.active~.menu-toggle {
  opacity: 0;
  visibility: hidden;
}

.header-visible+.menu-toggle,
.header-permanent+.menu-toggle {
  top: 5px;
  background: rgba(32, 32, 32, 0.0);
}

.menu-toggle:hover {
  background: rgba(20, 20, 20, 0.95);
}

/* ====================== */
/* БОКОВОЕ МЕНЮ */
/* ====================== */
.side-menu {
  position: fixed;
  top: 0;
  right: -350px;
  width: 350px;
  height: 100%;
  background: linear-gradient(135deg, #1a1a1a 0%, #222222 100%);
  z-index: 1002;
  transition: right 0.4s ease;
  padding: 30px 0;
  box-shadow: -5px 0 25px rgba(0, 0, 0, 0.4);
}

.menu-header {
  padding: 0 30px 25px;
  margin-bottom: 15px;
  border-bottom: 1px solid rgba(218, 182, 114, 0.2);
}

.menu-header h3 {
  color: #dab672;
  font-size: 1.5rem;
  margin: 0;
  text-align: center;
  font-weight: 600;
  letter-spacing: 1px;
}

.side-menu.active {
  right: 0;
}

.close-btn {
  position: absolute;
  top: 25px;
  right: 25px;
  font-size: 32px;
  color: white;
  background: none;
  border: none;
  cursor: pointer;
  transition: transform 0.3s ease;
  z-index: 1003;
}

.close-btn:hover {
  transform: rotate(90deg);
}

.menu {
  display: flex;
  flex-direction: column;
  margin-top: 0;
  padding: 0 25px;
  gap: 8px;
}

.menu-item {
  display: flex;
  align-items: center;
  color: #e0e0e0;
  padding: 18px 25px;
  font-size: 16px;
  border-radius: 10px;
  margin: 0;
  transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  text-decoration: none;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
  position: relative;
  overflow: hidden;
  font-weight: 500;
}

.menu-item::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  width: 4px;
  background: linear-gradient(to bottom, #dab672, #c9a45e);
  transform: scaleX(0);
  transition: transform 0.3s ease;
  border-radius: 2px;
}

.menu-item::after {
  content: '';
  position: absolute;
  top: 50%;
  right: 20px;
  transform: translateY(-50%);
  width: 6px;
  height: 6px;
  background: #dab672;
  border-radius: 50%;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.menu-item:hover {
  color: #dab672;
  background: rgba(218, 182, 114, 0.08);
  border-color: rgba(218, 182, 114, 0.2);
  transform: translateX(8px);
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
}

.menu-item:hover::before {
  transform: scaleX(1);
}

.menu-item:hover::after {
  opacity: 1;
}

.menu-text {
  flex: 1;
  font-weight: 500;
  letter-spacing: 0.5px;
  position: relative;
  z-index: 2;
}

.menu-item {
  opacity: 0;
  transform: translateX(30px);
  animation: menuItemAppear 0.6s ease forwards;
}

.menu-item:nth-child(2) {
  animation-delay: 0.1s;
}

.menu-item:nth-child(3) {
  animation-delay: 0.15s;
}

.menu-item:nth-child(4) {
  animation-delay: 0.2s;
}

.menu-item:nth-child(5) {
  animation-delay: 0.25s;
}

.menu-item:nth-child(6) {
  animation-delay: 0.3s;
}

@keyframes menuItemAppear {
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.menu-item.active {
  color: #dab672;
  background: rgba(218, 182, 114, 0.12);
  border-color: rgba(218, 182, 114, 0.3);
}

.menu-item.active::before {
  transform: scaleX(1);
}

.menu-item.active::after {
  opacity: 1;
}

.overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 999;
  display: none;
}

.overlay.active {
  display: block;
}

/* ====================== */
/* CART WIDGET OVERLAY */
/* ====================== */
.cart-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  z-index: 1999;
  display: none;
  transition: opacity 0.4s ease, visibility 0.4s ease;
}

.cart-overlay.active {
  display: block;
}

.cart-widget {
  position: fixed;
  top: 0;
  right: -400px;
  width: 100%;
  max-width: 400px;
  height: 100vh;
  background: #222;
  z-index: 2000;
  box-shadow: -5px 0 25px rgba(0, 0, 0, 0.5);
  transition: right 0.4s ease;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.cart-widget.active {
  right: 0;
}

.cart-widget-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 25px;
  background: #1a1a1a;
  border-bottom: 1px solid #333;
}

.cart-widget-header h3 {
  color: #dab672;
  font-size: 1.5rem;
  margin: 0;
}

.close-cart {
  background: none;
  border: none;
  color: #aaa;
  font-size: 2rem;
  cursor: pointer;
  line-height: 1;
  transition: color 0.3s;
}

.close-cart:hover {
  color: #dab672;
}

.cart-widget-items {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
}

.cart-widget-summary {
  padding: 25px;
  background: #1a1a1a;
  border-top: 1px solid #333;
  z-index: 1001;
}

.cart-widget-total {
  display: flex;
  justify-content: space-between;
  font-size: 1.2rem;
  margin-bottom: 20px;
  color: #fff;
}

.cart-widget-total-price {
  color: #dab672;
  font-weight: bold;
}

.btn-order {
  display: block;
  width: 100%;
  padding: 15px;
  background: #dab672;
  color: #000;
  border: none;
  border-radius: 8px;
  font-weight: bold;
  cursor: pointer;
  transition: background 0.3s;
  margin-top: 10px;
  text-align: center;
  text-decoration: none;
}

.btn-order:hover {
  background: #c9a45e;
}

.btn-order:disabled {
  background: #555;
  cursor: not-allowed;
}

/* Cart Items inside Widget */
.cart-item {
  background: #2a2a2a;
  border-radius: 8px;
  padding: 15px;
  margin-bottom: 15px;
  border: 1px solid #333;
}

.cart-item-top {
  display: flex;
  align-items: flex-start;
  gap: 15px;
  margin-bottom: 10px;
}

.cart-item-base {
  font-size: 0.85rem;
  color: #aaa;
  margin-top: 4px;
}

.cart-item-thumb {
  width: 90px;
  height: 90px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid #333;
}

.cart-item-info {
  flex: 1;
}

.cart-item-title {
  display: block;
  color: #dab672;
  font-weight: 600;
  text-decoration: none;
  margin-bottom: 5px;
  transition: opacity 0.3s;
}

.cart-item-title:hover {
  opacity: 0.8;
  text-decoration: underline;
}

.cart-item-price {
  color: #fff;
  font-weight: bold;
}

.cart-item-remove {
  background: none;
  border: none;
  color: #e74c3c;
  cursor: pointer;
  font-size: 0.9rem;
  padding: 5px;
  transition: opacity 0.3s;
  transform: scale(2);
}

.cart-item-remove:hover {
  opacity: 0.8;
}

.cart-item-options {
  padding-top: 10px;
  border-top: 1px solid #333;
  margin-top: 10px;
}

.option-item {
  display: flex;
  justify-content: space-between;
  font-size: 0.9rem;
  margin-bottom: 5px;
  color: #aaa;
  position: relative;
}

.option-price {
  color: #dab672;
}

.remove-option {
  background: none;
  border: none;
  color: #e74c3c;
  cursor: pointer;
  font-size: 1.2rem;
  padding: 0;
  margin-left: 10px;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.remove-option:hover {
  color: #ff6b6b;
}

.cart-empty {
  text-align: center;
  color: #aaa;
  margin-top: 20px;
}

/* ====================== */
/* МЕДИА-ЗАПРОСЫ ИЗ INDEX.CSS */
/* ====================== */

/* 1. МОБИЛЬНЫЕ УСТРОЙСТВА (до 767px) */
@media (max-width: 767px) {
  .header-container {
    padding: 0 10px;
  }

  .logo {
    font-size: 20px;
    padding-left: 10px;
  }

  .cart-container {
    padding-right: 55px;
  }

  .header-visible+.menu-toggle,
  .header-permanent+.menu-toggle {
    top: 10px;
    right: 15px;
  }

  .menu-toggle {
    width: 40px;
    height: 40px;
    top: 15px;
    right: 15px;
  }

  /* Убираем тень на мобильных */
  .menu-toggle,
  .side-menu,
  .cart-widget {
    box-shadow: none !important;
  }

  /* Боковое меню на мобильных */
  .side-menu {
    width: 85%;
    max-width: 300px;
    right: -85%;
  }
}

/* 2. iOS SAFE AREA */
@supports (padding: max(0px)) {
  @media (max-width: 767px) {
    .menu-toggle {
      top: max(15px, env(safe-area-inset-top));
      right: max(15px, env(safe-area-inset-right));
    }
  }
}

/* 3. ПЛАНШЕТЫ (768px - 1023px) */
@media (min-width: 768px) and (max-width: 1023px) {
  .side-menu {
    width: 350px;
  }
}

/* 4. IPAD PRO (1024px - 1199px) */
@media (min-width: 1024px) and (max-width: 1199px) {
  .side-menu {
    width: 320px;
  }
}

/* 5. МЕДИА-ЗАПРОСЫ ДЛЯ КОРЗИНЫ (важные!) */
@media (max-width: 1023px) {
  .cart-widget {
    width: 100% !important;
    max-width: 100% !important;
    right: -100% !important;
  }

  .cart-widget.active {
    right: 0 !important;
  }
}

@media (min-width: 1024px) {
  .cart-widget {
    width: 400px !important;
    max-width: 400px !important;
    right: -400px !important;
  }

  .cart-widget.active {
    right: 0 !important;
  }
}

/* 6. ДОПОЛНИТЕЛЬНЫЕ МЕДИА-ЗАПРОСЫ ДЛЯ КОРЗИНЫ */
@media (max-width: 600px) {
  .cart-container {
    padding-right: 50px !important;
  }
}

@media (max-width: 480px) {
  .cart-container {
    padding-right: 50px;
  }
}

