/* Collection Page Styles */

/* Collection Card */
.collection-card {
  background: white;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  display: flex;
  flex-direction: column;
  height: 100%;
  border: 1px solid rgba(0, 0, 0, 0.05);
  position: relative;
}

.collection-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.4s ease;
  z-index: 1;
}

.collection-card:hover::before {
  transform: scaleX(1);
}

.collection-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 12px 30px rgba(102, 126, 234, 0.2);
  border-color: rgba(102, 126, 234, 0.2);
}

.collection-link {
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.collection-image-wrapper {
  width: 100%;
  height: 280px;
  overflow: hidden;
  background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
  position: relative;
}

.collection-image-wrapper::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    to bottom,
    transparent 0%,
    rgba(0, 0, 0, 0.1) 100%
  );
  opacity: 0;
  transition: opacity 0.3s ease;
}

.collection-card:hover .collection-image-wrapper::after {
  opacity: 1;
}

.collection-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.collection-card:hover .collection-image {
  transform: scale(1.1) rotate(1deg);
}

.collection-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #e9ecef 0%, #dee2e6 100%);
  color: #6c757d;
  position: relative;
}

.collection-placeholder::before {
  content: "";
  position: absolute;
  width: 80px;
  height: 80px;
  border: 3px solid rgba(102, 126, 234, 0.2);
  border-radius: 50%;
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%,
  100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.1);
    opacity: 0.7;
  }
}

.collection-placeholder i {
  font-size: 3.5rem;
  position: relative;
  z-index: 1;
  color: #667eea;
  opacity: 0.6;
}

.collection-info {
  padding: 1.75rem 1.5rem;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  background: white;
  position: relative;
  min-height: 200px;
}

.collection-title {
  font-size: 1.35rem;
  margin: 0 0 0.875rem 0;
  color: #2d3748;
  font-weight: 700;
  text-align: center;
  letter-spacing: -0.02em;
  transition: color 0.3s ease;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  min-height: 2.6em;
  word-break: break-word;
}

.collection-card:hover .collection-title {
  color: #667eea;
}

.collection-info .collection-description {
  font-size: 0.95rem;
  color: #718096;
  line-height: 1.6;
  margin: 0.75rem 0 0 0;
  text-align: center;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  min-height: 4.8em;
  word-break: break-word;
  flex-shrink: 0;
}

/* Product Card */
.product-card {
  background: white;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  display: flex;
  flex-direction: column;
  height: 100%;
  border: 1px solid rgba(0, 0, 0, 0.05);
  position: relative;
}

.product-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.4s ease;
  z-index: 1;
}

.product-card:hover::before {
  transform: scaleX(1);
}

.product-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 12px 30px rgba(102, 126, 234, 0.2);
  border-color: rgba(102, 126, 234, 0.2);
}

.product-link {
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.product-image-wrapper {
  width: 100%;
  height: 280px;
  overflow: hidden;
  background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
  position: relative;
}

.product-image-wrapper::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    to bottom,
    transparent 0%,
    rgba(0, 0, 0, 0.1) 100%
  );
  opacity: 0;
  transition: opacity 0.3s ease;
}

.product-card:hover .product-image-wrapper::after {
  opacity: 1;
}

.product-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.product-card:hover .product-image {
  transform: scale(1.1) rotate(1deg);
}

.product-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #e9ecef 0%, #dee2e6 100%);
  color: #6c757d;
  position: relative;
}

.product-placeholder::before {
  content: "";
  position: absolute;
  width: 80px;
  height: 80px;
  border: 3px solid rgba(102, 126, 234, 0.2);
  border-radius: 50%;
  animation: pulse 2s ease-in-out infinite;
}

.product-placeholder i {
  font-size: 3.5rem;
  position: relative;
  z-index: 1;
  color: #667eea;
  opacity: 0.6;
}

.product-info {
  padding: 1.75rem 1.5rem;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  background: white;
  position: relative;
  min-height: 200px;
}

.product-title {
  font-size: 1.35rem;
  margin: 0 0 0.875rem 0;
  color: #2d3748;
  font-weight: 700;
  text-align: center;
  letter-spacing: -0.02em;
  transition: color 0.3s ease;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  min-height: 2.6em;
  word-break: break-word;
}

.product-card:hover .product-title {
  color: #667eea;
}

.product-price {
  font-size: 1.75rem;
  font-weight: 800;
  color: #667eea;
  margin: 0.5rem 0;
  text-align: center;
  letter-spacing: -0.01em;
  transition: color 0.3s ease;
}

.product-card:hover .product-price {
  color: #764ba2;
}

.product-description {
  font-size: 0.95rem;
  color: #718096;
  line-height: 1.6;
  margin: 0.75rem 0 0 0;
  text-align: center;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  min-height: 4.8em;
  word-break: break-word;
  flex-shrink: 0;
}

.product-stock {
  display: inline-block;
  padding: 0.5rem 1.25rem;
  border-radius: 25px;
  font-size: 0.875rem;
  font-weight: 600;
  background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
  color: #155724;
  margin-top: auto;
  text-align: center;
  align-self: center;
  box-shadow: 0 2px 8px rgba(21, 87, 36, 0.15);
  transition: all 0.3s ease;
  border: 1px solid rgba(21, 87, 36, 0.1);
}

.product-card:hover .product-stock {
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(21, 87, 36, 0.25);
}

.product-stock.out-of-stock {
  background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%);
  color: #721c24;
  box-shadow: 0 2px 8px rgba(114, 28, 36, 0.15);
  border-color: rgba(114, 28, 36, 0.1);
}

.product-card:hover .product-stock.out-of-stock {
  box-shadow: 0 4px 12px rgba(114, 28, 36, 0.25);
}

/* Collection Hero Header */
.collection-hero {
  position: relative;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  border-radius: 8px;
  padding: 1.5rem 1.5rem;
  margin-bottom: 2rem;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(102, 126, 234, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.collection-hero::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    135deg,
    rgba(102, 126, 234, 0.85) 0%,
    rgba(118, 75, 162, 0.85) 100%
  );
  z-index: 1;
}

.collection-hero-content {
  position: relative;
  z-index: 2;
  max-width: 800px;
  margin: 0 auto;
}

.collection-hero-title {
  font-size: 1.75rem;
  color: white;
  margin: 0 0 0.5rem 0;
  font-weight: 700;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
  letter-spacing: -0.01em;
  line-height: 1.3;
}

.collection-hero-description {
  font-size: 0.95rem;
  color: rgba(255, 255, 255, 0.95);
  line-height: 1.6;
  margin: 0;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
  font-weight: 400;
}

/* Section Heading */
.collection-page .section-heading {
  font-size: 2rem;
  margin-bottom: 2rem;
  color: #333;
  text-align: center;
  font-weight: 600;
  position: relative;
  padding-bottom: 1rem;
}

.collection-page .section-heading::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 3px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 2px;
}

/* Collections Grid */
.child-collections-section {
  margin-bottom: 4rem;
}

.collections-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 2rem;
  margin-bottom: 2rem;
}

/* Products Section */
.products-section {
  margin-bottom: 3rem;
}

.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 2rem;
  margin-bottom: 2rem;
}

/* No Products Message */
.no-products-message {
  text-align: center;
  padding: 4rem 2rem;
  color: #6c757d;
  background: white;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.no-products-message i {
  font-size: 4rem;
  color: #dee2e6;
  margin-bottom: 1rem;
}

.no-products-message h3 {
  color: #495057;
  margin-bottom: 0.5rem;
}

/* Pagination */
.pagination-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  margin-top: 3rem;
  padding: 2rem 0;
}

.pagination-info {
  color: #6c757d;
  font-size: 0.95rem;
}

.pagination {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex-wrap: wrap;
  justify-content: center;
}

.pagination-link {
  padding: 0.5rem 1rem;
  border: 1px solid #dee2e6;
  border-radius: 4px;
  text-decoration: none;
  color: #495057;
  background: white;
  transition: all 0.3s;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.pagination-link:hover {
  background: #e9ecef;
  border-color: #adb5bd;
}

.pagination-link.active {
  background: #667eea;
  color: white;
  border-color: #667eea;
}

.pagination-ellipsis {
  padding: 0.5rem;
  color: #6c757d;
}

/* Responsive */
@media (max-width: 768px) {
  .collection-hero {
    padding: 1.25rem 1.25rem;
    margin-bottom: 2rem;
    border-radius: 8px;
  }

  .collection-hero-title {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
  }

  .collection-hero-description {
    font-size: 0.9rem;
    line-height: 1.5;
  }

  .collections-grid,
  .products-grid {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1.5rem;
  }

  .collection-page .section-heading {
    font-size: 1.5rem;
  }
}

@media (max-width: 480px) {
  .collection-hero {
    padding: 1rem 1rem;
    margin-bottom: 1.5rem;
    border-radius: 6px;
  }

  .collection-hero-title {
    font-size: 1.35rem;
    margin-bottom: 0.4rem;
  }

  .collection-hero-description {
    font-size: 0.85rem;
    line-height: 1.5;
  }

  .collections-grid,
  .products-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .collection-page .section-heading {
    font-size: 1.25rem;
  }
}
