:root {
  --brand-color: #de0025;
  --accent-color: #ef6644;
  --text-color: #242222;
  --muted-color: #6f6f6f;
  --bg-surface: #ffffff;
  --shadow-strong: 0 10px 25px rgba(0, 0, 0, 0.12);
  --border-light: rgba(0, 0, 0, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: 'Poppins', sans-serif;
  font-size: 14px;
  color: var(--text-color);
  background: #f5f5f5;
  overflow-x: hidden;
}

/* Prevent horizontal overflow on product page */
#product-app {
  overflow-x: hidden;
  max-width: 100vw;
}

/* Header styles - копируем из catalog.css */
header.catalog-header {
  background: linear-gradient(120deg, #e80052, #6a00d4);
  color: #fff;
  padding: 1.5rem 2rem 2rem;
  border-radius: 0 0 24px 24px;
  box-shadow: 0 18px 48px rgba(14, 4, 22, 0.45);
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

header.catalog-header .catalog-header__main {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 2rem;
  align-items: start;
  margin-bottom: 1rem;
}

header.catalog-header .catalog-header__left {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

header.catalog-header .catalog-header__center {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  align-items: center;
}

header.catalog-header .catalog-header__logo {
  display: block;
  font-size: 1.8rem;
  letter-spacing: 0.05em;
}

header.catalog-header .catalog-header__subtitle {
  margin: 0.25rem 0 0;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.85);
}

header.catalog-header .catalog-header__shortcuts {
  display: flex;
  gap: 1.5rem;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  opacity: 0.87;
  justify-content: center;
}

header.catalog-header .catalog-header__shortcuts span {
  cursor: pointer;
  transition: all 0.2s;
  padding: 0.5rem 1rem;
  border-radius: 8px;
}

header.catalog-header .catalog-header__shortcuts span:hover {
  opacity: 1;
  background: rgba(255, 255, 255, 0.1);
}

header.catalog-header .catalog-header__shortcuts span.active {
  opacity: 1;
  background: rgba(255, 255, 255, 0.15);
  font-weight: 600;
}

header.catalog-header__search {
  margin-bottom: 0;
  display: flex;
  justify-content: center;
  width: 100%;
}

.catalog-search-input {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: rgba(255, 255, 255, 0.95);
  padding: 0.5rem;
  border-radius: 999px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
  width: min(720px, 100%);
}

.catalog-search-input input {
  flex: 1;
  border: none;
  background: transparent;
  font-size: 1.1rem;
  font-weight: 500;
  color: #121212;
}

.catalog-search-input input::placeholder {
  color: #686868;
}

.catalog-search-input input:focus {
  outline: none;
}

.catalog-search-input button {
  border: none;
  background: #1f58ff;
  color: #fff;
  font-weight: 600;
  border-radius: 999px;
  padding: 0.65rem 1.5rem;
  cursor: pointer;
  transition: background 0.2s ease;
}

.catalog-search-input button:hover {
  background: #1029d6;
}

/* Product container */
.product-container {
  max-width: 1400px;
  margin: 2rem auto 3rem;
  padding: 0 2rem;
  overflow-x: hidden;
}

.product-panel {
  background: var(--bg-surface);
  border-radius: 24px;
  padding: 2rem;
  box-shadow: 0 20px 40px rgba(15, 15, 15, 0.08);
}

.loader,
.error-message {
  text-align: center;
  padding: 3rem;
  font-size: 1.1rem;
  color: var(--muted-color);
}

.error-message {
  color: #d32f2f;
}

/* Breadcrumbs */
.breadcrumbs {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 2rem;
  font-size: 0.9rem;
  color: var(--muted-color);
  flex-wrap: wrap;
}

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

.breadcrumbs a:hover {
  color: var(--brand-color);
}

.breadcrumbs .current {
  color: var(--text-color);
  font-weight: 500;
}

/* Product main layout */
.product-main {
  display: grid;
  grid-template-columns: 100px 1fr minmax(0, 450px);
  gap: 2rem;
  margin-bottom: 3rem;
  align-items: start;
}

/* Вертикальная карусель миниатюр слева */
.product-thumbnails-vertical {
  position: sticky;
  top: 2rem;
}

.swiper-thumbs {
  height: 500px;
}

.swiper-thumbs .swiper-slide {
  width: 100px;
  height: 100px;
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all 0.3s;
  background: #f9f9f9;
}

.swiper-thumbs .swiper-slide:hover {
  border-color: var(--accent-color);
  transform: scale(1.05);
}

.swiper-thumbs .swiper-slide-thumb-active {
  border-color: var(--brand-color);
  box-shadow: 0 4px 12px rgba(222, 0, 37, 0.3);
}

.swiper-thumbs .swiper-slide img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 0.5rem;
}

/* Основная галерея */
.product-gallery-main {
  position: relative;
}

.swiper-main {
  width: 100%;
  max-width: 600px;
  margin: 0 auto;
  border-radius: 16px;
  overflow: hidden;
  background: #f9f9f9;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.swiper-main .swiper-slide {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  aspect-ratio: 1 / 1;
}

.swiper-main .swiper-slide img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  padding: 2rem;
}

.swiper-button-next,
.swiper-button-prev {
  color: var(--brand-color);
  background: rgba(255, 255, 255, 0.9);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.swiper-button-next:after,
.swiper-button-prev:after {
  font-size: 20px;
  font-weight: bold;
}

.product-badge {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: var(--brand-color);
  color: #fff;
  padding: 0.75rem 1.25rem;
  border-radius: 12px;
  font-weight: 700;
  font-size: 1.1rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  box-shadow: 0 4px 12px rgba(222, 0, 37, 0.4);
  z-index: 10;
}

/* Удаляем старые стили миниатюр */
.gallery-thumbnails {
  display: none;
}

/* Product info */
.product-info {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  position: sticky;
  top: 2rem;
  max-width: 100%;
  overflow: hidden;
}

.product-header h1 {
  margin: 0 0 0.75rem;
  font-size: 1.5rem;
  line-height: 1.3;
  color: var(--text-color);
  word-wrap: break-word;
}

.product-meta {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  align-items: center;
}

.product-sku {
  color: var(--muted-color);
  font-size: 0.9rem;
}

.product-brand {
  background: var(--accent-color);
  color: #fff;
  padding: 0.25rem 0.75rem;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 600;
}

.product-price-section {
  background: #f9f9f9;
  padding: 1.25rem;
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.product-price-block {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.price-main {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  flex-wrap: wrap;
}

.current-price {
  font-size: 2rem;
  font-weight: 700;
  color: var(--brand-color);
  word-wrap: break-word;
}

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

.discount-badge {
  background: #ff4444;
  color: #fff;
  padding: 0.4rem 0.8rem;
  border-radius: 6px;
  font-weight: 600;
  font-size: 0.9rem;
}

.delivery-info {
  border-top: 1px solid var(--border-light);
  padding-top: 1rem;
}

.delivery-item {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.delivery-icon {
  font-size: 2rem;
}

.delivery-text strong {
  display: block;
  font-size: 1rem;
  margin-bottom: 0.25rem;
  color: var(--text-color);
}

.delivery-text p {
  margin: 0;
  font-size: 1.1rem;
  color: #2e7d32;
  font-weight: 600;
}

.select-pickup-btn {
  margin-top: 8px;
  padding: 8px 16px;
  background: #fff;
  border: 2px solid #e80052;
  color: #e80052;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.select-pickup-btn:hover {
  background: #e80052;
  color: #fff;
}

.product-availability {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  font-weight: 500;
  width: fit-content;
}

.product-availability.in-stock {
  background: #e8f5e9;
  color: #2e7d32;
}

.product-availability.in-stock-fbo {
  background: #e3f2fd;
  color: #6a1b9a;
}

.product-availability.in-stock-fbo a {
  color: #6a1b9a;
  text-decoration: underline;
  font-weight: 600;
}

.product-availability.in-stock-fbo a:hover {
  color: #4a148c;
}

.product-availability.out-of-stock {
  background: #ffebee;
  color: #c62828;
}

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

.quantity-selector {
  display: flex;
  align-items: center;
  border: 2px solid var(--border-light);
  border-radius: 12px;
  overflow: hidden;
  width: fit-content;
}

.quantity-selector button {
  border: none;
  background: transparent;
  width: 45px;
  height: 50px;
  font-size: 1.5rem;
  cursor: pointer;
  transition: background 0.2s;
  color: var(--text-color);
  font-weight: 600;
}

.quantity-selector button:hover:not(:disabled) {
  background: #f5f5f5;
}

.quantity-selector button:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.quantity-selector input {
  border: none;
  width: 70px;
  text-align: center;
  font-size: 1.2rem;
  font-weight: 600;
  border-left: 1px solid var(--border-light);
  border-right: 1px solid var(--border-light);
  height: 50px;
}

.quantity-selector input:focus {
  outline: none;
  background: #f9f9f9;
}

.add-to-cart-btn {
  width: 100%;
  border: none;
  background: var(--accent-color);
  color: #fff;
  font-size: 1.05rem;
  font-weight: 700;
  border-radius: 12px;
  padding: 0.9rem 1.5rem;
  cursor: pointer;
  transition: all 0.3s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  white-space: nowrap;
}

.add-to-cart-btn span {
  font-size: 1.2rem;
}

.add-to-cart-btn:hover:not(:disabled) {
  background: var(--brand-color);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(222, 0, 37, 0.35);
}

.add-to-cart-btn:disabled {
  background: #ccc;
  cursor: not-allowed;
  opacity: 0.6;
}

/* Product features */
.product-features {
  background: #f9f9f9;
  padding: 1.5rem;
  border-radius: 12px;
}

.product-features h3 {
  margin: 0 0 1rem;
  font-size: 1.1rem;
}

.product-features ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.product-features li {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
}

.feature-label {
  color: var(--muted-color);
  font-size: 0.95rem;
}

.feature-value {
  font-weight: 500;
  text-align: right;
}

/* Product benefits */
.product-benefits {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  padding: 1rem;
  background: #fff;
  border-radius: 12px;
  border: 1px solid var(--border-light);
}

.benefit {
  display: flex;
  align-items: start;
  gap: 0.75rem;
}

.benefit .icon {
  font-size: 1.5rem;
  flex-shrink: 0;
}

.benefit strong {
  display: block;
  margin-bottom: 0.25rem;
  font-size: 0.95rem;
}

.benefit p {
  margin: 0;
  font-size: 0.85rem;
  color: var(--muted-color);
}

/* Product description */
.product-description,
.product-specifications {
  margin-top: 1.5rem;
}

/* Collapsible Group Items */
.collapsible-group {
  margin-top: 2rem;
}

.collapsible-item {
  background: #f8f9fa;
  border-radius: 8px;
  margin-bottom: 0.75rem;
  overflow: hidden;
  transition: all 0.2s ease;
}

.collapsible-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.25rem;
  cursor: pointer;
  -webkit-user-select: none;
  user-select: none;
  transition: background-color 0.2s ease;
  touch-action: manipulation;
  -webkit-tap-highlight-color: rgba(0, 0, 0, 0.1);
}

.collapsible-header:hover {
  background: #e9ecef;
}

.collapsible-header h2 {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-color);
}

.collapsible-chevron {
  width: 24px;
  height: 24px;
  transition: transform 0.3s ease;
  color: #6c757d;
}

.collapsible-chevron svg {
  width: 100%;
  height: 100%;
}

.collapsible-item.active .collapsible-chevron {
  transform: rotate(180deg);
}

.collapsible-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}

.collapsible-item.active .collapsible-content {
  max-height: 5000px;
}

.collapsible-content-inner {
  padding: 0 1.25rem 1.25rem;
}

.product-description {
  overflow-wrap: break-word;
  word-break: break-word;
}

.product-description p {
  line-height: 1.7;
  margin-bottom: 1rem;
}

.product-description ul {
  line-height: 1.8;
  padding-left: 1.5rem;
}

.product-description strong {
  color: var(--brand-color);
}

.product-description img {
  max-width: 100%;
  height: auto;
}

.product-description table {
  max-width: 100%;
  overflow-x: auto;
  display: block;
}

.product-description iframe,
.product-description video,
.product-description embed {
  max-width: 100%;
}

/* Specifications table */
.product-specifications table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  word-wrap: break-word;
}

.product-specifications tr {
  border-bottom: 1px solid var(--border-light);
}

.product-specifications tr:last-child {
  border-bottom: none;
}

.product-specifications td {
  padding: 1rem 0;
}

.spec-label {
  color: var(--muted-color);
  width: 40%;
  font-size: 0.95rem;
}

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

/* ===== RESPONSIVE STYLES ===== */

/* Tablets */
@media (max-width: 968px) {
  .product-main {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
  }

  .product-thumbnails-vertical {
    display: none;
  }

  .product-gallery-main {
    width: 100%;
  }

  .swiper-main {
    max-width: 100%;
  }

  .swiper-main .swiper-slide {
    aspect-ratio: 4 / 5;
  }

  .product-info {
    position: static;
    width: 100%;
    max-width: 100%;
  }

  .product-actions {
    flex-direction: column;
  }

  .quantity-selector {
    width: 100%;
    justify-content: center;
  }
}

/* Mobile */
@media (max-width: 768px) {
  /* Product-specific mobile styles */
}

@media (max-width: 640px) {
  .product-container {
    padding: 0 0.75rem;
    margin-top: 1rem;
  }

  .product-panel {
    padding: 1rem;
    border-radius: 16px;
  }
  
  /* Breadcrumbs mobile */
  .breadcrumbs {
    font-size: 0.8rem;
    margin-bottom: 1rem;
    gap: 0.3rem;
  }

  .product-header h1 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
  }
  
  .product-meta {
    gap: 0.5rem;
  }
  
  .product-sku {
    font-size: 0.8rem;
  }
  
  .product-brand {
    font-size: 0.75rem;
    padding: 0.2rem 0.5rem;
  }
  
  /* Price section mobile */
  .product-price-section {
    padding: 1rem;
    border-radius: 12px;
  }
  
  .current-price {
    font-size: 1.6rem;
  }
  
  .old-price {
    font-size: 1rem;
  }
  
  .discount-badge {
    padding: 0.3rem 0.6rem;
    font-size: 0.8rem;
  }
  
  /* Delivery info mobile */
  .delivery-item {
    gap: 0.75rem;
  }
  
  .delivery-icon {
    font-size: 1.5rem;
  }
  
  .delivery-text strong {
    font-size: 0.9rem;
  }
  
  .delivery-text p {
    font-size: 0.95rem;
  }
  
  .select-pickup-btn {
    width: 100%;
    padding: 10px 16px;
  }
  
  /* Product availability */
  .product-availability {
    width: 100%;
    justify-content: center;
    padding: 0.6rem 1rem;
    font-size: 0.9rem;
  }
  
  /* Quantity selector mobile */
  .quantity-selector {
    width: 100%;
  }
  
  .quantity-selector button {
    width: 50px;
    height: 48px;
    font-size: 1.3rem;
  }
  
  .quantity-selector input {
    flex: 1;
    height: 48px;
    font-size: 1.1rem;
  }
  
  /* Add to cart button mobile */
  .add-to-cart-btn {
    padding: 1rem;
    font-size: 1rem;
    border-radius: 10px;
  }
  
  .add-to-cart-btn span {
    font-size: 1.1rem;
  }
  
  /* Features mobile */
  .product-features {
    padding: 1rem;
    border-radius: 10px;
  }
  
  .product-features h3 {
    font-size: 1rem;
    margin-bottom: 0.75rem;
  }
  
  .product-features li {
    flex-direction: column;
    gap: 0.25rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid rgba(0,0,0,0.05);
  }
  
  .product-features li:last-child {
    border-bottom: none;
  }
  
  .feature-label {
    font-size: 0.85rem;
  }
  
  .feature-value {
    text-align: left;
    font-size: 0.95rem;
  }
  
  /* Benefits mobile */
  .product-benefits {
    padding: 0.75rem;
    gap: 0.75rem;
  }
  
  .benefit {
    gap: 0.5rem;
  }
  
  .benefit .icon {
    font-size: 1.25rem;
  }
  
  .benefit strong {
    font-size: 0.9rem;
  }
  
  .benefit p {
    font-size: 0.8rem;
  }
  
  /* Gallery mobile */
  .swiper-main .swiper-slide img {
    padding: 0.75rem;
  }
  
  .product-badge {
    top: 0.5rem;
    right: 0.5rem;
    padding: 0.5rem 0.75rem;
    font-size: 0.9rem;
    border-radius: 8px;
  }

  .swiper-button-next,
  .swiper-button-prev {
    width: 36px;
    height: 36px;
  }

  .swiper-button-next:after,
  .swiper-button-prev:after {
    font-size: 16px;
  }
  
  /* Description mobile */
  .product-description,
  .product-specifications {
    margin-top: 2rem;
    padding-top: 1.5rem;
  }
  
  .product-description h2,
  .product-specifications h2 {
    font-size: 1.25rem;
    margin-bottom: 1rem;
  }
  
  .product-description p {
    font-size: 0.95rem;
    line-height: 1.6;
  }
  
  /* Specifications table mobile */
  .product-specifications td {
    padding: 0.75rem 0;
    font-size: 0.9rem;
  }
  
  .spec-label {
    width: 45%;
  }
}

/* Small mobile phones */
@media (max-width: 480px) {
  .product-header h1 {
    font-size: 1.15rem;
  }
  
  .current-price {
    font-size: 1.5rem;
  }
  
  .product-features li {
    flex-direction: row;
    justify-content: space-between;
  }
}
