/* ===== ОСНОВНЫЕ СТИЛИ ===== */
.custom-products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 25px;
    margin: 20px 0;
    padding: 0 10px;
}

/* ===== КАРТОЧКА ТОВАРА ===== */
.product-card {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 15px;
    padding: 20px;
    position: relative;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    overflow: hidden;
    cursor: pointer;
}

.product-card:hover {
    background-color: #ffee58;
    transform: translateY(-8px);
    box-shadow: 0 12px 35px rgba(0,0,0,0.15);
    border-color: #ffd54f;
}

/* Стиль для товаров снятых с производства */
.product-nofactory {
    opacity: 0.7;
    background: #f8f9fa;
    position: relative;
}

.product-nofactory::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(44, 62, 80, 0.1), rgba(52, 73, 94, 0.1));
    z-index: 1;
    pointer-events: none;
}

.product-nofactory:hover {
    background: #f8f9fa;
    transform: none;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.product-nofactory .product-image img {
    filter: grayscale(0.3);
}

/* ===== КЛИКАБЕЛЬНАЯ ОБЛАСТЬ ДЛЯ ПЕРЕХОДА В POPUP ===== */
.product-card-link {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 5;
    text-decoration: none;
    cursor: pointer;
}

/* Исключаем кнопки из кликабельной области */
.product-buttons,
.quantity-selector,
.btn-add-to-cart,
.btn-one-click,
.btn-details {
    position: relative;
    z-index: 10;
}

/* Кнопка Краткий обзор - тоже исключаем из общей кликабельной области */
.btn-quick-view {
    position: relative;
    z-index: 10;
}

/* ===== ИЗОБРАЖЕНИЕ ТОВАРА ===== */
.product-image {
    position: relative;
    margin-bottom: 15px;
    overflow: hidden;
    border-radius: 10px;
    width: 100%;
    max-width: 250px;
    background: #f8f9fa;
    cursor: pointer;
}

.product-image img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    transition: all 0.4s ease;
}

.product-card:hover .product-image img {
    transform: scale(1.08);
}

.product-nofactory:hover .product-image img {
    transform: none;
}

/* ===== СТАТУС НАЛИЧИЯ ТОВАРА ===== */
.product-stock-status {
    font-size: 14px;
    font-weight: 700;
    padding: 6px 12px;
    border-radius: 20px;
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stock-status-instock {
    background: linear-gradient(135deg, #27ae60, #2ecc71);
    color: white;
    box-shadow: 0 2px 8px rgba(39, 174, 96, 0.3);
}

.stock-status-onorder {
    background: linear-gradient(135deg, #f39c12, #f1c40f);
    color: white;
    box-shadow: 0 2px 8px rgba(243, 156, 18, 0.3);
}

.stock-status-outofstock {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    color: white;
    box-shadow: 0 2px 8px rgba(231, 76, 60, 0.3);
}

/* ===== СТИКЕРЫ ТОВАРОВ ===== */
.product-sticker {
    position: absolute;
    top: 12px;
    left: 12px;
    padding: 8px 14px;
    border-radius: 8px;
    color: white;
    font-size: 11px;
    font-weight: 800;
    z-index: 20;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    line-height: 1;
    box-shadow: 0 3px 8px rgba(0,0,0,0.2);
    animation: stickerPulse 2s infinite;
}

@keyframes stickerPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.sticker-hit { 
    background: linear-gradient(135deg, #8e44ad, #9b59b6);
    border-left: 3px solid #6c3483;
}

.sticker-recommend { 
    background: linear-gradient(135deg, #f39c12, #f1c40f);
    border-left: 3px solid #d35400;
}

.sticker-promo { 
    background: linear-gradient(135deg, #e74c3c, #e67e22);
    border-left: 3px solid #c0392b;
}

.sticker-new { 
    background: linear-gradient(135deg, #27ae60, #2ecc71);
    border-left: 3px solid #229954;
}

.sticker-nofactory { 
    background: linear-gradient(135deg, #2c3e50, #34495e);
    border-left: 3px solid #1c2833;
    animation: nofactoryPulse 3s infinite;
}

@keyframes nofactoryPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.02); }
    100% { transform: scale(1); }
}

/* ===== НАЗВАНИЕ ТОВАРА ===== */
.product-title {
    font-size: 17px;
    font-weight: 700;
    margin-bottom: 12px;
    color: #2c3e50;
    text-align: center;
    line-height: 1.3;
    width: 100%;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 6;
    cursor: pointer;
    transition: color 0.3s ease;
}

.product-card:hover .product-title {
    color: #2c3e50;
}

.product-nofactory .product-title {
    color: #7f8c8d;
}

/* ===== ЦЕНА ТОВАРА ===== */
.product-price {
    font-size: 22px;
    font-weight: 800;
    margin-bottom: 15px;
    text-align: center;
    width: 100%;
    position: relative;
    z-index: 6;
}

.product-price .amount {
    color: #e74c3c;
}

.price-on-request {
    color: #7f8c8d;
    font-style: italic;
    font-weight: 600;
    font-size: 18px;
    background: #f8f9fa;
    padding: 8px 16px;
    border-radius: 8px;
    border: 1px dashed #bdc3c7;
}

.product-nofactory .price-on-request {
    color: #95a5a6;
    background: #ecf0f1;
}

/* ===== СЕЛЕКТОР КОЛИЧЕСТВА ===== */
.quantity-selector {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 15px;
    gap: 8px;
    background: #f8f9fa;
    padding: 8px;
    border-radius: 10px;
    border: 1px solid #e9ecef;
    position: relative;
    z-index: 10;
}

.product-nofactory .quantity-selector {
    opacity: 0.5;
    pointer-events: none;
}

.quantity-selector button {
    width: 38px;
    height: 38px;
    border: 2px solid #3498db;
    background: #3498db;
    color: white;
    border-radius: 8px;
    cursor: pointer;
    font-size: 18px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    position: relative;
    z-index: 11;
}

.quantity-selector button:hover {
    background: #2980b9;
    transform: scale(1.1);
}

.quantity-selector button:active {
    transform: scale(0.95);
}

.product-qty {
    width: 70px;
    height: 38px;
    text-align: center;
    border: 2px solid #bdc3c7;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    margin: 0 8px;
    background: white;
    position: relative;
    z-index: 11;
}

.product-qty:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

/* ===== КНОПКИ ===== */
.product-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
    position: relative;
    z-index: 10;
}

.btn {
    padding: 14px 18px;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    text-align: center;
    text-decoration: none;
    font-size: 14px;
    font-weight: 700;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    position: relative;
    overflow: hidden;
    z-index: 11;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    transition: left 0.5s;
}

.btn:hover::before {
    left: 100%;
}

.btn-icon {
    font-size: 16px;
    transition: transform 0.3s ease;
}

.btn:hover .btn-icon {
    transform: scale(1.2);
}

/* Стили конкретных кнопок */
.btn-add-to-cart {
    background: linear-gradient(135deg, #2ecc71, #27ae60);
    color: white;
    order: 1;
    box-shadow: 0 4px 15px rgba(46, 204, 113, 0.3);
}

/* КНОПКА КУПИТЬ В ОДИН КЛИК - ТЕПЕРЬ ПРОСТО ССЫЛКА НА POPUP */
.btn-one-click {
    background: linear-gradient(135deg, #e67e22, #d35400);
    color: white;
    order: 2;
    box-shadow: 0 4px 15px rgba(230, 126, 34, 0.3);
    text-decoration: none;
}

/* КНОПКА КРАТКИЙ ОБЗОР - ССЫЛКА НА POPUP */
.btn-quick-view {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    order: 3;
    box-shadow: 0 4px 15px rgba(52, 152, 219, 0.3);
    text-decoration: none;
}

.btn-details {
    background: linear-gradient(135deg, #95a5a6, #7f8c8d);
    color: white;
    order: 4;
    box-shadow: 0 4px 15px rgba(149, 165, 166, 0.3);
}

.btn-disabled {
    background: linear-gradient(135deg, #bdc3c7, #95a5a6);
    color: #7f8c8d;
    cursor: not-allowed;
    order: 1;
    box-shadow: none;
    opacity: 0.8;
}

.product-nofactory .btn-disabled {
    background: linear-gradient(135deg, #34495e, #2c3e50);
    color: #ecf0f1;
}

.btn:hover:not(.btn-disabled) {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.2);
}

.product-nofactory .btn:hover:not(.btn-disabled) {
    transform: none;
    box-shadow: none;
}

/* ===== СИСТЕМА КОРЗИНЫ В ХЕДЕРЕ ===== */
.menu-cart-item {
    margin-left: 15px !important;
    position: relative;
}

.menu-cart-item a.cart-contents {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 18px;
    background: linear-gradient(135deg, #3498db, #2980b9);
    border-radius: 25px;
    text-decoration: none;
    color: white;
    font-weight: 600;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.3);
}

.menu-cart-item a.cart-contents:hover {
    background: linear-gradient(135deg, #2980b9, #2471a3);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(52, 152, 219, 0.4);
}

.cart-icon {
    font-size: 20px;
    transition: transform 0.3s ease;
}

.menu-cart-item a.cart-contents:hover .cart-icon {
    transform: scale(1.2) rotate(-10deg);
}

.cart-count {
    background: #e74c3c;
    color: white;
    border-radius: 50%;
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 800;
    min-width: 22px;
    text-align: center;
    animation: countPulse 0.5s ease;
    border: 2px solid white;
    box-shadow: 0 2px 8px rgba(231, 76, 60, 0.3);
}

@keyframes countPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.3); }
    100% { transform: scale(1); }
}

.cart-total-mobile {
    display: none;
    font-size: 14px;
    font-weight: 600;
}

/* Отдельная иконка корзины через шорткод */
.custom-cart-icon {
    display: inline-block;
    margin-left: 20px;
}

.custom-cart-icon a.cart-contents {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    background: linear-gradient(135deg, #2ecc71, #27ae60);
    border-radius: 30px;
    text-decoration: none;
    color: white;
    font-weight: 700;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(46, 204, 113, 0.3);
}

.custom-cart-icon a.cart-contents:hover {
    background: linear-gradient(135deg, #27ae60, #229954);
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(46, 204, 113, 0.4);
}

.cart-icon-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
    position: relative;
}

/* ===== УВЕДОМЛЕНИЯ ===== */
.custom-notice {
    position: fixed;
    top: 20px;
    right: 20px;
    background: linear-gradient(135deg, #2ecc71, #27ae60);
    color: white;
    padding: 18px 24px;
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.2);
    z-index: 10000;
    animation: slideInRight 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 600;
    max-width: 350px;
    border-left: 4px solid #27ae60;
}

.custom-notice.error {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    border-left-color: #c0392b;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOutRight {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

.custom-notice.hiding {
    animation: slideOutRight 0.3s ease forwards;
}

/* ===== АНИМАЦИИ ДОБАВЛЕНИЯ В КОРЗИНУ ===== */
@keyframes addToCart {
    0% { transform: scale(1); }
    25% { transform: scale(1.1) rotate(3deg); }
    50% { transform: scale(1.05) rotate(-3deg); }
    100% { transform: scale(1); }
}

.added-to-cart {
    animation: addToCart 0.6s ease;
}

.cart-count-updated {
    animation: countUpdate 0.8s ease;
}

@keyframes countUpdate {
    0% { transform: scale(1); }
    25% { transform: scale(1.4); }
    50% { transform: scale(1.2); }
    75% { transform: scale(1.3); }
    100% { transform: scale(1); }
}

/* ===== ЗАГРУЗКИ ===== */
.loading {
    opacity: 0.7;
    pointer-events: none;
    position: relative;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ===== АДАПТИВНОСТЬ ===== */
@media (max-width: 1200px) {
    .custom-products-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    }
}

@media (max-width: 768px) {
    .custom-products-grid {
        grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
        gap: 20px;
        padding: 0 5px;
    }
    
    .product-card {
        padding: 16px;
        margin: 0 5px;
    }
    
    .product-title {
        font-size: 16px;
    }
    
    .product-price {
        font-size: 20px;
    }
    
    .product-stock-status {
        font-size: 13px;
        padding: 5px 10px;
    }
    
    .btn {
        padding: 12px 15px;
        font-size: 13px;
    }
    
    .custom-filters {
        padding: 20px;
        margin: 0 10px 20px 10px;
    }
    
    .filter-buttons {
        flex-direction: column;
    }
    
    .quantity-selector {
        padding: 6px;
    }
    
    .quantity-selector button {
        width: 34px;
        height: 34px;
        font-size: 16px;
    }
    
    .product-qty {
        width: 60px;
        height: 34px;
    }
    
    .menu-cart-item a.cart-contents {
        padding: 8px 15px;
        font-size: 14px;
    }
    
    .custom-cart-icon a.cart-contents {
        padding: 10px 16px;
        font-size: 14px;
    }
    
    .custom-notice {
        top: 10px;
        right: 10px;
        left: 10px;
        max-width: none;
    }
}

@media (max-width: 576px) {
    .custom-products-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .product-card {
        padding: 14px;
        border-radius: 12px;
    }
    
    .product-image {
        max-width: 220px;
    }
    
    .product-image img {
        height: 180px;
    }
    
    .product-sticker {
        font-size: 10px;
        padding: 6px 10px;
    }
    
    .product-stock-status {
        font-size: 12px;
    }
    
    .btn {
        padding: 10px 12px;
        font-size: 12px;
    }
    
    .btn-icon {
        font-size: 14px;
    }
    
    .custom-filters {
        padding: 16px;
    }
    
    .filter-group select,
    .filter-group input {
        padding: 12px 14px;
    }
    
    .menu-cart-item {
        margin-left: 10px !important;
    }
    
    .menu-cart-item a.cart-contents {
        padding: 6px 12px;
        gap: 6px;
    }
    
    .cart-count {
        padding: 2px 6px;
        font-size: 11px;
        min-width: 18px;
    }
}

@media (max-width: 480px) {
    .product-buttons {
        gap: 8px;
    }
    
    .product-title {
        font-size: 15px;
        min-height: 40px;
    }
    
    .product-price {
        font-size: 18px;
    }
    
    .menu-cart-item a.cart-contents {
        padding: 6px 12px;
        font-size: 14px;
    }
}

/* ===== ФИЛЬТРЫ ===== */
.custom-filters {
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    padding: 30px;
    border-radius: 15px;
    margin-bottom: 30px;
    border: 1px solid #dee2e6;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
}

.custom-filters h3 {
    margin-bottom: 25px;
    color: #2c3e50;
    text-align: center;
    font-size: 22px;
    font-weight: 700;
}

.filter-group {
    margin-bottom: 22px;
}

.filter-group label {
    display: block;
    margin-bottom: 10px;
    font-weight: 700;
    color: #34495e;
    font-size: 15px;
}

.filter-group select,
.filter-group input {
    width: 100%;
    padding: 14px 18px;
    border: 2px solid #ddd;
    border-radius: 10px;
    font-size: 15px;
    transition: all 0.3s ease;
    background: white;
}

.filter-group select:focus,
.filter-group input:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.15);
    transform: translateY(-2px);
}

.filter-buttons {
    display: flex;
    gap: 12px;
    margin-top: 28px;
}

.filter-buttons .btn {
    flex: 1;
    padding: 15px;
    font-size: 15px;
}

.btn-apply {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
}

.btn-reset {
    background: linear-gradient(135deg, #95a5a6, #7f8c8d);
    color: white;
}

@media (max-width: 768px) {
    .custom-filters {
        padding: 20px;
        margin: 0 10px 20px 10px;
    }
    
    .filter-buttons {
        flex-direction: column;
    }
}

/* ===== СТИЛИ ДЛЯ СТРАНИЦЫ ПОИСКА ===== */
.search-results-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 30px;
    border-radius: 15px;
    margin-bottom: 30px;
    text-align: center;
}

.search-results-header h2 {
    margin: 0 0 15px 0;
    font-size: 28px;
    font-weight: 700;
}

.search-query-info {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 30px;
    flex-wrap: wrap;
}

.search-query-info p {
    margin: 0;
    font-size: 16px;
}

.results-count {
    background: rgba(255, 255, 255, 0.2);
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 600;
}

.search-results-grid {
    margin-top: 20px;
}

/* Пагинация для поиска */
.search-pagination {
    margin-top: 40px;
    text-align: center;
}

.search-pagination .page-numbers {
    display: inline-flex;
    gap: 8px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.search-pagination .page-numbers li {
    margin: 0;
}

.search-pagination .page-numbers a,
.search-pagination .page-numbers span {
    display: block;
    padding: 10px 16px;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    text-decoration: none;
    color: #495057;
    font-weight: 600;
    transition: all 0.3s ease;
}

.search-pagination .page-numbers a:hover {
    background: #3498db;
    color: white;
    border-color: #3498db;
}

.search-pagination .page-numbers .current {
    background: #3498db;
    color: white;
    border-color: #3498db;
}

/* Сообщение "ничего не найдено" */
.no-search-results {
    text-align: center;
    padding: 60px 20px;
    background: #f8f9fa;
    border-radius: 15px;
    margin: 40px 0;
}

.no-results-message h3 {
    color: #2c3e50;
    margin-bottom: 20px;
    font-size: 24px;
}

.no-results-message p {
    color: #7f8c8d;
    font-size: 16px;
    margin-bottom: 30px;
}

.search-suggestions {
    max-width: 500px;
    margin: 0 auto;
    text-align: left;
    background: white;
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.search-suggestions h4 {
    color: #2c3e50;
    margin-bottom: 15px;
    font-size: 18px;
}

.search-suggestions ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.search-suggestions li {
    padding: 8px 0;
    color: #7f8c8d;
    position: relative;
    padding-left: 25px;
}

.search-suggestions li:before {
    content: '💡';
    position: absolute;
    left: 0;
    top: 8px;
}

/* Адаптивность для поиска */
@media (max-width: 768px) {
    .search-results-header {
        padding: 20px;
    }
    
    .search-results-header h2 {
        font-size: 24px;
    }
    
    .search-query-info {
        flex-direction: column;
        gap: 15px;
    }
    
    .search-pagination .page-numbers a,
    .search-pagination .page-numbers span {
        padding: 8px 12px;
        font-size: 14px;
    }
    
    .no-search-results {
        padding: 40px 15px;
    }
    
    .no-results-message h3 {
        font-size: 20px;
    }
    
    .search-suggestions {
        padding: 20px;
    }
}


/*====================ВЫВОД АКЦИОННЫХ ТОВАРОВ ==================================*/
