/**
 * modopencart.ru - Clean Modern CSS
 * Мінімалістичний стиль
 */

:root {
  --moc-primary: #21A038;
  --moc-primary-dark: #1a8a2e;
  --moc-primary-light: #2db848;
  --moc-text: #1a1a1a;
  --moc-text-secondary: #666;
  --moc-border: #e8e8e8;
  --moc-bg: #f5f5f5;
}

/* ========================================
   ЗАГАЛЬНІ СТИЛІ
   ======================================== */
.container {
  max-width: 1800px !important;
  width: 100% !important;
}

.btn-primary {
  background-color: var(--moc-primary);
  border-color: var(--moc-primary);
}
.btn-primary:hover,
.btn-primary:focus {
  background-color: var(--moc-primary-dark);
  border-color: var(--moc-primary-dark);
}

/* ========================================
   КАРТКА ТОВАРУ
   ======================================== */
.product-thumb {
  background: #fff;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 12px;
  transition: all 0.2s ease;
  position: relative;
}

.product-thumb:hover {
  border-color: var(--moc-border);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
}

/* Зображення */
.product-thumb .image {
  position: relative;
  margin-bottom: 12px;
  text-align: center;
}

.product-thumb .image a {
  display: block;
}

.product-thumb .image img {
  max-width: 100%;
  height: auto;
  aspect-ratio: 1/1;
  object-fit: contain;
  transition: transform 0.2s ease;
}

.product-thumb:hover .image img {
  transform: scale(1.02);
}

/* Контент */
.product-thumb .caption {
  padding: 0;
}

/* Назва товару */
.product-thumb .caption h4 {
  margin: 0 0 8px;
  min-height: 60px;
}

.product-thumb .caption h4 a {
  color: var(--moc-text);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.4;
}

.product-thumb .caption h4 a:hover {
  color: var(--moc-primary);
}

/* Опис - приховуємо в grid */
.product-thumb .caption > p:not(.price) {
  display: none;
}

/* Рейтинг */
.product-thumb .rating {
  margin-bottom: 8px;
}

.rating .fa-star,
.rating .fa-star-half-o {
  color: #ffc700;
  font-size: 12px;
}

.rating .fa-star-o {
  color: #e0e0e0;
  font-size: 12px;
}

/* Ціна */
.product-thumb .price {
  margin-bottom: 0;
}

.product-thumb .price-old {
  display: block;
  color: #999;
  font-size: 12px;
  text-decoration: line-through;
  font-weight: 400;
  margin-bottom: 2px;
}

.product-thumb .price-new {
  display: block;
  color: var(--moc-primary);
  font-size: 18px;
  font-weight: 700;
  line-height: 1.2;
}

.product-thumb .price {
  color: var(--moc-text);
  font-size: 18px;
  font-weight: 700;
}

.product-thumb .price-tax {
  display: block;
  color: #999;
  font-size: 11px;
  font-weight: 400;
  margin-top: 2px;
}

/* Кнопки */
.product-thumb .button-group {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
  padding: 0;
  border-top: none;
}

.product-thumb .button-group button {
  border: none;
  background: transparent;
  cursor: pointer;
  transition: all 0.2s ease;
}

/* Кнопка В корзину */
.product-thumb .button-group button:first-child {
  flex: 1;
  background: var(--moc-primary);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  padding: 10px 14px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.product-thumb .button-group button:first-child:hover {
  background: var(--moc-primary-dark);
}

/* Wishlist і Compare */
.product-thumb .button-group button:not(:first-child) {
  flex: 0 0 36px;
  width: 36px;
  height: 36px;
  color: #bbb;
  background: #f5f5f5;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.product-thumb .button-group button:not(:first-child):hover {
  color: var(--moc-primary);
  background: #e8f5e9;
}

.product-thumb .button-group button:not(:first-child) i {
  font-size: 14px;
}

/* ========================================
   CSS GRID - Сітка товарів
   ======================================== */
#content > .row:has(.product-thumb) {
  display: grid !important;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin: 0;
  padding: 0;
}

#content > .row:has(.product-thumb)::before,
#content > .row:has(.product-thumb)::after {
  display: none !important;
  content: none !important;
}

/* Службові елементи */
#content > .row:has(.product-thumb) > [class*="col-"]:not(.product-layout) {
  grid-column: 1 / -1;
  order: -1;
  width: 100% !important;
  max-width: 100% !important;
  padding: 0 !important;
  margin-bottom: 16px;
}

/* Товари */
#content > .row:has(.product-thumb) > .product-layout {
  width: 100% !important;
  max-width: 100% !important;
  padding: 0 !important;
  min-width: 0;
}

/* Картка на всю висоту */
#content > .row:has(.product-thumb) .product-thumb {
  height: 100%;
  display: flex;
  flex-direction: column;
  margin-bottom: 0;
}

#content > .row:has(.product-thumb) .product-thumb .caption {
  flex: 1;
  display: flex;
  flex-direction: column;
}

#content > .row:has(.product-thumb) .product-thumb .price {
  margin-top: auto;
}

#content > .row:has(.product-thumb) .product-thumb .button-group {
  margin-top: 12px;
}

/* ========================================
   RESPONSIVE
   ======================================== */
@media (min-width: 1800px) {
  #content > .row:has(.product-thumb) {
    grid-template-columns: repeat(5, 1fr);
  }
}

@media (max-width: 1199px) {
  #content > .row:has(.product-thumb) {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 991px) {
  #content > .row:has(.product-thumb) {
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
  }
}

@media (max-width: 767px) {
  #content > .row:has(.product-thumb) {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }
  
  .product-thumb {
    padding: 8px;
  }
  
  .product-thumb .caption h4 {
    min-height: 44px;
  }
  
  .product-thumb .caption h4 a {
    font-size: 13px;
    -webkit-line-clamp: 2;
  }
  
  .product-thumb .price-new,
  .product-thumb .price {
    font-size: 16px;
  }
  
  .product-thumb .button-group {
    gap: 4px;
  }
  
  .product-thumb .button-group button:first-child {
    padding: 8px 10px;
    font-size: 11px;
    border-radius: 6px;
  }
  
  .product-thumb .button-group button:first-child span {
    display: none;
  }
  
  .product-thumb .button-group button:not(:first-child) {
    flex: 0 0 32px;
    width: 32px;
    height: 32px;
    border-radius: 6px;
  }
  
  .product-thumb .button-group button:not(:first-child) i {
    font-size: 12px;
  }
}

/* ========================================
   LIST VIEW
   ======================================== */
.product-layout.product-list {
  grid-column: 1 / -1 !important;
}

.product-layout.product-list .product-thumb {
  flex-direction: row;
  padding: 16px;
  gap: 20px;
}

.product-layout.product-list .product-thumb .image {
  flex: 0 0 200px;
  margin-bottom: 0;
}

.product-layout.product-list .product-thumb .caption {
  flex: 1;
}

.product-layout.product-list .product-thumb .caption > p:not(.price) {
  display: block;
  color: var(--moc-text-secondary);
  font-size: 13px;
  margin-bottom: 12px;
}

.product-layout.product-list .product-thumb .caption h4 {
  min-height: auto;
}

.product-layout.product-list .product-thumb .caption h4 a {
  font-size: 16px;
  -webkit-line-clamp: 2;
}

.product-layout.product-list .product-thumb .button-group {
  border-top: none;
  padding-top: 0;
  justify-content: flex-start;
}

.product-layout.product-list .product-thumb .button-group button:first-child {
  flex: 0 0 auto;
}

@media (max-width: 767px) {
  .product-layout.product-list .product-thumb {
    flex-direction: column;
  }
  
  .product-layout.product-list .product-thumb .image {
    flex: none;
    width: 100%;
  }
}

/* ========================================
   САЙДБАР ФІЛЬТРІВ
   ======================================== */
#column-left {
  padding-right: 20px;
}

#column-left .panel {
  border: none;
  border-radius: 8px;
  box-shadow: none;
  margin-bottom: 16px;
  background: #fff;
}

#column-left .panel-heading {
  background: transparent;
  border: none;
  padding: 12px 0;
  border-bottom: 1px solid var(--moc-border);
}

#column-left .panel-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--moc-text);
}

#column-left .list-group-item {
  border: none;
  padding: 8px 0;
  font-size: 13px;
}

#column-left .list-group-item:hover {
  background: transparent;
  color: var(--moc-primary);
}
