/* ===== СБРОС СТИЛЕЙ ДЛЯ OPEN CART ===== */
.petz-product-card * {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

.petz-product-card {
  all: initial;
  box-sizing: border-box;
  font-family: inherit;
}

/* ===== ОСНОВНЫЕ СТИЛИ КАРТОЧКИ ===== */
.petz-product-card {
  position: relative;
  background: linear-gradient(135deg, #ffffff 0%, #f8faf9 100%);
  border-radius: 12px;
  margin: 4px;
  border: 1px solid #e8f5e9;
  transition: all 0.3s ease;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(76, 175, 80, 0.1);
  display: flex;
  flex-direction: column;
  height: 380px; /* Оптимальная высота для сетки */
  width: 100%;
  max-width: 100%;
  font-family: 'Inter', 'Segoe UI', system-ui, sans-serif;
  float: none !important;
  display: flex !important;
}

.petz-product-card:hover {
  transform: translateY(-2px);
  border-color: #4CAF50;
  box-shadow: 0 4px 15px rgba(76, 175, 80, 0.15);
}

/* ===== ДЕКОРАТИВНЫЕ ЭЛЕМЕНТЫ ===== */
.petz-decoration {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
  z-index: 1;
}

.petz-paw-print {
  position: absolute;
  font-size: 0.8rem;
  opacity: 0.08;
}

.petz-paw-1 {
  top: 10%;
  left: 8%;
}

.petz-paw-2 {
  bottom: 15%;
  right: 6%;
}

/* ===== БЕЙДЖИ ===== */
.petz-badge {
  position: absolute;
  top: 8px;
  z-index: 10;
  display: flex;
  align-items: center;
  padding: 4px 8px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  transform: rotate(-3deg);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(5px);
  animation: petz-badge-bounce 3s ease-in-out infinite;
}

.petz-sale-badge {
  left: 8px;
  background: linear-gradient(135deg, #FF6B35, #FF8E53);
  color: white;
}

.petz-new-badge {
  right: 8px;
  background: linear-gradient(135deg, #2196F3, #03A9F4);
  color: white;
}

.petz-badge-text {
  margin-right: 4px;
}

.petz-badge-paw {
  width: 10px;
  height: 10px;
  background: currentColor;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2C8.13 2 5 5.13 5 9c0 5.25 7 13 7 13s7-7.75 7-13c0-3.87-3.13-7-7-7zm0 9.5c-1.38 0-2.5-1.12-2.5-2.5s1.12-2.5 2.5-2.5 2.5 1.12 2.5 2.5-1.12 2.5-2.5 2.5z'/%3E%3C/svg%3E") center/contain no-repeat;
}

@keyframes petz-badge-bounce {
  0%, 100% { transform: rotate(-3deg) translateY(0); }
  50% { transform: rotate(-3deg) translateY(-2px); }
}

/* ===== СЕКЦИЯ ИЗОБРАЖЕНИЯ ===== */
.petz-image-section {
  position: relative;
  padding: 10px 10px 0;
  flex-shrink: 0;
  z-index: 2;
  height: 172px;
}

.petz-image-link {
  display: block;
  text-decoration: none;
  width: 100%;
  height: 100%;
}

.petz-image-container {
  position: relative;
  background: linear-gradient(135deg, #f7fbf6 0%, #edf7ef 100%);
  border-radius: 8px;
  overflow: hidden;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(76, 175, 80, 0.1);
  transition: all 0.3s ease;
  width: 100%;
}

.petz-product-card:hover .petz-image-container {
  border-color: rgba(76, 175, 80, 0.2);
}

.petz-product-image {
  display: block;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  object-fit: cover;
  object-position: center;
  transform: scale(1.06);
  transform-origin: center center;
  transition: transform 0.35s ease;
}

.petz-product-card:hover .petz-product-image {
  transform: scale(1.10);
}

.petz-image-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(76, 175, 80, 0.9), rgba(56, 142, 60, 0.9));
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: all 0.3s ease;
}

.petz-image-container:hover .petz-image-overlay {
  opacity: 1;
}

.petz-quick-view {
  background: rgba(255, 255, 255, 0.95);
  color: #4CAF50;
  padding: 6px 12px;
  border-radius: 15px;
  font-weight: 600;
  font-size: 0.75rem;
  display: flex;
  align-items: center;
  gap: 4px;
  transform: translateY(8px);
  transition: all 0.3s ease;
}

.petz-image-container:hover .petz-quick-view {
  transform: translateY(0);
}

/* ===== СЕКЦИЯ КОНТЕНТА ===== */
.petz-content-section {
  padding: 12px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 0;
  z-index: 2;
}

/* Заголовок и категория */
.petz-header {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.petz-category {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(139, 195, 74, 0.1);
  color: #4CAF50;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 0.65rem;
  font-weight: 600;
  width: fit-content;
}

.petz-category i {
  font-size: 0.6rem;
}

.petz-product-name {
  margin: 0;
  line-height: 1.2;
  min-height: 32px;
  display: flex;
  align-items: center;
}

.petz-product-name a {
  color: #2c3e50;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.85rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  transition: color 0.2s ease;
  line-height: 1.2;
}

.petz-product-name a:hover {
  color: #4CAF50;
}

/* Характеристики */
.petz-features {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.petz-feature {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  color: #5a6c7d;
  line-height: 1.1;
}

.petz-feature-icon {
  width: 16px;
  height: 16px;
  background: linear-gradient(135deg, #4CAF50, #66BB6A);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.petz-feature-icon i {
  color: white;
  font-size: 0.6rem;
}

/* Цены и рейтинг */
.petz-pricing-section {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex-shrink: 0;
}

.petz-price-block {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.petz-price-main {
  font-size: 1.1rem;
  font-weight: 700;
  color: #2c3e50;
}

.petz-price-special {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.petz-special-price {
  font-size: 1.1rem;
  font-weight: 700;
  color: #e74c3c;
}

.petz-old-price {
  font-size: 0.8rem;
  color: #95a5a6;
  text-decoration: line-through;
}

.petz-savings-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(231, 76, 60, 0.1);
  color: #e74c3c;
  padding: 2px 6px;
  border-radius: 6px;
  font-size: 0.65rem;
  font-weight: 600;
  width: fit-content;
}

.petz-rating-block {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.petz-stars {
  display: flex;
  gap: 1px;
  color: #FFD166;
}

.petz-stars i {
  font-size: 0.7rem;
}

.petz-reviews {
  font-size: 0.7rem;
  color: #7f8c8d;
}

/* ===== СЕКЦИЯ ДЕЙСТВИЙ ===== */
.petz-actions-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: auto;
  flex-shrink: 0;
  z-index: 2;
}

.petz-quantity-control {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.petz-quantity-control label {
  font-size: 0.75rem;
  font-weight: 600;
  color: #4CAF50;
  white-space: nowrap;
}

.petz-quantity-selector {
  display: flex;
  align-items: center;
  gap: 2px;
  background: #f8f9fa;
  border-radius: 8px;
  padding: 3px;
  border: 1px solid #e9ecef;
}

.petz-qty-btn {
  width: 24px;
  height: 24px;
  border: none;
  border-radius: 6px;
  background: #4CAF50;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 0.7rem;
}

.petz-qty-btn:hover {
  background: #388E3C;
  transform: scale(1.05);
}

.petz-qty-input {
  width: 30px;
  height: 24px;
  border: none;
  background: transparent;
  text-align: center;
  font-weight: 600;
  font-size: 0.8rem;
  color: #2c3e50;
}

.petz-qty-input:focus {
  outline: none;
  background: white;
  box-shadow: 0 0 0 2px rgba(76, 175, 80, 0.2);
  border-radius: 4px;
}

/* Кнопки действий */
.petz-action-buttons {
  display: flex;
  gap: 6px;
  align-items: center;
}

.petz-btn {
  border: none;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
}

.petz-btn-primary {
  flex: 1;
  background: linear-gradient(135deg, #4CAF50, #66BB6A);
  color: white;
  padding: 8px 12px;
  font-size: 0.8rem;
  gap: 4px;
}

.petz-btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(76, 175, 80, 0.3);
}

.petz-btn-secondary {
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, #6c757d, #5a6268);
  color: white;
  font-size: 0.8rem;
}

.petz-btn-secondary:hover {
  transform: translateY(-1px);
}

.petz-wishlist-btn:hover {
  background: linear-gradient(135deg, #e74c3c, #c0392b);
}

.petz-compare-btn:hover {
  background: linear-gradient(135deg, #3498db, #2980b9);
}

.petz-btn-content {
  display: flex;
  align-items: center;
  gap: 4px;
  transition: all 0.3s ease;
  z-index: 1;
}

.petz-btn-icon {
  font-size: 0.9rem;
}

.petz-btn-text {
  font-weight: 600;
  white-space: nowrap;
}

.petz-btn-loader {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: inherit;
  border-radius: inherit;
  opacity: 0;
  transition: all 0.3s ease;
  z-index: 2;
}

.petz-loading-dots {
  display: flex;
  gap: 2px;
}

.petz-loading-dots span {
  width: 4px;
  height: 4px;
  background: white;
  border-radius: 50%;
  animation: petz-dot-bounce 1.4s ease-in-out infinite both;
}

.petz-loading-dots span:nth-child(1) { animation-delay: -0.32s; }
.petz-loading-dots span:nth-child(2) { animation-delay: -0.16s; }

@keyframes petz-dot-bounce {
  0%, 80%, 100% {
    transform: scale(0);
    opacity: 0.5;
  }
  40% {
    transform: scale(1);
    opacity: 1;
  }
}

.petz-cart-btn.loading .petz-btn-content {
  opacity: 0;
}

.petz-cart-btn.loading .petz-btn-loader {
  opacity: 1;
}

.petz-secondary-actions {
  display: flex;
  gap: 4px;
}

/* ===== АДАПТИВНОСТЬ ===== */
@media (max-width: 1200px) {
  .petz-product-card {
    height: 360px;
    margin: 3px;
  }
  
  .petz-image-section {
    height: 162px;
  }
  
  .petz-product-image {
    transform: scale(1.10);
  }
}

@media (max-width: 768px) {
  .petz-product-card {
    height: 340px;
    margin: 2px;
  }
  
  .petz-content-section {
    padding: 10px;
    gap: 6px;
  }
  
  .petz-image-section {
    padding: 8px 8px 0;
    height: 150px;
  }
  
  .petz-product-image {
    transform: scale(1.08);
  }
  
  .petz-product-name a {
    font-size: 0.8rem;
  }
  
  .petz-price-main,
  .petz-special-price {
    font-size: 1rem;
  }
  
  .petz-action-buttons {
    flex-direction: column;
  }
  
  .petz-secondary-actions {
    width: 100%;
    justify-content: space-between;
  }
  
  .petz-secondary-actions .petz-btn-secondary {
    flex: 1;
    width: auto;
  }
}

@media (max-width: 480px) {
  .petz-product-card {
    height: 320px;
    margin: 2px 1px;
  }
  
  .petz-image-section {
    height: 142px;
  }
  
  .petz-product-image {
    transform: scale(1.05);
  }
}

/* ===== ВАЖНЫЕ ПРАВИЛА ДЛЯ OPEN CART ===== */
.petz-hidden-quantity {
  display: none;
}

/* Гарантия правильного отображения в сетках OpenCart */
.product-layout .petz-product-card,
.product-grid .petz-product-card,
#content .petz-product-card,
.row .petz-product-card,
.col-xs-6 .petz-product-card,
.col-sm-4 .petz-product-card,
.col-md-3 .petz-product-card,
.col-lg-3 .petz-product-card {
  width: 100% !important;
  height: 380px !important;
  margin: 4px !important;
  float: none !important;
  display: flex !important;
}

/* Исправление для контейнеров OpenCart */
.product-layout > .row,
.product-grid {
  display: flex !important;
  flex-wrap: wrap !important;
  justify-content: flex-start !important;
  margin: -4px !important;
}

.product-layout > .row > [class*="col-"],
.product-grid > [class*="col-"] {
  padding: 4px !important;
  display: flex !important;
}

/* Анимация появления */
@keyframes petzCardSlideIn {
  from {
    opacity: 0;
    transform: translateY(15px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.petz-product-card {
  opacity: 0;
  animation: petzCardSlideIn 0.4s ease-out forwards;
}

/* ===== ДОПОЛНИТЕЛЬНОЕ ЗАПОЛНЕНИЕ РАМКИ ИЗОБРАЖЕНИЯ ===== */
.petz-image-container::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(circle at center, rgba(255,255,255,0.0) 45%, rgba(255,255,255,0.08) 100%);
}


/* === Width fill refinement for category product images === */
.petz-image-container {
  width: 100%;
  height: 100%;
}

.petz-product-image {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  object-position: center center !important;
  max-width: none !important;
  max-height: none !important;
}

.petz-product-card:hover .petz-product-image {
  transform: scale(1.10);
}


/* ===== CLICK-SAFETY HOTFIX FOR MANUFACTURER/CATEGORY PRODUCT CARDS ===== */
.petz-image-overlay,
.petz-quick-view,
.petz-decoration,
.petz-paw-print,
.petz-image-container::before {
  pointer-events: none !important;
}

.petz-image-link,
.petz-product-name a,
.petz-product-image {
  position: relative;
  z-index: 3;
}
