/*
    File: product-detail.css
    Purpose: ENHANCED styles for the single product detail page.
*/

/* ====== Coffee&Vape-like sticky layout tweaks ====== */

/* Main image — square box, fills left column width */
.main-image-wrapper {
  width: 100%;
  aspect-ratio: 1 / 1;
  border: 1px solid #e0e0e0;
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: block;
  position: relative;
}

.main-image-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

/* Product info container */
.product-info-details {
  display: flex;
  flex-direction: column;
  padding: var(--spacing-xl);
  background: var(--white);
  border-radius: var(--radius-xl);
  box-shadow: 0px 4px 20px rgba(0, 0, 0, 0.05);
}

/* On large screens we want pronounced gap and image focus */
@media (min-width: 1200px) {
  .product-detail-container {
    gap: 80px;
    grid-template-columns: 1fr 420px; /* fixed width right column like the reference */
  }
}

/* Desktop-only styles - Match backup exactly */
@media (min-width: 1025px) {
  /* Remove all overrides - test if backup works without them */
}

/* Tablet + mobile overrides are at the BOTTOM of this file (after all base rules)
   so the cascade resolves correctly without fighting the base rules. */

.product-detail-section {
  padding: var(--spacing-xxl) 0;
  background-color: #f5f5f5;
}

.product-detail-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: var(--spacing-xl);
  display: grid;
  grid-template-columns: 1fr 1fr; /* Equal columns for image and info */
  gap: 60px;
  background-color: var(--light-bg);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
}

/* Left section wrapper — sticky so image stays in view while scrolling right column.
   top: 90px = nav height (50px logo + 16px padding top + 16px bottom) + 8px gap */
.product-left-section {
  position: sticky;
  top: 90px;
  align-self: start; /* critical: prevents grid from stretching it to full row height */
}

/* Image Gallery (as per reference) */
.product-image-gallery {
  display: grid;
  grid-template-columns: 70px 1fr;
  gap: 12px;
  /* height: 100% removed — image is now sized by its own aspect-ratio */
}
.thumbnail-list {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  overflow-y: auto;
  overflow-x: hidden;
  /* No fixed max-height — list height is constrained by the square image beside it */
  max-height: 100%;
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE/Edge */
}

.thumbnail-list::-webkit-scrollbar {
  display: none; /* Chrome/Safari */
}
.thumbnail-item {
  width: 56px;
  min-height: 56px;
  height: 56px;
  border: 2px solid #e0e0e0;
  border-radius: var(--radius-md);
  cursor: pointer;
  overflow: hidden;
  transition: var(--transition-fast);
  flex-shrink: 0;
}
.thumbnail-item:hover,
.thumbnail-item.active {
  border-color: var(--primary-color);
}
.thumbnail-item img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.main-image-wrapper {
  width: 100%;
  aspect-ratio: 1 / 1;
  border: 1px solid #e0e0e0;
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.main-image-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* Product Info - Right Column */
.product-info-details {
  display: flex;
  flex-direction: column;
  padding: var(--spacing-xl);
  background: var(--white);
  border-radius: var(--radius-xl);
  box-shadow: 0px 4px 20px rgba(0, 0, 0, 0.05);
}

.variant-row {
  display: flex;
  gap: 20px;
  width: 100%;
  margin-bottom: 20px;
}

.variant-column {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.variant-dropdown {
  width: 100%;
  padding: 12px;
  border: 1px solid #ddd;
  border-radius: var(--radius-md);
  font-size: 16px;
  background: #fff;
}

.product-title {
  font-size: 32px;
  font-weight: 700;
  margin-bottom: 0;
  margin-top: 0;
}
.product-brand-name {
  font-size: 16px;
  color: var(--text-light);
  margin-bottom: var(--spacing-sm);
}
.price-box {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 0;
  margin-top: 0;
}

.price-row {
  display: flex;
  align-items: baseline;
  gap: 12px;
}
.current-price {
  font-size: 28px;
  font-weight: 500;
  color: var(--primary-color);
}
.shipping-note {
  font-size: 14px;
  color: var(--text-light);
  margin-bottom: var(--spacing-lg);
}

/* Variant Selector (as per reference) - Dropdown Style */
.variant-selector-section {
  margin-bottom: var(--spacing-md);
}
.variant-label {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: var(--spacing-xs);
  display: block;
  color: #1a1a1a;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.variant-label .required-indicator {
  color: #ef4444;
  font-size: 16px;
  margin-left: 4px;
}

/* Custom Dropdown Styling */
.custom-select {
  position: relative;
  width: 100%;
  user-select: none;
}

.custom-select-trigger {
  width: 100%;
  padding: 12px 40px 12px 16px;
  font-size: 14px;
  font-weight: 500;
  color: #1a1a1a;
  background-color: white;
  border: 2px solid #d1d5db;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  box-sizing: border-box;
}

.custom-select-trigger::after {
  content: "";
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 6px solid #374151;
  transition: transform 0.2s ease;
}

.custom-select.open .custom-select-trigger::after {
  transform: translateY(-50%) rotate(180deg);
}

.custom-select-trigger:hover {
  border-color: #fb923c;
}

.custom-select.open .custom-select-trigger {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.1);
  border-radius: 8px 8px 0 0;
}

.custom-select-trigger.placeholder {
  color: #9ca3af;
}

.custom-select-options {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: white;
  border: 2px solid var(--primary-color);
  border-top: none;
  border-radius: 0 0 8px 8px;
  max-height: 240px;
  overflow-y: auto;
  z-index: 100;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  scrollbar-width: thin;
  scrollbar-color: #ddd transparent;
}

.custom-select.open .custom-select-options {
  display: block;
}

.custom-select-options::-webkit-scrollbar {
  width: 6px;
}

.custom-select-options::-webkit-scrollbar-track {
  background: transparent;
}

.custom-select-options::-webkit-scrollbar-thumb {
  background: #ddd;
  border-radius: 3px;
}

.custom-select-options::-webkit-scrollbar-thumb:hover {
  background: #bbb;
}

.custom-select-option {
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 500;
  color: #1a1a1a;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.custom-select-option:hover {
  background: #fff7ed;
  color: var(--primary-color);
}

.custom-select-option.selected {
  background: var(--primary-color);
  color: white;
}

.custom-select-option.disabled {
  color: #9ca3af;
  cursor: default;
}

.custom-select-option.disabled:hover {
  background: transparent;
  color: #9ca3af;
}

/* Hidden native select for form compatibility */
.custom-select .variant-dropdown {
  display: none;
}

/* Keep old button styles for backward compatibility if needed */
.variant-options {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.variant-option {
  padding: 10px 18px;
  border: 2px solid #d1d5db;
  border-radius: var(--radius-sm);
  font-weight: 500;
  font-size: 14px;
  background-color: white;
  cursor: pointer;
  transition: all 0.2s ease;
}
.variant-option:hover {
  border-color: #fb923c;
  color: #fb923c;
  background-color: #fff7ed;
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}
.variant-option.active {
  background-color: #f97316;
  border-color: #f97316;
  color: white;
  box-shadow: 0 2px 6px rgba(249, 115, 22, 0.3);
}

/* Stock Availability Info */
.stock-availability-info {
  margin: var(--spacing-md) 0;
  padding: var(--spacing-sm) var(--spacing-md);
  background-color: #f0fdf4;
  border-left: 4px solid #22c55e;
  border-radius: var(--radius-sm);
}
.stock-availability-info.out-of-stock {
  background-color: #fef2f2;
  border-left-color: #ef4444;
}
.stock-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}
.stock-indicator svg {
  color: #22c55e;
  flex-shrink: 0;
}
.stock-availability-info.out-of-stock .stock-indicator svg {
  color: #ef4444;
}
.stock-indicator span {
  font-size: 14px;
  font-weight: 600;
  color: #065f46;
}
.stock-availability-info.out-of-stock .stock-indicator span {
  color: #991b1b;
}
.stock-sku-display {
  font-size: 13px;
  color: #6b7280;
  margin: 4px 0 0 0;
}

/* Product Description - Separate full-width section below grid */
.product-description-wrapper {
  max-width: 1400px;
  width: 100%;
  margin: 15px auto 0;
  padding: 0 var(--spacing-xl);
  box-sizing: border-box;
}

.product-description {
  width: 100%;
  padding: var(--spacing-xl) var(--spacing-lg);
  background: var(--white);
  border-radius: var(--radius-lg);
  box-sizing: border-box;
}

.product-description h3 {
  font-size: 20px;
  margin-bottom: var(--spacing-xs); /* Reduced padding between title and description text */
  color: #1a1a1a;
  font-weight: 700;
  padding-bottom: var(--spacing-xs);
  border-bottom: 2px solid var(--primary-color);
  display: inline-block;
}

.product-description h4 {
  font-size: 18px;
  margin: var(--spacing-lg) 0 var(--spacing-sm) 0;
  color: #1a1a1a;
  font-weight: 700;
}

.product-description h5 {
  font-size: 16px;
  margin: var(--spacing-md) 0 var(--spacing-xs) 0;
  color: #1a1a1a;
  font-weight: 600;
}

.product-description p {
  line-height: 1.9;
  color: #444;
  font-size: 15px;
  margin-bottom: var(--spacing-md);
}

.product-description ul,
.product-description ol {
  line-height: 2;
  color: #444;
  font-size: 15px;
  margin: var(--spacing-md) 0;
  padding-left: 0;
  list-style: none;
}

.product-description ul li,
.product-description ol li {
  position: relative;
  padding-left: 28px;
  margin-bottom: 12px;
  line-height: 1.7;
}

.product-description ul li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 8px;
  width: 8px;
  height: 8px;
  background: var(--primary-color);
  border-radius: 50%;
}

.product-description ol {
  counter-reset: item;
}

.product-description ol li::before {
  content: counter(item);
  counter-increment: item;
  position: absolute;
  left: 0;
  top: 0;
  width: 22px;
  height: 22px;
  background: var(--primary-color);
  color: white;
  border-radius: 50%;
  font-size: 12px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Features section styling */
.product-description .features-title {
  font-size: 16px;
  font-weight: 600;
  color: #1a1a1a;
  margin: var(--spacing-lg) 0 var(--spacing-sm) 0;
}

/* Strong/bold text in descriptions */
.product-description strong,
.product-description b {
  color: #1a1a1a;
  font-weight: 600;
}

/* Italic text */
.product-description em,
.product-description i {
  font-style: italic;
}

/* Underline */
.product-description u {
  text-decoration: underline;
}

/* Strikethrough */
.product-description s,
.product-description strike {
  text-decoration: line-through;
}

/* Links */
.product-description a {
  color: var(--primary-color);
  text-decoration: underline;
}

.product-description a:hover {
  color: #ea580c;
}

/* Headings from Quill */
.product-description h1 {
  font-size: 28px;
  margin: var(--spacing-lg) 0 var(--spacing-md) 0;
  color: #1a1a1a;
  font-weight: 700;
}

.product-description h2 {
  font-size: 24px;
  margin: var(--spacing-lg) 0 var(--spacing-sm) 0;
  color: #1a1a1a;
  font-weight: 700;
}

/* Quill specific classes */
.product-description .ql-align-center {
  text-align: center;
}

.product-description .ql-align-right {
  text-align: right;
}

.product-description .ql-align-justify {
  text-align: justify;
}

/* Quill indent classes */
.product-description .ql-indent-1 {
  padding-left: 3em;
}

.product-description .ql-indent-2 {
  padding-left: 6em;
}

.product-description .ql-indent-3 {
  padding-left: 9em;
}

/* Quill size classes */
.product-description .ql-size-small {
  font-size: 0.75em;
}

.product-description .ql-size-large {
  font-size: 1.5em;
}

.product-description .ql-size-huge {
  font-size: 2.5em;
}

/* Blockquote */
.product-description blockquote {
  border-left: 4px solid var(--primary-color);
  margin: var(--spacing-md) 0;
  padding: var(--spacing-sm) var(--spacing-md);
  background: #f8f9fa;
  font-style: italic;
  color: #555;
}

/* Code block */
.product-description pre,
.product-description code {
  background: #f4f4f4;
  padding: 2px 6px;
  border-radius: 4px;
  font-family: monospace;
  font-size: 14px;
}

.product-description pre {
  padding: var(--spacing-md);
  overflow-x: auto;
}

/* Highlight boxes for key features */
.product-description .highlight-box {
  background: linear-gradient(135deg, #f8f9fa 0%, #fff 100%);
  border-left: 4px solid var(--primary-color);
  padding: var(--spacing-md);
  margin: var(--spacing-md) 0;
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
}

/* Responsive description */
@media (max-width: 768px) {
  .product-description {
    padding: var(--spacing-md);
    margin: var(--spacing-md) 0;
  }

  .product-description h3 {
    font-size: 18px;
  }

  .product-description p,
  .product-description ul li,
  .product-description ol li {
    font-size: 14px;
  }
}

/* Actions Box (Quantity + Add to Cart) */
.actions-box {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin: var(--spacing-lg) 0;
}
.quantity-selector {
  display: flex;
  flex-direction: column;
}
.quantity-selector label {
  font-size: 14px;
  margin-bottom: var(--spacing-xs);
  font-weight: 600;
  color: #333;
}
.quantity-control {
  display: flex;
  align-items: center;
  border: 2px solid #d1d5db;
  border-radius: 8px;
  width: fit-content;
  overflow: hidden;
  background-color: white;
}
.quantity-control button {
  width: 40px;
  height: 40px;
  background-color: transparent;
  font-size: 18px;
  font-weight: 600;
  border: none;
  border-left: 1px solid transparent;
  border-right: 1px solid transparent;
  cursor: pointer;
  transition: all 0.2s;
  color: #374151;
}
.quantity-control button:hover {
  background-color: #f3f4f6;
  color: var(--primary-color);
}
.quantity-control button:active {
  background-color: #e5e7eb;
}
.quantity-control input {
  width: 60px;
  height: 40px;
  text-align: center;
  border: none;
  border-left: 1px solid transparent;
  border-right: 1px solid transparent;
  font-size: 16px;
  font-weight: 600;
  color: #1f2937;
  background-color: transparent;
}
.quantity-control input:focus {
  outline: none;
}
.add-to-cart-main-btn {
  width: 100%;
  padding: 16px 24px;
  font-size: 16px;
  font-weight: 700;
  background: linear-gradient(135deg, #fb923c 0%, #f97316 100%);
  color: white;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(249, 115, 22, 0.2);
}
.add-to-cart-main-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(249, 115, 22, 0.3);
}
.add-to-cart-main-btn:active {
  transform: translateY(0);
}

/* States */
.loading-state,
.error-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 100px 0;
  font-size: 18px;
}
.error-state {
  color: var(--danger-color);
}

/* Related Products */
.related-products-section {
  padding: var(--spacing-xxl) 0;
  background-color: #f9f9f9;
}
.related-products-section .section-header h2 {
  font-size: 32px;
  margin-bottom: var(--spacing-lg);
}
.related-products-section .section-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 15px;
}
.related-products-section .products-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--spacing-lg);
  margin-bottom: var(--spacing-xl);
}

/* Responsive */
@media (max-width: 992px) {
  .product-detail-container {
    grid-template-columns: 1fr;
    gap: var(--spacing-xl);
  }
  .product-image-gallery {
    height: 400px;
  }
  .related-products-section .products-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Tablet only (769px–992px): switch gallery to single-column horizontal thumbnails.
   Below 769px responsive.css handles this with !important rules — don't touch it. */
@media only screen and (min-width: 769px) and (max-width: 992px) {
  .product-image-gallery {
    grid-template-columns: 1fr;
    grid-template-rows: 400px auto;
    height: auto;
  }
  /* thumbnail-list is first in DOM — must appear below main image */
  .main-image-wrapper {
    grid-row: 1;
    grid-column: 1;
  }
  .thumbnail-list {
    grid-row: 2;
    grid-column: 1;
    flex-direction: row;
    overflow-x: auto;
    overflow-y: hidden;
    max-height: none;
  }
  .thumbnail-item {
    min-width: 60px;
    flex-shrink: 0;
  }
}

@media (max-width: 768px) {
  .product-detail-container {
    padding: var(--spacing-md);
  }

  .product-title {
    font-size: 28px;
  }

  .current-price {
    font-size: 24px;
  }

  .variant-selector-section {
    padding: var(--spacing-sm);
  }

  .variant-options {
    gap: 8px;
  }

  .variant-option {
    padding: 8px 14px;
    font-size: 13px;
  }

  .quantity-control {
    width: 100%;
    max-width: 180px;
  }

  .quantity-control button {
    width: 42px;
    height: 42px;
  }

  .quantity-control input {
    flex: 1;
    height: 42px;
  }

  .related-products-section .products-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--spacing-md);
  }
}

@media (max-width: 480px) {
  .product-detail-container {
    padding: var(--spacing-sm);
  }

  .product-image-gallery {
    grid-template-columns: 1fr;
    grid-template-rows: 300px 80px;
    height: auto;
  }

  .thumbnail-list {
    flex-direction: row;
    overflow-x: auto;
  }

  .thumbnail-item {
    width: 70px;
    height: 70px;
  }

  .product-title {
    font-size: 24px;
  }

  .current-price {
    font-size: 22px;
  }

  .variant-selector-section {
    padding: 12px;
    margin-bottom: var(--spacing-md);
  }

  .variant-label {
    font-size: 13px;
  }

  .variant-options {
    gap: 6px;
  }

  .variant-option {
    padding: 7px 12px;
    font-size: 12px;
  }

  .stock-availability-info {
    padding: 10px 12px;
    font-size: 13px;
  }

  .stock-indicator {
    font-size: 13px;
  }

  .actions-box {
    gap: 14px;
  }

  .quantity-selector label {
    font-size: 13px;
  }

  .quantity-control {
    width: 100%;
    max-width: 160px;
  }

  .quantity-control button {
    width: 38px;
    height: 38px;
    font-size: 18px;
  }

  .quantity-control input {
    height: 38px;
    font-size: 15px;
  }

  .add-to-cart-main-btn {
    padding: 14px 20px;
    font-size: 15px;
  }

  .related-products-section .products-grid {
    grid-template-columns: 1fr;
  }
}

/* ========================================
   NEW UI ELEMENTS - MATCHING REFERENCE IMAGE
   ======================================== */

/* Product Header Row with Title and Navigation */
.product-header-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: var(--spacing-md);
}

.product-title-section {
  flex: 1;
}

.product-title {
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 8px;
  color: #1a1a1a;
}

/* Star Rating */
.product-rating-section {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 0;
  margin-top: 0;
}

.star-rating {
  display: flex;
  align-items: center;
  gap: 4px;
}

.star {
  font-size: 20px;
  color: #d0d0d0;
}

.star.filled {
  color: #ffa500;
}

.star.half-filled {
  background: linear-gradient(90deg, #ffa500 50%, #d0d0d0 50%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.review-count {
  font-size: 14px;
  color: #666;
  margin-left: 4px;
}

.view-all-reviews {
  font-size: 12px;
  font-weight: 600;
  color: #1a1a1a;
  background: none;
  border: none;
  text-decoration: none;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: color 0.3s ease;
  padding: 0;
}

.view-all-reviews:hover {
  color: var(--primary-color);
}

/* Stock Availability */
.stock-availability {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: var(--spacing-sm) 0;
  padding: 8px 0;
}

.availability-label {
  font-size: 12px;
  font-weight: 600;
  color: #1a1a1a;
  letter-spacing: 0.5px;
}

.availability-status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.5px;
}

.availability-status.in-stock {
  color: #22c55e;
}

.availability-status svg {
  stroke: #22c55e;
}

/* Product Categories */
.product-categories {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: var(--spacing-md);
  padding: 8px 0;
}

.category-label {
  font-size: 12px;
  font-weight: 600;
  color: #1a1a1a;
  letter-spacing: 0.5px;
}

.category-link {
  font-size: 13px;
  color: #666;
  text-decoration: none;
  transition: color 0.3s ease;
}

.category-link:hover {
  color: var(--primary-color);
}

/* Actions Box - Simplified Layout */
.actions-box {
  margin-bottom: var(--spacing-md);
}

/* Buy It Now Button */
.buy-now-btn {
  display: block;
  width: 100%;
  box-sizing: border-box;
  background: #1a1a1a;
  color: white;
  border: none;
  padding: 16px 24px;
  border-radius: 6px;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.5px;
  cursor: pointer;
  margin-bottom: var(--spacing-md);
  transition: all 0.3s ease;
}

.buy-now-btn:hover {
  background: #000;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* Button group wrapper */
.page-btn-group {
  width: 100%;
}

/* Add to Cart Button */
.page-btn-group .add-to-cart-btn {
  display: block;
  width: 100%;
  box-sizing: border-box;
  margin: 0 0 var(--spacing-md) 0;
  background: #e8e8e8;
  color: #1a1a1a;
  border: none;
  padding: 16px 24px;
  border-radius: 6px;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.5px;
  cursor: pointer;
  margin-bottom: var(--spacing-md);
  transition: all 0.3s ease;
}

.page-btn-group .add-to-cart-btn:hover {
  background: #d0d0d0;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* Secondary Actions */
.product-actions-secondary {
  display: flex;
  gap: 16px;
  margin-bottom: var(--spacing-lg);
  padding: var(--spacing-md) 0;
  border-top: 1px solid #e0e0e0;
  border-bottom: 1px solid #e0e0e0;
}

.action-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  background: none;
  border: none;
  padding: 8px 0;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.5px;
  color: #1a1a1a;
  cursor: pointer;
  transition: color 0.3s ease;
}

.action-btn:hover {
  color: var(--primary-color);
}

.action-btn svg {
  stroke: #1a1a1a;
  transition: stroke 0.3s ease;
}

.action-btn:hover svg {
  stroke: var(--primary-color);
}

/* Shipping Deadline Notice */
.shipping-deadline-notice {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  background: #f0fdf4;
  border: 2px solid #22c55e;
  border-radius: 8px;
  margin-bottom: var(--spacing-lg);
}

.shipping-deadline-notice svg {
  flex-shrink: 0;
  stroke: #22c55e;
}

.shipping-deadline-notice span {
  font-size: 14px;
  color: #1a1a1a;
  line-height: 1.5;
}

.shipping-deadline-notice strong {
  color: var(--primary-color);
  font-weight: 700;
}

/* iPad Specific Styles (769px to 1024px) */
@media (min-width: 769px) and (max-width: 1024px) {
  .product-detail-section {
    overflow: hidden;
  }

  .product-detail-container {
    max-width: 100%;
    padding: 0 var(--spacing-lg);
    box-sizing: border-box;
  }

  .product-detail-layout {
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-xl);
  }

  .product-gallery {
    max-width: 100%;
  }

  .product-info-section {
    max-width: 100%;
  }

  .product-title {
    font-size: 26px;
  }

  .product-brand {
    font-size: 15px;
  }

  .product-price {
    margin: var(--spacing-md) 0;
  }

  .current-price {
    font-size: 30px;
  }

  .original-price {
    font-size: 20px;
  }

  .actions-box {
    flex-direction: row;
    gap: var(--spacing-md);
    align-items: center;
  }

  .quantity-selector {
    flex: 0 1 auto;
  }

  .add-to-cart-main-btn {
    flex: 1;
  }

  .related-products-section {
    overflow: hidden;
  }

  .related-products-section .section-container {
    max-width: 100%;
    padding: 0 var(--spacing-lg);
  }

  .related-products-section .products-grid {
    grid-template-columns: repeat(3, 1fr) !important;
    gap: var(--spacing-md);
  }
}

/* Mobile Responsive for New Elements */
@media (max-width: 768px) {
  .product-header-row {
    gap: 16px;
  }

  .product-title {
    font-size: 22px;
  }

  .actions-box {
    flex-wrap: wrap;
  }

  .wishlist-btn {
    order: 2;
  }

  .quantity-selector {
    order: 1;
    flex: 1 1 calc(100% - 60px);
  }

  .product-actions-secondary {
    flex-direction: column;
    gap: 12px;
  }

  .shipping-deadline-notice {
    padding: 12px;
  }

  .shipping-deadline-notice span {
    font-size: 13px;
  }
}

/* ========================================
   MODAL STYLING
   ======================================== */

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  padding: 20px;
}

.modal-overlay.active {
  display: flex;
}

.modal-content {
  background: white;
  border-radius: 12px;
  padding: 32px;
  max-width: 500px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: translateY(-30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: none;
  border: none;
  font-size: 28px;
  cursor: pointer;
  color: #666;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.3s ease;
}

.modal-close:hover {
  color: #1a1a1a;
}

.modal-content h2 {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 8px;
  color: #1a1a1a;
}

.modal-subtitle {
  font-size: 14px;
  color: #666;
  margin-bottom: 24px;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: #1a1a1a;
  margin-bottom: 8px;
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 12px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 14px;
  font-family: inherit;
  transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--primary-color);
}

.form-group textarea {
  resize: vertical;
  min-height: 100px;
}

.modal-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  margin-top: 24px;
}

.btn-primary {
  background: var(--primary-color);
  color: white;
  border: none;
  padding: 12px 24px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.btn-primary:hover {
  background: #ea580c;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(249, 115, 22, 0.3);
}

.btn-secondary {
  background: #f3f4f6;
  color: #1a1a1a;
  border: none;
  padding: 12px 24px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.btn-secondary:hover {
  background: #e5e7eb;
}

/* Star Selector for Review Modal */
.star-selector {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
}

.star-selector .star {
  font-size: 32px;
  color: #d0d0d0;
  cursor: pointer;
  transition: all 0.2s ease;
}

.star-selector .star:hover,
.star-selector .star.hover {
  color: #ffa500;
  transform: scale(1.1);
}

.star-selector .star.selected {
  color: #ffa500;
}

@media (max-width: 480px) {
  .modal-content {
    padding: 24px 20px;
  }

  .modal-content h2 {
    font-size: 20px;
  }

  .modal-actions {
    flex-direction: column;
  }

  .btn-primary,
  .btn-secondary {
    width: 100%;
  }
}

/* ========================================
   LOGIN REQUIRED MODAL STYLING
   ======================================== */

.login-required-content {
  text-align: center;
  padding: var(--spacing-md) 0;
}

.login-required-content svg {
  display: block;
}

.login-required-content h2 {
  font-size: 24px;
  font-weight: 700;
  color: #1a1a1a;
  margin: 0 0 var(--spacing-md) 0;
}

.login-required-content p {
  font-size: 16px;
  line-height: 1.6;
  color: var(--text-light);
  margin: 0 0 var(--spacing-lg) 0;
  max-width: 400px;
  margin-left: auto;
  margin-right: auto;
}

/* ========================================
   ALL REVIEWS MODAL STYLING
   ======================================== */

.reviews-modal-content {
  max-width: 800px;
  max-height: 85vh;
}

.reviews-modal-header {
  margin-bottom: var(--spacing-md);
  padding-bottom: var(--spacing-md);
  border-bottom: 2px solid #e0e0e0;
}

.reviews-modal-header h2 {
  margin: 0;
  font-size: 24px;
  font-weight: 700;
  color: #1a1a1a;
}

.write-review-btn-container {
  margin-bottom: var(--spacing-lg);
  text-align: center;
}

.write-review-btn-container .btn-primary {
  min-width: 200px;
}

.reviews-summary {
  background: #f5f5f5;
  padding: var(--spacing-lg);
  border-radius: var(--radius-md);
  margin-bottom: var(--spacing-lg);
}

.average-rating {
  text-align: center;
}

.average-rating h3 {
  font-size: 48px;
  font-weight: 700;
  color: var(--primary-color);
  margin: 0 0 var(--spacing-xs) 0;
}

.average-rating .star-display {
  display: flex;
  justify-content: center;
  gap: 4px;
  margin-bottom: var(--spacing-xs);
}

.average-rating p {
  color: var(--text-light);
  font-size: 14px;
  margin: 0;
}

.reviews-list {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-md);
  max-height: 400px;
  overflow-y: auto;
  padding-right: var(--spacing-xs);
}

.review-item {
  padding: var(--spacing-md);
  background: var(--white);
  border: 1px solid #e0e0e0;
  border-radius: var(--radius-md);
  transition: var(--transition-fast);
}

.review-item:hover {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.review-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: var(--spacing-sm);
}

.reviewer-info {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-xs);
}

.reviewer-info strong {
  font-size: 16px;
  color: #1a1a1a;
  font-weight: 600;
}

.reviewer-info .star-display {
  display: flex;
  gap: 2px;
}

.review-date {
  font-size: 13px;
  color: var(--text-light);
}

.review-title {
  font-size: 16px;
  font-weight: 600;
  color: #1a1a1a;
  margin: 0 0 var(--spacing-xs) 0;
}

.review-text {
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-light);
  margin: 0;
}

.no-reviews {
  text-align: center;
  padding: 60px var(--spacing-md);
}

.no-reviews p {
  font-size: 16px;
  color: var(--text-light);
  margin-bottom: var(--spacing-md);
}

.loading-text {
  text-align: center;
  padding: 40px;
  color: var(--text-light);
}

.star-display .star {
  font-size: 18px;
  color: #d0d0d0;
}

.star-display .star.filled {
  color: #ffa500;
}

.star-display .star.half-filled {
  background: linear-gradient(90deg, #ffa500 50%, #d0d0d0 50%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Scrollbar styling for reviews list */
.reviews-list::-webkit-scrollbar {
  width: 6px;
}

.reviews-list::-webkit-scrollbar-track {
  background: #f5f5f5;
  border-radius: var(--radius-sm);
}

.reviews-list::-webkit-scrollbar-thumb {
  background: #d1d5db;
  border-radius: var(--radius-sm);
}

.reviews-list::-webkit-scrollbar-thumb:hover {
  background: #9ca3af;
}

/* Responsive styles for reviews modal */
@media (max-width: 992px) {
  .reviews-list {
    max-height: 350px;
  }
}

@media (max-width: 768px) {
  .reviews-modal-content {
    max-height: 90vh;
  }

  .reviews-modal-header h2 {
    font-size: 20px;
  }

  .write-review-btn-container .btn-primary {
    width: 100%;
  }

  .average-rating h3 {
    font-size: 36px;
  }

  .reviews-list {
    max-height: 300px;
  }

  .review-item {
    padding: var(--spacing-sm);
  }
}

@media (max-width: 480px) {
  .reviews-modal-header h2 {
    font-size: 18px;
  }

  .average-rating h3 {
    font-size: 28px;
  }

  .review-header {
    flex-direction: column;
    gap: var(--spacing-xs);
  }

  .review-date {
    font-size: 12px;
  }

  .reviewer-info strong {
    font-size: 15px;
  }

  .review-title {
    font-size: 15px;
  }

  .review-text {
    font-size: 13px;
  }

  .reviews-list {
    max-height: 250px;
    padding-right: 4px;
  }

  .no-reviews {
    padding: 40px var(--spacing-sm);
  }

  .no-reviews p {
    font-size: 14px;
  }
}

/* ============================================================
   TABLET + MOBILE LAYOUT OVERRIDE (≤1024px)
   Placed at end of file so it wins the cascade over all base
   rules and the 992px / 480px blocks above without needing
   !important on layout properties.
   Only pointer-events / AOS overrides still need !important
   because AOS CSS loads asynchronously after this file.
   ============================================================ */
@media (max-width: 1024px) {
  /* Outer grid: single column, product info stacks below gallery */
  .product-detail-container {
    grid-template-columns: 1fr;
    gap: var(--spacing-xl);
  }

  /* Gallery: single-column grid, image on top, thumbnails below.
     thumbnail-list is FIRST in DOM so must be explicitly placed in row 2. */
  .product-image-gallery {
    position: static;
    height: auto;
    grid-template-columns: 1fr;
    grid-template-rows: 350px 70px;
    gap: 10px;
  }

  .main-image-wrapper {
    grid-row: 1;
    grid-column: 1;
    height: 350px;
    width: 100%;
  }

  .thumbnail-list {
    grid-row: 2;
    grid-column: 1;
    flex-direction: row;
    overflow-x: auto;
    overflow-y: hidden;
    max-height: none;
    height: 70px;
    pointer-events: auto !important;
  }

  .thumbnail-item {
    min-width: 60px;
    flex-shrink: 0;
    pointer-events: auto !important;
  }

  .product-info-details {
    position: static;
    max-height: none;
    overflow: visible;
    transform: none !important;
    opacity: 1 !important;
    pointer-events: auto !important;
  }

  .product-image-gallery[data-aos] {
    transform: none !important;
    opacity: 1 !important;
    pointer-events: auto !important;
  }

  .product-left-section {
    position: static;
  }
}
