/**
 * Product Page Styles
 * Dedicated product detail page styling
 */

.product-page {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1rem;
}

/* Breadcrumb */
.product-breadcrumb {
  margin-bottom: 1.5rem;
}

.product-breadcrumb a {
  color: var(--color-primary, #2563eb);
  text-decoration: none;
  font-size: 0.9rem;
}

.product-breadcrumb a:hover {
  text-decoration: underline;
}

/* Loading State */
.product-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 400px;
  gap: 1rem;
}

.loading-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid #e5e7eb;
  border-top-color: var(--color-primary, #2563eb);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Error State */
.product-error {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 400px;
  gap: 1rem;
  text-align: center;
}

.product-error p {
  color: #dc2626;
  font-size: 1.1rem;
}

/* Main Content Layout */
.product-content {
  margin-top: 1rem;
}

.product-main {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
}

@media (max-width: 768px) {
  .product-main {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
}

/* Image Gallery */
.product-gallery {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.product-image-main {
  background: #f9fafb;
  border-radius: 8px;
  overflow: hidden;
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.product-image-main img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.product-thumbnails {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.thumbnail {
  width: 60px;
  height: 60px;
  border: 2px solid transparent;
  border-radius: 6px;
  overflow: hidden;
  cursor: pointer;
  padding: 0;
  background: #f9fafb;
}

.thumbnail:hover,
.thumbnail.active {
  border-color: var(--color-primary, #2563eb);
}

.thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Product Details */
.product-details {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.product-name {
  font-size: 1.75rem;
  font-weight: 700;
  margin: 0;
  color: #1f2937;
}

.product-description {
  color: #6b7280;
  line-height: 1.6;
  margin: 0;
}

/* Badges */
.product-badges {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
}

.badge-finisher {
  background: #fef3c7;
  color: #92400e;
}

.badge-limited {
  background: #fee2e2;
  color: #991b1b;
}

.badge-countdown {
  background: #fecaca;
  color: #b91c1c;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

/* Price */
.product-price-section {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.product-price {
  font-size: 1.5rem;
  font-weight: 700;
  color: #1f2937;
}

.product-original-price {
  font-size: 1.1rem;
  color: #9ca3af;
  text-decoration: line-through;
}

/* Variant Selectors */
.product-variants {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.variant-selector {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.variant-selector label {
  font-weight: 600;
  font-size: 0.9rem;
  color: #374151;
}

.variant-options {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.variant-btn {
  padding: 0.5rem 1rem;
  border: 2px solid #e5e7eb;
  border-radius: 6px;
  background: white;
  cursor: pointer;
  font-size: 0.9rem;
  transition: all 0.15s;
}

.variant-btn:hover:not(:disabled) {
  border-color: var(--color-primary, #2563eb);
}

.variant-btn.selected {
  border-color: var(--color-primary, #2563eb);
  background: var(--color-primary, #2563eb);
  color: white;
}

.variant-btn.out-of-stock {
  opacity: 0.5;
  cursor: not-allowed;
  text-decoration: line-through;
}

/* Color buttons */
.color-btn {
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: 50%;
  border: 3px solid #e5e7eb;
}

.color-btn.selected {
  border-color: var(--color-primary, #2563eb);
  box-shadow: 0 0 0 2px white, 0 0 0 4px var(--color-primary, #2563eb);
}

/* Size Guide Button */
.size-guide-btn {
  background: none;
  border: none;
  color: var(--color-primary, #2563eb);
  cursor: pointer;
  font-size: 0.85rem;
  padding: 0.25rem 0;
  text-decoration: underline;
  align-self: flex-start;
}

.size-guide-btn:hover {
  color: #1d4ed8;
}

/* Product Actions */
.product-actions {
  display: flex;
  gap: 1rem;
  align-items: flex-end;
  flex-wrap: wrap;
  margin-top: 0.5rem;
}

.quantity-selector {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.quantity-selector label {
  font-weight: 600;
  font-size: 0.9rem;
  color: #374151;
}

.quantity-controls {
  display: flex;
  align-items: center;
  border: 2px solid #e5e7eb;
  border-radius: 6px;
  overflow: hidden;
}

.qty-btn {
  width: 40px;
  height: 40px;
  border: none;
  background: #f9fafb;
  cursor: pointer;
  font-size: 1.25rem;
  font-weight: 600;
  transition: background 0.15s;
}

.qty-btn:hover {
  background: #e5e7eb;
}

#quantity-display {
  width: 50px;
  text-align: center;
  font-size: 1rem;
  font-weight: 600;
}

/* Add to Cart Button */
.add-to-cart-btn {
  flex: 1;
  min-width: 200px;
  padding: 0.875rem 1.5rem;
  background: var(--color-primary, #2563eb);
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}

.add-to-cart-btn:hover:not(:disabled) {
  background: #1d4ed8;
}

.add-to-cart-btn:disabled {
  background: #9ca3af;
  cursor: not-allowed;
}

/* Stock Status */
.stock-status {
  font-size: 0.9rem;
  font-weight: 500;
}

.stock-status.in-stock {
  color: #059669;
}

.stock-status.low-stock {
  color: #d97706;
}

.stock-status.out-of-stock {
  color: #dc2626;
}

/* Reviews Summary */
.reviews-summary {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.review-stars {
  color: #fbbf24;
  font-size: 1.1rem;
}

.review-count {
  color: #6b7280;
  font-size: 0.9rem;
}

/* Modal Styles */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
}

.modal-content {
  position: relative;
  background: white;
  border-radius: 12px;
  max-width: 90%;
  max-height: 90vh;
  overflow: auto;
  padding: 1.5rem;
}

.modal-close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  width: 32px;
  height: 32px;
  border: none;
  background: #f3f4f6;
  border-radius: 50%;
  font-size: 1.25rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-close:hover {
  background: #e5e7eb;
}

/* Size Guide Modal */
.size-guide-content {
  min-width: 300px;
  max-width: 600px;
}

.size-guide-content h3 {
  margin-top: 0;
  margin-bottom: 1rem;
}

.size-guide-section {
  margin-bottom: 1.5rem;
}

.size-guide-desc {
  font-size: 0.85rem;
  color: #6b7280;
  margin-bottom: 0.75rem;
}

.size-guide-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.size-guide-table th,
.size-guide-table td {
  padding: 0.5rem;
  border: 1px solid #e5e7eb;
  text-align: center;
}

.size-guide-table th {
  background: #f9fafb;
  font-weight: 600;
}

.size-guide-unit {
  font-size: 0.75rem;
  color: #9ca3af;
  margin-top: 0.5rem;
}

/* Cart Notification */
.cart-notification {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background: #059669;
  color: white;
  padding: 1rem 1.5rem;
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 1rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  z-index: 1001;
  animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

.cart-notification a {
  color: white;
  font-weight: 600;
  text-decoration: underline;
}

/* Button base (in case not defined globally) */
.btn {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  border-radius: 6px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.15s;
}

.btn-primary {
  background: var(--color-primary, #2563eb);
  color: white;
  border: none;
}

.btn-primary:hover {
  background: #1d4ed8;
}
