/* Стили для публичного каталога */

/* Современный каталог (catalog-new) */
.catalog-card {
    scroll-margin-top: 140px;
}

#showSidebarBtn {
    padding: 12px 16px;
}

.catalog-card.search-highlight {
    outline: 3px solid #f43f5e;
    box-shadow: 0 0 30px rgba(244, 63, 94, 0.35);
}

.catalog-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.5rem;
}

@media (min-width: 768px) {
    .catalog-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (min-width: 1280px) {
    .catalog-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

.catalog-search-panel {
    backdrop-filter: blur(16px);
}

/* Карточка товара */
.product-card {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    transition: all 0.3s;
}

.product-card:hover {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

/* Подсветка при поиске */
.product-card.search-highlight {
    border: 3px solid #dc2626 !important;
    box-shadow: 0 0 20px rgba(220, 38, 38, 0.4) !important;
    animation: pulse-highlight 1s ease-in-out;
}

@keyframes pulse-highlight {
    0%, 100% {
        box-shadow: 0 0 20px rgba(220, 38, 38, 0.4);
    }
    50% {
        box-shadow: 0 0 30px rgba(220, 38, 38, 0.6);
    }
}

/* Заголовок карточки с названием товара */
.product-card-header {
    background-color: #374151 !important; /* gray-700 */
    color: white !important;
    padding: 0.5rem 0.75rem;
    border-radius: 0.5rem 0.5rem 0 0;
}

.product-card-header h4 {
    font-weight: 700;
    font-size: 0.875rem;
    margin: 0;
    color: white !important;
}

/* Контейнер с изображением и информацией */
.product-card-body {
    display: flex;
}

/* Блок с изображением */
.product-image-container {
    position: relative;
    flex-shrink: 0;
    background-color: #f9fafb;
    padding: 0.5rem;
    width: 140px;
}

/* Код и цена над картинкой */
.product-code-price {
    margin-bottom: 0.5rem;
    font-size: 0.75rem;
    line-height: 1.5;
}

.product-code-line {
    display: flex;
    justify-content: space-between;
    gap: 0.5rem;
}

.product-price-line {
    text-align: right;
}

.product-code-small {
    color: #dc2626;
    font-weight: 600;
}

.product-price-small {
    color: #16a34a;
    font-weight: 600;
    font-size: 10pt;
}

.product-image-wrapper {
    position: relative !important;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 120px;
}

.product-image-wrapper img {
    max-width: 120px;
    max-height: 120px;
    object-fit: contain;
}

/* Плейсхолдер для отсутствующих изображений */
.product-image-placeholder {
    width: 120px;
    height: 120px;
    background-color: #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #9ca3af;
    font-size: 0.75rem;
    font-weight: 500;
    text-align: center;
    border-radius: 0.25rem;
}

/* Бейдж остатка */
.stock-badge {
     position: absolute;
     bottom: 6px;
     left: 1px;
     padding: 0 8px;
     font-size: 0.75rem;
     font-weight: 700;
     border-radius: 0.25rem;
     box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
 }

/* Бейдж в таблице (inline) */
.stock-badge-table {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    font-weight: 700;
    border-radius: 0.25rem;
}

.stock-badge-out {
    background-color: #dc2626;
    color: white;
}

.stock-badge-low {
    background-color: #f97316;
    color: white;
}

.stock-badge-available {
    background-color: #16a34a;
    color: white;
}

/* Блок с информацией */
.product-info {
    flex: 1;
    padding: 0.75rem;
}

input#catalog-search {
    padding: 10px 38px;
    max-width: 600px;
}

/* Цена в правой колонке */
.product-price-right {
    margin-bottom: 0.5rem;
    text-align: right;
}

/* Код товара и цена */
.product-code {
    color: #dc2626;
    font-weight: 600;
    font-size: 0.875rem;
}

.product-price {
    color: #16a34a;
    font-weight: 700;
    font-size: 1.125rem;
}

/* Бренд */
.product-brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.product-brand img {
    height: 1.5rem;
    object-fit: contain;
}

.product-brand span {
    font-size: 0.875rem;
    font-weight: 600;
    color: #374151;
}

/* Атрибуты */
.product-attributes {
    font-size: 0.75rem;
    color: #374151;
    margin-bottom: 0.75rem;
}

.product-attributes > div {
    display: flex;
    justify-content: space-between;
    padding: 0.25rem 0.5rem;
    border-bottom: 1px solid #f3f4f6;
}

.product-attributes > div:nth-child(even) {
    background-color: #f9fafb;
}

.product-attributes > div:hover {
    background-color: #f3f4f6;
}

.product-attributes .attr-name {
    font-weight: 500;
}

.product-attributes .attr-value {
    color: #111827;
    font-weight: 400;
}

/* Ссылка "Vezi pe site" под картинкой */
.product-link-container {
    text-align: center;
}

.product-link {
    display: inline-block;
    color: #000000;
    font-size: 0.80rem;
    font-weight: 600;
    text-decoration: underline;
    transition: color 0.2s;
}

.product-link:hover {
    color: #374151;
    text-decoration: underline;
}

/* Кнопка "Vezi pe site" для групповых товаров */
.product-btn {
    display: inline-block;
    background-color: #dc2626;
    color: white;
    text-align: center;
    font-weight: 600;
    padding: 0.5rem 1rem;
    border-radius: 0.25rem;
    transition: background-color 0.2s;
    text-decoration: none;
    font-size: 0.875rem;
}

.product-btn:hover {
    background-color: #b91c1c;
    color: white;
    text-decoration: none;
}

/* Таблица вариантов для группового товара */
.variants-table {
    width: 100%;
    font-size: 0.75rem;
    border-collapse: collapse;
}

.variants-table thead tr {
    background-color: #f3f4f6;
    border-bottom: 2px solid #d1d5db;
}

.variants-table th {
    padding: 0.25rem 0.5rem;
    font-weight: 600;
}

.variants-table tbody tr {
    border-bottom: 1px solid #f3f4f6;
}

.variants-table tbody tr:hover {
    background-color: #f9fafb;
}

.variants-table tbody tr.out-of-stock {
    text-decoration: line-through;
    color: #9ca3af;
}

.variants-table td {
    padding: 0.25rem 0.5rem;
}

.variants-table .variant-code {
    font-weight: 500;
    color: #dc2626;
}

.variants-table .variant-price {
    font-weight: 600;
    color: #16a34a;
    text-align: right;
}

/* Результаты поиска */
.search-result-item {
    cursor: pointer;
    transition: background-color 0.2s;
}

.search-result-item:hover {
    background-color: #f9fafb;
}

/* Заголовки категорий */
.category-header {
    font-weight: 700;
    text-align: center;
    padding-bottom: 0.75rem;
    margin-bottom: 2rem;
    border-bottom: 3px solid #dc2626;
    color: #111827;
}

.category-header-super {
    font-size: 2rem;
    margin-bottom: 2rem;
    border-bottom-width: 4px;
}

.category-header-sub {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
}
