/* =====================================
   PRODUCT VIEW PAGE
   รายละเอียดสินค้า
   ===================================== */
/* Page Container */
.product-view-page {
  min-height: 100vh;
  background: var(--color-background, #F5F3F0);
}
/* Breadcrumb Navigation */
.breadcrumb-nav {
  padding: 1rem 0;
  margin-bottom: 1.5rem;
}
.btn-back {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  color: var(--color-text-secondary, #736B5E);
  text-decoration: none;
  transition: color 0.3s ease;
  font-size: 0.95rem;
}
.btn-back:hover {
  color: var(--color-primary, #8B7355);
}
.btn-back::before {
  font-size: 1.2em;
}
/* Product Detail Section */
.product-detail {
  padding: 2rem 0 4rem;
}
/* Loading State */
.api-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 400px;
  gap: 1rem;
}
.loading-spinner {
  width: 48px;
  height: 48px;
  border: 4px solid var(--color-border, #E0DDD9);
  border-top-color: var(--color-primary, #8B7355);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
/* Product Grid Layout */
.product-grid {
  display: grid;
  grid-template-columns: 1fr 1.5fr;
  gap: 3rem;
  background: var(--color-surface-bg, #FFFFFF);
  border-radius: var(--border-radius, 8px);
  padding: 2rem;
  box-shadow: var(--shadow, 0 4px 12px rgba(44, 40, 37, 0.08));
}
/* Product Gallery */
.product-gallery {
  position: sticky;
  top: 8rem;
  align-self: start;
}
.main-image {
  position: relative;
  width: 100%;
  border-radius: var(--border-radius, 8px);
  overflow: hidden;
  background: var(--color-background, #F5F3F0);
  box-shadow: var(--shadow, 0 2px 8px rgba(44, 40, 37, 0.1));
}
.product-main-img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: cover;
}
/* Product Badges */
.product-badges {
  position: absolute;
  top: 1rem;
  left: 1rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  z-index: 2;
}
.stock-status {
  position: absolute;
  bottom: 1rem;
  right: 1rem;
  z-index: 2;
}
.out-of-stock,
.in-stock,
.badge {
  display: inline-flex;
  gap: 0.5rem;
  padding: 0.25rem 0.75rem;
  border-radius: 12px;
  font-size: 0.75rem;
  letter-spacing: 0.5px;
  color: white;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}
.badge-new {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}
.badge-hot {
  background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}
.badge-recommend {
  background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}
.in-stock {
  background: rgba(34, 197, 94, 0.9);
  color: white;
}
.out-of-stock {
  background: rgba(239, 68, 68, 0.9);
  color: white;
}
/* Product Info */
.product-info {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}
.product-title {
  font-size: 2rem;
  font-weight: 700;
  color: var(--color-primary, #8B7355);
  line-height: 1.3;
  margin: 0;
}
/* Product Meta */
.product-meta {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 1rem;
  background: var(--color-background, #F5F3F0);
  border-radius: var(--border-radius, 8px);
}
.meta-item {
  display: flex;
  gap: 0.5rem;
  font-size: 0.95rem;
}
.meta-label {
  font-weight: 600;
  color: var(--color-text-secondary, #736B5E);
  min-width: 100px;
}
.meta-value {
  color: var(--color-text, #2C2825);
}
.category-link {
  color: var(--color-primary, #8B7355);
  text-decoration: none;
  transition: color 0.3s ease;
}
.category-link:hover {
  color: var(--color-primary-hover, #6D5A43);
  text-decoration: underline;
}
/* Product Pricing */
.product-pricing {
  display: flex;
  gap: 2rem;
  padding: 1.5rem;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: var(--border-radius, 8px);
  color: white;
}
.price-box {
  flex: 1;
}
.price-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  opacity: 0.9;
  margin-bottom: 0.25rem;
}
.price-value {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
}
.current-price {
  font-size: 2.5rem;
  font-weight: 700;
  line-height: 1;
}
.stock-box {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: center;
}
.stock-label {
  font-size: 0.875rem;
  font-weight: 500;
  opacity: 0.9;
  margin-bottom: 0.25rem;
}
.stock-count {
  font-size: 1.5rem;
  font-weight: 700;
}
/* Product Actions */
.product-actions {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 1.5rem;
  background: var(--color-background, #F5F3F0);
  border-radius: var(--border-radius, 8px);
}
/* Quantity Selector */
.quantity-selector {
  display: flex;
  align-items: center;
  gap: 1rem;
}
.quantity-selector label {
  font-weight: 600;
  color: var(--color-text, #2C2825);
}
.quantity-controls {
  display: flex;
  align-items: center;
  gap: 0;
  background: white;
  border: 2px solid var(--color-border, #E0DDD9);
  border-radius: var(--border-radius, 8px);
  overflow: hidden;
}
.btn-quantity {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  color: var(--color-primary, #8B7355);
  font-size: 1.2rem;
  cursor: pointer;
  transition: all 0.2s ease;
}
.btn-quantity:hover {
  background: var(--color-primary, #8B7355);
  color: white;
}
.btn-quantity:active {
  transform: scale(0.95);
}
.quantity-input {
  width: 60px;
  height: 36px;
  border-style: none !important;
  text-align: center;
  font-size: 1rem;
  font-weight: 600;
  outline: none;
}
.quantity-input::-webkit-inner-spin-button,
.quantity-input::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.quantity-input:focus {
  box-shadow: none;
}
/* Add to Cart Button */
.btn-add-to-cart {
  width: 100%;
  padding: 1rem 2rem;
  font-size: 1.125rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  transition: all 0.3s ease;
}
.btn-add-to-cart::before {
  font-size: 1.5em;
}
.btn-add-to-cart:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(139, 115, 85, 0.3);
}
.btn-add-to-cart:active {
  transform: translateY(0);
}
.btn-disabled {
  width: 100%;
  padding: 1rem 2rem;
  font-size: 1.125rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  background: #9CA3AF;
  color: white;
  border: none;
  border-radius: var(--border-radius, 8px);
  cursor: not-allowed;
  opacity: 0.7;
}
/* Product Details Table */
.product-details-table {
  margin-top: 1rem;
}
.details-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--color-primary, #8B7355);
  margin-bottom: 1rem;
}
.details-table {
  width: 100%;
  border-collapse: collapse;
  background: white;
  border-radius: var(--border-radius, 8px);
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}
.details-table tbody tr {
  border-bottom: 1px solid var(--color-border, #E0DDD9);
}
.details-table tbody tr:last-child {
  border-bottom: none;
}
.details-table td {
  padding: 1rem;
  font-size: 0.95rem;
}
.details-table td.label {
  font-weight: 600;
  color: var(--color-text-secondary, #736B5E);
  width: 150px;
  background: var(--color-background, #F5F3F0);
}
.details-table td.value {
  color: var(--color-text, #2C2825);
}
/* Product Description */
.product-description {
  margin-top: 1rem;
  padding: 1.5rem;
  background: white;
  border-radius: var(--border-radius, 8px);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}
.description-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--color-primary, #8B7355);
  margin-bottom: 1rem;
}
.description-content {
  line-height: 1.8;
  color: var(--color-text, #2C2825);
}
.description-content p {
  margin-bottom: 1rem;
}
.description-content ul,
.description-content ol {
  margin-left: 1.5rem;
  margin-bottom: 1rem;
}
/* Related Products Section */
.related-products {
  padding: 4rem 0;
  background: var(--color-background, #F5F3F0);
}
.section-title {
  font-size: 2rem;
  font-weight: 700;
  color: var(--color-primary, #8B7355);
  text-align: center;
  margin-bottom: 0.5rem;
}
.section-subtitle {
  font-size: 1.125rem;
  color: var(--color-text-secondary, #736B5E);
  text-align: center;
  margin-bottom: 3rem;
}
/* Responsive Design */
@media (max-width: 1024px) {
  .product-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  .product-gallery {
    position: relative;
    top: 0;
  }
  .product-pricing {
    flex-direction: column;
    gap: 1rem;
  }
  .stock-box {
    align-items: flex-start;
  }
}
@media (max-width: 768px) {
  .product-title {
    font-size: 1.5rem;
  }
  .current-price {
    font-size: 2rem;
  }
  .product-actions {
    padding: 1rem;
  }
  .quantity-selector {
    flex-direction: column;
    align-items: flex-start;
    width: 100%;
  }
  .quantity-controls {
    width: 100%;
    justify-content: center;
  }
  .btn-add-to-cart,
  .btn-disabled {
    font-size: 1rem;
    padding: 0.875rem 1.5rem;
  }
  .details-table td {
    padding: 0.75rem;
    font-size: 0.875rem;
  }
  .details-table td.label {
    width: 120px;
  }
  .section-title {
    font-size: 1.5rem;
  }
  .section-subtitle {
    font-size: 1rem;
  }
}
@media (max-width: 480px) {
  .product-detail {
    padding: 1rem 0 2rem;
  }
  .product-grid {
    padding: 1rem;
    gap: 1.5rem;
  }
  .product-title {
    font-size: 1.25rem;
  }
  .meta-label {
    min-width: 80px;
    font-size: 0.875rem;
  }
  .meta-value {
    font-size: 0.875rem;
  }
  .details-table td.label {
    display: block;
    width: 100%;
    border-bottom: none;
    padding-bottom: 0.25rem;
  }
  .details-table td.value {
    display: block;
    width: 100%;
    padding-top: 0.25rem;
  }
}