/* Hyper-Glass Catalog CSS v4.3.0 — Seiken Style */
:root {
    --hg-card-radius: 18px;
    --hg-card-bg: #ffffff;
    --hg-card-text: #0f172a;
    --hg-card-description: #64748b;
    --hg-font-size: 13px;
    --hg-img-fit: cover;
}

/* Base Catalog Layout */
.hg-wrap {
    width: 100%;
    margin: 30px auto;
    padding: 0 20px;
    box-sizing: border-box;
    display: grid;
    grid-template-columns: 210px minmax(0, 1fr);
    gap: 24px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: #1e293b;
}

.hg-wrap * {
    box-sizing: border-box;
}

/* Width Modes */
.hg-wrap.hg-width-container {
    max-width: 1240px;
}

.hg-wrap.hg-width-full,
.hg-wrap.hg-fullwidth {
    max-width: 100% !important;
}

/* Sidebar */
.hg-sidebar {
    position: sticky;
    top: 90px;
    align-self: start;
}

.hg-sidebar-inner {
    background: #ffffff;
    border-radius: 18px;
    padding: 16px 14px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    border: 1px solid #f1f5f9;
}

.hg-sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 700;
    font-size: 13px;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid #f1f5f9;
}

.hg-sidebar-dot {
    display: inline-block;
    width: 6px;
    height: 6px;
    background: #e63946;
    border-radius: 2px;
    margin-right: 6px;
    vertical-align: middle;
}

.hg-sidebar-all {
    font-size: 11px;
    color: #e63946;
    text-decoration: none;
    font-weight: 600;
}

.hg-sidebar-list, .hg-sidebar-list ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.hg-sidebar-list > li > a {
    display: block;
    padding: 9px 12px;
    color: #1e293b;
    text-decoration: none;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.2s;
}

.hg-sidebar-list > li > a:hover,
.hg-sidebar-list li.active > a {
    background: #fde8ec;
    color: #e63946;
}

.hg-sidebar-list .hg-group {
    padding: 10px 0 4px;
    border-bottom: 1px solid #edf0f4;
}

.hg-sidebar-list .hg-group:last-child {
    border-bottom: none;
}

.hg-sidebar-list .hg-group > strong {
    display: block;
    padding: 0 4px 6px;
    font-size: 11px;
    font-weight: 700;
    color: #0f172a;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.hg-sidebar-list .hg-group li a {
    display: block;
    padding: 6px 10px;
    color: #64748b;
    text-decoration: none;
    font-size: 12px;
    font-weight: 500;
    border-radius: 6px;
    transition: all 0.15s;
}

.hg-sidebar-list .hg-group li a:hover {
    background: #f8fafc;
    color: #0f172a;
}

.hg-sidebar-list .hg-group li.active a {
    background: #fde8ec;
    color: #e63946;
    font-weight: 600;
}

/* Main Catalog Area */
.hg-main {
    min-width: 0;
}

.hg-main-header {
    margin-bottom: 18px;
}

.hg-main-label {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    color: #e63946;
    margin-bottom: 4px;
    text-transform: uppercase;
}

.hg-main-title-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
    flex-wrap: wrap;
}

.hg-main-title {
    margin: 0;
    font-size: 24px;
    font-weight: 800;
    line-height: 1.2;
    color: #0f172a;
}

.hg-main-count {
    font-size: 12px;
    color: #94a3b8;
    font-weight: 500;
}

/* 3-column Grid on Desktop */
.hg-grid {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 20px !important;
    width: 100% !important;
    align-items: stretch;
}

/* Карточка товара */
.hg-card {
    background: var(--hg-card-bg, #ffffff);
    border-radius: var(--hg-card-radius, 18px) !important;
    overflow: hidden !important;
    box-shadow: 0 4px 18px rgba(15, 23, 42, 0.05);
    border: 1px solid #eef2f6;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    display: flex;
    flex-direction: column;
    width: 100%;
    position: relative;
}

.hg-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.10);
}

/* Блок фото: вертикальный формат 3:3.8 (чуть выше квадрата), чтобы литражи внизу не срезались! */
.hg-card-image {
    position: relative;
    width: 100%;
    aspect-ratio: 3 / 3.8; /* Оптимальная высота, чтобы литражи полностью помещались */
    background: #0f172a;
    overflow: hidden !important;
    border-top-left-radius: var(--hg-card-radius, 18px);
    border-top-right-radius: var(--hg-card-radius, 18px);
}

.hg-gallery {
    width: 100%;
    height: 100%;
    position: relative;
    overflow: hidden;
}

.hg-gallery-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: var(--hg-img-fit, cover) !important;
    object-position: center bottom; /* Прижимаем к низу/центру, чтобы литражи были видны */
    opacity: 0;
    transition: opacity 0.3s ease, transform 0.45s ease;
    display: block;
}

/* Плавное увеличение фото при наведении */
.hg-card:hover .hg-gallery-img.active {
    transform: scale(1.06);
}

.hg-gallery-img.active {
    opacity: 1;
}

/* Плашка категории вверху слева */
.hg-card-plaques {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 5;
    display: flex;
    flex-direction: column;
    gap: 6px;
    pointer-events: none;
}

.hg-card-plaque {
    display: inline-block;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    line-height: 1.2;
    background: rgba(255, 255, 255, 0.95);
    color: #1e293b;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
    backdrop-filter: blur(4px);
    width: fit-content;
}

.hg-card-plaque-badge {
    background: #e63946;
    color: #ffffff;
}

/* Кнопки перелистывания фото */
.hg-gal-btn {
    position: absolute;
    z-index: 4;
    background: rgba(255, 255, 255, 0.92);
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    line-height: 1;
    color: #334155;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    transition: background 0.2s, transform 0.15s;
}

.hg-gal-btn:hover {
    background: #ffffff;
    transform: scale(1.08);
}

.hg-gal-prev { left: 10px; top: 50%; transform: translateY(-50%); }
.hg-gal-next { right: 10px; top: 50%; transform: translateY(-50%); }

/* Нижний блок точек галереи и "1/2" */
.hg-gal-dots {
    position: absolute;
    bottom: 12px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 5px;
    z-index: 4;
    background: rgba(15, 23, 42, 0.65);
    padding: 4px 10px;
    border-radius: 14px;
    backdrop-filter: blur(4px);
}

.hg-gal-dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.6);
    transition: all 0.2s;
}

.hg-gal-dot.active {
    background: #ffffff;
    width: 14px;
    border-radius: 3px;
}

.hg-gal-counter {
    font-size: 11px;
    font-weight: 600;
    color: #ffffff;
    margin-left: 4px;
}

/* Кнопка zoom */
.hg-gal-zoom {
    right: 12px;
    bottom: 12px;
    width: 30px;
    height: 30px;
    font-size: 11px;
    background: rgba(15, 23, 42, 0.65);
    color: #ffffff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hg-gal-zoom:hover {
    background: rgba(15, 23, 42, 0.9);
}

/* Описание и текст под фото */
.hg-card-body {
    padding: 16px 18px 18px;
    display: flex;
    flex: 1;
    flex-direction: column;
    background: var(--hg-card-bg, #ffffff);
    font-size: var(--hg-font-size, 13px);
    border-bottom-left-radius: var(--hg-card-radius, 18px);
    border-bottom-right-radius: var(--hg-card-radius, 18px);
}

.hg-card-title {
    margin: 0 0 8px 0;
    color: var(--hg-card-text, #0f172a);
    font-size: calc(var(--hg-font-size, 13px) * 1.15);
    font-weight: 700;
    line-height: 1.35;
}

.hg-card-description {
    color: var(--hg-card-description, #64748b);
    font-size: var(--hg-font-size, 13px);
    line-height: 1.55;
    margin-bottom: 10px;
    word-break: break-word;
}

.hg-card-description p {
    margin: 0 0 6px 0;
}

.hg-card-description p:last-child {
    margin-bottom: 0;
}

.hg-card-description strong, 
.hg-card-description b {
    color: var(--hg-card-text, #0f172a);
    font-weight: 700;
}

/* Счетчик фото */
.hg-card-photo-count {
    font-size: 12px;
    color: #94a3b8;
    margin-top: 4px;
    margin-bottom: 8px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 500;
}

/* PDF */
.hg-card-footer {
    margin-top: auto;
    padding-top: 10px;
    border-top: 1px dashed #e2e8f0;
}

.hg-card-pdf-label {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #94a3b8;
    margin-bottom: 4px;
}

.hg-card-pdf-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #e63946;
    font-size: 12px;
    font-weight: 700;
    text-decoration: none;
    transition: color 0.2s;
}

.hg-card-pdf-link:hover {
    color: #c1121f;
    text-decoration: underline;
}

/* Адаптив */
@media (max-width: 1024px) {
    .hg-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }
}

@media (max-width: 820px) {
    .hg-wrap {
        grid-template-columns: 1fr;
    }
    .hg-sidebar {
        position: fixed;
        top: 0;
        left: -100%;
        height: 100vh;
        width: 280px;
        z-index: 10000;
        background: #fff;
        padding: 20px;
        overflow-y: auto;
        transition: left 0.3s ease;
        box-shadow: 4px 0 24px rgba(0,0,0,0.15);
    }
    .hg-sidebar.mobile-open {
        left: 0;
    }
    .hg-mobile-filter-btn {
        display: block !important;
        position: fixed;
        bottom: 20px;
        right: 20px;
        z-index: 999;
        background: #e63946;
        color: #fff;
        border: none;
        padding: 12px 22px;
        border-radius: 30px;
        font-weight: 600;
        box-shadow: 0 4px 16px rgba(230, 57, 70, 0.4);
        cursor: pointer;
    }
}

@media (max-width: 600px) {
    .hg-grid {
        grid-template-columns: 1fr !important;
    }
}

/* Lightbox */
.hg-lightbox {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.92);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.hg-lightbox.active {
    display: flex;
}
.hg-lightbox img {
    max-width: 90vw;
    max-height: 90vh;
    object-fit: contain;
}
.hg-lightbox-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(255,255,255,0.2);
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 44px;
    height: 44px;
    font-size: 24px;
    cursor: pointer;
}
