@use 'sass:color';

// ========== platform ITEM DETAIL - Redesigned 2026 ==========
$dx-font: "DM Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
$dx-dark: #1e3c38;
$dx-primary: #497671;
$dx-secondary: #a1b4b5;
$dx-muted: #697777;
$dx-border: #d3dad9;
$dx-card-bg: #f5f3f9;

.dx-item-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px;
  font-family: $dx-font;
}

// Loading & Error
.dx-loading,
.dx-error {
  text-align: center;
  padding: 80px 20px;
  color: $dx-muted;

  p { margin: 0; font-size: 1rem; }
}

.dx-spinner {
  width: 48px;
  height: 48px;
  border: 4px solid $dx-border;
  border-top-color: $dx-primary;
  border-radius: 50%;
  animation: dxSpin 0.8s linear infinite;
  margin: 0 auto 20px;
}

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

.dx-back-link {
  display: inline-block;
  margin-top: 20px;
  padding: 12px 28px;
  background: $dx-primary;
  color: white;
  text-decoration: none;
  border-radius: 13px;
  font-weight: 600;
  transition: all 0.2s;

  &:hover {
    background: color.adjust($dx-primary, $lightness: -8%);
    transform: translateY(-1px);
  }
}

// Main Content Grid
.dx-item-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  margin-bottom: 48px;
}

.related-products {
  margin-top: 48px;

  h2 {
    margin: 0 0 20px;
    color: $dx-dark;
    font-size: 1.5rem;
    font-weight: 800;
  }
}

.related-products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 24px;
}

// Gallery: thumbnails left + main photo right
.dx-gallery {
  display: flex;
  gap: 16px;
}

.dx-thumbnails {
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex-shrink: 0;
  width: 80px;
  max-height: 520px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: $dx-border transparent;
}

.dx-thumb {
  width: 80px;
  height: 80px;
  border: 2px solid $dx-border;
  border-radius: 10px;
  overflow: hidden;
  cursor: pointer;
  position: relative;
  flex-shrink: 0;
  transition: all 0.2s;
  background: white;

  img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: white;
    padding: 4px;
  }

  &:hover {
    border-color: $dx-secondary;
  }

  &.active {
    border-color: $dx-primary;
    box-shadow: 0 0 0 1px $dx-primary;
  }
}

.dx-video-badge {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 28px;
  height: 28px;
  background: rgba(0, 0, 0, 0.6);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  z-index: 1;
}

.dx-main-photo {
  flex: 1;
  aspect-ratio: 1;
  background: white;
  border: 1px solid $dx-border;
  border-radius: 13px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 3px 4px 0 rgba(0, 0, 0, 0.08);

  img, video {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: white;
    padding: 16px;
  }
}

.dx-no-image {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  color: $dx-secondary;
  font-size: 0.95rem;
}

// Item Info Panel
.dx-info {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.dx-title {
  font-family: $dx-font;
  font-size: 1.75rem;
  font-weight: 700;
  color: $dx-dark;
  margin: 0;
  line-height: 1.3;
}

.dx-rating {
  display: flex;
  align-items: center;
  gap: 10px;
}

.dx-stars {
  display: flex;
  gap: 3px;
}

.dx-rating-value {
  font-weight: 700;
  font-size: 1rem;
  color: $dx-dark;
}

.dx-rating-count {
  font-size: 0.9rem;
  color: $dx-muted;
}

.dx-price-block {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.dx-price-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.dx-old-price {
  text-decoration: line-through;
  color: $dx-muted;
  font-size: 1.1rem;
}

.dx-discount-tag {
  background: #ef4444;
  color: white;
  padding: 3px 10px;
  border-radius: 20px;
  font-weight: 700;
  font-size: 0.85rem;
}

.dx-current-price {
  font-family: $dx-font;
  font-size: 2.25rem;
  font-weight: 800;
  color: $dx-primary;
  line-height: 1.1;
}

.dx-stock {
  display: flex;
  align-items: center;
  gap: 10px;
}

.dx-stock-label {
  font-size: 0.95rem;
  color: $dx-muted;
}

.dx-stock-status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.95rem;
  font-weight: 600;

  &.high { color: #2ed573; }
  &.medium { color: #ffa502; }
  &.low { color: #ef4444; }
}

.dx-stock-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
}

.dx-add-cart {
  width: 100%;
  max-width: 400px;
  padding: 16px 24px;
  background: $dx-primary;
  color: white;
  border: none;
  border-radius: 13px;
  font-family: $dx-font;
  font-size: 1.1rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  box-shadow: 0 3px 4px 0 rgba(0, 0, 0, 0.15);

  &:hover {
    background: color.adjust($dx-primary, $lightness: -8%);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(73, 118, 113, 0.3);
  }

  &:active {
    transform: translateY(0);
  }
}

// Variant chips (colour/size) — shared between platform and alt
.dx-variants, .alt-variants {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 12px;

  .variant-group {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
  }

  .variant-label {
    font-size: 0.9rem;
    color: #6b7280;
    font-weight: 500;
  }

  .variant-chip {
    display: inline-flex;
    align-items: center;
    padding: 6px 14px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    border: 1.5px solid $dx-border;
    background: rgba(73, 118, 113, 0.06);
    color: $dx-primary;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, box-shadow 0.15s;

    &:hover {
      background: rgba(73, 118, 113, 0.12);
    }

    &.active {
      border-color: $dx-primary;
      background: rgba(73, 118, 113, 0.18);
      box-shadow: 0 0 0 2px rgba(73, 118, 113, 0.25);
    }
  }

  .colour-swatch {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid $dx-border;
    cursor: pointer;
    transition: border-color 0.15s, box-shadow 0.15s;
    flex-shrink: 0;

    &:hover {
      border-color: $dx-primary;
    }

    &.active {
      border-color: $dx-primary;
      box-shadow: 0 0 0 2px rgba(73, 118, 113, 0.25);
    }
  }
}

.dx-attributes, .alt-attributes {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  margin-bottom: 14px;
  padding: 10px 14px;
  background: #f8fafa;
  border-radius: 10px;

  .attribute-row {
    display: flex;
    gap: 6px;
    font-size: 0.85rem;
  }

  .attribute-key {
    color: #6b7280;
    &::after { content: ':'; }
  }

  .attribute-value {
    font-weight: 600;
    color: #1a1a1a;
  }
}

.dx-delivery, .alt-delivery {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px 16px;
  border: 1px solid $dx-border;
  border-radius: 12px;
  background: #f8fafa;
}

.dx-delivery-title, .alt-delivery-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  color: $dx-dark;
}

.dx-delivery-list, .alt-delivery-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.dx-delivery-option, .alt-delivery-option {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  background: white;
}

.dx-delivery-option-main, .alt-delivery-option-main {
  display: flex;
  flex-direction: column;
  gap: 4px;
  color: $dx-muted;
  font-size: 0.9rem;
}

.dx-delivery-price, .alt-delivery-price {
  flex-shrink: 0;
  font-weight: 700;
  color: $dx-primary;
  font-size: 0.95rem;
}

.dx-delivery-chip, .alt-delivery-chip {
  display: inline-flex;
  align-self: flex-start;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(73, 118, 113, 0.12);
  color: $dx-primary;
  font-size: 0.9rem;
  font-weight: 700;
}

.dx-description {
  padding-top: 8px;
  border-top: 1px solid $dx-border;

  h2 {
    font-family: $dx-font;
    font-size: 1.3rem;
    font-weight: 700;
    color: $dx-dark;
    margin: 0 0 12px 0;
  }
}

.dx-description-text {
  font-size: 0.95rem;
  color: $dx-muted;
  line-height: 1.7;
}

// Reviews Section
.dx-reviews-section {
  margin-bottom: 48px;

  h2 {
    font-family: $dx-font;
    font-size: 1.5rem;
    font-weight: 700;
    color: $dx-dark;
    margin: 0 0 24px 0;
  }
}

.dx-review-form {
  background: $dx-card-bg;
  border: 1px solid $dx-border;
  border-radius: 13px;
  padding: 24px;
  margin-bottom: 24px;

  h3 {
    font-family: $dx-font;
    margin: 0 0 20px 0;
    color: $dx-dark;
    font-size: 1.15rem;
    font-weight: 700;
  }
}

.dx-rating-input {
  margin-bottom: 16px;

  label {
    display: block;
    margin-bottom: 8px;
    color: $dx-dark;
    font-weight: 600;
    font-size: 0.95rem;
  }
}

.dx-star-selector {
  display: flex;
  gap: 6px;

  .dx-star-pick {
    font-size: 1.8rem;
    cursor: pointer;
    opacity: 0.25;
    transition: all 0.15s;
    user-select: none;

    &.selected { opacity: 1; }
    &:hover { opacity: 0.7; transform: scale(1.15); }
  }
}

.dx-textarea {
  width: 100%;
  padding: 14px;
  border: 1px solid $dx-border;
  border-radius: 10px;
  font-family: $dx-font;
  font-size: 0.95rem;
  resize: none;
  margin-bottom: 16px;
  background: white;
  transition: border-color 0.2s;

  &:focus {
    outline: none;
    border-color: $dx-primary;
    box-shadow: 0 0 0 3px rgba(73, 118, 113, 0.1);
  }
}

.dx-form-actions {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.dx-anon-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 0.9rem;
  color: $dx-muted;

  input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: $dx-primary;
    cursor: pointer;
  }
}

.dx-user-preview {
  color: $dx-primary;
  font-size: 0.85rem;
  font-style: italic;
}

.dx-submit-btn {
  margin-left: auto;
  background: $dx-primary;
  color: white;
  border: none;
  padding: 12px 28px;
  border-radius: 13px;
  font-family: $dx-font;
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 140px;
  justify-content: center;

  &:hover:not(:disabled) {
    background: color.adjust($dx-primary, $lightness: -8%);
    transform: translateY(-1px);
  }

  &:disabled {
    background: $dx-border;
    color: $dx-muted;
    cursor: not-allowed;
  }

  &.submitting {
    background: $dx-secondary;
  }
}

.dx-spinner-sm {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: dxSpin 0.8s linear infinite;
}

.dx-status {
  margin-top: 16px;
  padding: 12px 16px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  font-size: 0.95rem;
  animation: dxSlideIn 0.3s ease-out;

  &.success {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #6ee7b7;
  }

  &.error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fca5a5;
  }
}

@keyframes dxSlideIn {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

// Reviews List
.dx-reviews-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.dx-review-card {
  background: white;
  border: 1px solid $dx-border;
  border-radius: 13px;
  padding: 20px;
  transition: box-shadow 0.2s;

  &:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
  }
}

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

.dx-reviewer {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.dx-reviewer-name {
  font-weight: 600;
  color: $dx-dark;
  font-size: 0.95rem;
}

.dx-review-date {
  color: $dx-muted;
  font-size: 0.8rem;
}

.dx-review-stars {
  display: flex;
  gap: 2px;
}

.dx-review-text {
  color: $dx-muted;
  line-height: 1.6;
  margin: 0;
  font-size: 0.95rem;
}

.dx-no-reviews {
  text-align: center;
  color: $dx-muted;
  padding: 40px;
  font-size: 1rem;
}

// Q&A Section
.dx-qa-section {
  margin-bottom: 48px;

  h2 {
    font-family: $dx-font;
    font-size: 1.5rem;
    font-weight: 700;
    color: $dx-dark;
    margin: 0 0 24px 0;
  }
}

.dx-qa-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.dx-qa-card {
  background: white;
  border: 1px solid $dx-border;
  border-radius: 13px;
  padding: 20px;
}

.dx-question,
.dx-answer {
  display: flex;
  gap: 10px;
  margin-bottom: 12px;
  line-height: 1.6;
  color: $dx-muted;
  font-size: 0.95rem;
}

.dx-qa-label {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.8rem;

  &.q {
    background: $dx-primary;
    color: white;
  }

  &.a {
    background: $dx-card-bg;
    color: $dx-primary;
    border: 1px solid $dx-border;
  }
}

.dx-qa-votes {
  display: flex;
  gap: 12px;
  padding-top: 8px;
  border-top: 1px solid $dx-border;
}

.dx-vote {
  display: flex;
  align-items: center;
  gap: 5px;
  background: none;
  border: 1px solid $dx-border;
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 0.85rem;
  color: $dx-muted;
  cursor: pointer;
  transition: all 0.2s;
  font-family: $dx-font;

  &.up:hover {
    border-color: #2ed573;
    color: #2ed573;
    background: rgba(46, 213, 115, 0.05);
  }

  &.down:hover {
    border-color: #ef4444;
    color: #ef4444;
    background: rgba(239, 68, 68, 0.05);
  }
}

// ========== platform RESPONSIVE ==========

// Large desktop — constrain gallery height
@media (min-width: 1201px) {
  .dx-main-photo {
    max-height: 560px;
  }
}

// Tablet landscape / small desktop
@media (max-width: 1200px) {
  .dx-item-content {
    gap: 32px;
  }

  .dx-title {
    font-size: 1.5rem;
  }
}

// Tablet portrait
@media (max-width: 992px) {
  .dx-item-content {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .dx-gallery {
    max-width: 600px;
    margin: 0 auto;
  }

  .dx-main-photo {
    max-height: 480px;
    aspect-ratio: auto;
  }

  .dx-add-cart {
    max-width: 100%;
  }

  .dx-reviews-section,
  .dx-qa-section {
    h2 {
      font-size: 1.3rem;
    }
  }
}

// Mobile
@media (max-width: 768px) {
  .dx-item-container {
    padding: 16px;
  }

  .dx-item-content {
    gap: 24px;
    margin-bottom: 32px;
  }

  // Thumbnails go below main photo
  .dx-gallery {
    flex-direction: column;
    max-width: 100%;
  }

  .dx-thumbnails {
    flex-direction: row;
    width: 100%;
    max-height: none;
    overflow-x: auto;
    overflow-y: hidden;
    order: 1;

    scrollbar-width: none;
    &::-webkit-scrollbar { display: none; }
  }

  .dx-main-photo {
    order: 0;
    max-height: 400px;
    aspect-ratio: auto;
  }

  .dx-thumb {
    width: 64px;
    height: 64px;
    min-width: 64px;
  }

  .dx-title {
    font-size: 1.4rem;
  }

  .dx-current-price {
    font-size: 1.8rem;
  }

  .dx-old-price {
    font-size: 1rem;
  }

  .dx-add-cart {
    max-width: 100%;
    padding: 14px 20px;
    font-size: 1rem;
  }

  .dx-description {
    h2 {
      font-size: 1.15rem;
    }
  }

  .dx-specs-table {
    .spec-key {
      white-space: normal;
      width: auto;
    }

    td {
      padding: 8px 10px;
      font-size: 0.85rem;
    }
  }

  .dx-review-form {
    padding: 16px;
  }

  .dx-form-actions {
    flex-direction: column;
    align-items: stretch;

    .dx-submit-btn {
      margin-left: 0;
      width: 100%;
    }
  }

  .dx-review-card {
    padding: 16px;
  }

  .dx-reviews-section,
  .dx-qa-section {
    margin-bottom: 32px;

    h2 {
      font-size: 1.25rem;
      margin-bottom: 16px;
    }
  }

  .dx-qa-card {
    padding: 16px;
  }

  .dx-question,
  .dx-answer {
    font-size: 0.9rem;
  }
}

// Small mobile
@media (max-width: 480px) {
  .dx-item-container {
    padding: 12px;
  }

  .dx-item-content {
    gap: 20px;
    margin-bottom: 24px;
  }

  .dx-main-photo {
    max-height: 300px;
    border-radius: 10px;

    img, video {
      padding: 8px;
    }
  }

  .dx-thumb {
    width: 52px;
    height: 52px;
    min-width: 52px;
  }

  .dx-title {
    font-size: 1.2rem;
  }

  .dx-info {
    gap: 16px;
  }

  .dx-current-price {
    font-size: 1.5rem;
  }

  .dx-rating {
    flex-wrap: wrap;
    gap: 6px;
  }

  .dx-stock {
    flex-wrap: wrap;
    gap: 6px;
  }

  .dx-add-cart {
    padding: 12px 16px;
    font-size: 0.95rem;
    border-radius: 10px;
  }

  .dx-review-form {
    padding: 14px;

    h3 {
      font-size: 1rem;
    }
  }

  .dx-star-selector {
    .dx-star-pick {
      font-size: 1.5rem;
    }
  }

  .dx-textarea {
    padding: 12px;
    font-size: 0.9rem;
  }

  .dx-review-card {
    padding: 14px;
  }

  .dx-reviewer-name {
    font-size: 0.9rem;
  }

  .dx-review-text {
    font-size: 0.9rem;
  }

  .dx-specs-table {
    td {
      padding: 6px 8px;
      font-size: 0.8rem;
      display: block;
    }

    .spec-key {
      width: 100%;
      padding-bottom: 2px;
    }

    .spec-value {
      padding-top: 0;
    }

    tr {
      display: flex;
      flex-direction: column;
      padding: 6px 0;
    }
  }

  .dx-qa-card {
    padding: 14px;
  }

  .dx-question,
  .dx-answer {
    font-size: 0.85rem;
    gap: 8px;
  }

  .dx-qa-label {
    width: 24px;
    height: 24px;
    font-size: 0.7rem;
  }
}

// ========== alt ITEM DETAIL STYLES ==========
.alt-item-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 2rem;
}

.alt-loading,
.alt-error {
  text-align: center;
  padding: 4rem 1rem;
}

.alt-spinner {
  width: 48px;
  height: 48px;
  border: 3px solid var(--border-color);
  border-top-color: var(--primary-color);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 1.5rem;
}

.alt-back-link {
  display: inline-block;
  margin-top: 1.5rem;
  padding: 0.75rem 2rem;
  background: var(--primary-color);
  color: white;
  text-decoration: none;
  border-radius: var(--radius-lg);
  font-weight: 600;
  transition: all 0.3s;

  &:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
  }
}

.alt-item-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  margin-bottom: 3rem;
}

.alt-gallery {
  .alt-main-photo {
    width: 100%;
    aspect-ratio: 1;
    background: var(--bg-secondary);
    border-radius: var(--radius-xl);
    overflow: hidden;
    margin-bottom: 1rem;
    border: 1px solid var(--border-color);

    img,
    video {
      width: 100%;
      height: 100%;
      object-fit: contain;
      background: white;
    }

    &.alt-no-image {
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      color: var(--text-tertiary);

      svg {
        margin-bottom: 1rem;
        stroke-width: 1;
      }

      p {
        font-size: 0.9rem;
      }
    }
  }

  .alt-thumbnails {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
    gap: 0.75rem;
  }

  .alt-thumb {
    aspect-ratio: 1;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.2s;
    position: relative;

    &:hover {
      border-color: var(--primary-color);
      transform: scale(1.05);
    }

    &.active {
      border-color: var(--primary-color);
      box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
    }

    img {
      width: 100%;
      height: 100%;
      object-fit: contain;
      background: white;
    }

    .video-indicator {
      position: absolute;
      top: 50%;
      left: 50%;
      transform: translate(-50%, -50%);
      background: rgba(0, 0, 0, 0.7);
      color: white;
      width: 28px;
      height: 28px;
      border-radius: 50%;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 10px;
      padding-left: 2px;
    }
  }
}

.alt-info {
  .alt-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 1rem 0;
    line-height: 1.3;
  }

  .alt-rating {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.5rem;

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

    .value {
      font-weight: 700;
      color: var(--text-primary);
    }

    .reviews {
      color: var(--text-secondary);
      font-size: 0.9rem;
    }
  }

  .alt-price-block {
    background: var(--bg-secondary);
    padding: 1.5rem;
    border-radius: var(--radius-lg);
    margin-bottom: 1.5rem;

    .price-row {
      display: flex;
      align-items: center;
      gap: 0.75rem;
      margin-bottom: 0.5rem;
    }

    .old-price {
      text-decoration: line-through;
      color: var(--text-tertiary);
      font-size: 1.1rem;
    }

    .discount-badge {
      background: #ef4444;
      color: white;
      padding: 0.25rem 0.75rem;
      border-radius: var(--radius-md);
      font-weight: 700;
      font-size: 0.85rem;
    }

    .current-price {
      font-size: 2.5rem;
      font-weight: 800;
      color: var(--primary-color);
      line-height: 1;
    }
  }

  .alt-stock {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);

    .stock-label {
      font-weight: 600;
      color: var(--text-secondary);
    }

    .stock-indicator {
      display: flex;
      align-items: center;
      gap: 0.5rem;
      font-weight: 600;

      .dot {
        width: 10px;
        height: 10px;
        border-radius: 50%;
        display: block;
      }

      &.high {
        color: #10b981;
        .dot { background: #10b981; }
      }

      &.medium {
        color: #f59e0b;
        .dot { background: #f59e0b; }
      }

      &.low {
        color: #ef4444;
        .dot { background: #ef4444; }
      }
    }
  }

  .alt-add-cart {
    width: 100%;
    padding: 1.25rem 2rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: var(--radius-lg);
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    transition: all 0.3s;
    margin-bottom: 2rem;

    &:hover {
      background: var(--primary-hover);
      transform: translateY(-2px);
      box-shadow: var(--shadow-lg);
    }

    &:active {
      transform: translateY(0);
    }
  }

  .alt-description {
    h3 {
      font-size: 1.25rem;
      font-weight: 600;
      color: var(--text-primary);
      margin: 0 0 1rem 0;
    }

    ::ng-deep {
      p { color: var(--text-secondary); line-height: 1.7; margin-bottom: 1rem; }
      ul, ol { padding-left: 1.5rem; margin-bottom: 1rem; }
      li { margin-bottom: 0.5rem; color: var(--text-secondary); }
      strong { color: var(--text-primary); }
    }
  }
}

.alt-reviews {
  margin-top: 3rem;
  padding-top: 3rem;
  border-top: 1px solid var(--border-color);

  h2 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 2rem 0;
  }

  .alt-reviews-list {
    display: grid;
    gap: 1.5rem;
  }

  .alt-review-card {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    transition: all 0.3s;

    &:hover {
      box-shadow: var(--shadow-md);
      transform: translateY(-2px);
      border-color: #10b981;
    }

    .review-header {
      display: flex;
      justify-content: space-between;
      align-items: flex-start;
      margin-bottom: 1rem;
      gap: 1rem;

      .reviewer-info {
        display: flex;
        flex-direction: column;
        gap: 0.25rem;

        .reviewer-name {
          font-weight: 600;
          font-size: 1rem;
          color: var(--text-primary);
        }

        .review-date {
          font-size: 0.8rem;
          color: var(--text-secondary);
        }
      }

      .review-stars {
        color: #fbbf24;
        font-size: 1.125rem;
        flex-shrink: 0;
      }
    }

    .review-text {
      color: var(--text-secondary);
      line-height: 1.7;
      margin: 0;
      font-size: 0.95rem;
    }
  }

  .alt-no-reviews {
    text-align: center;
    padding: 3rem 2rem;
    color: var(--text-secondary);
    font-size: 1rem;
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
  }
}

/* alt Review Form */
.alt-review-form {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 2rem;
  margin-bottom: 2rem;

  h3 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 1.5rem 0;
  }

  .alt-rating-input {
    margin-bottom: 1.5rem;

    label {
      display: block;
      font-size: 0.95rem;
      font-weight: 600;
      color: var(--text-primary);
      margin-bottom: 0.75rem;
    }

    .alt-star-selector {
      display: flex;
      gap: 0.5rem;

      .alt-star {
        font-size: 2rem;
        color: #d1d5db;
        cursor: pointer;
        transition: all 0.2s ease;
        user-select: none;

        &:hover, &.selected {
          color: #fbbf24;
          transform: scale(1.1);
        }

        &.selected {
          text-shadow: 0 0 10px rgba(251, 191, 36, 0.5);
        }
      }
    }
  }

  .alt-textarea {
    width: 100%;
    padding: 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 0.95rem;
    font-family: inherit;
    color: var(--text-primary);
    background: white;
    resize: none;
    min-height: 100px;
    transition: all 0.2s ease;

    &:focus {
      outline: none;
      border-color: #10b981;
      box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
    }

    &::placeholder {
      color: var(--text-secondary);
      opacity: 0.6;
    }
  }

  .alt-form-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 1rem;
    flex-wrap: wrap;

    .alt-anonymous-toggle {
      display: flex;
      align-items: center;
      gap: 0.5rem;
      font-size: 0.9rem;
      color: var(--text-secondary);
      cursor: pointer;

      input[type="checkbox"] {
        cursor: pointer;
        width: 18px;
        height: 18px;
      }

      span {
        user-select: none;
      }
    }

    .alt-username-preview {
      font-size: 0.875rem;
      color: var(--text-secondary);
      font-style: italic;
    }

    .alt-submit-review-btn {
      display: flex;
      align-items: center;
      gap: 0.5rem;
      padding: 0.75rem 1.5rem;
      margin-left: auto;
      background: linear-gradient(135deg, #10b981, #14b8a6, #06b6d4);
      color: white;
      border: none;
      border-radius: var(--radius-md);
      font-size: 0.95rem;
      font-weight: 600;
      cursor: pointer;
      transition: all 0.3s ease;

      svg {
        width: 18px;
        height: 18px;
      }

      &:hover:not(:disabled) {
        transform: translateY(-2px);
        box-shadow: 0 8px 20px rgba(16, 185, 129, 0.3);
      }

      &:disabled {
        opacity: 0.5;
        cursor: not-allowed;
        transform: none;
      }

      &.submitting {
        pointer-events: none;
      }

      .alt-spinner-small {
        width: 16px;
        height: 16px;
        border: 2px solid rgba(255, 255, 255, 0.3);
        border-top-color: white;
        border-radius: 50%;
        animation: spin 0.8s linear infinite;
      }
    }
  }

  .alt-status-message {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    margin-top: 1rem;
    border-radius: var(--radius-md);
    font-size: 0.95rem;
    font-weight: 500;
    animation: slideDown 0.3s ease;

    svg {
      flex-shrink: 0;
      width: 20px;
      height: 20px;
    }

    &.success {
      background: rgba(16, 185, 129, 0.1);
      color: #059669;
      border: 1px solid rgba(16, 185, 129, 0.3);

      svg {
        stroke: #059669;
      }
    }

    &.error {
      background: rgba(239, 68, 68, 0.1);
      color: #dc2626;
      border: 1px solid rgba(239, 68, 68, 0.3);

      svg {
        stroke: #dc2626;
      }
    }
  }
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

// ========== alt RESPONSIVE ==========

// Tablet portrait
@media (max-width: 968px) {
  .alt-item-content {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .alt-gallery {
    max-width: 600px;
    margin: 0 auto;
  }

  .alt-info .alt-title {
    font-size: 1.5rem;
  }

  .alt-info .alt-price-block .current-price {
    font-size: 2rem;
  }

  .alt-info .alt-add-cart {
    max-width: 100%;
  }

  .alt-review-form {
    padding: 1.5rem;

    .alt-form-actions {
      flex-direction: column;
      align-items: stretch;

      .alt-submit-review-btn {
        margin-left: 0;
        justify-content: center;
      }
    }
  }
}

// Mobile
@media (max-width: 768px) {
  .alt-item-container {
    padding: 1rem;
  }

  .alt-item-content {
    gap: 1.5rem;
    margin-bottom: 2rem;
  }

  .alt-gallery {
    max-width: 100%;

    .alt-main-photo {
      border-radius: var(--radius-lg);
      margin-bottom: 0.75rem;
    }

    .alt-thumbnails {
      grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
      gap: 0.5rem;
    }
  }

  .alt-info {
    .alt-title {
      font-size: 1.35rem;
    }

    .alt-rating {
      flex-wrap: wrap;
      gap: 0.5rem;
      margin-bottom: 1rem;
    }

    .alt-price-block {
      padding: 1rem;

      .current-price {
        font-size: 1.75rem;
      }

      .old-price {
        font-size: 0.95rem;
      }
    }

    .alt-stock {
      flex-wrap: wrap;
      gap: 0.5rem;
      padding: 0.75rem;
    }

    .alt-add-cart {
      padding: 1rem 1.5rem;
      font-size: 1rem;
      margin-bottom: 1.5rem;
    }

    .alt-description {
      h3 {
        font-size: 1.1rem;
      }
    }
  }

  .alt-specs-table {
    .spec-key {
      white-space: normal;
      width: auto;
    }

    td {
      padding: 8px 10px;
      font-size: 0.85rem;
    }
  }

  .alt-reviews {
    margin-top: 2rem;
    padding-top: 2rem;

    h2 {
      font-size: 1.35rem;
      margin-bottom: 1.5rem;
    }
  }

  .alt-review-card {
    padding: 1rem;
  }

  .alt-review-form {
    padding: 1.25rem;

    h3 {
      font-size: 1.1rem;
    }
  }
}

// Small mobile
@media (max-width: 480px) {
  .alt-item-container {
    padding: 0.75rem;
  }

  .alt-item-content {
    gap: 1.25rem;
    margin-bottom: 1.5rem;
  }

  .alt-gallery {
    .alt-thumbnails {
      grid-template-columns: repeat(auto-fill, minmax(52px, 1fr));
      gap: 0.4rem;
    }

    .alt-main-photo {
      border-radius: var(--radius-md);
    }
  }

  .alt-info {
    .alt-title {
      font-size: 1.15rem;
    }

    .alt-price-block {
      padding: 0.75rem;

      .current-price {
        font-size: 1.5rem;
      }
    }

    .alt-stock {
      padding: 0.6rem;
      font-size: 0.85rem;
    }

    .alt-add-cart {
      padding: 0.85rem 1rem;
      font-size: 0.95rem;
      border-radius: var(--radius-md);
    }
  }

  .alt-review-form {
    padding: 1rem;

    .alt-rating-input {
      .alt-star-selector {
        .alt-star {
          font-size: 1.6rem;
        }
      }
    }

    .alt-textarea {
      padding: 0.75rem;
      font-size: 0.9rem;
    }
  }

  .alt-review-card {
    padding: 0.75rem;

    .review-header {
      flex-direction: column;
      gap: 0.5rem;

      .review-stars {
        align-self: flex-start;
      }
    }

    .review-text {
      font-size: 0.9rem;
    }
  }

  .alt-specs-table {
    td {
      padding: 6px 8px;
      font-size: 0.8rem;
      display: block;
    }

    .spec-key {
      width: 100%;
      padding-bottom: 2px;
    }

    .spec-value {
      padding-top: 0;
    }

    tr {
      display: flex;
      flex-direction: column;
      padding: 6px 0;
    }
  }
}

// ========== BADGES, TAGS & SPECS (shared) ==========

// Badges
.alt-badges, .dx-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 8px 0;
}

.item-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #fff;

  &.badge-new       { background: #4caf50; }
  &.badge-sale       { background: #f44336; }
  &.badge-exclusive  { background: #9c27b0; }
  &.badge-hot        { background: #ff5722; }
  &.badge-limited    { background: #ff9800; }
  &.badge-bestseller { background: #2196f3; }
  &.badge-featured   { background: #607d8b; }
  &.badge-custom     { background: #78909c; }
}

// Tags
.alt-tags, .dx-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 6px 0 12px;
}

.item-tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 0.75rem;
  color: #497671;
  background: rgba(73, 118, 113, 0.08);
  border: 1px solid rgba(73, 118, 113, 0.15);
}

// Specs table
.alt-specs-table, .dx-specs-table {
  width: 100%;
  border-collapse: collapse;
  margin: 12px 0;

  tr {
    border-bottom: 1px solid #e8ecec;
    &:last-child { border-bottom: none; }
  }

  td {
    padding: 10px 12px;
    font-size: 0.9rem;
    vertical-align: top;
  }

  .spec-key {
    color: #697777;
    font-weight: 500;
    width: 40%;
    white-space: nowrap;
  }

  .spec-value {
    color: #1e3c38;
  }
}

// Simple description
.alt-simple-desc, .dx-simple-desc {
  font-size: 0.95rem;
  color: #697777;
  line-height: 1.6;
  margin-bottom: 16px;
}

// Stock quantity
.stock-qty, .dx-stock-qty {
  font-size: 0.8rem;
  color: #697777;
  margin-left: 8px;
}

