/* ===== PRODUCT PAGE LAYOUT ===== */

.product-page {
  padding: 20px 0 60px;
  background: #fff;
}

.breadcrumbs {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 20px;
}

.breadcrumbs a {
  color: var(--accent);
  text-decoration: none;
}

.product-title {
  font-size: 28px;
  font-weight: 800;
  margin-bottom: 25px;
  line-height: 1.2;
}

/* ===== TABS ===== */

.product-tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  margin-bottom: 30px;
  gap: 30px;
}

.tab-item {
  padding: 15px 0;
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
  position: relative;
  cursor: pointer;
}

.tab-item.active {
  color: var(--accent);
}

.tab-item.active::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 100%;
  height: 3px;
  background: var(--accent);
}

.tab-item .count {
  font-weight: 400;
  color: var(--text-muted);
  margin-left: 4px;
}

/* ===== GRID ===== */

.product-main-grid {
  display: grid;
  grid-template-columns: 1fr 400px;
  gap: 40px;
}

/* ===== LEFT COLUMN ===== */

.main-img {
  position: relative;
  width: 100%;
  height: 500px;
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: zoom-in;
}

.main-img img {
  max-width: 90%;
  max-height: 90%;
  object-fit: contain;
  transition: transform 0.15s ease;
}

.thumbs {
  display: flex;
  gap: 12px;
  margin-bottom: 40px;
  flex-wrap: wrap;
}

.thumb-item {
  width: 80px;
  height: 80px;
  border: 2px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  padding: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: 0.2s;
}

.thumb-item:hover {
  border-color: var(--accent);
}

.thumb-item.active {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(99,102,241,0.15);
}

.thumb-item img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.product-description,
.product-specs-section {
  margin-top: 40px;
  padding-top: 40px;
  border-top: 1px solid var(--border);
}

.product-description h2,
.product-specs-section h2 {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 20px;
}

.desc-text {
  line-height: 1.6;
  color: var(--text);
}

.specs-table {
  width: 100%;
  border-collapse: collapse;
}

.specs-table tr {
  border-bottom: 1px solid #f1f5f9;
}

.specs-table td {
  padding: 12px 10px;
  font-size: 14px;
}

.specs-table .name {
  width: 40%;
  color: var(--text-muted);
}

.specs-table .name span {
  display: inline-block;
  background: #fff;
  padding-right: 10px;
}

.specs-table .value {
  font-weight: 600;
  color: var(--text);
}

/* ===== LIGHTBOX ===== */

.lightbox-overlay {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.92);
  z-index: 10000;
  align-items: center;
  justify-content: center;
  flex-direction: column;
}

.lightbox-overlay.active {
  display: flex;
}

.lightbox-overlay img {
  max-width: 90vw;
  max-height: 80vh;
  object-fit: contain;
  border-radius: 8px;
}

.lightbox-close {
  position: absolute;
  top: 20px;
  right: 24px;
  background: rgba(255,255,255,0.15);
  border: none;
  color: white;
  font-size: 28px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: 0.2s;
  z-index: 10;
}

.lightbox-close:hover {
  background: rgba(255,255,255,0.3);
}

.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255,255,255,0.12);
  border: none;
  color: white;
  font-size: 40px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: 0.2s;
}

.lightbox-nav:hover {
  background: rgba(255,255,255,0.25);
}

.lightbox-prev { left: 20px; }
.lightbox-next { right: 20px; }

.lightbox-counter {
  position: absolute;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255,255,255,0.7);
  font-size: 14px;
  font-weight: 600;
}

/* ===== RIGHT COLUMN ===== */

.buy-block {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px;
  box-shadow: var(--shadow);
  margin-bottom: 20px;
}

.price-container {
  margin-bottom: 25px;
}

.old-price {
  font-size: 18px;
  color: var(--text-muted);
  text-decoration: line-through;
}

.current-price {
  font-size: 36px;
  font-weight: 800;
  color: var(--error);
}

.buy-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 25px;
}

.buy-btn-large {
  background: #10b981;
  color: white;
  text-align: center;
  padding: 16px;
  border-radius: 12px;
  font-size: 20px;
  font-weight: 700;
  text-decoration: none;
  transition: 0.2s;
}

.buy-btn-large:hover {
  background: #059669;
}

.delivery-block {
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px;
}

.info-block-title {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 12px;
}

.del-info {
  font-size: 13px;
  color: var(--text-muted);
}

/* ===== INFO TABS (mobile) ===== */

.info-tabs-mobile {
  display: none;
}

/* ===== REVIEWS / QUESTIONS TOGGLE ===== */

.section-toggle-area {
  margin-top: 40px;
  padding-top: 40px;
  border-top: 1px solid var(--border);
}

.toggle-buttons-row {
  display: flex;
  gap: 0;
  margin-bottom: 24px;
  border: 2px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}

.section-toggle-btn {
  flex: 1;
  padding: 14px 20px;
  border: none;
  background: #f8fafc;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--text-muted);
  transition: 0.2s;
}

.section-toggle-btn:first-child {
  border-right: 2px solid var(--border);
}

.section-toggle-btn.active {
  background: var(--accent);
  color: white;
}

.toggle-count {
  background: rgba(255,255,255,0.25);
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 700;
}

.section-toggle-btn.active .toggle-count {
  background: rgba(255,255,255,0.25);
}

.section-toggle-btn:not(.active) .toggle-count {
  background: var(--border);
  color: var(--text-muted);
}

.toggle-content {
  display: none;
}

.toggle-content.active {
  display: block;
}

/* ===== REVIEWS SUMMARY ===== */

.reviews-summary {
  padding: 20px;
  background: #f8fafc;
  border-radius: 12px;
  margin-bottom: 20px;
  border: 1px solid var(--border);
}

.reviews-avg {
  display: flex;
  align-items: center;
  gap: 12px;
}

.avg-number {
  font-size: 36px;
  font-weight: 800;
  color: var(--text);
}

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

.avg-count {
  font-size: 14px;
  color: var(--text-muted);
  font-weight: 500;
}

/* ===== REVIEW CARD ===== */

.review-card {
  padding: 20px;
  background: #fff;
  border-radius: 12px;
  margin-bottom: 12px;
  border: 1px solid var(--border);
  transition: 0.2s;
}

.review-card:hover {
  border-color: #cbd5e1;
}

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

.review-user {
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-avatar {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: white;
  font-size: 16px;
  flex-shrink: 0;
}

.review-stars {
  display: flex;
  gap: 1px;
  margin-top: 2px;
}

.review-date {
  font-size: 12px;
  color: var(--text-muted);
  padding-top: 4px;
  white-space: nowrap;
}

.review-text {
  font-size: 14px;
  line-height: 1.6;
  color: var(--text);
}

.answer-block {
  margin-top: 12px;
  padding: 14px;
  background: #f0f7ff;
  border-radius: 10px;
  border-left: 3px solid var(--accent);
}

.answer-block strong {
  font-size: 13px;
  color: var(--accent);
}

.answer-block p {
  font-size: 14px;
  margin-top: 5px;
  line-height: 1.5;
}

.empty-section {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
  border: 1px dashed var(--border);
  border-radius: 12px;
  margin-bottom: 20px;
  font-size: 15px;
}

/* ===== WRITE REVIEW BUTTON ===== */

.write-review-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 12px 24px;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: 0.2s;
  margin-top: 16px;
}

.write-review-btn:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
}

.form-collapse {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease, padding 0.4s ease;
  padding: 0 20px;
}

.form-collapse.open {
  max-height: 600px;
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: 12px;
  margin-top: 16px;
  background: #f8fafc;
}

/* ===== FEEDBACK FORM ===== */

.feedback-form label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 6px;
  margin-top: 12px;
}

.feedback-form input,
.feedback-form select,
.feedback-form textarea {
  width: 100%;
  padding: 12px 14px;
  border: 2px solid #e2e8f0;
  border-radius: 10px;
  outline: none;
  font-family: inherit;
  font-size: 14px;
  transition: border 0.2s;
  box-sizing: border-box;
}

.feedback-form input:focus,
.feedback-form select:focus,
.feedback-form textarea:focus {
  border-color: var(--accent);
}

.feedback-form textarea {
  min-height: 100px;
  resize: vertical;
}

.submit-btn {
  padding: 12px 28px;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
  margin-top: 16px;
  transition: 0.2s;
}

.submit-btn:hover {
  background: var(--accent-hover);
}

/* ===== MOBILE RESPONSIVE ===== */

@media (max-width: 992px) {
  .product-main-grid {
    grid-template-columns: 1fr 300px;
    gap: 20px;
  }
}

@media (max-width: 768px) {
  .product-main-grid {
    display: flex;
    flex-direction: column;
  }
  .product-left, .product-right {
    display: contents;
  }
  .gallery-block { order: 1; margin-bottom: 20px; }
  .buy-block { order: 2; margin-bottom: 15px; }
  
  /* info tabs mobile */
  .info-tabs-mobile {
    order: 3;
    display: flex;
    gap: 0;
    border: 2px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 15px;
  }
  
  .info-tab-btn {
    flex: 1;
    padding: 12px 8px;
    border: none;
    background: #f8fafc;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    color: var(--text-muted);
    transition: 0.2s;
    text-align: center;
  }
  
  .info-tab-btn:not(:last-child) {
    border-right: 2px solid var(--border);
  }
  
  .info-tab-btn.active {
    background: var(--accent);
    color: white;
  }
  
  .info-block {
    order: 4;
    display: none !important;
    margin-top: 0 !important;
  }
  
  .info-block.mobile-visible {
    display: block !important;
    margin-bottom: 15px;
  }
  
  .desktop-only {
    display: none;
  }
  
  .product-description { order: 5; }
  .product-specs-section { order: 6; }
  .section-toggle-area { order: 7; }
  
  .product-title {
    font-size: 22px;
    margin-bottom: 15px;
  }
  .main-img {
    height: 300px;
  }
  .product-tabs {
    gap: 15px;
    overflow-x: auto;
    padding-bottom: 5px;
  }
  .tab-item {
    white-space: nowrap;
    font-size: 14px;
    padding: 10px 0;
  }
  .buy-block {
    padding: 15px;
  }
  .current-price {
    font-size: 28px;
  }
  .buy-btn-large {
    padding: 12px;
    font-size: 18px;
  }
  .delivery-block {
    padding: 15px;
  }
  .product-description,
  .product-specs-section {
    margin-top: 30px;
    padding-top: 30px;
  }
  .product-description h2,
  .product-specs-section h2 {
    font-size: 18px;
  }
  
  .toggle-buttons-row {
    flex-direction: row;
  }
  
  .section-toggle-btn {
    font-size: 13px;
    padding: 12px 10px;
  }
  
  .lightbox-nav {
    width: 44px;
    height: 44px;
    font-size: 30px;
  }
  .lightbox-prev { left: 10px; }
  .lightbox-next { right: 10px; }
  
  .reviews-avg {
    flex-wrap: wrap;
    gap: 8px;
  }
  .avg-number { font-size: 28px; }
  
  .feedback-form div[style*="grid-template-columns"] {
    grid-template-columns: 1fr !important;
  }
}

/* Desktop: show all info blocks */
@media (min-width: 769px) {
  .info-tabs-mobile {
    display: none;
  }
  .info-block {
    display: block !important;
  }
}