/* -------------------------------------------
   1) GLOBAL & BASIC RESETS
------------------------------------------- */
body {
  font-family: "Roboto", sans-serif;
  background-color: #f8f9fa;
  margin: 0;
  padding: 0;
}

html,
body {
  color: #333;
}

/* -------------------------------------------
   2) NAVBAR & TOGGLER
   (Box-shadow removed)
------------------------------------------- */
.navbar {
  border-radius: 16px !important;
  box-shadow: none !important; /* Removed header shadow */
}
.navbar-toggler {
  border: none;
  cursor: pointer;
  margin-right: 5px;
}
.navbar-toggler:focus {
  outline: none;
  box-shadow: none;
}

/* -------------------------------------------
   3) LOGO (Center)
------------------------------------------- */
.logo-container {
  display: flex;
  justify-content: center;
  align-items: center;
}


/* -------------------------------------------
   4) SIDE MENU
------------------------------------------- */
.side-menu {
  position: fixed;
  top: 0;
  left: -290px;
  width: 290px;
  height: 100vh;
  background: #fff;
  box-shadow: 2px 0 6px rgba(0, 0, 0, 0.1);
  transition: left 0.3s ease;
  z-index: 1050;
  padding: 20px;
  overflow-y: auto;
  border-radius: 16px;
}
.side-menu.active {
  left: 0;
}

.side-menu ul {
  list-style: none;
  padding: 0;
  margin: 0;
}
.side-menu ul li {
  margin-bottom: 10px;
  border-bottom: 1px solid #eee;
}
.side-menu ul li a {
  color: #2c3e50;
  text-decoration: none;
  display: block;
  padding: 12px 0;
  transition: color 0.3s ease;
  border-radius: 8px;
}
.side-menu ul li a:hover {
  color: #c00;
}

/* -------------------------------------------
   5) TOP-LEVEL CATEGORY TOGGLES
------------------------------------------- */
.top-cat-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.top-cat-item {
  position: relative;
  margin-bottom: 6px;
  border-bottom: 1px solid #ddd;
  padding: 6px 0;
}
.cat-header {
  display: flex;
  align-items: center;
  padding: 6px 0;
}
.cat-header .cat-text {
  flex: 0 0 auto;
  display: inline-block;
  color: #333;
  text-decoration: none;
  margin-right: 8px;
}
.toggle-arrow {
  flex: 0 0 auto;
  font-size: 1.6em;
  margin-left: auto;
  cursor: pointer;
  transition: transform 0.3s ease;
}
.top-cat-item.open .toggle-arrow {
  transform: rotate(90deg);
}

/* Smooth expand/collapse for subcategories */
.subcat-list {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
  list-style: none;
  margin: 0;
  padding-left: 0;
}
.top-cat-item.open .subcat-list {
  max-height: 500px;
  margin-top: 6px;
}
.subcat-list li {
  margin: 0;
  padding: 0;
  border-bottom: 1px solid #eee;
}
.subcat-list li:last-child {
  border-bottom: none;
}
.subcat-list li a {
  display: block;
  padding: 6px 10px;
  text-decoration: none;
  color: #333;
  text-align: left;
  background-color: #fafafa;
  border-radius: 8px;
  transition: background 0.2s ease;
}
.subcat-list li a:hover {
  background: #f2f2f2;
}

/* ------------------------------------ 
   6) Product Cards (Updated)
------------------------------------- */

.product-item {
  display: flex;
  flex-direction: column;
}

.card-title {
  min-height: 3.2em; /* enough for 2 lines */
  line-height: 1.6em;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-card .card-img-top {
  height: 200px; /* You can adjust this value */
  width: 100%;
  object-fit: contain; /* or 'cover' depending on your needs */
  object-position: center;
}

@media (max-width: 576px) {
  .product-item {
    padding-left: 5px;
    padding-right: 5px;
  }

  .product-grid {
    margin-left: -5px;
    margin-right: -5px;
  }
}

.product-card {
  border: 2px solid #c00;  /* Red border from second site */
  position: relative;
  overflow: hidden;
  padding: 12px;
  display: flex;
  flex-direction: column;
  height: 100%;
  justify-content: space-between;
  transition: all 0.3s ease;
  border-radius: 16px; /* Updated border-radius to match second site */
}
.product-card img {
  max-width: 100%;
  height: auto;
  display: block;
  margin-bottom: 12px;
  border-radius: 16px; /* Updated border-radius to match second site */
}

/* SKIDKA label */
.skidka-label {
  position: absolute;
  top: 15px;
  left: 8px;
  background: red;
  color: #fff;
  padding: 4px 8px;
  font-size: 0.85rem;
  font-weight: 700;
  z-index: 2;
  border-radius: 3px;
  transform: rotate(-15deg);
}

/* Color circle in product description */
.color-circle {
  display: inline-block;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  margin-left: 6px;
  margin-right: 5px;
  vertical-align: middle;
  border: 1px solid #999;
}
@media (max-width: 576px) {
  .color-circle {
    width: 10px;
    height: 10px;
    margin-left: 4px;
    margin-right: 3px;
  }
}

.product-info {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  text-align: center;
}
.product-info .product-name {
  font-size: 0.95rem; /* было 1.1rem */
  line-height: 1.4rem;
}
.product-info .price-block {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.discount-badge {
  background-color: red;
  color: #fff;
  padding: 3px 6px;
  border-radius: 3px;
  font-size: 0.85rem;
  margin-top: 6px;
}
.color-info {
  margin-top: 10px;
  font-size: 0.9rem;
  display: flex;
  justify-content: center;
  align-items: center;
}
@media (max-width: 576px) {
  .color-info {
    margin-top: 5px;
    font-size: 0.6rem;
  }
  .product-info .product-name {
    font-size: 0.9rem; /* было 1rem */
    line-height: 1.3rem;
  }
  .product-info .price-block {
    gap: 6px;
  }
  .discount-badge {
    font-size: 0.75rem;
    padding: 2px 4px;
    margin-top: 4px;
  }
}
 

/* Cart badge */
.cart-badge {
  background: #dc3545;
  color: #fff;
  border-radius: 50%;
  padding: 2px 6px;
  font-size: 0.7rem;
  position: absolute;
  top: -5px;
  right: 0;
}

.product-card:hover {
  box-shadow: 0px 4px 12px rgba(0, 0, 0, 0.1);
  transform: translateY(-4px);
}

@media (max-width: 576px) {
  .action-buttons {
    margin-top: 8px;
  }
  .action-buttons button {
    padding: 6px 12px;
    font-size: 0.9rem;
  }
  .cart-badge {
    padding: 1px 4px;
    font-size: 0.6rem;
  }
}

/* ------------------------------------ 
   Category Cards (Updated)
------------------------------------- */
.category-card {
  margin-bottom: 20px;
  border: 2px solid #c00;  /* Red border */
  overflow: hidden;
  padding: 12px;
  transition: all 0.3s ease;
  border-radius: 16px; /* Updated border-radius */
}
.category-card .btn {
  margin-top: 12px;
  font-size: 1rem;
  padding: 8px 16px;
  border-radius: 8px;  /* Adjusted for subtle rounding */
  border: 2px solid #c00;  /* Red border */
  background-color: #c00;  /* Red background */
  color: #fff;
  transition: background-color 0.3s ease, transform 0.2s ease;
}
.category-card .btn:hover {
  background-color: #990000;  /* Darker red on hover */
  transform: scale(1.03);  /* Slight scaling effect */
}

@media (max-width: 576px) {
  .category-card {
    padding: 10px;
    margin-bottom: 16px;
  }
  .category-card .btn {
    font-size: 0.9rem;
    padding: 6px 12px;
    margin-top: 8px;
  }
}
.category-card img {
  border-radius: 16px;  /* Updated border-radius */
  max-width: 100%;
  display: block;
}


/* ------------------------------------ 
   Grid Layout for Product Cards (Responsive)
------------------------------------- */
.products-container {
  display: grid;
  grid-template-columns: repeat(4, 1fr); /* 4 columns on desktop */
  gap: 16px;
  margin-bottom: 32px;
}

@media (max-width: 576px) {
  .products-container {
    grid-template-columns: repeat(2, 1fr);
    gap: 1px; /* Was 16px → reduced for mobile tightness */
  }

  .product-card {
    margin: 0; /* Ensure no extra margin inside grid item */
  }
}


/* -------------------------------------------
   7) PREMIUM ANIMATIONS (Cards, Images, Buttons)
------------------------------------------- */
/* Card fade-in */
@keyframes premiumCardFadeIn {
  from {
    opacity: 0;
    transform: translateY(5px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}
.product-grid .product-card,
.category-grid .category-card {
  opacity: 0;
  animation: premiumCardFadeIn 0.7s ease-out forwards;
}
.product-grid .product-card:nth-child(1) {
  animation-delay: 0.05s;
}
.product-grid .product-card:nth-child(2) {
  animation-delay: 0.1s;
}
.product-grid .product-card:nth-child(3) {
  animation-delay: 0.15s;
}
.category-grid .category-card:nth-child(1) {
  animation-delay: 0.05s;
}
.category-grid .category-card:nth-child(2) {
  animation-delay: 0.1s;
}
.category-grid .category-card:nth-child(3) {
  animation-delay: 0.15s;
}

/* Image fade-in */
@keyframes premiumImageFadeIn {
  from {
    opacity: 0;
    transform: translateY(3px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.product-card .card-img-top,
.category-card .card-img-top {
  opacity: 0;
  animation: premiumImageFadeIn 0.7s ease-out forwards;
}
.product-grid .product-card:nth-child(1) .card-img-top {
  animation-delay: 0.1s;
}
.product-grid .product-card:nth-child(2) .card-img-top {
  animation-delay: 0.15s;
}
.product-grid .product-card:nth-child(3) .card-img-top {
  animation-delay: 0.2s;
}
.category-grid .category-card:nth-child(1) .card-img-top {
  animation-delay: 0.1s;
}
.category-grid .category-card:nth-child(2) .card-img-top {
  animation-delay: 0.15s;
}
.category-grid .category-card:nth-child(3) .card-img-top {
  animation-delay: 0.2s;
}

/* Buttons fade-in */
@keyframes premiumFadeIn {
  from {
    opacity: 0;
    transform: translateY(5px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.product-card .card-body .btn,
.category-card .card-body .btn {
  opacity: 0;
  animation: premiumFadeIn 0.8s ease-out forwards;
  animation-delay: 0.4s;
}

.btn-primary {
  background-color: #c00 !important;
  border-color: #c00 !important;
}

/* Buttons in product card */
.action-buttons {
  margin-top: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.action-buttons button {
  padding: 8px 16px;
  font-size: 1rem;
  cursor: pointer;
  transition: background-color 0.3s ease;
  border-radius: 20px; /* manual border-radius for buttons */
}
.action-buttons button:hover {
  background-color: #007bff;
  color: white;
}
.product-card .product-info,
.product-card .action-buttons {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
}

/* -------------------------------------------
   8) CART BADGE
------------------------------------------- */
.cart-badge {
  background: #dc3545;
  color: #fff;
  border-radius: 50%;
  padding: 2px 6px;
  font-size: 0.7rem;
  position: absolute;
  top: -5px;
  right: 0;
}

/* -------------------------------------------
   9) PRIVACY BANNER
------------------------------------------- */
.privacy-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  background: #f2f2f2;
  padding: 10px 20px;
  z-index: 9999;
  box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.15);
  text-align: center;
  border-radius: 16px;
}
.privacy-banner p {
  margin: 0;
  display: inline-block;
}
.privacy-banner button {
  margin-left: 10px;
}

/* -------------------------------------------
   10) FOOTER FADE-IN
------------------------------------------- */
@keyframes footerFadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
footer {
  opacity: 0;
  animation: footerFadeIn 1s ease-out forwards;
  animation-delay: 1s;
  border-radius: 16px;
  padding: 16px;
  margin-top: 0;
}

/* -------------------------------------------
   11) CONTACT BUTTONS (Footer)
------------------------------------------- */
.button-container {
  display: grid;
  grid-template-columns: repeat(2, auto);
  gap: calc(0.3vh + 0.3vw);
  justify-content: center;
  max-width: 400px;
  margin: auto;
}
.contact-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: min(2.5vw, 12px);
  padding: calc(0.3vh + 0.3vw) calc(0.5vh + 0.5vw);
  width: min(32vw, 130px);
  border-radius: 8px;
  text-decoration: none;
  transition: background-color 0.3s ease, transform 0.2s ease;
}
.contact-btn i {
  margin-right: 4px;
  font-size: 1em;
}
.contact-btn:hover {
  background-color: #0a131d;
  transform: scale(1.05);
}

/* -------------------------------------------
   12) RESPONSIVE TWEAKS
------------------------------------------- */
@media (max-width: 576px) {
  /* Remove extra horizontal container padding on mobile */
  .navbar .container {
    padding-left: 0px !important;
    padding-right: 0px !important;
  }
  .navbar-toggler {
    margin-left: 0 !important;
    margin-right: 0 !important;
  }
  .logo-container img {
    height: 32px !important;
    border-radius: 16px !important;
  }

  /* Move dropdown & cart a bit closer to the logo on mobile */
  .d-flex.align-items-center[style*="margin-right: 4px;"] {
    margin-right: 0px !important;
  }
  .dropdown[style*="margin-right: 1rem;"] {
    margin-right: 0.8rem !important;
  }

  /* Hide language text on mobile, keep only flag & arrow */
  #languageDropdown {
    font-size: 0;
    padding: 0;
    margin: 0;
    line-height: 1;
  }
  #languageDropdown img {
    margin-right: 3px;
    vertical-align: middle;
  }
  #languageDropdown::after {
    font-size: 14px;
    margin-left: 0;
    vertical-align: middle;
  }

  /* Make category cards fit better on small screens */
  .product-card,
  .category-card {
    padding: 8px;
    margin: 12px 8px 20px 8px; /* Slightly less margin on phone */
  }
  .product-card img,
  .category-card img {
    margin-bottom: 8px;
  }
  .product-info .product-name {
    font-size: 1rem;
  }
  .action-buttons button {
    font-size: 0.9rem;
    white-space: nowrap; /* Keep text from splitting awkwardly */
  }
}

/* -------------------------------------------
   13) OPTIONAL SCROLL MARGIN
------------------------------------------- */
#product-listing {
  scroll-margin-top: 80px;
}

/* -------------------------------------------
   14) Pagination Styles
------------------------------------------- */

.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  margin-top: 20px;
}

.pagination a, .pagination span {
  padding: 10px 15px;
  border: 1px solid #dee2e6;
  text-decoration: none;
  color: #007bff;
  border-radius: 4px;
}

.pagination a:hover {
  background-color: #f8f9fa;
}

.pagination .active {
  font-weight: bold;
  background-color: #007bff;
  color: #fff;
}

.pagination .disabled {
  color: #ccc;
  cursor: not-allowed;
}

.pagination .prev-page, .pagination .next-page {
  font-size: 1.1rem;
}


 #filter-panel {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 15px 20px;
    margin-bottom: 20px;
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    align-items: flex-start;
  }
  .filter-section {
    flex: 1 1 250px;
  }
  .filter-section h6 {
    font-size: 1.1rem;
    font-weight: bold;
    margin-bottom: 10px;
    border-bottom: 1px solid #dee2e6;
    padding-bottom: 5px;
  }
  #brandCheckboxes {
    max-height: 150px;
    overflow-y: auto;
  }
  #brandCheckboxes label {
    text-transform: uppercase;
    margin-right: 10px;
  }
  #active-filters {
    margin-bottom: 1rem;
  }
  #active-filters .badge {
    margin-right: 0.5rem;
  }
  /* Full-width select for subcategories */
  #subcategorySelect {
    width: 100%;
  }
  /* Container for reset-filters button, hidden by default */
  #reset-filters-container {
    width: 100%;
    text-align: right;
    margin-top: 10px;
    display: none;
  }
  
  /* -------------------- FILTER TOGGLE BUTTON (MOBILE) -------------------- */
  #toggle-filter-panel {
    display: none;
    width: 100%;
    padding: 10px 15px;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    /* Reduced bottom margin to tighten space below search bar */
    margin-bottom: 10px;
    font-size: 1rem;
    text-align: left;
  }
  #toggle-filter-panel .filter-icon {
    vertical-align: middle;
    margin-right: 8px;
  }
  
  /* -------------------- MOBILE STYLES -------------------- */
  @media (max-width: 576px) {
    #filter-panel {
      display: none;
    }
    #toggle-filter-panel {
      display: block;
    }
    /* When "mobile-open" is added, show the filter panel */
    #filter-panel.mobile-open {
      display: flex;
    }
    .filter-section {
      flex: 1 1 100%;
    }
    .filter-section h6 {
      font-size: 1rem;
      margin-bottom: 5px;
      padding-bottom: 3px;
    }
    #brandCheckboxes label {
      margin-right: 5px;
    }
  }

  /* -------------------- FLOATING FILTER BUTTON -------------------- */
  #filter-btn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background-color: #007bff;
    color: white;
    padding: 10px 20px;
    border-radius: 50px;
    font-size: 1rem;
    display: none; /* Hidden by default */
    z-index: 1050; /* Ensure it's on top */
  }

  #filter-btn.show {
    display: block; /* Show the button when it's supposed to be visible */
  }


  /* Modal close button */
  .close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
  }

  .close:hover,
  .close:focus {
    color: black;
    text-decoration: none;
    cursor: pointer;
  }
/* Добавляем отступ между полем ввода и кнопкой поиска */
.input-group > .form-control {
  margin-right: 0.5rem; /* «пару пробелов» */
}

/* Для мобильных экранов можно чуть уменьшить отступ */
@media (max-width: 576px) {
  .input-group > .form-control {
    margin-right: 0.3rem;
  }
}
/* ✅ Основной стиль для заголовков категорий */
.side-menu .top-cat-list .cat-header {
  padding: 4px 6px;               /* Минимум вертикали */
  font-size: 1rem;
  font-weight: 600;              /* ЖИРНЕЕ! */
  line-height: 1.1;              /* Компактнее по вертикали */
  word-break: break-word;        /* Перенос по словам */
  white-space: normal;
}

/* ✅ Текст категории */
.side-menu .top-cat-list .cat-header .cat-text {
  font-size: 1rem;
  font-weight: 700;              /* Ещё жирнее текст */
  line-height: 1.2;
  margin-right: 0.4rem;
  word-break: break-word;
}

/* ✅ Стиль для подкатегорий */
.side-menu .top-cat-list .subcat-list {
  padding-left: 12px;
  margin-top: 4px;
}

.side-menu .top-cat-list .subcat-list li {
  font-size: 0.9rem;
  line-height: 1.1;
  margin-bottom: 2px;
  list-style-type: disc;        /* Буллеты */
  font-weight: 500;
  color: #444;
}

/* ✅ Уменьшаем отступы снизу */
.side-menu .bottom-links {
  padding: 10px 14px;
  font-size: 0.9rem;
  line-height: 1.3;
}

/* ✅ Убираем горизонтальный скролл */
.side-menu {
  overflow-x: hidden;
  scrollbar-width: thin;
  word-break: break-word;
}


/* 1) Фиксируем заголовок ровно на 3 строки */
.card.product-card .card-title {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;       /* обрезаем до 3 строк */
  overflow: hidden;            /* прячем остальное */
  line-height: 1.2em;          /* ваш текущий line-height */
  height: calc(1.2em * 3);     /* ровно 3 строки */
}

/* 2) Делаем колонки и карточки flex-контейнерами */
.product-item {
  display: flex;               /* колонка растянется под размер строки */
}

.card.product-card {
  display: flex;
  flex-direction: column;      /* внутренности по вертикали */
  flex: 1;                     /* чтобы занимать всю высоту .product-item */
}

/* 3) «Растягиваем» тело карточки, чтобы кнопки всегда были внизу */
.card.product-card .card-body {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  flex: 1;
}


 /* -------------------- FILTER PANEL STYLES -------------------- */
  #filter-panel {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 15px 20px;
    margin-bottom: 20px;
  }

  .filter-section h6 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 10px;
    padding-bottom: 4px;
    color: #333;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid #dee2e6;
  }

  #brandCheckboxes {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px 16px;
    max-height: 180px;
    overflow-y: auto;
    padding-right: 6px;
  }

  #brandCheckboxes::-webkit-scrollbar {
    width: 6px;
  }

  #brandCheckboxes::-webkit-scrollbar-thumb {
    background: #bbb;
    border-radius: 4px;
  }

  #brandCheckboxes label {
    display: flex;
    align-items: center;
    font-size: 0.9rem;
    cursor: pointer;
    margin: 0;
    text-transform: uppercase;
    color: #222;
    transition: color 0.2s ease;
  }

  #brandCheckboxes label:hover {
    color: #007bff;
  }

  #brandCheckboxes input[type="checkbox"] {
    margin-right: 6px;
    transform: scale(1.05);
  }

  .filter-section .form-control,
  .filter-section input[type="number"],
  .filter-section select {
    padding: 6px 10px;
    font-size: 0.9rem;
    height: 38px;
    border-radius: 4px;
    border: 1px solid #ccc;
  }

  .filter-section .form-row {
    display: flex;
    gap: 10px;
  }

  .filter-section .form-row .col {
    padding: 0;
  }

  #active-filters {
    margin-bottom: 1rem;
  }

  #active-filters .badge {
    margin-right: 0.5rem;
  }

  #subcategorySelect {
    width: 100%;
  }

  #reset-filters-container {
    width: 100%;
    text-align: right;
    margin-top: 10px;
    display: none;
  }

  #toggle-filter-panel {
    display: none;
    width: 100%;
    padding: 10px 15px;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    margin-bottom: 10px;
    font-size: 1rem;
    text-align: left;
  }

  #toggle-filter-panel .filter-icon {
    vertical-align: middle;
    margin-right: 8px;
  }

  @media (max-width: 576px) {
    #filter-panel {
      display: none;
    }
    #toggle-filter-panel {
      display: block;
    }
    #filter-panel.mobile-open {
      display: flex;
    }
    .filter-section {
      flex: 1 1 100%;
    }
    #brandCheckboxes {
      grid-template-columns: 1fr;
      max-height: 250px;
    }
    #brandCheckboxes label {
      margin-right: 5px;
    }
  }
 /* -------------------- category pages -------------------- */

  .product-item {
    margin-bottom: 1rem !important;
  }

  .card.product-card .card-body {
    padding: 0.75rem !important;
  }

  .card.product-card .card-title {
    font-size: 0.9rem !important;
    font-weight: bold !important;
    margin-bottom: 0 !important;
  }

  .card.product-card .card-text {
    margin: 0 !important;
    font-size: 0.9rem !important;
    line-height: 1.2 !important;
  }

  .card.product-card .color-circle {
    width: 12px !important;
    height: 12px !important;
    margin: 0 8px !important;
  }

  .card.product-card .d-inline-flex span.ml-1 {
    font-size: 1rem !important;
    line-height: 1.2 !important;
  }

  .price-block {
    margin-bottom: 0.5rem !important;
  }

  @media (max-width: 576px) {
    .card.product-card .d-flex.justify-content-between {
      display: flex !important;
      flex-direction: column !important;
      align-items: flex-start !important;
    }
    .card.product-card .d-flex.justify-content-between .card-text {
      margin-bottom: 0.25rem !important;
    }
    .card.product-card .d-flex.justify-content-between .d-inline-flex {
      align-self: flex-end !important;
    }

    .card.product-card .color-circle {
      width: 10px !important;
      height: 10px !important;
      margin: 0 6px !important;
    }
    .card.product-card .d-inline-flex span.ml-1 {
      font-size: 0.9rem !important;
      line-height: 1.2 !important;
    }
  }

  #search-suggestions-category {
    max-height: 400px;
    overflow-y: auto;
  }

  .scroll-hint-overlay {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 60px;
    background: linear-gradient(to bottom, rgba(255,255,255,0), rgba(255,255,255,1));
    display: flex;
    justify-content: center;
    align-items: center;
    pointer-events: none;
    opacity: 1;
    transition: opacity 0.5s ease;
  }

  .scroll-hint .arrow {
    font-size: 28px;
    font-weight: bold;
    color: #000;
    animation: arrowSlide 1.5s infinite;
    pointer-events: auto;
    cursor: pointer;
  }

  @keyframes arrowSlide {
    0% { transform: translateY(0); opacity: 1; }
    50% { transform: translateY(30px); opacity: 0.7; }
    100% { transform: translateY(0); opacity: 1; }
  }

  .pagination-nav {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding: 0 10px;
    margin-top: 1rem;
  }

  .pagination {
    flex-wrap: nowrap;
    gap: 6px;
    display: inline-flex;
    white-space: nowrap;
  }

  @media (max-width: 576px) {
    .pagination-nav {
      justify-content: flex-start !important;
    }

    .pagination .page-link {
      padding: 6px 10px;
      font-size: 0.85rem;
    }

    .pagination .disabled span,
    .pagination .page-item.disabled .page-link {
      display: none;
    }
  }

  @media (max-width: 576px) {
  #cartModal .modal-content {
    padding: 10px;
  }

  #cartModal .modal-body {
    padding: 5px 10px;
  }

  #cart-items > div {
    border-bottom: 1px solid #ddd;
    padding: 10px 0;
    display: flex;
    align-items: center;
    gap: 10px;
  }

  #cart-items img {
    width: 40px;
    height: auto;
    border-radius: 4px;
  }

  #cart-items .product-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    font-size: 0.85rem;
  }

  #cart-items .quantity-control {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: 6px;
  }

  #cart-items .quantity-control button {
    width: 28px;
    height: 28px;
    font-size: 1rem;
    padding: 0;
    border-radius: 6px;
  }

  #cart-items .remove-btn {
    background: none;
    border: none;
    font-size: 1.2rem;
    color: #dc3545;
  }

  .cart-total {
    font-size: 1rem;
    font-weight: bold;
    text-align: right;
    padding-top: 10px;
  }

  .modal-footer .btn {
    font-size: 0.9rem;
    padding: 8px 14px;
  }
}
@media (max-width: 576px) {
  .side-menu .top-cat-list .cat-header .cat-text {
    font-size: 0.85rem !important;
    line-height: 1.2em !important;
    display: -webkit-box;
    -webkit-line-clamp: 3;         /* максимум 3 строки */
    -webkit-box-orient: vertical;
    overflow: hidden;
    height: calc(1.2em * 3);        /* высота точно на 3 строки */
    word-break: break-word;
  }
}
.order-items-scroll {
  max-height: 120px;
  overflow-y: auto;
  padding-right: 8px;
  scrollbar-width: thin;
}
.order-items-scroll::-webkit-scrollbar {
  width: 4px;
}
.order-items-scroll::-webkit-scrollbar-thumb {
  background-color: rgba(0, 0, 0, 0.3);
  border-radius: 4px;
}

.order-items-list {
  list-style-type: upper-roman;         /* I, II, III */
  font-size: 0.9rem;
  padding-left: 20px;
  list-style-position: inside;
}

.order-items-list li::marker {
  font-weight: bold;
  color: #333;
}


@media (max-width: 576px) {
  /* Make all Bootstrap modals full‐width on small screens */
  .modal-dialog {
    max-width: 100% !important;
    margin: 0 0.5rem;       /* small gutter each side */
  }
  .modal-content {
    border-radius: 16px;     /* keep your rounding */
    overflow: hidden;
  }
}

/* ─── Cart modal product‐name truncation ─── */
/* Ensure flex child can shrink so text‐truncate works */
#cartModal .modal-body .d-flex.align-items-center > .flex-grow-1 {
  min-width: 0;
}
/* Clamp to one line with ellipsis, full text visible on hover */
#cartModal .modal-body .d-flex.align-items-center h6 {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: help; /* hint that you can hover for full */
}
/* Optional: Tooltip on hover for full title */
#cartModal .modal-body .d-flex.align-items-center h6:hover {
  position: relative;
}
#cartModal .modal-body .d-flex.align-items-center h6[title]:hover::after {
  content: attr(title);
  position: absolute;
  left: 0; top: 100%;
  white-space: normal;
  background: rgba(0,0,0,0.8);
  color: #fff;
  padding: 4px 8px;
  border-radius: 4px;
  z-index: 1000;
  width: max-content;
  max-width: 80vw;
}

/* 🔧 Подкатегории: отступ и фон по ширине текста */
.side-menu .top-cat-list .subcat-list li a {
  display: inline-block;         /* фон только под текст */
  padding-left: 12px;            /* отступ слева — 1-2 пробела */
  padding-right: 12px;           /* чтобы фон не обрывался сразу */
  background-color: #f2f2f2;     /* серый фон */
  border-radius: 14px;           /* чуть скруглённые углы */
  margin-bottom: 6px;            /* немного воздуха между строками */
}

@media (max-width: 767.98px) {
  .category-card .card-title {
    font-size: 0.88rem !important;
    line-height: 1.2 !important;
    display: -webkit-box !important;
    -webkit-line-clamp: 3 !important;
    -webkit-box-orient: vertical !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    min-height: 3.6em !important;
  }
}
@media (max-width: 768px) {
  #cart-items .cart-item-title {
    font-size: 0.8rem !important;
    line-height: 1.1 !important;
    white-space: normal !important;
    word-break: break-word !important;
    max-height: 2.2em !important;
    overflow: hidden !important;
    display: -webkit-box !important;
    -webkit-line-clamp: 2 !important;
    -webkit-box-orient: vertical !important;
    text-align: left !important;
  }
}
.modal-header .close {
  padding: 0.5rem 0.75rem !important;
  margin: 0 !important;
  font-size: 1.5rem !important;
  line-height: 1 !important;
  text-align: center !important;
  width: 36px !important;
  height: 36px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  border-radius: 50% !important;
}
.cart-item-title {
  font-size: 0.82rem !important;
  line-height: 1.2 !important;
  white-space: normal !important;
  word-break: break-word !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  display: -webkit-box !important;
  -webkit-line-clamp: 2 !important;
  -webkit-box-orient: vertical !important;
  max-height: 2.4em !important;
  cursor: pointer !important;
}
