/* Product Detail Page Styles */

.product-detail-container {
  max-width: 1000px;
  margin: 0 auto;
  padding: 20px;
}

.back-link {
  margin-bottom: 20px;
}

.back-link a {
  color: #007bff;
  text-decoration: none;
  font-weight: bold;
  font-size: 1rem;
}

.back-link a:hover {
  text-decoration: underline;
}

.product-detail {
  display: flex;
  gap: 40px;
  padding: 20px;
  background-color: #f9f9f9;
  border-radius: 8px;
}

.product-image-section {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.product-image-main {
  width: 100%;
  height: auto;
  min-height: 400px;
  max-height: 600px;
  object-fit: contain;
  border-radius: 8px;
  background-color: #fff;
  margin-bottom: 20px;
}

.product-image-main.no-image {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 4rem;
  color: #999;
}

.product-thumbnails {
  display: flex;
  gap: 10px;
  overflow-x: auto;
}

.thumbnail {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: 5px;
  cursor: pointer;
  border: 2px solid #ddd;
  transition: all 0.3s ease;
}

.thumbnail:hover,
.thumbnail.active {
  border-color: #007bff;
}

.product-info-section {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.product-name {
  font-size: 2rem;
  font-weight: bold;
  color: #333;
  margin-bottom: 15px;
}

.product-category-badge {
  display: inline-block;
  background-color: #007bff;
  color: white;
  padding: 5px 10px;
  border-radius: 20px;
  font-size: 0.9rem;
  margin-bottom: 15px;
  width: fit-content;
}

.product-rating {
  display: flex;
  gap: 5px;
  margin-bottom: 15px;
  align-items: center;
}

.stars {
  color: #ffc107;
  font-size: 1.2rem;
}

.rating-text {
  color: #666;
  font-size: 0.9rem;
}

.product-price-section {
  margin-bottom: 20px;
  padding: 15px;
  background-color: #f0f0f0;
  border-radius: 5px;
}

.current-price {
  font-size: 2.5rem;
  font-weight: bold;
  color: #007bff;
  margin-bottom: 10px;
}

.original-price {
  font-size: 1.2rem;
  color: #999;
  text-decoration: line-through;
  margin-right: 10px;
}

.discount-badge {
  background-color: #dc3545;
  color: white;
  padding: 5px 10px;
  border-radius: 5px;
  font-weight: bold;
  font-size: 0.9rem;
}

.product-stock-info {
  font-size: 1.1rem;
  margin-bottom: 20px;
}

.stock-status {
  font-weight: bold;
}

.stock-available {
  color: #28a745;
}

.stock-low {
  color: #ffc107;
}

.stock-out {
  color: #dc3545;
}

.product-description {
  font-size: 1rem;
  color: #666;
  line-height: 1.6;
  margin-bottom: 20px;
  padding: 15px;
  background-color: #f0f0f0;
  border-radius: 5px;
}

.product-features {
  margin-bottom: 20px;
}

.features-title {
  font-weight: bold;
  margin-bottom: 10px;
  font-size: 1.1rem;
}

.features-list {
  list-style-position: inside;
  color: #666;
}

.features-list li {
  margin-bottom: 8px;
}

.product-quantity-section {
  display: flex;
  gap: 15px;
  align-items: center;
  margin-bottom: 20px;
}

.quantity-label {
  font-weight: bold;
}

.quantity-control {
  display: flex;
  align-items: center;
  border: 1px solid #ddd;
  border-radius: 5px;
  overflow: hidden;
}

.quantity-btn {
  width: 35px;
  height: 35px;
  border: none;
  background-color: #f5f5f5;
  cursor: pointer;
  font-size: 1.2rem;
  transition: all 0.3s ease;
}

.quantity-btn:hover {
  background-color: #007bff;
  color: white;
}

.quantity-input {
  width: 50px;
  text-align: center;
  border: none;
  font-size: 1rem;
  padding: 5px;
}

.product-actions {
  display: flex;
  gap: 15px;
  margin-bottom: 20px;
}

.btn-add-cart,
.btn-buy-now,
.btn-wishlist {
  flex: 1;
  padding: 15px;
  border: none;
  border-radius: 5px;
  font-size: 1rem;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s ease;
}

.btn-add-cart {
  background-color: #007bff;
  color: white;
}

.btn-add-cart:hover:not(:disabled) {
  background-color: #0056b3;
}

.btn-buy-now {
  background-color: #28a745;
  color: white;
}

.btn-buy-now:hover:not(:disabled) {
  background-color: #218838;
}

.btn-wishlist {
  background-color: #f5f5f5;
  color: #333;
  border: 1px solid #ddd;
}

.btn-wishlist:hover {
  background-color: #ffcccc;
  border-color: #dc3545;
}

button:disabled {
  background-color: #999 !important;
  color: white !important;
  cursor: not-allowed;
  opacity: 0.6;
}

.loading {
  grid-column: 1 / -1;
  text-align: center;
  padding: 40px;
  font-size: 1.2rem;
  color: #999;
}

@media (max-width: 768px) {
  .product-detail {
    flex-direction: column;
    gap: 20px;
  }

  .product-name {
    font-size: 1.5rem;
  }

  .current-price {
    font-size: 2rem;
  }

  .product-image-main {
    min-height: 300px;
  }

  .product-actions {
    flex-direction: column;
  }
}

/* --- Professional Product Detail Page Styles --- */
:root {
  --primary: #5a67d8;
  --secondary: #764ba2;
  --accent: #28a745;
  --danger: #dc3545;
  --bg: #f8f9fa;
  --text: #222;
  --muted: #888;
  --radius: 12px;
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
}

.hidden {
  display: none !important;
}

.header {
  background: linear-gradient(120deg, var(--primary), var(--secondary));
  color: #fff;
  padding: 1.2rem 0;
  position: fixed;
  width: 100%;
  top: 0;
  z-index: 1000;
  box-shadow: var(--shadow);
}

.header .container {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 24px;
}

.logo {
  font-size: 2rem;
  font-weight: 700;
  text-decoration: none;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-circle {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #fff;
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.3rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.07);
}

.nav {
  display: flex;
  gap: 22px;
  align-items: center;
}

.nav a {
  color: #fff;
  text-decoration: none;
  padding: 10px 18px;
  border-radius: 6px;
  font-size: 1.05rem;
  transition: background 0.2s;
}

.nav a:hover,
.nav a.active {
  background: rgba(255, 255, 255, 0.18);
}

.main-content {
  margin-top: 90px;
  min-height: calc(100vh - 180px);
  padding: 48px 0;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

.product-detail {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  padding: 48px;
  align-items: flex-start;
}

.product-images {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.main-image {
  width: 100%;
  height: 420px;
  object-fit: cover;
  border-radius: var(--radius);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
  background: #f3f3f3;
}

.thumbnail-images {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding: 8px 0;
}

.thumbnail {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: 6px;
  cursor: pointer;
  border: 2px solid transparent;
  transition: border 0.2s;
  background: #f3f3f3;
}

.thumbnail:hover,
.thumbnail.active {
  border-color: var(--primary);
}

.product-meta {
  display: flex;
  gap: 18px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.product-meta span {
  font-size: 0.97rem;
  color: var(--muted);
  background: #f1f1f1;
  padding: 6px 14px;
  border-radius: 20px;
}

.pricing {
  margin-bottom: 18px;
}

.unit-price,
.box-price {
  font-size: 1.6rem;
  color: var(--primary);
  font-weight: 700;
  margin-bottom: 4px;
}

.stock-info {
  display: flex;
  gap: 18px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.stock,
.boxes {
  font-size: 1.08rem;
  color: var(--accent);
  font-weight: 600;
}

.discount {
  font-size: 1.15rem;
  color: var(--danger);
  font-weight: 700;
  margin-bottom: 12px;
}

.specifications {
  margin-bottom: 18px;
  padding: 16px;
  background: #f7f7fb;
  border-radius: 8px;
}

.specifications div {
  margin-bottom: 4px;
  font-size: 0.98rem;
  color: #555;
}

.features {
  margin-bottom: 18px;
}

.features h3 {
  margin-bottom: 8px;
  color: var(--text);
  font-size: 1.13rem;
}

.features ul {
  list-style: none;
  padding: 0;
}

.features li {
  padding: 5px 0 5px 22px;
  position: relative;
  font-size: 1rem;
}

.features li:before {
  content: "\2713";
  color: var(--accent);
  font-weight: bold;
  position: absolute;
  left: 0;
}

.description {
  margin-bottom: 24px;
  line-height: 1.8;
}

.description h3 {
  margin-bottom: 8px;
  color: var(--text);
  font-size: 1.13rem;
}

.description p {
  color: #555;
}

.stock {
  font-size: 1.08rem;
  margin-bottom: 16px;
  color: var(--muted);
}

.quantity-selector {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 24px;
}

.quantity-btn {
  width: 38px;
  height: 38px;
  border: 1px solid #ddd;
  background: #fff;
  border-radius: 6px;
  cursor: pointer;
  font-size: 1.2rem;
  transition: background 0.2s;
}

.quantity-btn:hover {
  background: #f3f3f3;
}

.quantity-input {
  width: 54px;
  height: 38px;
  text-align: center;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 1.08rem;
}

.action-buttons {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

.btn {
  padding: 13px 28px;
  border: none;
  border-radius: 6px;
  font-size: 1.08rem;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
  display: inline-block;
  text-align: center;
  font-weight: 600;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
}

.btn-primary:hover {
  background: #4c51bf;
}

.btn-secondary {
  background: #f7f7fb;
  color: var(--text);
  border: 1px solid #ddd;
}

.btn-secondary:hover {
  background: #ececf6;
}

.loading {
  text-align: center;
  padding: 90px;
  color: var(--muted);
  font-size: 1.18rem;
}

.footer {
  background: #232946;
  color: #fff;
  padding: 44px 0 22px;
  margin-top: 44px;
}

.footer .container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 32px;
}

.footer h3 {
  margin-bottom: 18px;
  color: var(--primary);
  font-size: 1.18rem;
}

.footer ul {
  list-style: none;
  padding: 0;
}

.footer ul li {
  margin-bottom: 8px;
}

.footer a {
  color: #bfc0c0;
  text-decoration: none;
  transition: color 0.2s;
}

.footer a:hover {
  color: #fff;
}

.footer-bottom {
  text-align: center;
  padding-top: 18px;
  border-top: 1px solid #444;
  margin-top: 28px;
  font-size: 0.98rem;
  color: #bfc0c0;
}

@media (max-width: 900px) {
  .product-detail {
    grid-template-columns: 1fr;
    padding: 28px;
    gap: 32px;
  }

  .main-image {
    height: 300px;
  }
}

@media (max-width: 600px) {
  .main-content {
    padding: 18px 0;
  }

  .container {
    padding: 0 8px;
  }

  .product-detail {
    padding: 10px;
    gap: 18px;
  }

  .main-image {
    height: 180px;
  }

  .btn {
    width: 100%;
    padding: 12px 0;
  }

  .action-buttons {
    flex-direction: column;
    gap: 8px;
  }
}