:root {
  --primary: #d10000;
  --primary-dark: #a30000;
  --primary-light: #ffd1d1;
  --dark: #1f2937;
  --bg: #fff;
  --nav-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
  --radius: 0.75rem;
  --transition: 0.25s cubic-bezier(0.56, -0.06, 0.52, 1.19);
  --z-header: 1050;

  --card-bg: #fff;
  --card-bg-dark: #1d232b;
  --card-shadow: 0 4px 28px 0 rgba(31, 41, 55, 0.09),
    0 2px 8px rgba(209, 0, 0, 0.03);
  --card-shadow-hover: 0 8px 40px 0 rgba(21, 21, 35, 0.16),
    0 6px 20px rgba(209, 0, 0, 0.06);
  --card-radius: 1.3rem;
  --card-border: 1.3px solid #f0f2f3;
  --card-border-dark: 1.5px solid #222734;
  --space: 2.2rem;
  --muted: #757f95;
  --muted-dark: #bdc3c8;
  --title: #181d24;
  --title-dark: #fafbff;
  --excerpt: #384165;
  --excerpt-dark: #dde4f0;
  --meta-font: 0.97rem;
}

body {
  margin: 0;
  font-family: "Poppins", Arial, sans-serif;
  background: var(--bg);
  color: var(--dark);
  line-height: 1.6;
}

.cart-icon {
  position: relative;
  font-size: 1.4rem;
  color: var(--dark);
}

.cart-count {
  position: absolute;
  top: -8px;
  right: -8px;
  background: var(--primary);
  color: white;
  font-size: 0.7rem;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
}

/* Main container */
.container {
  max-width: 1200px;
  margin: 2rem auto;
  padding: 0 1.5rem;
}

/* Breadcrumb */
.breadcrumb {
  margin-bottom: 2rem;
  font-size: 0.9rem;
  color: var(--muted);
}

.breadcrumb a {
  color: var(--muted);
  text-decoration: none;
}

.breadcrumb a:hover {
  color: var(--primary);
}

/* Product details layout */
.product-details {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space);
  margin-bottom: 4rem;
}

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

.main-image {
  position: relative;
  border-radius: var(--card-radius);
  overflow: hidden;
  box-shadow: var(--card-shadow);
  border: var(--card-border);
  aspect-ratio: 1/1;
}

.main-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s;
}

.main-image:hover img {
  transform: scale(1.03);
}

.image-thumbnails {
  display: flex;
  gap: 1rem;
}

.thumbnail {
  width: 80px;
  height: 80px;
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  border: 2px solid transparent;
  transition: border 0.2s;
  box-shadow: var(--card-shadow);
}

.thumbnail.active {
  border-color: var(--primary);
}

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

/* Product info */
.product-info {
  padding: 1rem;
}

.product-title {
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--title);
  margin: 0 0 1rem 0;
  line-height: 1.2;
}

.product-rating {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.stars {
  color: #ffc107;
}

.rating-count {
  color: var(--muted);
  font-size: 0.9rem;
}

.product-price {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.current-price {
  font-size: 2rem;
  font-weight: 800;
  color: var(--primary);
}

.original-price {
  font-size: 1.5rem;
  color: var(--muted);
  text-decoration: line-through;
}

.discount-badge {
  background: var(--primary-light);
  color: var(--primary);
  padding: 0.3rem 0.8rem;
  border-radius: 0.4rem;
  font-weight: 700;
  font-size: 0.9rem;
}

.product-description {
  color: var(--excerpt);
  margin-bottom: 2rem;
  line-height: 1.7;
}

/* Product options */
.product-options {
  margin-bottom: 2rem;
}

.option-group {
  margin-bottom: 1.5rem;
}

.option-title {
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--title);
}

.color-options {
  display: flex;
  gap: 0.8rem;
}

.color-option {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all 0.2s;
  position: relative;
}

.color-option.active {
  border-color: var(--primary);
}

.color-option.active::after {
  content: "✓";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: white;
  font-size: 0.9rem;
  text-shadow: 0 0 2px rgba(0, 0, 0, 0.5);
}

.size-options {
  display: flex;
  gap: 0.8rem;
}

.size-option {
  padding: 0.5rem 1rem;
  border: 1px solid #e5e7eb;
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.2s;
  font-weight: 500;
}

.size-option.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

/* Add to cart section */
.add-to-cart-section {
  display: flex;
  gap: 1rem;
  margin-bottom: 2rem;
  align-items: center;
}

.quantity-selector {
  display: flex;
  align-items: center;
  border: 1px solid #e5e7eb;
  border-radius: var(--radius);
  overflow: hidden;
}

.quantity-btn {
  background: none;
  border: none;
  width: 40px;
  height: 40px;
  font-size: 1.2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.quantity-input {
  width: 50px;
  height: 40px;
  text-align: center;
  border: none;
  border-left: 1px solid #e5e7eb;
  border-right: 1px solid #e5e7eb;
  font-size: 1rem;
  font-weight: 600;
}

.add-to-cart-btn {
  flex: 1;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 2em;
  padding: 0.75rem 1.5rem;
  font-weight: 600;
  font-size: 1.1rem;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.add-to-cart-btn:hover {
  background: var(--primary-dark);
  transform: translateY(-2px);
}

.wishlist-btn {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: #f8f9fa;
  border: 1px solid #e9ecef;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 1.2rem;
}

.wishlist-btn:hover {
  background: #fff5f5;
  color: var(--primary);
  border-color: var(--primary-light);
}

/* Product specs */
.product-specs {
  background: var(--card-bg);
  border-radius: var(--card-radius);
  box-shadow: var(--card-shadow);
  padding: 1.5rem;
  margin-bottom: 2rem;
}

.specs-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--title);
  margin: 0 0 1.5rem 0;
}

.specs-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

.spec-item {
  display: flex;
  flex-direction: column;
}

.spec-name {
  font-weight: 600;
  color: var(--muted);
  font-size: 0.9rem;
}

.spec-value {
  font-weight: 500;
}

/* Reviews section */
.reviews-section {
  background: var(--card-bg);
  border-radius: var(--card-radius);
  box-shadow: var(--card-shadow);
  padding: 1.5rem;
}

.reviews-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
}

.reviews-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--title);
  margin: 0;
}

.write-review-btn {
  background: none;
  border: 1px solid var(--primary);
  color: var(--primary);
  padding: 0.5rem 1rem;
  border-radius: 2em;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.write-review-btn:hover {
  background: var(--primary);
  color: white;
}

.review-card {
  padding: 1.5rem;
  border-radius: var(--card-radius);
  border: var(--card-border);
  margin-bottom: 1.5rem;
}

.review-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.reviewer {
  font-weight: 600;
}

.review-date {
  color: var(--muted);
  font-size: 0.9rem;
}

.review-content {
  color: var(--excerpt);
}

/* Responsive adjustments */
@media (max-width: 980px) {
  .product-details {
    grid-template-columns: 1fr;
    gap: 1.7rem;
  }

  .specs-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 680px) {
  .add-to-cart-section {
    flex-direction: column;
    align-items: stretch;
  }

  .wishlist-btn {
    align-self: center;
  }
}


/* Reviews header */
.reviews-header {
  margin-top: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 30px;
  padding-bottom: 15px;
  border-bottom: 1px solid #eaeaea;
}

.reviews-title {
  font-size: 28px;
  font-weight: 700;
  color: #2c3e50;
  position: relative;
}

.reviews-title::after {
  content: "";
  position: absolute;
  bottom: -16px;
  left: 0;
  width: 60px;
  height: 4px;
  background: var(--primary);
  border-radius: 2px;
}

.write-review-btn {
  background: var(--primary);
  color: white;
  border: none;
  padding: 12px 24px;
  border-radius: 30px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(52, 152, 219, 0.2);
}

.write-review-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(52, 152, 219, 0.3);
}

/* Modal design */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(5px);
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

.modal-content {
  background: #fff;
  width: 90%;
  max-width: 500px;
  margin: 10% auto;
  padding: 30px;
  border-radius: 16px;
  text-align: center;
  position: relative;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
  animation: slideIn 0.4s ease;
  margin-top: 13%;
}

@keyframes slideIn {
  from {
    transform: translateY(-50px);
    opacity: 0;
  }

  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.close-btn {
  position: absolute;
  right: 20px;
  top: 15px;
  font-size: 24px;
  cursor: pointer;
  color: #aaa;
  transition: color 0.3s;
}

.close-btn:hover {
  color: #e74c3c;
}

.modal-content h2 {
  margin-bottom: 20px;
  color: #2c3e50;
  font-weight: 600;
}

.star-rating {
  display: flex;
  justify-content: center;
  margin: 20px 0;
  gap: 5px;
}

.star {
  font-size: 36px;
  color: #e0e0e0;
  cursor: pointer;
  transition: all 0.2s ease;
}

.star.selected,
.star:hover,
.star:hover ~ .star {
  color: gold;
  text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

.star.selected {
  animation: starBounce 0.5s ease;
}

@keyframes starBounce {
  0%,
  100% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.2);
  }
}

textarea {
  width: 100%;
  border: 1px solid #e0e0e0;
  border-radius: 10px;
  resize: none;
  font-size: 16px;
  margin: 15px 0;
  transition: border 0.3s;
}

textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}

.submit-review {
  background: var(--primary);
  color: white;
  border: none;
  padding: 12px 30px;
  border-radius: 30px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  width: 100%;
  font-size: 16px;
  margin-top: 10px;
}

.submit-review:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 15px rgba(52, 152, 219, 0.3);
}

.rating-text {
  margin-top: 10px;
  font-size: 14px;
  color: #7f8c8d;
  min-height: 20px;
}

/* Existing reviews display */
.reviews-container {
  margin-top: 40px;
}

.review-card {
  background: white;
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
  transition: transform 0.3s ease;
}

.review-card:hover {
  transform: translateY(-5px);
}

.review-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
}

.reviewer-name {
  font-weight: 600;
  color: #2c3e50;
}

.review-date {
  color: #95a5a6;
  font-size: 14px;
}

.review-stars {
  color: gold;
  margin: 5px 0 10px;
}

.review-text {
  color: #34495e;
  line-height: 1.6;
}

/* Responsive adjustments */
@media (max-width: 600px) {
  .reviews-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 15px;
  }

  .modal-content {
    padding: 20px;
    margin: 20% auto;
    margin-top: 50%;
  }

  .star {
    font-size: 30px;
  }
}
