/*=============================================================================
  TearTrade Components - Shared Styles
  Tüm sayfalarda kullanılan ortak component stilleri
=============================================================================*/

/* CSS Variables - Tema Renkleri (header.ejs'deki --primary ile uyumlu) */
:root {
  --tt-primary: var(--primary, #1c49c2);
  --tt-primary-dark: var(--primary-dark, #1c49c2);
  --tt-success: var(--success, #10b981);
  --tt-warning: var(--warning, #f59e0b);
  --tt-danger: var(--danger, #ef4444);
  --tt-gray-400: var(--gray-400, #94a3b8);
  --tt-gray-500: var(--gray-500, #64748b);
  --tt-gray-600: var(--gray-600, #475569);
}

/*=============================================================================
  Product Card Component
=============================================================================*/
.tt-product-card {
  background: white;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  border: 1px solid #e2e8f0;
  transition: all 0.3s ease;
  position: relative;
  cursor: pointer;
  display: flex;
  flex-direction: column;
}

.tt-product-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 5px 20px rgba(0,0,0,0.15);
}

/* Rank Badge */
.tt-product-card .rank-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  background: var(--primary);
  color: white;
  width: 35px;
  height: 35px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  z-index: 2;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.tt-product-card .rank-badge.gold {
  background: linear-gradient(135deg, #fbbf24, #f59e0b);
}

.tt-product-card .rank-badge.silver {
  background: linear-gradient(135deg, #cbd5e1, #94a3b8);
}

.tt-product-card .rank-badge.bronze {
  background: linear-gradient(135deg, #f97316, #ea580c);
}

/* Product Actions */
.tt-product-card .product-actions {
  position: absolute;
  top: 10px;
  right: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  opacity: 1;
  z-index: 2;
}

.tt-product-card .action-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: white;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.tt-product-card .action-btn:hover {
  transform: scale(1.1);
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.tt-product-card .action-btn i {
  font-size: 18px;
  color: #dc2626;
  transition: all 0.3s ease;
}

.tt-product-card .action-btn.is-favorited i {
  font-weight: 900;
}

/* Product Image */
.tt-product-card .product-image {
  width: 100%;
  height: 200px;
  background: white;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px;
  overflow: hidden;
}

.tt-product-card .product-image img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

/* Product Info */
.tt-product-card .product-info {
  padding: 15px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.tt-product-card .product-brand {
  font-size: 12px;
  color: var(--primary);
  font-weight: 700;
  margin-bottom: 5px;
}

.tt-product-card .product-name {
  font-size: 14px;
  font-weight: 600;
  color: #1f2937;
  margin: 0 0 10px 0;
  line-height: 1.4;
  flex-grow: 1;
}

/* Product Rating */
.tt-product-card .product-rating {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.tt-product-card .product-rating .stars {
  color: #fbbf24;
  font-size: 14px;
  display: flex;
  gap: 1px;
}

.tt-product-card .product-rating .review-count {
  font-size: 12px;
  color: #64748b;
}

/* Sales Count */
.tt-product-card .sales-count {
  font-size: 14px;
  color: var(--success);
  font-weight: 700;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 5px;
}

.tt-product-card .sales-count i {
  font-size: 13px;
}

/* Product Price */
.tt-product-card .product-price {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: auto;
  margin-bottom: 12px;
}

.tt-product-card .price {
  font-size: 18px;
  font-weight: 700;
  color: var(--primary);
}

.tt-product-card .price-old {
  font-size: 14px;
  color: var(--gray-400);
  text-decoration: line-through;
}

/* Add to Cart Button */
.tt-product-card .add-to-cart {
  width: 100%;
  padding: 12px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.tt-product-card .add-to-cart:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(28, 73, 194, 0.4);
}

.tt-product-card .add-to-cart.added {
  background: linear-gradient(135deg, var(--success), #059669);
}

/*=============================================================================
  Product Grid Component
=============================================================================*/
.tt-products-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 20px;
}

@media (max-width: 1200px) {
  .tt-products-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (max-width: 992px) {
  .tt-products-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 768px) {
  .tt-products-grid {
    display: flex;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    gap: 10px;
    padding: 0 12px 15px 12px;
    -ms-overflow-style: none;
    scrollbar-width: none;
  }

  .tt-products-grid::-webkit-scrollbar {
    display: none;
  }

  .tt-products-grid .tt-product-card {
    flex: 0 0 calc((100vw - 45px) / 2.15);
    min-width: calc((100vw - 45px) / 2.15);
    scroll-snap-align: start;
  }

  .tt-product-card .product-image {
    height: 160px;
    background: white;
    padding: 6px;
  }

  .tt-product-card .product-info {
    padding: 10px;
  }

  .tt-product-card .product-brand {
    font-size: 10px;
  }

  .tt-product-card .product-name {
    font-size: 12px;
    min-height: 32px;
  }

  .tt-product-card .product-rating {
    margin-bottom: 5px;
  }

  .tt-product-card .product-rating .stars {
    font-size: 10px;
  }

  .tt-product-card .product-rating .review-count {
    font-size: 10px;
  }

  .tt-product-card .sales-count {
    font-size: 10px;
    margin-bottom: 6px;
  }

  .tt-product-card .product-price {
    gap: 5px;
    margin-bottom: 8px;
  }

  .tt-product-card .price {
    font-size: 14px;
  }

  .tt-product-card .price-old {
    font-size: 11px;
  }

  .tt-product-card .add-to-cart {
    padding: 7px;
    font-size: 11px;
    gap: 4px;
  }

  .tt-product-card .add-to-cart i {
    font-size: 10px;
  }

  .tt-product-card .rank-badge {
    width: 30px;
    height: 30px;
    font-size: 12px;
    top: 8px;
    left: 8px;
  }

  .tt-product-card .product-actions {
    opacity: 1;
  }
}

/*=============================================================================
  Section Header Component
=============================================================================*/
.tt-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.tt-section-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--tt-text-primary);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.tt-section-title i {
  color: var(--tt-primary);
}

.tt-view-all {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--tt-primary);
  text-decoration: none;
  font-weight: 500;
  font-size: 14px;
  transition: all 0.3s ease;
}

.tt-view-all:hover {
  gap: 10px;
}

/*=============================================================================
  Empty State Component
=============================================================================*/
.tt-empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--tt-text-secondary);
}

.tt-empty-state i {
  font-size: 50px;
  opacity: 0.3;
  margin-bottom: 15px;
  display: block;
}

.tt-empty-state h3 {
  font-size: 18px;
  color: var(--tt-text-primary);
  margin: 0 0 8px 0;
}

.tt-empty-state p {
  margin: 0;
  font-size: 14px;
}

/*=============================================================================
  Category Card Component
=============================================================================*/
.tt-category-card {
  background: white;
  border-radius: var(--tt-radius-lg);
  overflow: hidden;
  box-shadow: var(--tt-shadow-sm);
  transition: all 0.3s ease;
  cursor: pointer;
  text-decoration: none;
  display: block;
  border: 1px solid var(--tt-border);
}

.tt-category-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--tt-shadow-lg);
  border-color: var(--tt-primary);
}

.tt-category-card .category-image {
  width: 100%;
  height: 120px;
  background: var(--tt-primary-light);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.tt-category-card .category-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.tt-category-card .category-image-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--tt-primary);
}

.tt-category-card .category-image-placeholder i {
  font-size: 32px;
  opacity: 0.5;
}

.tt-category-card .category-info {
  padding: 12px;
  text-align: center;
}

.tt-category-card .category-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--tt-text-primary);
  margin-bottom: 4px;
}

.tt-category-card .category-count {
  font-size: 12px;
  color: var(--tt-text-secondary);
}

/*=============================================================================
  Category Grid Component
=============================================================================*/
.tt-categories-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 15px;
}

/*=============================================================================
  Banner Slider Component
=============================================================================*/
.tt-banner-slider {
  position: relative;
  width: 100%;
  height: 300px;
  border-radius: var(--tt-radius-lg);
  overflow: hidden;
  box-shadow: var(--tt-shadow-md);
}

.tt-banner-slider .slider-track {
  position: relative;
  width: 100%;
  height: 100%;
}

.tt-banner-slider .slider-slide {
  display: block;
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 0.5s ease-in-out;
  cursor: pointer;
}

.tt-banner-slider .slider-slide.active {
  opacity: 1;
  z-index: 1;
}

.tt-banner-slider .slider-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.tt-banner-slider .slider-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  background: rgba(255, 255, 255, 0.9);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  box-shadow: var(--tt-shadow-sm);
}

.tt-banner-slider .slider-nav:hover {
  background: white;
  transform: translateY(-50%) scale(1.1);
}

.tt-banner-slider .slider-nav.prev {
  left: 15px;
}

.tt-banner-slider .slider-nav.next {
  right: 15px;
}

.tt-banner-slider .slider-nav i {
  font-size: 16px;
  color: var(--tt-primary);
}

.tt-banner-slider .slider-dots {
  position: absolute;
  bottom: 15px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  z-index: 10;
}

.tt-banner-slider .slider-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.5);
  cursor: pointer;
  transition: all 0.3s ease;
}

.tt-banner-slider .slider-dot.active {
  background: white;
  width: 30px;
  border-radius: 5px;
}

@media (max-width: 768px) {
  .tt-banner-slider {
    height: 200px;
  }
}

/*=============================================================================
  Button Components
=============================================================================*/
.tt-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--tt-radius-sm);
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
  border: none;
}

.tt-btn-primary {
  background: linear-gradient(135deg, var(--tt-primary), var(--tt-primary-dark));
  color: white;
}

.tt-btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(14, 116, 144, 0.4);
}

.tt-btn-outline {
  background: transparent;
  border: 2px solid var(--tt-primary);
  color: var(--tt-primary);
}

.tt-btn-outline:hover {
  background: var(--tt-primary);
  color: white;
}

.tt-btn-success {
  background: linear-gradient(135deg, var(--tt-success), #059669);
  color: white;
}

.tt-btn-sm {
  padding: 6px 12px;
  font-size: 12px;
}

.tt-btn-lg {
  padding: 14px 28px;
  font-size: 16px;
}

/*=============================================================================
  Badge Components
=============================================================================*/
.tt-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
}

.tt-badge-success {
  background: rgba(16, 185, 129, 0.1);
  color: var(--tt-success);
}

.tt-badge-warning {
  background: rgba(245, 158, 11, 0.1);
  color: var(--tt-warning);
}

.tt-badge-danger {
  background: rgba(239, 68, 68, 0.1);
  color: var(--tt-danger);
}

.tt-badge-info {
  background: rgba(59, 130, 246, 0.1);
  color: var(--tt-info);
}

/*=============================================================================
  Loading Spinner Component
=============================================================================*/
.tt-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--tt-border);
  border-top-color: var(--tt-primary);
  border-radius: 50%;
  animation: tt-spin 1s linear infinite;
}

@keyframes tt-spin {
  to {
    transform: rotate(360deg);
  }
}

.tt-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px;
  gap: 15px;
  color: var(--tt-text-secondary);
}
