/* ============================================================
   CATALOG.CSS – уникальные стили для страницы "Каталог"
   ============================================================ */

.catalog { padding: 50px 0 30px 0; }
.catalog-header {
    display: flex; justify-content: space-between; align-items: flex-end; margin-bottom: 30px;
}
.catalog-header h2 {
    font-size: 30px; font-weight: 700; text-transform: uppercase;
    letter-spacing: 0.05em; color: var(--bg-dark);
}
.catalog-header a {
    color: var(--bg-dark); text-decoration: none; border-bottom: 1px solid transparent;
    transition: all 0.3s; font-weight: 500;
}
.catalog-header a:hover { border-bottom-color: var(--bg-dark); opacity: 0.7; }

.catalog-layout { display: flex; gap: 30px; align-items: flex-start; }

/* ============================
   ПАНЕЛЬ ФИЛЬТРОВ (Исправленный стиль)
   ============================ */
.catalog-filter {
    flex: 0 0 260px; 
    background-color: #e1e6ef; padding: 25px; border-radius: 16px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.03); 
    display: flex; flex-direction: column; gap: 15px;
    position: sticky; top: 20px; max-height: calc(100vh - 40px); overflow-y: auto;
}
.catalog-filter::-webkit-scrollbar { width: 6px; }
.catalog-filter::-webkit-scrollbar-track { background: transparent; }
.catalog-filter::-webkit-scrollbar-thumb { background: #b0c4de; border-radius: 10px; }
.catalog-filter::-webkit-scrollbar-thumb:hover { background: var(--accent-blue); }

.catalog-filter h3 { font-size: 18px; margin: 0; font-weight: 600; }

/* Стили для полей ввода и выпадающих списков */
.filter-group { display: flex; flex-direction: column; gap: 8px; }
.filter-group label { font-size: 14px; font-weight: 500; }
.filter-group select, .filter-group input {
    width: 100%; padding: 10px 14px; border-radius: 6px; border: 1px solid transparent;
    outline: none; font-size: 14px; background: #fff; transition: all 0.3s;
}
.filter-group select:focus, .filter-group input:focus {
    border: 1px solid var(--accent-blue); box-shadow: 0 0 0 4px rgba(114, 168, 210, 0.2);
}

/* Стили для расширяющейся лупы (золотая кнопка) */
.search-expand-wrapper {
    position: relative; width: 48px; height: 48px;
    background-color: var(--accent-gold); border-radius: 24px; cursor: pointer;
    transition: width 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.3s;
    display: flex; align-items: center; overflow: hidden; align-self: flex-start;
    margin-bottom: 5px; box-shadow: 0 2px 8px rgba(220, 179, 107, 0.2);
}
.search-expand-wrapper:hover,
.search-expand-wrapper:focus-within {
    width: 100%; box-shadow: 0 4px 15px rgba(220, 179, 107, 0.4);
}
.search-expand-wrapper .search-icon {
    position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
    width: 24px; height: 24px; stroke: #1e293b; fill: none; stroke-width: 2;
    stroke-linecap: round; stroke-linejoin: round; z-index: 2; pointer-events: none;
}
.search-expand-wrapper .search-input {
    width: 100%; height: 100%; border: none; outline: none; background: transparent;
    padding: 0 44px 0 48px; font-size: 15px; color: #1e293b; opacity: 0;
    transition: opacity 0.3s ease 0.1s; cursor: text;
}
.search-expand-wrapper:hover .search-input,
.search-expand-wrapper:focus-within .search-input { opacity: 1; }
.search-expand-wrapper .search-input::placeholder { color: #475569; }
.search-clear-btn {
    position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
    width: 32px; height: 32px; border-radius: 50%; background: rgba(0, 0, 0, 0.1);
    border: none; cursor: pointer; display: none; align-items: center; justify-content: center;
    color: #1e293b; transition: all 0.2s ease; z-index: 3; padding: 0;
}
.search-clear-btn:hover { background: rgba(0, 0, 0, 0.2); }
.search-clear-btn:active { transform: translateY(-50%) scale(0.9); }
.search-clear-btn svg {
    width: 18px; height: 18px;
    stroke: currentColor; stroke-width: 2.5;
    stroke-linecap: round; stroke-linejoin: round; fill: none; pointer-events: none;
}
.search-expand-wrapper:hover .search-clear-btn.has-text,
.search-expand-wrapper:focus-within .search-clear-btn.has-text { display: flex; }

/* Кнопки внизу фильтра */
.btn-find {
    width: 100%; background-color: var(--accent-blue); color: var(--text-light);
    border: none; padding: 12px; border-radius: 6px; cursor: pointer; font-weight: 600;
    transition: all 0.3s; margin-top: 5px;
}
.btn-find:hover { background-color: #5d92b9; transform: translateY(-2px); }
.btn-reset { display: block; text-align: center; font-size: 13px; color: #555; text-decoration: underline; cursor: pointer; transition: 0.3s;}
.btn-reset:hover { color: #0e2942; }

/* ============================
   СЕТКА ТОВАРОВ
   ============================ */
.catalog-grid {
    display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; flex: 1;
}
.catalog-item {
    border-radius: 12px; overflow: hidden; background: #fff; height: auto;
    box-shadow: 0 4px 15px rgba(0,0,0,0.04);
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.4s;
    cursor: pointer; display: flex; flex-direction: column; text-decoration: none;
}
.catalog-item:hover {
    transform: translateY(-5px) scale(1.02); box-shadow: var(--shadow-hover);
}
.catalog-item .item-img-wrap {
    width: 100%; aspect-ratio: 1 / 1;
    display: flex; align-items: center; justify-content: center;
    position: relative; background: #fafafa; overflow: hidden;
}
.catalog-item .item-img-wrap img {
    width: 100%; height: 100%; object-fit: cover;
    border: 2px dashed var(--accent-blue); padding: 5px;
    display: block; transition: transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border-bottom: none; border-radius: 12px 12px 0 0;
}
.catalog-item:hover .item-img-wrap img {
    transform: scale(1.1) rotate(-1deg); border-color: var(--bg-dark);
}
.catalog-item .item-img-wrap::after {
    content: ''; position: absolute; bottom: 0; left: 0; width: 100%; height: 60%;
    background: linear-gradient(to top, rgba(14, 41, 66, 0.5), transparent);
    opacity: 0; transition: opacity 0.4s ease; pointer-events: none; z-index: 1;
}
.catalog-item:hover .item-img-wrap::after { opacity: 1; }
.catalog-item .item-title {
    padding: 12px 8px; text-align: center; font-size: 13px; font-weight: 600;
    color: var(--bg-dark); background: #fff;
    border-bottom-left-radius: 12px; border-bottom-right-radius: 12px;
    border-left: 2px dashed transparent; border-right: 2px dashed transparent;
    border-bottom: 2px dashed transparent; margin-top: -2px;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.catalog-item:hover .item-title {
    background-color: var(--bg-dark); color: var(--accent-gold);
    border-left-color: var(--accent-gold); border-right-color: var(--accent-gold);
    border-bottom-color: var(--accent-gold);
}

/* ============================
   ПАГИНАЦИЯ
   ============================ */
.catalog-pagination-wrapper {
    margin-top: 40px; border-top: 1px solid #d1d9e6;
    padding-top: 25px; display: flex; justify-content: space-between;
    align-items: center; flex-wrap: wrap; gap: 15px;
}
.catalog-counter { font-size: 14px; color: var(--text-main); opacity: 0.8; }
.catalog-counter strong { font-weight: 700; color: var(--bg-dark); opacity: 1; }
.pagination { display: flex; align-items: center; gap: 5px; }
.pagination a {
    display: flex; align-items: center; justify-content: center;
    min-width: 38px; height: 38px; padding: 0 10px;
    background: #fff; border: 1px solid #e2e8f0; border-radius: 8px;
    color: var(--text-main); text-decoration: none; font-size: 14px; font-weight: 500;
    transition: all 0.3s;
}
.pagination a:hover { background: var(--bg-light); border-color: var(--bg-dark); }
.pagination a.active {
    background: var(--bg-dark); border-color: var(--bg-dark); color: var(--text-light);
    box-shadow: 0 4px 12px rgba(14, 41, 66, 0.2);
}
.pagination .dots { padding: 0 5px; color: #94a3b8; font-weight: 500; }

/* ============================
   АДАПТИВНОСТЬ
   ============================ */
@media (max-width: 1024px) { .catalog-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 768px) {
    .catalog-layout { flex-direction: column; }
    .catalog-filter { flex: 1; width: 100%; position: static; max-height: none; overflow-y: visible; }
    .catalog-grid { gap: 15px; }
    .catalog-pagination-wrapper { flex-direction: column; align-items: center; text-align: center; gap: 15px; }
    .catalog-counter { width: 100%; text-align: center; }
}
@media (max-width: 480px) {
    .catalog-grid { grid-template-columns: 1fr; }
    .catalog-header { flex-direction: column; align-items: flex-start; gap: 10px; }
    .pagination a { min-width: 32px; height: 32px; font-size: 13px; }
}