/* ========== СТИЛИ КАТАЛОГА ========== */

/* Отступ для основного контента под фиксированной шапкой */

/* ========== ЗАГОЛОВОК КАТАЛОГА ========== */
.catalog-header {
  text-align: center;
  font-size: 32px;
  font-weight: 600;
  color: #45555f;
  margin: 32px 0;
  position: relative;
  z-index: 1;
}

/* ========== КОНТРОЛЫ ========== */
.catalog-controls {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 16px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 32px;
  align-items: center;
  box-sizing: border-box;
  position: sticky;
  top: 80px;
  z-index: 50;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-radius: 8px;
  transition: all 0.3s ease;
  will-change: transform;
  transform: translateZ(0);
  backface-visibility: hidden;
  -webkit-transform: translateZ(0);
  -webkit-backface-visibility: hidden;
  -webkit-perspective: 1000px;
  perspective: 1000px;
}

.catalog-controls.scrolled {
  background: rgba(255, 255, 255, 0.98);
}

/* Фильтры */
.catalog-filters {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  padding-bottom: 6px;
  box-sizing: border-box;
  flex: 1 1 60%;
  min-width: 0;
  scrollbar-width: thin;
  scrollbar-color: #cbd5e1 #f1f5f9;
}

.catalog-filters::-webkit-scrollbar {
  height: 4px;
}

.catalog-filters::-webkit-scrollbar-track {
  background: #f1f5f9;
  border-radius: 2px;
}

.catalog-filters::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 2px;
}

.catalog-filters::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

.catalog-filters button {
  background-color: #f3f4f6;
  border: none;
  border-radius: 9999px;
  padding: 8px 16px;
  cursor: pointer;
  font-weight: 500;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  white-space: nowrap;
  font-size: 14px;
  flex: 0 0 auto;
  position: relative;
  overflow: hidden;
}

.catalog-filters button:hover {
  background-color: #e5e7eb;
  color: #45555f;
  transform: translateY(-1px) scale(1.05);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.catalog-filters button.active {
  background: linear-gradient(135deg, #45555f, #2f3c44);
  color: #fff;
  box-shadow: 0 4px 12px rgba(69, 85, 95, 0.3);
}

.catalog-filters button.active:hover {
  background: linear-gradient(135deg, #2f3c44, #1a2529);
  transform: translateY(-1px) scale(1.05);
  box-shadow: 0 6px 16px rgba(69, 85, 95, 0.4);
}

/* Поиск и сортировка */
.controls-right {
  display: flex;
  gap: 10px;
  align-items: center;
  flex: 0 0 auto;
}

.search-input {
  padding: 8px 16px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 14px;
  min-width: 160px;
  max-width: 320px;
  box-sizing: border-box;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  background: #fff;
  opacity: 0;
  transform: translateY(-10px) scale(0.95);
  animation: searchInputFadeIn 0.6s ease-out forwards;
}

.search-input:focus {
  outline: none;
  border-color: #2d5a27;
  box-shadow: 0 0 0 3px rgba(45, 90, 39, 0.1), 0 4px 12px rgba(45, 90, 39, 0.15);
  transform: translateY(0) scale(1) !important;
  opacity: 1 !important;
}

.search-input:hover:not(:focus) {
  border-color: #4a7c59;
  box-shadow: 0 2px 8px rgba(45, 90, 39, 0.1);
  transform: translateY(-2px);
}

@keyframes searchInputFadeIn {
  0% {
    opacity: 0;
    transform: translateY(-10px) scale(0.95);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.sort-wrapper {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  opacity: 0;
  transform: translateY(-10px) scale(0.95);
  animation: sortWrapperFadeIn 0.6s ease-out 0.2s forwards;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  background: linear-gradient(
    135deg,
    rgba(127, 179, 20, 0.05),
    rgba(255, 255, 255, 0.8)
  );
  border-radius: 12px;
  padding: 6px 12px;
  border: 2px solid rgba(127, 179, 20, 0.15);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

@keyframes sortWrapperFadeIn {
  0% {
    opacity: 0;
    transform: translateY(-10px) scale(0.95);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.sort-wrapper:hover {
  transform: translateY(-2px);
  border-color: rgba(127, 179, 20, 0.3);
  box-shadow: 0 4px 12px rgba(127, 179, 20, 0.15);
  background: linear-gradient(
    135deg,
    rgba(127, 179, 20, 0.1),
    rgba(255, 255, 255, 0.9)
  );
}

.sort-select {
  padding: 8px 32px 8px 12px;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  appearance: none;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  background: transparent;
  cursor: pointer;
  font-weight: 600;
  color: #45555f;
  position: relative;
  outline: none;
  min-width: 140px;
}

.sort-select:hover {
  color: #7fb314;
}

.sort-select:focus {
  color: #6a9810;
}

.sort-select::after {
  content: "▼";
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  color: #7fb314;
  font-size: 10px;
  transition: transform 0.2s ease;
  font-weight: normal;
}

.sort-select:focus::after {
  transform: translateY(-50%) rotate(180deg);
}

.sort-reset {
  cursor: pointer;
  color: #dc2626;
  font-weight: bold;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 2px solid rgba(220, 38, 38, 0.2);
  background: rgba(255, 255, 255, 0.9);
  border-radius: 50%;
  width: 24px;
  height: 24px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  font-size: 14px;
  line-height: 1;
  flex-shrink: 0;
}

.sort-reset:hover {
  background: #dc2626;
  color: white;
  border-color: #dc2626;
  transform: scale(1.15) rotate(90deg);
  box-shadow: 0 2px 8px rgba(220, 38, 38, 0.3);
}

.sort-reset:active {
  transform: scale(1) rotate(90deg);
}

.color-thumbs {
  display: flex; /* flex-контейнер */
  flex-wrap: wrap; /* перенос на новую строку при необходимости */
  justify-content: center; /* выравнивание по центру горизонтально */
  gap: 4px; /* расстояние между миниатюрами */
  margin-bottom: 20px;
  width: 100%;
}

/* Мобильные: карточка раскрывается в потоке, без absolute и z-index */
@media (max-width: 1025px) {
  /* Карточка в потоке */
  .card > div {
    position: relative !important;
    z-index: 20 !important;
  }

  /* Контейнер миниатюр цветов */
  .color-thumbs-wrapper {
    max-height: 65px; /* свернутый вид */
    overflow: hidden;
    transition: max-height 0.3s ease;
    position: relative !important;
    box-shadow: none !important;
  }

  .color-thumbs-wrapper.expanded {
    max-height: none; /* убираем ограничение, чтобы карточка могла расширяться */
    justify-content: center;
  }
}

.profile-icon svg,
.cart-icon svg {
  width: 28px; /* одинаковая ширина */
  height: 28px; /* одинаковая высота */
  display: block;
  cursor: pointer;
  position: relative;
  transition: background-color 0.3s;
}

.profile-icon,
.cart-icon {
  margin-right: 20px;
}

.color-thumbs-wrapper {
  position: relative; /* меняем на relative, чтобы влиял на высоту карточки */
  display: flex;
  flex-wrap: wrap;
  width: 100%;
  background: #fff;
  border-radius: 8px;
  z-index: 10; /* выше соседних карточек */
  overflow: visible; /* показываем второй ряд */
  transition: max-height 0.3s ease;
  justify-content: center;
  align-content: flex-start;
  gap: 4px;
  max-height: none; /* убираем ограничение по умолчанию */
  margin-top: 8px; /* отступ сверху */
  padding: 8px 0; /* отступы сверху и снизу */
}

/* ========== СЕТКА КАТАЛОГА ========== */
.catalog-container {
  max-width: 1200px;
  min-height: 500px;
  margin: 0 auto;
  padding: 16px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
  box-sizing: border-box;
  align-items: start;
}

/* Высота для каталога "На заказ" */
.catalog-container.catalog-order {
  min-height: 410px;
}

/* Высота для каталога "В наличии" */
.catalog-container.catalog-stock {
  min-height: 450px;
}

/* Хедер как на странице продукта */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 200;
}

/* Центрирование логотипа в шапке */
.site-header .logo {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
}

/* Скрываем дублирующий верхний логотип только на странице каталога */
.logo-top {
  display: none !important;
}

/* Размер логотипа */
.site-header .logo img {
  height: 60px;
}

/* На десктопе логотип слева */
@media (min-width: 721px) {
  .site-header .logo {
    position: static;
    transform: none;
  }
}

.burger {
  display: none;
  background: none;
  border: 0;
  width: 36px;
  height: 28px;
  padding: 0;
  margin-left: 8px;
  cursor: pointer;
}
.burger span {
  display: block;
  height: 3px;
  background: #45555f;
  margin: 6px 0;
  border-radius: 2px;
}

.mobile-menu {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
  z-index: 300;
}
.mobile-menu.open {
  opacity: 1;
  pointer-events: auto;
}
.mobile-menu-panel {
  position: absolute;
  top: 80px;
  left: 0;
  right: 0;
  background: #fff;
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  border-bottom: 1px solid #e5e7eb;
  max-height: calc(100vh - 80px);
  overflow-y: auto;
}
.mobile-menu-close {
  position: absolute;
  top: 8px;
  right: 8px;
  background: none;
  border: 0;
  font-size: 24px;
  line-height: 1;
  color: #45555f;
  cursor: pointer;
}
.mobile-menu-panel a {
  color: #45555f;
  text-decoration: none;
  font-weight: 500;
}
.logo-top {
  display: none !important;
}

@media (max-width: 1025px) {
  .nav-links {
    display: none;
  }
  .burger {
    display: inline-block;
  }
  .site-header {
    position: fixed !important;
    top: 0;
    left: 0;
    right: 0;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding: 0 8px;
    height: 48px !important;
  }
  /* Отступ под фиксированной шапкой (моб) */
  main {
    padding-top: 48px;
  }
  .site-header .logo {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
  }
  .profile-icon {
    margin-left: auto;
  }
  .profile-icon,
  .cart-icon {
    display: flex;
    align-items: center;
  }
  .site-header .cart-icon {
    position: static !important;
    top: auto !important;
    right: auto !important;
    transform: none !important;
    margin-right: 10px;
  }
  .site-header .cart-icon .cart-badge.show {
    margin-right: 10px;
    margin-top: 6px;
  }
  .mobile-menu-panel {
    top: 48px;
  }
}

/* Анимация появления карточек */
.card {
  position: relative;
  transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
  opacity: 0;
  transform: translateY(20px) translateZ(0);
  display: flex;
  flex-direction: column;
  font-size: 16px;
  line-height: 1.3;
  overflow: visible;
  contain: layout style paint;
  will-change: transform, opacity;
}

.card:hover {
  position: relative;
  z-index: 100;
  transform: translateY(-4px) translateZ(0);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.15);
  /* scale убран для производительности */
}

.card.show {
  opacity: 1;
  transform: translateY(0);
  animation: cardSlideIn 0.5s cubic-bezier(0.4, 0, 0.2, 1) forwards;
  height: 480px;
  display: flex;
  flex-direction: column; /* вертикальное расположение содержимого */
}

/* Высота карточек для каталога "На заказ" */
.catalog-order .card {
  height: 440px; /* уменьшено на 20px для более компактных карточек */
}

.catalog-prices-blurred {
  filter: blur(12px);
  pointer-events: none;
  user-select: none;
  transition: filter 0.3s ease;
}

@keyframes cardSlideIn {
  from {
    opacity: 0;
    transform: translateY(30px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Анимация для элементов управления */
.catalog-controls {
  animation: fadeInDown 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Анимация для поиска и сортировки */
.search-container,
.sort-container,
.filter-container {
  animation: slideInRight 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Плавная анимация при фокусе */
.search-input:focus,
select:focus {
  animation: none;
}

/* Не поднимать при наведении на тач-устройствах */
@media (hover: none) {
  .card:hover {
    transform: none;
  }
}

/* ========== АДАПТИВ ========== */
@media (max-width: 1300px) {
  .catalog-container {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
  }

  .card {
    padding: 12px;
  }

  .card-name {
    font-size: 18px;
    min-height: calc(
      1.3em * 2
    ); /* Зарезервировано место под две строки с учетом меньшего font-size */
  }

  .card-price {
    font-size: 15px;
  }
}

@media (max-width: 1024px) {
  .catalog-container {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .catalog-header {
    font-size: 28px;
    margin-top: 24px;
  }

  .catalog-controls {
    padding: 0 12px;
    gap: 12px;
    top: 80px;
  }

  .catalog-filters button {
    padding: 6px 12px;
    font-size: 13px;
  }

  .search-input {
    min-width: 140px;
    max-width: 200px;
  }

  main {
    padding-top: 0px;
  }
}

@media (max-width: 768px) {
  .catalog-container {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    padding: 12px;
  }

  .catalog-controls {
    flex-direction: column;
    gap: 12px;
    align-items: stretch;
    top: 80px;
  }

  .catalog-filters {
    flex: 1 1 100%;
    justify-content: center;
    overflow-x: auto;
    padding-bottom: 8px;
  }

  .controls-right {
    flex-direction: row;
    justify-content: center;
    gap: 8px;
  }

  .search-input {
    min-width: 120px;
    max-width: 180px;
  }
}

@media (max-width: 700px) {
  .catalog-header {
    font-size: 24px;
    margin: 16px 0;
    padding: 0 16px;
  }

  .catalog-container {
    grid-template-columns: 1fr;
    gap: 16px;
    padding: 12px;
  }
}

@media (max-width: 768px) {
  .catalog-controls {
    padding: 0 12px;
    margin-bottom: 20px;
    top: 88px;
  }

  .catalog-filters {
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 6px;
    max-height: 120px;
    overflow-y: auto;
  }

  .catalog-filters button {
    padding: 6px 10px;
    font-size: 12px;
    border-radius: 16px;
    white-space: nowrap;
  }

  .controls-right {
    flex-direction: column;
    gap: 8px;
    width: 100%;
  }

  .search-input {
    width: 100%;
    min-width: auto;
    max-width: none;
  }

  .sort-wrapper {
    width: 100%;
  }

  .sort-select {
    width: 100%;
  }

  main {
    padding-top: 0px;
  }
}

@media (max-width: 480px) {
  .catalog-header {
    font-size: 20px;
    margin: 12px 0;
  }

  .catalog-container {
    padding: 8px;
    gap: 12px;
  }

  .catalog-controls {
    padding: 0 8px;
    top: 88px;
  }

  .catalog-filters {
    max-height: 100px;
  }

  .catalog-filters button {
    padding: 5px 8px;
    font-size: 11px;
  }
}
.add-category-btn {
  background-color: #28a745;
  color: #0f172a;
  border: none;
  border-radius: 6px;
  padding: 6px 12px;
  cursor: pointer;
  font-weight: bold;
  transition: background 0.2s;
}

.add-category-btn:hover {
  background-color: #218838;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(4px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

.modal-panel {
  background: #fff;
  border-radius: 12px;
  padding: 24px;
  width: 300px;
  max-width: 90%;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* ========== УЛУЧШЕННЫЕ СТИЛИ ДЛЯ АДМИНСКИХ МОДАЛЬНЫХ ОКОН ========== */

.modal-input {
  padding: 12px 16px;
  border: 2px solid #e5e7eb;
  border-radius: 10px;
  width: 100%;
  font-size: 14px;
  margin-bottom: 12px;
  background: #ffffff;
  color: #1f2937;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-sizing: border-box;
  font-family: inherit;
}

.modal-input:hover:not(:disabled):not(:focus) {
  border-color: #d1d5db;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.modal-input:focus {
  outline: none;
  border-color: #7fb314;
  box-shadow: 0 0 0 3px rgba(127, 179, 20, 0.1),
    0 4px 12px rgba(127, 179, 20, 0.15);
  transform: translateY(-1px);
}

.modal-input::placeholder {
  color: #9ca3af;
  opacity: 1;
}

.modal-input:disabled {
  background: #f9fafb;
  color: #6b7280;
  cursor: not-allowed;
  opacity: 0.7;
}

.modal-input[type="number"] {
  -moz-appearance: textfield;
  appearance: textfield;
}

.modal-input[type="number"]::-webkit-inner-spin-button,
.modal-input[type="number"]::-webkit-outer-spin-button {
  -webkit-appearance: none;
  appearance: none;
  margin: 0;
}

textarea.modal-input {
  min-height: 100px;
  resize: vertical;
  font-family: inherit;
  line-height: 1.5;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.add-category-btn {
  background-color: #7fb314 !important;
  color: white;
}

.add-category-btn:hover {
  background-color: #6a9810 !important;
  color: rgb(206, 206, 206) !important;
}
.category-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #f3f3f3;
  border-radius: 6px;
  padding: 6px 10px;
  margin-bottom: 6px;
}

.category-item span {
  font-size: 14px;
}

.delete-btn {
  background: none;
  border: none;
  color: #ef4444;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  padding: 6px 12px;
  border-radius: 6px;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.delete-btn:hover {
  color: #dc2626;
  background: #fef2f2;
  transform: translateY(-1px);
}

.delete-btn:active {
  transform: translateY(0);
}

.btn-column {
  display: flex;
  flex-direction: column;
  gap: 4px; /* расстояние между кнопками */
}

.replace-btn {
  background: none;
  border: none;
  color: #3b82f6;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  padding: 6px 12px;
  border-radius: 6px;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.replace-btn:hover {
  color: #2563eb;
  background: #eff6ff;
  transform: translateY(-1px);
}

.replace-btn:active {
  transform: translateY(0);
}

.dropzone {
  border: 2px dashed #d1d5db;
  padding: 24px 20px;
  border-radius: 12px;
  text-align: center;
  margin-bottom: 12px;
  background: linear-gradient(135deg, #fafafa 0%, #f9fafb 100%);
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.dropzone::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(127, 179, 20, 0.1),
    transparent
  );
  transition: left 0.5s;
}

.dropzone:hover {
  background: linear-gradient(135deg, #f3f4f6 0%, #f9fafb 100%);
  border-color: #7fb314;
  box-shadow: 0 4px 12px rgba(127, 179, 20, 0.15);
  transform: translateY(-2px);
}

.dropzone:hover::before {
  left: 100%;
}

.dropzone.dragover {
  border-color: #7fb314;
  background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
  box-shadow: 0 8px 24px rgba(127, 179, 20, 0.25);
  transform: scale(1.02);
}

.dropzone p {
  margin: 0 0 12px 0;
  color: #6b7280;
  font-size: 14px;
  font-weight: 500;
}

.dropzone.uploading {
  opacity: 0.7;
  pointer-events: none;
  cursor: wait;
}

.error-input {
  border-color: #ef4444 !important;
  background: #fef2f2 !important;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1) !important;
}

.error-input:focus {
  border-color: #ef4444 !important;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15) !important;
}

.error-text {
  color: #ef4444;
  font-size: 13px;
  margin-top: 6px;
  margin-bottom: 4px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 6px;
}

.error-text::before {
  content: "⚠";
  font-size: 16px;
}

.delete-product-btn {
  position: absolute;
  top: 6px;
  right: 6px;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 28px;
  height: 28px;
  font-size: 18px;
  line-height: 26px;
  cursor: pointer;
  z-index: 10;
  transition: background 0.2s;
}
.delete-product-btn:hover {
  background: rgba(220, 38, 38, 0.85); /* красный при наведении */
}
.card {
  position: relative; /* нужно для абсолютного позиционирования кнопки */
}

/* Кнопка редактирования товара */
.edit-product-btn {
  position: absolute;
  top: 6px;
  right: 36px; /* Немного слева от кнопки удаления */
  width: 28px;
  height: 28px;
  background-color: #4a90e2; /* цвет в стиле кнопок сайта */
  color: white;
  border: none;
  border-radius: 50%;
  font-size: 16px;
  font-weight: bold;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s, transform 0.2s;
  z-index: 2;
}

.edit-product-btn:hover {
  background-color: #357ab8;
  transform: scale(1.1);
}

/* dropzone + видео-превью */
.dropzone {
  border: 2px dashed #ddd;
  padding: 12px;
  border-radius: 8px;
  text-align: center;
  cursor: pointer;
  background: #fafafa;
}
.dropzone.dragover {
  background: #f0f8ff;
  border-color: #8ab4ff;
}
.video-preview {
  margin-top: 8px;
  display: block;
  width: 120px;
  height: 80px;
  object-fit: cover;
  border-radius: 6px;
}
/* ========== МОДАЛКА ПРОФИЛЯ ========== */

.profile-modal-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;

  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(2px);
  z-index: 2500;
}

.profile-modal {
  background: white;
  padding: 20px;
  border-radius: 12px;
  max-width: 600px;
}

.profile-form h2 {
  justify-content: center;
  display: flex;
}

.profile-tabs {
  display: flex;
  justify-content: space-around;
  margin-bottom: 20px;
}
.profile-tabs button {
  flex: 1;
  padding: 10px;
  background: #f3f3f3;
  border: none;
  cursor: pointer;
}
.profile-tabs button.active {
  background: #45555f;
  color: white;
  font-weight: bold;
}

.profile-form {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.profile-form input {
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 6px;
}
.profile-form button {
  padding: 12px;
  border: none;
  border-radius: 6px;
  background: #7fb314;
  color: white;
  font-weight: bold;
  cursor: pointer;
}
.profile-form button:hover {
  background-color: #6a9810;
  transform: scale(1.05);
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.2);
}
.profile-form .msg {
  font-size: 14px;
  color: red;
  text-align: center;
  height: 5px;
  margin: 0px;
  margin-top: -15px;
}

@media (max-width: 480px) {
  .profile-modal {
    padding: 15px;
    max-width: 95%;
  }
  .profile-form input,
  .profile-form button {
    font-size: 14px;
  }
}

/* Стили профиля конец */

.cart-badge {
  position: absolute;
  top: -6px;
  right: -6px;
  background: #e63946;
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  border-radius: 50%;
  padding: 2px 6px;
  line-height: 1;
  min-width: 18px;
  text-align: center;
  display: none; /* скрыт по умолчанию */
  z-index: 10;
}

.cart-badge.show {
  display: inline-block;
}

/* ========== СТИЛИ КНОПОК ДЛЯ АДМИНКИ ========== */

.btn {
  padding: 12px 24px;
  border: none;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: inherit;
  line-height: 1.5;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none !important;
}

.btn-primary {
  background: linear-gradient(135deg, #7fb314 0%, #6a9810 100%);
  color: white;
  box-shadow: 0 4px 12px rgba(127, 179, 20, 0.3);
}

.btn-primary:hover:not(:disabled) {
  background: linear-gradient(135deg, #6a9810 0%, #5a7f0e 100%);
  box-shadow: 0 6px 20px rgba(127, 179, 20, 0.4);
  transform: translateY(-2px);
}

.btn-primary:active:not(:disabled) {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(127, 179, 20, 0.3);
}

.btn-secondary {
  background: #f3f4f6;
  color: #374151;
  border: 2px solid #e5e7eb;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.btn-secondary:hover:not(:disabled) {
  background: #e5e7eb;
  border-color: #d1d5db;
  color: #1f2937;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.btn-secondary:active:not(:disabled) {
  transform: translateY(0);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.btn-danger {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  color: white;
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.btn-danger:hover:not(:disabled) {
  background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
  box-shadow: 0 6px 20px rgba(239, 68, 68, 0.4);
  transform: translateY(-2px);
}

.btn-danger:active:not(:disabled) {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(239, 68, 68, 0.3);
}

/* ========== СТИЛИ ЛЕЙБЛОВ ========== */

.cart-content label,
.cart-panel label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: #374151;
  margin-bottom: 8px;
  margin-top: 4px;
}

.cart-content label:first-child,
.cart-panel label:first-child {
  margin-top: 0;
}

.cart-content h3,
.cart-panel h3 {
  font-size: 18px;
  font-weight: 700;
  color: #1f2937;
  margin: 20px 0 12px 0;
  padding-bottom: 8px;
  border-bottom: 2px solid #e5e7eb;
}

/* ========== СТИЛИ СПИСКОВ ПОДСКАЗОК ========== */

.category-suggestions,
.material-suggestions {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: white;
  border: 2px solid #e5e7eb;
  border-radius: 10px;
  max-height: 200px;
  overflow-y: auto;
  z-index: 1000;
  list-style: none;
  margin: 4px 0 0 0;
  padding: 4px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
  animation: fadeInDown 0.2s ease-out;
}

@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.category-suggestions li,
.material-suggestions li {
  padding: 10px 14px;
  cursor: pointer;
  border-radius: 8px;
  transition: all 0.2s ease;
  color: #374151;
  font-size: 14px;
}

.category-suggestions li:hover,
.material-suggestions li:hover {
  background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
  color: #166534;
  transform: translateX(4px);
}

.category-suggestions li:active,
.material-suggestions li:active {
  background: #7fb314;
  color: white;
}

/* ========== СТИЛИ БЛОКОВ ЦВЕТОВ ========== */

.color-block {
  border: 2px solid #e5e7eb !important;
  padding: 20px !important;
  border-radius: 12px !important;
  margin-bottom: 20px !important;
  background: linear-gradient(135deg, #fafafa 0%, #ffffff 100%);
  transition: all 0.3s ease;
}

.color-block:hover {
  border-color: #7fb314 !important;
  box-shadow: 0 4px 12px rgba(127, 179, 20, 0.15);
  transform: translateY(-2px);
}

/* ========== УЛУЧШЕНИЕ КНОПОК В ФУТЕРЕ МОДАЛЬНОГО ОКНА ========== */

.cart-footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 20px;
  padding-top: 20px;
  border-top: 2px solid #e5e7eb;
}

/* ========== СТИЛИ ДЛЯ КНОПОК УДАЛЕНИЯ ФОТО ========== */

.cart-content
  button:not(.btn):not(.delete-btn):not(.replace-btn):not(.cart-close):not(
    .btn-primary
  ):not(.btn-secondary):not(.btn-danger) {
  padding: 8px 16px;
  background: #f3f4f6;
  border: 2px solid #e5e7eb;
  border-radius: 8px;
  color: #374151;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.cart-content
  button:not(.btn):not(.delete-btn):not(.replace-btn):not(.cart-close):not(
    .btn-primary
  ):not(.btn-secondary):not(.btn-danger):hover {
  background: #e5e7eb;
  border-color: #d1d5db;
  transform: translateY(-1px);
}

/* ========== УЛУЧШЕНИЕ ОТСТУПОВ В МОДАЛЬНОМ ОКНЕ ========== */

.cart-content > div {
  margin-bottom: 4px;
}

.cart-content > div:last-child {
  margin-bottom: 0;
}

/* ========== СТИЛИ ДЛЯ ИЗОБРАЖЕНИЙ В МОДАЛЬНОМ ОКНЕ ========== */

.cart-content img {
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
}

.cart-content img:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  transform: scale(1.02);
}

/* ========== АДАПТИВНОСТЬ ========== */

@media (max-width: 768px) {
  .btn {
    padding: 10px 20px;
    font-size: 13px;
  }

  .modal-input {
    padding: 10px 14px;
    font-size: 16px; /* Предотвращает зум на iOS */
  }

  .cart-footer {
    flex-direction: column-reverse;
  }

  .cart-footer .btn {
    width: 100%;
  }
}
