#product-as-option {
  overflow: hidden;
}

/*#product-as-option .box-header {
  font-weight: 500;
  margin-bottom: 8px;
  padding-bottom: 3px;
  border-bottom: 1px solid #e9e9e9;
}*/

#product-as-option .products-container {
  display: flex;
  flex-wrap: nowrap;
  margin-left: -5px;
}

#product-as-option .product-grid {
  padding: 0 5px;
  width: 135px;
}

#product-as-option .product-thumb {
  align-items: center;
}

#product-as-option .product-thumb {
  /*border: 1px solid #e9e9e9;*/
  padding: 0;
  margin-bottom: 0;
}

#product-as-option .product-thumb.current {
  border-color: #7735e9;
}

#product-as-option .product-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
}

#product-as-option .product-inner .product-caption {
  margin-top: 10px;
  display:none;
}

#product-as-option .product-inner .product-name {
  font-weight: 500;
}



/* ============================================
   Универсальный блок выбора опции товара (варианты)
   ============================================ */

#product-as-option {
    /* margin: 2rem 0; */
    /* font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif; */
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    /* padding-bottom: 0.5rem; */
    background: #fbfbfb;
    padding: 10px;
    border-radius: 26px;
}

#product-as-option::-webkit-scrollbar {
    height: 6px;
    width: 6px;
}
#product-as-option::-webkit-scrollbar-track {
    background: transparent;
}
#product-as-option::-webkit-scrollbar-thumb {
    background: rgba(0,0,0,0.1);
    border-radius: 3px;
}
#product-as-option:hover::-webkit-scrollbar-thumb {
    background: rgba(0,0,0,0.2);
}

#product-as-option .box-header {
    font-size: 1.1rem;
    font-weight: 600;
    color: #1f2937;
    /* margin-bottom: 1rem; */
    /*padding-bottom: 0.5rem;*/
    /*border-bottom: 1px solid #e5e7eb;*/
    position: sticky;
    left: 0;
    background: inherit;
    z-index: 2;
}

#product-as-option .products-container {
    display: flex;
    gap: 0.75rem;
    padding: 0.5rem 0;
    min-width: max-content;
}

/* Карточка товара - компактная версия */
#product-as-option .product-layout {
    flex: 0 0 auto;
    width: 90px; /* Уменьшенная ширина */
}

#product-as-option .product-thumb {
    background: #fff;
    border-radius: 0.5rem;
    overflow: hidden;
    transition: box-shadow 0.2s ease, transform 0.2s ease;
    /* border: 1px solid #e5e7eb; */
    cursor: pointer;
    height: 100%;
    display: flex;
    flex-direction: column;
    position: relative;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

#product-as-option .product-thumb:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

#product-as-option .product-thumb.current {
    border-color: #3b82f6;
    /* box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2); */
}

#product-as-option .product-thumb.current::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border: 2px solid #a700aa;
    pointer-events: none;
    border-radius: inherit;
}

#product-as-option .product-thumb.out-of-stock {
    opacity: 0.6;
    cursor: not-allowed;
}

#product-as-option .product-inner {
    padding: 0.5rem 0.25rem; /* Уменьшены внутренние отступы */
    display: flex;
    /* flex-direction: column; */
    /* align-items: center; */
    /* text-align: center; */
    flex: 1;
}

/* Изображение - увеличено */
#product-as-option .image {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    /* min-height: 70px; */
    margin-bottom: 0.25rem;
}

#product-as-option .image img {
    width: auto;
    height: auto;
    /* max-width: 50px; */ /* Увеличено */
    /* max-height: 50px; */ /* Увеличено */
    object-fit: contain;
    transition: transform 0.2s ease;
}

#product-as-option .product-thumb:hover .image img {
    transform: scale(1.05);
}

/* Название товара - компактное */
#product-as-option .product-name {
    font-size: 0.7rem; /* Уменьшен */
    font-weight: 500;
    color: #374151;
    line-height: 1.2;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 0.25rem;
    min-height: 1.6em;
}

/* Цена - компактная */
#product-as-option .price-container {
    font-size: 0.65rem; /* Уменьшен */
    width: 100%;
}

#product-as-option .price {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.05rem;
}

#product-as-option .price-new {
    color: #3b82f6;
    font-weight: 600;
    font-size: 0.7rem; /* Уменьшен */
}

#product-as-option .price-old {
    color: #9ca3af;
    text-decoration: line-through;
    font-size: 0.55rem; /* Уменьшен */
}

#product-as-option a {
    text-decoration: none;
    display: block;
    height: 100%;
}

/* ============================================
   Режим без изображений
   ============================================ */
#product-as-option.no-image .option-products {
    display: flex;
    flex-wrap: nowrap;
    gap: 0.5rem;
    overflow-x: auto;
    padding: 0.5rem 0;
    min-width: max-content;
}

#product-as-option.no-image .product-variant-inner {
    background: #f9fafb;
    border: 1px solid #d1d5db;
    border-radius: 1.5rem;
    padding: 0.3rem 0.8rem; /* Уменьшены отступы */
    transition: all 0.2s ease;
    cursor: pointer;
    font-size: 0.75rem; /* Уменьшен */
    font-weight: 500;
    color: #374151;
    white-space: nowrap;
}

#product-as-option.no-image .product-variant a:hover .product-variant-inner {
    background: #f3f4f6;
    border-color: #9ca3af;
}

#product-as-option.no-image .product-variant.current .product-variant-inner {
    background: #3b82f6;
    border-color: #3b82f6;
    color: white;
}

#product-as-option.no-image .product-variant-inner.out-of-stock {
    opacity: 0.5;
    cursor: not-allowed;
}