/* Mağaza ürün kartı stilleri — 2026-09-15'te `templates/store/_product_card.html`
   içinden çıkarıldı. Sebep (ölçüldü, canlı /store/): partial HER KART için
   include ediliyordu → aynı 11.759 karakterlik <style> bloğu sayfada 38 kez
   basılıyordu (~446 KB). Gzip tel üzerinde tekrarları eziyor (57 KB) ama
   tarayıcı aynı CSS'i 38 kez AYRIŞTIRIYORDU. Artık sayfa başına bir kez
   <link> ile gelir (ayrıca önbelleklenebilir).
   Kaskad: dosya, kartların ilk basıldığı yerden ÖNCE yüklenir; kural sırası
   ve seçici özgüllüğü birebir korunmuştur (blok aynen taşındı). */
/* =============== PRODUCT CARD STYLES =============== */
.product-card-link {
  display: block;
  height: 100%;
}

.product-card {
  background: white;
  border: 1px solid #e8e8e8;
  border-radius: 10px;
  overflow: hidden;
  height: 100%;
  display: flex;
  flex-direction: column;
  transition: all 0.2s ease;
}

.product-card:hover {
  border-color: #d0d0d0;
  box-shadow: 0 4px 16px rgba(0,0,0,0.08);
  transform: translateY(-2px);
}

.product-promo-stack {
  position: absolute;
  z-index: 4;
  top: 8px;
  left: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: flex-start;
  max-width: 88%;
  pointer-events: none;
}
.product-promo-pill,
.product-coupon-pill {
  font-size: 0.65rem;
  font-weight: 700;
  padding: 0.2rem 0.45rem;
  border-radius: 6px;
  line-height: 1.2;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.product-promo-pill {
  background: linear-gradient(135deg, #e11d48, #f97316);
  color: #fff;
  box-shadow: 0 2px 8px rgba(225, 29, 72, 0.35);
}
.product-coupon-pill {
  background: #1e293b;
  color: #fff;
}

/* Image Container */
.product-image-container {
  position: relative !important;
  width: 100% !important;
  padding-bottom: 100% !important; /* 1:1 aspect ratio */
  overflow: hidden !important;
  background: #f8f9fa !important;
}

/* Product Image - This is applied to <img> element */
.product-image {
  position: absolute !important;
  top: 0 !important;
  left: 0 !important;
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  transition: transform 0.3s ease;
  display: block !important;
  padding-bottom: 0 !important; /* Reset any conflicting styles */
}

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

.product-card-gallery {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background: #f8f9fa;
  touch-action: pan-y pinch-zoom;
}

.product-card-gallery-track {
  display: flex;
  height: 100%;
  width: calc(100% * var(--gallery-count, 1));
  transition: transform 0.45s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: transform;
}

.product-card-gallery-img {
  position: relative;
  flex: 0 0 calc(100% / var(--gallery-count, 1));
  width: calc(100% / var(--gallery-count, 1));
  min-width: 0;
  height: 100%;
  object-fit: cover;
  display: block;
  z-index: 1;
}

.product-card-gallery-dots {
  position: absolute;
  bottom: 7px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 5px;
  z-index: 5;
  pointer-events: none;
}

.product-card-gallery-dots span {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.55);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.12);
  transition: transform 0.2s ease, background 0.2s ease;
}

.product-card-gallery-dots span.is-active {
  background: #F27A1A;
  transform: scale(1.3);
}

@media (prefers-reduced-motion: reduce) {
  .product-card-gallery-track {
    transition: none;
  }
}

.product-image-placeholder {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f5f5f5;
  color: #d0d0d0;
  font-size: 2rem;
}

/* Badges */
.badge-discount {
  position: absolute;
  top: 8px;
  left: 8px;
  background: #dc2626;
  color: white;
  font-size: 0.625rem;
  font-weight: 700;
  padding: 3px 6px;
  border-radius: 4px;
  z-index: 2;
}

.badge-new {
  position: absolute;
  top: 10px;
  left: 10px;
  right: auto;
  transform: none;
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
  background: linear-gradient(145deg, #ea580c 0%, #F27A1A 45%, #fb923c 100%);
  color: #fff;
  font-size: clamp(0.6875rem, 1.9vw, 0.75rem);
  font-weight: 800;
  padding: 0.35rem 0.55rem 0.35rem 0.45rem;
  border-radius: 7px;
  z-index: 20;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  line-height: 1;
  border: 1px solid rgba(255, 255, 255, 0.45);
  box-shadow:
    0 2px 8px rgba(234, 88, 12, 0.45),
    0 1px 0 rgba(0, 0, 0, 0.12) inset;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.18);
  pointer-events: none;
  max-width: calc(100% - 52px);
}

.badge-new__icon {
  font-size: 0.95em;
  opacity: 0.95;
  flex-shrink: 0;
}

.badge-new__text {
  white-space: nowrap;
}

/* Favorite Button */
@keyframes favorite-pop {
  0% { transform: scale(1); }
  35% { transform: scale(1.28); }
  60% { transform: scale(0.94); }
  100% { transform: scale(1); }
}

.btn-favorite {
  position: absolute;
  top: 5px;
  right: 5px;
  width: 36px;
  height: 36px;
  background: rgba(255,255,255,0.94);
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 6;
  padding: 0;
  transition: transform 0.22s cubic-bezier(0.34, 1.2, 0.64, 1),
    box-shadow 0.2s ease,
    border-color 0.2s ease,
    background 0.2s ease;
}

.btn-favorite:hover {
  background: #fff;
  border-color: rgba(242, 122, 26, 0.35);
  transform: scale(1.06);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

.btn-favorite:active {
  transform: scale(0.94);
}

.btn-favorite .favorite-icon {
  font-size: 0.95rem;
  line-height: 1;
  color: #6b7280;
  transition: color 0.35s ease, transform 0.2s ease;
  display: block;
}

.btn-favorite:hover .favorite-icon {
  color: #F27A1A;
  transform: rotate(-6deg);
}

.btn-favorite.active .favorite-icon {
  color: #F27A1A;
}

.btn-favorite.active:not(:active) .favorite-icon {
  animation: favorite-pop 0.5s cubic-bezier(0.34, 1.45, 0.64, 1);
}

.btn-favorite.active {
  border-color: rgba(242, 122, 26, 0.45);
  background: rgba(255, 247, 240, 0.98);
}

@keyframes cart-tap {
  0% { transform: scale(1); }
  45% { transform: scale(0.88); }
  100% { transform: scale(1); }
}

@keyframes cart-nudge {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-1.5px); }
}

/* Quick Add — tam genişlik şerit, alçak yükseklik (padding küçük) */
.btn-quick-add {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  width: 100%;
  max-width: none;
  padding: 4px 8px;
  min-height: 0;
  border-radius: 0;
  background: linear-gradient(135deg, #F27A1A, #FF8C3D);
  color: white;
  border: none;
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.06);
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  cursor: pointer;
  opacity: 0;
  transform: translateY(100%);
  transition: opacity 0.22s ease, transform 0.24s cubic-bezier(0.34, 1.2, 0.64, 1),
    filter 0.2s ease, box-shadow 0.2s ease;
  z-index: 7;
  box-sizing: border-box;
}

.btn-quick-add-icon-wrap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 0;
}

.btn-quick-add-ico {
  font-size: 0.8rem !important;
  line-height: 1;
  flex-shrink: 0;
  color: inherit;
  transition: transform 0.2s ease;
}

.product-card:hover .btn-quick-add {
  opacity: 1;
  transform: translateY(0);
}

.btn-quick-add:hover {
  background: linear-gradient(135deg, #D66A16, #F27A1A);
  color: white;
  filter: brightness(1.02);
  box-shadow: 0 -3px 14px rgba(242, 122, 26, 0.35);
}

.btn-quick-add:hover .btn-quick-add-ico {
  animation: cart-nudge 1.15s ease-in-out infinite;
}

.btn-quick-add:active .btn-quick-add-ico {
  animation: cart-tap 0.35s cubic-bezier(0.34, 1.2, 0.64, 1);
}

.btn-quick-add-label {
  white-space: nowrap;
}

@media (prefers-reduced-motion: reduce) {
  .btn-favorite,
  .btn-favorite .favorite-icon,
  .btn-quick-add,
  .btn-quick-add-ico {
    transition: none !important;
  }
  .btn-favorite.active:not(:active) .favorite-icon,
  .btn-quick-add:hover .btn-quick-add-ico,
  .btn-quick-add:active .btn-quick-add-ico {
    animation: none !important;
  }
}

/* Card Body */
.product-body {
  padding: 10px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.product-brand {
  font-size: 0.5625rem;
  color: #9ca3af;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  font-weight: 600;
  margin: 0 0 2px 0;
}

.product-title {
  font-size: 0.75rem;
  font-weight: 500;
  color: #1f2937;
  line-height: 1.35;
  margin: 0 0 6px 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2rem;
}

/* Rating */
.product-rating {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 6px;
}

.rating-stars {
  display: flex;
  gap: 1px;
  color: #fbbf24;
  font-size: 0.625rem;
}

.review-count {
  font-size: 0.5625rem;
  color: #9ca3af;
}

/* Price */
.product-price {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: auto;
}

.price-old {
  font-size: 0.625rem;
  color: #9ca3af;
  text-decoration: line-through;
}

.price-current {
  font-size: 0.875rem;
  font-weight: 700;
  color: #F27A1A;
}

.price-hidden {
  font-size: 0.6875rem;
  font-weight: 600;
  color: #9ca3af;
  display: flex;
  align-items: center;
  gap: 4px;
}

.price-hidden i {
  font-size: 0.625rem;
}

/* Upgrade Required — tam genişlik, alçak gri şerit */
.btn-upgrade-required {
  left: 0 !important;
  right: 0 !important;
  width: 100% !important;
  max-width: none !important;
  transform: translateY(100%) !important;
  background: linear-gradient(135deg, #6b7280, #9ca3af) !important;
  color: white !important;
  border: none !important;
  border-radius: 0 !important;
}

.product-card:hover .btn-upgrade-required {
  transform: translateY(0) !important;
}

.btn-upgrade-required:hover {
  background: linear-gradient(135deg, #4b5563, #6b7280) !important;
  color: white !important;
  filter: brightness(1.03);
}

/* =============== MOBILE STYLES =============== */
@media (max-width: 767px) {
  .product-card {
    border-radius: 8px;
  }
  
  .btn-quick-add {
    opacity: 1;
    transform: translateY(0);
    padding: 4px 6px;
    min-height: 28px;
    max-width: none;
    box-sizing: border-box;
    box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.07);
  }
  
  .btn-quick-add-label {
    display: none;
  }
  
  .btn-quick-add-ico {
    font-size: 0.82rem !important;
  }
  
  .btn-upgrade-required {
    transform: translateY(0) !important;
    opacity: 1 !important;
  }
  
  .btn-favorite {
    width: 38px;
    height: 38px;
    top: 4px;
    right: 4px;
  }
  
  .btn-favorite .favorite-icon {
    font-size: 1.28rem;
  }
  
  .badge-discount {
    font-size: 0.5625rem;
    padding: 2px 5px;
  }
  
  .badge-new {
    font-size: clamp(0.6875rem, 3.2vw, 0.75rem);
    padding: 0.4rem 0.5rem 0.4rem 0.42rem;
    top: 8px;
    left: 8px;
    border-radius: 8px;
  }
  
  .product-body {
    padding: 8px;
  }
  
  .product-title {
    font-size: 0.6875rem;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    min-height: 2.5rem;
  }
  
  .rating-stars {
    font-size: 0.5625rem;
  }
  
  .review-count {
    font-size: 0.5rem;
  }
  
  .price-old {
    font-size: 0.5625rem;
  }
  
  .price-current {
    font-size: 0.8125rem;
  }
}

/* =============== TABLET STYLES =============== */
@media (min-width: 768px) and (max-width: 991px) {
  .product-title {
    font-size: 0.6875rem;
  }
  
  .price-current {
    font-size: 0.8125rem;
  }
  
  .btn-quick-add {
    padding: 4px 8px;
    font-size: 0.65rem;
  }
  
  .btn-quick-add-ico {
    font-size: 0.8rem !important;
  }
}

/* =============== LARGE DESKTOP =============== */
@media (min-width: 1200px) {
  .product-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.1);
  }
  
  .btn-quick-add {
    padding: 5px 10px;
    font-size: 0.7rem;
  }
  
  .btn-quick-add-ico {
    font-size: 0.85rem !important;
  }
  
  .product-body {
    padding: 12px;
  }
  
  .product-title {
    font-size: 0.8125rem;
    min-height: 2.2rem;
  }
  
  .price-current {
    font-size: 0.9375rem;
  }
}
