/* ============================================================
   БАЗОВЫЕ ПЕРЕМЕННЫЕ И СБРОС
   ============================================================ */
:root {
    --primary: #1a3a5c;
    --primary-light: #2a5a8c;
    --primary-dark: #0f2a44;
    --accent: #e8a838;
    --accent-hover: #d4942a;
    --success: #2e8b57;
    --danger: #c0392b;
    --gray-50: #f8f9fa;
    --gray-100: #f1f3f5;
    --gray-200: #e9ecef;
    --gray-300: #dee2e6;
    --gray-400: #ced4da;
    --gray-500: #adb5bd;
    --gray-600: #6c757d;
    --gray-700: #495057;
    --gray-800: #343a40;
    --gray-900: #212529;
    --shadow: 0 2px 12px rgba(0,0,0,0.08);
    --shadow-hover: 0 8px 30px rgba(0,0,0,0.12);
    --radius: 12px;
    --radius-sm: 6px;
    --transition: all 0.3s ease;
    --font: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font);
    background: var(--gray-50);
    color: var(--gray-800);
    line-height: 1.6;
}

.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 20px;
}

a {
    text-decoration: none;
    color: var(--primary);
    transition: var(--transition);
}
a:hover {
    color: var(--accent);
}

/* ============================================================
   HEADER
   ============================================================ */
.site-header {
    background: white;
    border-bottom: 2px solid var(--gray-200);
    padding: 12px 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: var(--shadow);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}

.logo {
    font-size: 24px;
    font-weight: 700;
    color: var(--primary-dark);
    letter-spacing: -0.5px;
}
.logo span {
    color: var(--accent);
}

.header-search {
    flex: 1;
    min-width: 200px;
    max-width: 400px;
    display: flex;
    gap: 0;
}
.header-search input {
    flex: 1;
    padding: 10px 16px;
    border: 2px solid var(--gray-300);
    border-right: none;
    border-radius: var(--radius-sm) 0 0 var(--radius-sm);
    font-size: 14px;
    outline: none;
    transition: var(--transition);
}
.header-search input:focus {
    border-color: var(--primary);
}
.header-search button {
    padding: 10px 18px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: var(--transition);
}
.header-search button:hover {
    background: var(--primary-light);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}
.header-actions .cart-link {
    position: relative;
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 600;
    padding: 8px 16px;
    background: var(--gray-100);
    border-radius: var(--radius-sm);
    transition: var(--transition);
}
.header-actions .cart-link:hover {
    background: var(--gray-200);
}
.cart-count {
    background: var(--accent);
    color: white;
    border-radius: 50%;
    padding: 0 8px;
    font-size: 12px;
    font-weight: 700;
    min-width: 20px;
    text-align: center;
}

/* ============================================================
   КАТАЛОГ (ГЛАВНАЯ)
   ============================================================ */
.catalog-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 30px;
    padding: 30px 0;
}

/* ----- ФИЛЬТРЫ ----- */
.filter-sidebar {
    background: white;
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
    height: fit-content;
    position: sticky;
    top: 90px;
}

.filter-sidebar h3 {
    font-size: 16px;
    margin-bottom: 16px;
    color: var(--gray-800);
    border-bottom: 2px solid var(--gray-200);
    padding-bottom: 10px;
}

.filter-group {
    margin-bottom: 20px;
}
.filter-group label {
    display: block;
    font-weight: 600;
    font-size: 13px;
    color: var(--gray-700);
    margin-bottom: 6px;
}
.filter-group select,
.filter-group input[type="text"] {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-sm);
    font-size: 14px;
    background: white;
}

.filter-checkboxes {
    max-height: 150px;
    overflow-y: auto;
}
.filter-checkboxes label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 400;
    font-size: 14px;
    padding: 4px 0;
    cursor: pointer;
}
.filter-checkboxes label:hover {
    color: var(--primary);
}

.filter-price {
    display: flex;
    gap: 10px;
}
.filter-price input {
    width: 50%;
    padding: 8px;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-sm);
    font-size: 14px;
}

.filter-actions {
    display: flex;
    gap: 10px;
    margin-top: 16px;
}
.filter-actions button {
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}
.filter-actions .btn-apply {
    background: var(--primary);
    color: white;
}
.filter-actions .btn-apply:hover {
    background: var(--primary-light);
}
.filter-actions .btn-reset {
    background: var(--gray-200);
    color: var(--gray-700);
}
.filter-actions .btn-reset:hover {
    background: var(--gray-300);
}

/* ----- ТОВАРЫ ----- */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 24px;
}

.product-card {
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
}
.product-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
}

.product-card .image-wrapper {
    position: relative;
    padding-top: 75%;
    background: var(--gray-100);
    overflow: hidden;
}
.product-card .image-wrapper img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 12px;
    transition: var(--transition);
}
.product-card:hover .image-wrapper img {
    transform: scale(1.03);
}

.product-card .product-info {
    padding: 16px;
    flex: 1;
    display: flex;
    flex-direction: column;
}
.product-card .product-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--gray-800);
    margin-bottom: 6px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    height: 40px;
}
.product-card .product-name:hover {
    color: var(--primary);
}

.product-card .product-meta {
    font-size: 13px;
    color: var(--gray-600);
    margin-bottom: 8px;
}

.product-card .product-price {
    font-size: 20px;
    font-weight: 700;
    color: var(--primary-dark);
    margin: 8px 0;
}
.product-card .product-price .old-price {
    font-size: 14px;
    font-weight: 400;
    color: var(--gray-500);
    text-decoration: line-through;
    margin-left: 8px;
}

.product-card .stock-badge {
    display: inline-block;
    padding: 2px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 8px;
}
.product-card .stock-badge.in-stock {
    background: #d4edda;
    color: #155724;
}
.product-card .stock-badge.on-order {
    background: #fff3cd;
    color: #856404;
}
.product-card .stock-badge.out-of-stock {
    background: #f8d7da;
    color: #721c24;
}

.product-card .add-to-cart {
    width: 100%;
    padding: 10px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    margin-top: auto;
}
.product-card .add-to-cart:hover {
    background: var(--primary-light);
}
.product-card .add-to-cart:disabled {
    background: var(--gray-300);
    cursor: not-allowed;
}

/* ----- ПАГИНАЦИЯ ----- */
.pagination {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-top: 30px;
    flex-wrap: wrap;
}
.pagination a,
.pagination span {
    padding: 8px 14px;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-sm);
    font-size: 14px;
    color: var(--gray-700);
    transition: var(--transition);
}
.pagination a:hover {
    background: var(--gray-100);
}
.pagination .active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* ============================================================
   КАРТОЧКА ТОВАРА
   ============================================================ */
.product-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    padding: 30px 0;
}

.product-gallery {
    position: sticky;
    top: 100px;
    height: fit-content;
}
.main-image-wrapper {
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 20px;
    cursor: zoom-in;
}
.main-image-wrapper img {
    width: 100%;
    height: auto;
    max-height: 500px;
    object-fit: contain;
}
.thumbnails {
    display: flex;
    gap: 10px;
    margin-top: 12px;
    flex-wrap: wrap;
}
.thumbnails .thumb {
    width: 70px;
    height: 70px;
    object-fit: cover;
    border-radius: var(--radius-sm);
    border: 2px solid transparent;
    cursor: pointer;
    transition: var(--transition);
    background: white;
}
.thumbnails .thumb:hover {
    border-color: var(--gray-300);
}
.thumbnails .thumb.active {
    border-color: var(--primary);
}

.product-info {
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.product-info .brand-name {
    font-size: 14px;
    color: var(--gray-600);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.product-info .product-title {
    font-size: 28px;
    font-weight: 700;
    color: var(--gray-900);
    line-height: 1.3;
}

.product-details-card {
    background: white;
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow);
}
.product-short-specs {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 16px;
}
.product-short-specs .spec-item {
    font-size: 14px;
    color: var(--gray-700);
    background: var(--gray-100);
    padding: 4px 12px;
    border-radius: 20px;
}
.variant-links {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.variant-link {
    display: inline-block;
    padding: 4px 14px;
    background: var(--gray-100);
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    color: var(--gray-700);
    transition: var(--transition);
    position: relative;
}
.variant-link:hover {
    background: var(--gray-200);
}
.variant-link.active {
    background: var(--primary);
    color: white;
}
.variant-link .tooltip {
    display: none;
    position: absolute;
    bottom: 110%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--gray-800);
    color: white;
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 400;
    white-space: nowrap;
    z-index: 10;
}
.variant-link:hover .tooltip {
    display: block;
}

.order-card-stock {
    margin-bottom: 12px;
}
.stock-badge {
    display: inline-block;
    padding: 4px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
}
.stock-badge.in-stock {
    background: #d4edda;
    color: #155724;
}
.stock-badge.out-of-stock {
    background: #f8d7da;
    color: #721c24;
}
.stock-details {
    font-size: 13px;
    color: var(--gray-600);
    margin-top: 4px;
}

.price-line {
    display: flex;
    align-items: baseline;
    gap: 12px;
    padding: 8px 0;
}
.price-line .price-label {
    font-size: 15px;
    color: var(--gray-600);
}
.price-line .price-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--primary-dark);
}
.price-line .price-value.service {
    font-size: 20px;
    color: var(--gray-700);
}
.price-line.total-price .price-value.total {
    color: var(--accent);
    font-size: 32px;
}

.service-block {
    margin: 12px 0;
    padding: 12px 16px;
    background: var(--gray-50);
    border-radius: var(--radius-sm);
    border-left: 4px solid var(--accent);
}
.service-checkbox-wrapper {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}
.service-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-weight: 600;
}
.service-checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--accent);
}
.service-link {
    font-size: 13px;
    color: var(--gray-600);
    text-decoration: underline;
}
.service-link:hover {
    color: var(--primary);
}

.product-add-to-cart {
    width: 100%;
    padding: 14px;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    margin-top: 8px;
}
.product-add-to-cart:hover {
    background: var(--accent-hover);
}
.product-add-to-cart:disabled {
    background: var(--gray-300);
    cursor: not-allowed;
}

.inquire-btn {
    width: 100%;
    padding: 14px;
    background: var(--gray-200);
    color: var(--gray-700);
    border: 2px solid var(--gray-300);
    border-radius: var(--radius-sm);
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}
.inquire-btn:hover {
    background: var(--gray-300);
}

/* Описание */
.product-description-fullwidth {
    background: white;
    border-radius: var(--radius);
    padding: 30px;
    margin: 30px 0;
    box-shadow: var(--shadow);
}
.description-inner h2 {
    font-size: 22px;
    margin-bottom: 16px;
    color: var(--gray-800);
}
.description-content p {
    margin-bottom: 12px;
    line-height: 1.8;
    color: var(--gray-700);
}

/* Характеристики */
.product-specs {
    background: white;
    border-radius: var(--radius);
    padding: 30px;
    margin: 30px 0;
    box-shadow: var(--shadow);
}
.product-specs h2 {
    font-size: 22px;
    margin-bottom: 20px;
}
.specs-group {
    margin-bottom: 24px;
}
.specs-group h3 {
    font-size: 16px;
    color: var(--gray-700);
    border-bottom: 2px solid var(--gray-200);
    padding-bottom: 8px;
    margin-bottom: 12px;
}
.props-table {
    width: 100%;
    border-collapse: collapse;
}
.props-table tr {
    border-bottom: 1px solid var(--gray-200);
}
.props-table td {
    padding: 8px 12px;
    font-size: 14px;
}
.props-table .prop-name {
    color: var(--gray-600);
    width: 40%;
}
.props-table .prop-value {
    color: var(--gray-800);
    font-weight: 500;
}

/* УТП */
.utp-list {
    list-style: none;
    padding: 0;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px 24px;
}
.utp-list li::before {
    content: "✓ ";
    color: var(--success);
    font-weight: 700;
}

/* ============================================================
   КОРЗИНА
   ============================================================ */
.cart-group {
    background: white;
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: var(--shadow);
}
.cart-group h3 {
    font-size: 16px;
    margin-bottom: 16px;
    color: var(--gray-700);
}
.cart-item {
    display: grid;
    grid-template-columns: 80px 1fr 120px 100px 100px 60px;
    gap: 12px;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid var(--gray-200);
}
.cart-item:last-child {
    border-bottom: none;
}
.cart-item-img img {
    width: 70px;
    height: 70px;
    object-fit: contain;
    background: var(--gray-100);
    border-radius: var(--radius-sm);
}
.cart-item-name {
    font-size: 14px;
}
.cart-item-name a:hover {
    color: var(--primary);
}
.cart-item-price {
    font-weight: 600;
}
.cart-item-qty {
    display: flex;
    align-items: center;
    gap: 6px;
}
.cart-item-qty button {
    width: 28px;
    height: 28px;
    border: 1px solid var(--gray-300);
    border-radius: 50%;
    background: white;
    cursor: pointer;
    font-size: 16px;
    transition: var(--transition);
}
.cart-item-qty button:hover {
    background: var(--gray-100);
}
.cart-item-qty input {
    width: 50px;
    text-align: center;
    padding: 4px;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-sm);
}
.cart-item-total {
    font-weight: 700;
    color: var(--primary-dark);
}
.cart-item-remove {
    background: none;
    border: none;
    color: var(--danger);
    cursor: pointer;
    font-size: 20px;
    transition: var(--transition);
}
.cart-item-remove:hover {
    color: #a93226;
}

.cart-total {
    text-align: right;
    font-size: 22px;
    font-weight: 700;
    padding: 16px 0;
    border-top: 2px solid var(--gray-200);
}
.cart-actions {
    text-align: right;
    margin-top: 16px;
}
.cart-actions .btn {
    padding: 12px 32px;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
}
.cart-actions .btn:hover {
    background: var(--accent-hover);
}

/* ============================================================
   ОФОРМЛЕНИЕ ЗАКАЗА
   ============================================================ */
.checkout-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    padding: 30px 0;
}
.order-summary {
    background: white;
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow);
}
.order-summary .cart-group {
    box-shadow: none;
    padding: 12px 0;
}
.form-group {
    margin-bottom: 16px;
}
.form-group label {
    display: block;
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 4px;
}
.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-sm);
    font-size: 14px;
    transition: var(--transition);
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--primary);
    outline: none;
    box-shadow: 0 0 0 3px rgba(26, 58, 92, 0.1);
}
.checkbox-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 400;
}
.checkbox-group input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
}

/* ============================================================
   ПОИСК
   ============================================================ */
.search-form {
    display: flex;
    gap: 0;
    max-width: 600px;
    margin: 20px 0;
}
.search-form input {
    flex: 1;
    padding: 12px 18px;
    border: 2px solid var(--gray-300);
    border-right: none;
    border-radius: var(--radius-sm) 0 0 var(--radius-sm);
    font-size: 16px;
}
.search-form input:focus {
    border-color: var(--primary);
    outline: none;
}
.search-form button {
    padding: 12px 28px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}
.search-form button:hover {
    background: var(--primary-light);
}

.search-placeholder {
    padding: 40px 0;
}
.popular-queries {
    margin-top: 20px;
}
.popular-queries h3 {
    font-size: 16px;
    margin-bottom: 12px;
    color: var(--gray-600);
}
.popular-queries a {
    display: inline-block;
    padding: 6px 16px;
    margin: 4px 8px 4px 0;
    background: var(--gray-100);
    border-radius: 20px;
    font-size: 14px;
    color: var(--gray-700);
    transition: var(--transition);
}
.popular-queries a:hover {
    background: var(--primary);
    color: white;
}

/* ============================================================
   МОДАЛЬНОЕ ОКНО (ДЛЯ КАРТИНОК)
   ============================================================ */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.85);
    z-index: 9999;
    justify-content: center;
    align-items: center;
    padding: 40px;
}
.modal img {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
    border-radius: var(--radius-sm);
}
.modal-close {
    position: absolute;
    top: 20px;
    right: 30px;
    font-size: 40px;
    color: white;
    cursor: pointer;
    transition: var(--transition);
}
.modal-close:hover {
    color: var(--gray-400);
}

/* ============================================================
   ПЛАВАЮЩАЯ КОРЗИНА
   ============================================================ */
.floating-cart {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: var(--primary-dark);
    color: white;
    padding: 12px 20px;
    border-radius: 50px;
    box-shadow: var(--shadow-hover);
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    transition: var(--transition);
    z-index: 999;
}
.floating-cart:hover {
    transform: scale(1.05);
}
.floating-cart .cart-icon {
    font-size: 24px;
}
.floating-cart .cart-info {
    font-size: 13px;
    line-height: 1.3;
}
.floating-cart .cart-count {
    font-weight: 700;
    font-size: 16px;
}
.floating-cart .cart-total {
    font-weight: 700;
    color: var(--accent);
}

/* ============================================================
   АДАПТИВНОСТЬ
   ============================================================ */
@media (max-width: 1024px) {
    .catalog-layout {
        grid-template-columns: 1fr;
    }
    .filter-sidebar {
        position: static;
        display: none;
    }
    .filter-sidebar.open {
        display: block;
    }
    .filter-toggle {
        display: block !important;
    }
    .product-container {
        grid-template-columns: 1fr;
    }
    .product-gallery {
        position: static;
    }
    .checkout-container {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .header-inner {
        flex-wrap: wrap;
    }
    .header-search {
        order: 3;
        flex: 1 1 100%;
        max-width: 100%;
    }
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 16px;
    }
    .product-card .product-name {
        font-size: 13px;
        height: 36px;
    }
    .product-card .product-price {
        font-size: 17px;
    }
    .cart-item {
        grid-template-columns: 60px 1fr 80px 70px 60px 40px;
        gap: 8px;
        font-size: 13px;
    }
    .cart-item-img img {
        width: 50px;
        height: 50px;
    }
    .cart-item-qty input {
        width: 40px;
    }
    .product-info .product-title {
        font-size: 22px;
    }
    .utp-list {
        grid-template-columns: 1fr;
    }
    .price-line .price-value {
        font-size: 22px;
    }
    .price-line.total-price .price-value.total {
        font-size: 26px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 12px;
    }
    .products-grid {
        grid-template-columns: 1fr 1fr;
        gap: 12px;
    }
    .product-card .product-info {
        padding: 12px;
    }
    .product-card .product-name {
        font-size: 12px;
        height: 32px;
    }
    .product-card .product-price {
        font-size: 15px;
    }
    .product-card .add-to-cart {
        font-size: 12px;
        padding: 8px;
    }
    .variant-links {
        gap: 4px;
    }
    .variant-link {
        font-size: 12px;
        padding: 2px 10px;
    }
}

/* ============================================================
   ВСПОМОГАТЕЛЬНЫЕ КЛАССЫ
   ============================================================ */
.text-center { text-align: center; }
.mt-20 { margin-top: 20px; }
.mb-20 { margin-bottom: 20px; }
.hidden { display: none !important; }

.filter-toggle {
    display: none;
    padding: 8px 16px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-weight: 600;
    margin-bottom: 16px;
}
/* ============================================================
   МОБИЛЬНАЯ АДАПТАЦИЯ КАРТОЧЕК ТОВАРОВ
   ============================================================ */

/* Фиксированный размер картинок */
.product-card .image-wrapper {
    position: relative;
    padding-top: 75%; /* 4:3 — универсальное соотношение */
    background: #f5f5f5;
    overflow: hidden;
    border-radius: 8px 8px 0 0;
}

.product-card .image-wrapper img {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    height: 100%;
    object-fit: contain; /* Вписываем картинку без обрезания */
    padding: 8px;
    background: white;
    transition: var(--transition);
}

.product-card:hover .image-wrapper img {
    transform: translate(-50%, -50%) scale(1.03);
}

/* Заглушка, если картинка не загрузилась */
.product-card .image-wrapper img[src=""],
.product-card .image-wrapper img:not([src]) {
    opacity: 0;
}

.product-card .image-wrapper::after {
    content: "📷";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 40px;
    color: #ddd;
    pointer-events: none;
    display: none;
}

.product-card .image-wrapper img[src=""],
.product-card .image-wrapper img:not([src]) {
    opacity: 0;
}

.product-card .image-wrapper img[src=""] ~ .image-wrapper::after,
.product-card .image-wrapper img:not([src]) ~ .image-wrapper::after {
    display: block;
}

/* Мобильная версия */
@media (max-width: 768px) {
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 12px;
    }
    
    .product-card .image-wrapper {
        padding-top: 70%; /* Чуть ниже для мобильных */
    }
    
    .product-card .image-wrapper img {
        padding: 4px;
    }
    
    .product-card .product-info {
        padding: 10px;
    }
    
    .product-card .product-name {
        font-size: 13px;
        height: 36px;
        -webkit-line-clamp: 2;
    }
    
    .product-card .product-meta {
        font-size: 11px;
    }
    
    .product-card .product-price {
        font-size: 16px;
    }
    
    .product-card .stock-badge {
        font-size: 10px;
        padding: 1px 8px;
    }
    
    .product-card .add-to-cart {
        font-size: 12px;
        padding: 8px;
    }
}

@media (max-width: 480px) {
    .products-grid {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }
    
    .product-card .image-wrapper {
        padding-top: 65%;
    }
    
    .product-card .product-name {
        font-size: 12px;
        height: 32px;
    }
    
    .product-card .product-price {
        font-size: 14px;
    }
    
    .product-card .add-to-cart {
        font-size: 11px;
        padding: 6px;
    }
}