/* ═══════════════════════════════════════════════════════════════
   cat.css  –  Catalog of Bulgarian Postage Stamps
   Extra styles layered on top of the main site's style.css
   ═══════════════════════════════════════════════════════════════ */

/* ── Layout ──────────────────────────────────────────────────────────────── */
.cat-main {
    padding-top: 0;
}

/* ── Breadcrumb ──────────────────────────────────────────────────────────── */
.cat-breadcrumb {
    background: #f1f5fb;
    border-bottom: 1px solid #e2e8f0;
    padding: 10px 0;
    font-size: 0.82rem;
    color: #64748b;
}
.cat-breadcrumb .container {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}
.cat-breadcrumb a {
    color: #1976d2;
    text-decoration: none;
}
.cat-breadcrumb a:hover { text-decoration: underline; }
.cat-breadcrumb-sep { color: #94a3b8; }
.cat-breadcrumb-current { color: #374151; font-weight: 500; }

/* ── Hero / Search ───────────────────────────────────────────────────────── */
.cat-hero {
    background: linear-gradient(135deg, #0d1b2a 0%, #1565c0 55%, #1976d2 100%);
    color: #fff;
    padding: 8px 0 15px;
    text-align: center;
}
.cat-hero-title {
    font-size: 1.33rem;
    font-weight: 800;
    margin: 0 0 2px;
    color: #fff;
    letter-spacing: -0.01em;
    line-height: 1.15;
}
.cat-hero-sub {
    font-size: 0.67rem;
    color: #bfdbfe;
    margin: 0 0 2px;
    line-height: 1.3;
}
.cat-hero-stats {
    font-size: 0.57rem;
    color: #93c5fd;
    margin: 0 0 10px;
    line-height: 1.3;
}
.cat-search-form {
    display: flex;
    gap: 0;
    flex: 0 1 307px;
    min-width: 0;
}
.cat-search-input {
    flex: 1;
    padding: 9px 12px;
    font-size: 0.78rem;
    border: none;
    border-radius: 7px 0 0 7px;
    outline: none;
    background: #fff;
    color: #111;
}
.cat-search-btn {
    padding: 9px 15px;
    background: var(--btn-bg, #1976d2);
    color: #fff;
    border: none;
    border-radius: 0 7px 7px 0;
    cursor: pointer;
    font-size: 0.78rem;
    font-weight: 600;
    transition: background 0.18s;
    white-space: nowrap;
}
.cat-search-btn:hover { background: #1455a4; }

/* ── Advanced search button (beside search form) ─────────────────────────── */
.cat-search-wrap {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    max-width: 900px;
    margin: 0 auto;
}
.cat-advsearch-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 8px 12px;
    background: rgba(255,255,255,0.15);
    color: #fff;
    border: 1.5px solid rgba(255,255,255,0.45);
    border-radius: 7px;
    font-size: 0.72rem;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
    transition: background 0.18s, border-color 0.18s;
}
.cat-advsearch-btn:hover {
    background: rgba(255,255,255,0.28);
    border-color: rgba(255,255,255,0.75);
    color: #fff;
    text-decoration: none;
}
@media (max-width: 640px) {
    .cat-search-wrap {
        flex-direction: row;
        flex-wrap: wrap;
        align-items: stretch;
        gap: 8px;
        padding: 0 4px;
    }
    .cat-search-form {
        flex: 1 1 100%;   /* own full-width row */
        width: 100%;
    }
    .cat-advsearch-btn {
        flex: 1 1 0;      /* the two buttons share the next row, side by side */
        text-align: center;
        justify-content: center;
        border-radius: 10px;
    }
}

/* ── Top-level tabs: Postal / Other postal / Non-postal editions ─────────── */
/* Deliberately styled as a segmented control (pill track), not as buttons,
   so it reads as page navigation and isn't confused with the search actions. */
.cat-toplevel-tabs-wrap {
    margin-top: 10px;
    padding-top: 7px;
    border-top: 1px solid rgba(255,255,255,0.18);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 7px;
}
.cat-toplevel-tabs-label {
    font-size: 0.62rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #7fa8d9;
}
.cat-toplevel-tabs {
    display: inline-flex;
    gap: 3px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 999px;
    padding: 4px;
    max-width: 100%;
}
.cat-toplevel-tab {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    border-radius: 999px;
    border: none;
    background: transparent;
    color: #cbdcf5;
    font-size: 0.72rem;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
    transition: background 0.18s, color 0.18s;
}
.cat-toplevel-tab-icon {
    font-size: 0.9em;
}
.cat-toplevel-tab:hover {
    background: rgba(255,255,255,0.1);
    color: #fff;
    text-decoration: none;
}
.cat-toplevel-tab.active {
    background: linear-gradient(180deg, #f2a71b 0%, #ffd400 100%);
    color: #402a00;
    box-shadow: 0 1px 3px rgba(0,0,0,.3);
}
.cat-toplevel-tab.active:hover {
    background: linear-gradient(180deg, #f2a71b 0%, #ffd400 100%);
    color: #402a00;
}
@media (max-width: 640px) {
    .cat-toplevel-tabs {
        flex-wrap: wrap;
        justify-content: center;
        border-radius: 14px;
    }
    .cat-toplevel-tab {
        flex: 1 1 auto;
        justify-content: center;
    }
}

/* ── Empty-state placeholder (coming-soon pages) ──────────────────────────── */
.cat-empty-state {
    padding: 60px 20px;
    text-align: center;
    color: #64748b;
    font-size: 1rem;
}

/* ── Type navigation tabs ────────────────────────────────────────────────── */
.cat-type-nav {
    background: #fff;
    border-bottom: 2px solid #e2e8f0;
    padding: 0;
}

/* Hamburger toggle — visible only on mobile */
.cat-type-nav-toggle {
    display: none;
    width: 100%;
    padding: 11px 16px;
    background: #fff;
    border: none;
    border-bottom: 1px solid #e2e8f0;
    font-size: 0.9rem;
    font-weight: 600;
    color: #1565c0;
    cursor: pointer;
    text-align: left;
    gap: 8px;
    align-items: center;
}
.cat-type-nav-toggle-icon {
    margin-left: auto;
    font-size: 1.1rem;
    transition: transform 0.2s;
    display: inline-block;
}
.cat-type-nav-body {
    /* desktop: always visible */
}

@media (max-width: 768px) {
    .cat-type-nav-toggle {
        display: flex;
    }
    .cat-type-nav-body {
        display: none;
        border-top: 1px solid #f1f5f9;
    }
    .cat-type-nav-body.open {
        display: block;
    }
    .cat-type-nav-toggle.open .cat-type-nav-toggle-icon {
        transform: rotate(180deg);
    }
    .cat-type-nav .container {
        flex-wrap: wrap !important;
        overflow-x: visible;
    }
    .cat-type-tab {
        flex: 1 0 auto;
    }
}
.cat-type-nav .container {
    display: flex;
    flex-wrap: wrap;
    gap: 0;
    overflow-x: visible;
    scrollbar-width: none;
}
.cat-type-nav-row1 {
    border-bottom: 1px solid #f1f5f9;
}
.cat-type-nav-row2 {
    background: #f8fafc;
    flex-wrap: wrap;
}
.cat-type-nav .container::-webkit-scrollbar { display: none; }
.cat-type-tab {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 12px 6px;
    border: none;
    background: none;
    font-size: 0.75rem;
    font-weight: 500;
    color: #64748b;
    cursor: pointer;
    text-decoration: none;
    border-bottom: 3px solid transparent;
    white-space: nowrap;
    transition: color 0.15s, border-color 0.15s;
}
.cat-type-tab-sm {
    padding: 8px 6px;
    font-size: 0.75rem;
}
.cat-type-tab:hover { color: #1976d2; }
.cat-type-tab.active {
    color: #1976d2;
    border-bottom-color: #1976d2;
    font-weight: 700;
}
.cat-type-tab-count {
    background: #e0f2fe;
    color: #0369a1;
    border-radius: 999px;
    padding: 1px 7px;
    font-size: 0.72rem;
    font-weight: 700;
}
/* Subgroup=2 tabs (FDC, Maxicard etc.) */
.cat-type-tab-sub2 {
    color: #7c3aed;
    font-size: 0.8rem;
}
.cat-type-tab-sub2:hover { color: #6d28d9; }
.cat-type-tab-sub2.active {
    color: #7c3aed;
    border-bottom-color: #7c3aed;
}
.cat-type-tab-sub2 .cat-type-tab-count {
    background: #f5f3ff;
    color: #7c3aed;
}
/* Separator between main and subgroup=2 tabs */
.cat-type-tab-sep {
    color: #cbd5e1;
    font-size: 1.2rem;
    line-height: 1;
    align-self: center;
    padding: 0 2px;
    user-select: none;
}

/* ── Type navigation — card style (catbgst.php only) ─────────────────────── */
.cat-type-nav.cat-type-nav-cards {
    background: #eef1f6;
    border-bottom: 2px solid #e2e8f0;
    padding: 10px 0;
}
.cat-type-nav-cards .container {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
    overflow-x: visible;
}
.cat-type-nav-cards .cat-type-tab {
    display: flex;
    align-items: center;
    gap: 7px;
    height: 50px;
    padding: 3px 10px 3px 6px;
    border: 1px solid #e5e9f0;
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 1px 2px rgba(15, 23, 42, .05);
    font-weight: 500;
    box-sizing: border-box;
}
.cat-type-nav-cards .cat-type-tab:hover {
    border-color: #93c5fd;
    box-shadow: 0 2px 6px rgba(15, 23, 42, .1);
    color: #64748b;
}
.cat-type-nav-cards .cat-type-tab.active {
    border-color: #1976d2;
    box-shadow: 0 0 0 2px rgba(25, 118, 210, .18);
}
.cat-type-nav-cards .cat-type-tab-icon {
    flex: 0 0 auto;
    width: 28px;
    height: 28px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    background: #e0f2fe;
}
.cat-type-nav-cards .cat-type-tab-text {
    display: flex;
    flex-direction: column;
    justify-content: center;
    line-height: 1.2;
    min-width: 0;
}
.cat-type-nav-cards .cat-type-tab-label {
    font-size: 0.76rem;
    font-weight: 700;
    color: #1e3a8a;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    white-space: normal;
    word-break: break-word;
}
.cat-type-nav-cards .cat-type-tab-count {
    background: none;
    border-radius: 0;
    padding: 0;
    font-size: 0.66rem;
    font-weight: 500;
    color: #64748b;
}

/* Per-type icon accent colors */
.cat-type-nav-cards .cat-icon-stamp .cat-type-tab-icon         { background: #fef3c7; }
.cat-type-nav-cards .cat-icon-postcover .cat-type-tab-icon     { background: #dbeafe; }
.cat-type-nav-cards .cat-icon-postcard .cat-type-tab-icon      { background: #e0e7ff; }
.cat-type-nav-cards .cat-icon-carnet .cat-type-tab-icon        { background: #dcfce7; }
.cat-type-nav-cards .cat-icon-giftcarnet .cat-type-tab-icon    { background: #fce7f3; }
.cat-type-nav-cards .cat-icon-redovni .cat-type-tab-icon       { background: #ede9fe; }
.cat-type-nav-cards .cat-icon-fdc .cat-type-tab-icon           { background: #fee2e2; }
.cat-type-nav-cards .cat-icon-pechat .cat-type-tab-icon        { background: #cffafe; }
.cat-type-nav-cards .cat-icon-maxicard .cat-type-tab-icon      { background: #d1fae5; }
.cat-type-nav-cards .cat-icon-privatefdc .cat-type-tab-icon    { background: #fef9c3; }
.cat-type-nav-cards .cat-icon-suvenir_zero .cat-type-tab-icon  { background: #ffe4e6; }
.cat-type-nav-cards .cat-icon-privatecarnet .cat-type-tab-icon { background: #e0f2fe; }
.cat-type-nav-cards .cat-icon-skcover .cat-type-tab-icon       { background: #f3e8ff; }
.cat-type-nav-cards .cat-icon-skpostcard .cat-type-tab-icon    { background: #dbeafe; }
.cat-type-nav-cards .cat-icon-artists .cat-type-tab-icon       { background: #fde68a; }

/* Per-type icon accent colors — "Other postal editions" sub-categories */
.cat-type-nav-cards .cat-icon-doplashtane .cat-type-tab-icon         { background: #d1fae5; }
.cat-type-nav-cards .cat-icon-sanatorium .cat-type-tab-icon          { background: #fee2e2; }
.cat-type-nav-cards .cat-icon-koletni .cat-type-tab-icon             { background: #ffedd5; }
.cat-type-nav-cards .cat-icon-obshtinska .cat-type-tab-icon          { background: #e0e7ff; }
.cat-type-nav-cards .cat-icon-dop_uslugi .cat-type-tab-icon          { background: #fef9c3; }
.cat-type-nav-cards .cat-icon-rsr .cat-type-tab-icon                 { background: #cffafe; }
.cat-type-nav-cards .cat-icon-iztochna_rumelia .cat-type-tab-icon    { background: #dbeafe; }
.cat-type-nav-cards .cat-icon-yuzhna_bulgaria .cat-type-tab-icon     { background: #dcfce7; }
.cat-type-nav-cards .cat-icon-zapadna_trakia .cat-type-tab-icon      { background: #ede9fe; }
.cat-type-nav-cards .cat-icon-mezhdusayuznicheska .cat-type-tab-icon { background: #fce7f3; }
.cat-type-nav-cards .cat-icon-makedonia .cat-type-tab-icon           { background: #ffe4e6; }

@media (max-width: 900px) {
    .cat-type-nav-cards .container {
        grid-template-columns: repeat(4, 1fr);
    }
}
@media (max-width: 768px) {
    .cat-type-nav-cards .container {
        grid-template-columns: repeat(3, 1fr) !important;
    }
}
@media (max-width: 640px) {
    .cat-type-nav-cards .container {
        grid-template-columns: repeat(2, 1fr) !important;
    }
    .cat-type-nav-cards .cat-type-tab { padding: 6px 9px 6px 5px; font-size: 0.76rem; }
}

/* ── Section title ────────────────────────────────────────────────────────── */
.cat-section {
    padding: 2px 0;
}
.cat-section-title {
    font-size: 1.0rem;
    font-weight: 700;
    color: #111827;
    margin-bottom: 6px;
    padding-bottom: 4px;
    border-bottom: 2px solid #e2e8f0;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ── Years grid ──────────────────────────────────────────────────────────── */
.year-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 14px;
}
.year-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    transition: box-shadow 0.18s, transform 0.18s, border-color 0.18s;
    display: flex;
    flex-direction: column;
}
.year-card:hover {
    box-shadow: 0 6px 24px rgba(15,23,42,0.13);
    transform: translateY(-3px);
    border-color: #93c5fd;
    color: inherit;
    text-decoration: none;
}
.year-card-img {
    width: 100%;
    height: 110px;
    object-fit: contain;
    background: #f8fafc;
    border-bottom: 1px solid #f1f5f9;
    padding: 6px;
}
.year-card-img-placeholder {
    width: 100%;
    height: 110px;
    background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: #94a3b8;
    border-bottom: 1px solid #f1f5f9;
}
.year-card-body {
    padding: 12px;
    flex: 1;
    text-align: center;
}
.year-card-num {
    font-size: 1.5rem;
    font-weight: 800;
    color: #1565c0;
    line-height: 1;
    margin-bottom: 4px;
}
.year-card-stats {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    flex-wrap: wrap;
}
.year-card-meta {
    font-size: 0.76rem;
    color: #64748b;
}
.year-card-badge {
    display: inline-block;
    background: #dbeafe;
    color: #1e40af;
    border-radius: 999px;
    padding: 1px 8px;
    font-size: 0.7rem;
    font-weight: 600;
    margin-top: 4px;
}

/* ── Stamp group cards (year page) ───────────────────────────────────────── */
.stamp-groups {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.stamp-group-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 16px;
    display: flex;
    gap: 16px;
    align-items: flex-start;
    text-decoration: none;
    color: inherit;
    transition: box-shadow 0.18s, border-color 0.18s;
}
.stamp-group-card:hover {
    box-shadow: 0 4px 18px rgba(15,23,42,0.11);
    border-color: #93c5fd;
    text-decoration: none;
    color: inherit;
}
.stamp-group-thumb {
    flex: 0 0 90px;
    width: 90px;
    height: 100px;
    object-fit: contain;
    background: #f8fafc;
    border-radius: 6px;
    border: 1px solid #e9ecef;
}
.stamp-group-thumb-placeholder {
    flex: 0 0 90px;
    width: 90px;
    height: 100px;
    background: #f1f5f9;
    border-radius: 6px;
    border: 1px solid #e9ecef;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    color: #94a3b8;
}
.stamp-group-info {
    flex: 1;
    min-width: 0;
}
.stamp-group-title {
    font-size: 1rem;
    font-weight: 600;
    color: #111827;
    margin-bottom: 4px;
    line-height: 1.3;
}
.stamp-group-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 14px;
    margin-top: 6px;
}
.stamp-group-meta-item {
    font-size: 0.8rem;
    color: #64748b;
    display: flex;
    align-items: center;
    gap: 3px;
}
.stamp-group-meta-item strong {
    color: #374151;
    font-weight: 600;
}
.stamp-group-bk {
    display: inline-block;
    background: #eff6ff;
    color: #1e40af;
    border-radius: 5px;
    padding: 2px 8px;
    font-size: 0.78rem;
    font-weight: 700;
    border: 1px solid #bfdbfe;
}
.stamp-group-type-badge {
    display: inline-block;
    background: #f0fdf4;
    color: #166534;
    border-radius: 5px;
    padding: 2px 8px;
    font-size: 0.75rem;
    font-weight: 600;
    border: 1px solid #bbf7d0;
}
.stamp-group-year-badge {
    display: inline-block;
    background: #fff7ed;
    color: #9a3412;
    border-radius: 5px;
    padding: 2px 8px;
    font-size: 0.78rem;
    font-weight: 700;
    border: 1px solid #fed7aa;
    text-decoration: none;
}
.stamp-group-year-badge:hover {
    background: #ffedd5;
    text-decoration: none;
}
.stamp-group-prices {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}
.price-tag {
    background: #fefce8;
    color: #713f12;
    border: 1px solid #fde68a;
    border-radius: 6px;
    padding: 2px 9px;
    font-size: 0.77rem;
    font-weight: 600;
}
.price-tag-label {
    font-weight: 400;
    color: #92400e;
    font-size: 0.72rem;
}

/* ── Extra info accordion (cattemismall.php "Допълнителна информация") ────── */
.cat-extra-info {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    margin-top: 24px;
    overflow: hidden;
}
.cat-extra-info > summary {
    list-style: none;
    cursor: pointer;
    user-select: none;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 20px;
    font-size: 0.95rem;
    font-weight: 700;
    color: #111827;
    transition: background 0.15s;
}
.cat-extra-info > summary::-webkit-details-marker { display: none; }
.cat-extra-info > summary:hover { background: #f8fafc; }
.cat-extra-info > summary .cei-icon {
    font-size: 1.05rem;
    flex-shrink: 0;
}
.cat-extra-info > summary .cei-chevron {
    margin-left: auto;
    font-size: 0.75rem;
    color: #94a3b8;
    transition: transform 0.18s;
    flex-shrink: 0;
}
.cat-extra-info[open] > summary .cei-chevron { transform: rotate(180deg); }
.cat-extra-info[open] > summary { border-bottom: 1px solid #e2e8f0; }
.cat-extra-info-body {
    padding: 16px 20px 20px;
    font-size: 0.88rem;
    color: #374151;
    line-height: 1.7;
}

/* ── Stamp detail page ───────────────────────────────────────────────────── */
.stamp-detail-header {
    background: linear-gradient(135deg, #0d1b2a, #1565c0);
    color: #fff;
    padding: 6px 0;
}
.stamp-detail-header-inner {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    flex-wrap: wrap;
}
.stamp-detail-header-img {
    flex: 0 0 auto;
    max-width: 150px;
}
.stamp-detail-header-img img {
    width: 150px;
    max-height: 175px;
    object-fit: contain;
    border-radius: 6px;
    background: rgba(255,255,255,0.1);
    padding: 4px;
    border: 1px solid #222;
}
.stamp-detail-header-img.multi {
    display: grid;
    align-content: flex-start;
    gap: 4px;
}
.stamp-detail-header-img.multi img {
    border-radius: 4px;
    padding: 2px;
}
.stamp-detail-header-text {
    flex: 1;
    min-width: 0;
}
.stamp-detail-header-text h2 {
    font-size: 0.9rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 2px;
}
.stamp-detail-header-text .stamp-date {
    color: #bfdbfe;
    font-size: 0.85rem;
    margin-bottom: 6px;
}

/* Emission items grid — one card per row */
.emission-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 6px;
    margin-top: 8px;
}
.emission-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(15,23,42,0.05);
    transition: box-shadow 0.18s;
    display: flex;
    flex-direction: row;
    align-items: stretch;
}
.emission-card:hover {
    box-shadow: 0 4px 14px rgba(15,23,42,0.11);
}
.emission-card-img-wrap {
    background: #f8fafc;
    padding: 6px;
    text-align: center;
    border-right: 1px solid #f1f5f9;
    min-width: 90px;
    max-width: 110px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}
.emission-card-img-wrap img {
    max-width: 100%;
    max-height: 120px;
    object-fit: contain;
    cursor: pointer;
    border: 1px solid #222;
    border-radius: 4px;
}
.emission-card-body {
    padding: 6px 10px;
    flex: 1;
    min-width: 0;
}
.emission-card-bk {
    font-size: 0.8rem;
    font-weight: 700;
    color: #1e40af;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 5px;
    padding: 1px 6px;
    display: inline-block;
    margin-bottom: 4px;
}
.emission-card-type {
    font-size: 0.76rem;
    color: #166534;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 5px;
    padding: 1px 6px;
    display: inline-block;
    margin-left: 4px;
    margin-bottom: 4px;
}
.emission-detail-table {
    width: 100%;
    font-size: 0.78rem;
    border-collapse: collapse;
}
.emission-detail-table tr td {
    padding: 0px 0;
    vertical-align: top;
    color: #374151;
}
.emission-detail-table tr td:first-child {
    color: #64748b;
    width: 92px;
    white-space: nowrap;
    font-size: 0.74rem;
    padding-right: 6px;
}
.emission-price-row {
    margin-top: 6px;
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}
.emission-price-new  { background: #f0fdf4; color: #14532d; border: 1px solid #86efac; }
.emission-price-used { background: #fef9c3; color: #713f12; border: 1px solid #fde047; }
.emission-price-mint { background: #eff6ff; color: #1e3a5f; border: 1px solid #93c5fd; }

/* Notes / zab section */
.stamp-notes {
    background: #f8fafc;
    border-left: 4px solid #1976d2;
    border-radius: 0 8px 8px 0;
    padding: 14px 16px;
    font-size: 0.85rem;
    color: #374151;
    line-height: 1.7;
    margin-top: 8px;
}

/* Michel number badge */
.michel-badge {
    display: inline-block;
    background: #fef3c7;
    color: #78350f;
    border: 1px solid #fcd34d;
    border-radius: 5px;
    padding: 2px 8px;
    font-size: 0.78rem;
    font-weight: 700;
}

/* ── Search page ─────────────────────────────────────────────────────────── */
.cat-search-panel {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 24px;
}
.cat-search-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 14px;
}
.cat-form-group label {
    display: block;
    font-size: 0.82rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 4px;
}
.cat-form-group input, .cat-form-group select {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 0.9rem;
    color: #111;
    background: #fff;
    outline: none;
    transition: border-color 0.15s;
}
.cat-form-group input:focus, .cat-form-group select:focus {
    border-color: #1976d2;
    box-shadow: 0 0 0 3px rgba(25,118,210,0.12);
}
.cat-search-actions {
    display: flex;
    gap: 10px;
    margin-top: 16px;
    flex-wrap: wrap;
}
.cat-results-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    font-size: 0.85rem;
    box-shadow: 0 1px 4px rgba(15,23,42,0.06);
}
.cat-results-table thead th {
    background: #1565c0;
    color: #fff;
    padding: 12px 14px;
    text-align: left;
    font-weight: 600;
    font-size: 0.8rem;
    white-space: nowrap;
}
.cat-results-table tbody tr {
    border-bottom: 1px solid #f1f5f9;
    transition: background 0.12s;
}
.cat-results-table tbody tr:hover { background: #f8faff; }
.cat-results-table td {
    padding: 10px 14px;
    color: #374151;
    vertical-align: middle;
}
.cat-results-table td.td-img {
    width: 64px;
    text-align: center;
}
.cat-results-table td.td-img img {
    width: 54px;
    height: 60px;
    object-fit: contain;
    border-radius: 4px;
    background: #f8fafc;
    border: 1px solid #222;
}
.cat-results-table a {
    color: #1976d2;
    text-decoration: none;
    font-weight: 500;
}
.cat-results-table a:hover { text-decoration: underline; }
.cat-no-results {
    text-align: center;
    padding: 48px;
    color: #64748b;
    font-size: 1rem;
    background: #fff;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
}

/* ── Pagination ──────────────────────────────────────────────────────────── */
.cat-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    margin-top: 24px;
    flex-wrap: wrap;
}
.cat-pagination a, .cat-pagination span {
    padding: 7px 14px;
    border-radius: 8px;
    font-size: 0.85rem;
    text-decoration: none;
    font-weight: 500;
    border: 1px solid #e2e8f0;
    color: #374151;
    background: #fff;
    transition: background 0.15s;
}
.cat-pagination a:hover { background: #eff6ff; color: #1976d2; border-color: #93c5fd; }
.cat-pagination .current {
    background: #1976d2;
    color: #fff;
    border-color: #1976d2;
    cursor: default;
}
.cat-pagination .disabled { opacity: 0.4; pointer-events: none; cursor: default; }

/* ── Utilities ───────────────────────────────────────────────────────────── */
.cat-back-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #64748b;
    font-size: 0.85rem;
    text-decoration: none;
    padding: 6px 12px;
    border-radius: 7px;
    border: 1px solid #e2e8f0;
    background: #fff;
    transition: background 0.15s, color 0.15s;
    margin-bottom: 16px;
}
.cat-back-btn:hover { background: #f1f5f9; color: #1976d2; text-decoration: none; }
.cat-count-badge {
    background: #e0f2fe;
    color: #0369a1;
    border-radius: 999px;
    padding: 2px 10px;
    font-size: 0.78rem;
    font-weight: 700;
}

/* ── Expanded stamp-group card (catyears.php new layout) ─────────────────── */
.stamp-group-card.sgc-expanded {
    flex-direction: column;
    gap: 0;
    align-items: stretch;
    padding: 0;
    overflow: hidden;
    cursor: default;
    text-decoration: none;
    color: inherit;
    border: 2px solid #bfdbfe;
    border-left: 5px solid #1976d2;
    box-shadow: 0 2px 8px rgba(25,118,210,0.08);
}
.stamp-group-card.sgc-expanded:hover {
    box-shadow: 0 6px 22px rgba(25,118,210,0.18);
    border-color: #1976d2;
    border-left-color: #1565c0;
}

/* Card header */
.sgc-header {
    padding: 7px 14px 6px;
    background: linear-gradient(to right, #e8f0fe, #f0f7ff);
    border-bottom: 2px solid #bfdbfe;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 5px;
}
.sgc-title {
    font-size: 0.9rem;
    font-weight: 700;
    color: #1565c0;
    text-decoration: none;
    flex: 1 1 0;
    min-width: 0;
    line-height: 1.35;
}
.sgc-title:hover { color: #0d47a1; text-decoration: underline; }
.sgc-badges {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}
.sgc-date {
    font-size: 0.78rem;
    font-weight: 700;
    color: #fff;
    background: #d97706;
    border: 1px solid #b45309;
    border-radius: 6px;
    padding: 2px 8px;
    white-space: nowrap;
}

/* Type-level announcement, shown above the year grid on ?type=... */
.dop-type-announce {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    background: #fffbeb;
    border: 1px solid #fcd34d;
    border-left: 4px solid #d97706;
    border-radius: 10px;
    padding: 14px 18px;
    color: #92400e;
}
.dop-type-announce-icon {
    font-size: 1.1rem;
    flex-shrink: 0;
    line-height: 1.4;
}
.dop-type-announce-text {
    font-size: 0.92rem;
    line-height: 1.5;
    flex: 1;
    min-width: 0;
    text-align: justify;
}
.dop-type-announce-imgs {
    margin-left: auto;
    flex-shrink: 0;
}

/* Card body */
.sgc-body {
    display: flex;
    gap: 0;
    align-items: stretch;
}

/* Thumbnail image grid — ALWAYS same 296px column, 3 per row */
.sgc-images,
.sgc-images.sgc-images-wide,
.sgc-images.sgc-images--few {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    align-content: center;
    gap: 4px;
    padding: 8px 8px;
    background: #f8fafc;
    border-right: 1px solid #f1f5f9;
    flex: 0 0 296px;   /* fixed: 3×88px + 2×6px gap + 2×10px padding */
    box-sizing: border-box;
}
/* 1-2 images: larger thumbnails, still in same 296px column */
.sgc-images.sgc-images--few .sgc-img-wrap {
    flex: 0 0 130px;
    width: 130px;
}
.sgc-images.sgc-images--few .sgc-img {
    width: 130px;
    height: auto;
    max-height: 180px;
}
.sgc-img-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    flex: 0 0 88px;
    width: 88px;
    overflow: hidden;
}
.sgc-img {
    width: 88px;
    height: auto;
    max-height: 110px;
    object-fit: contain;
    background: #fff;
    border-radius: 6px;
    border: 1px solid #222;
    cursor: zoom-in;
    transition: border-color 0.15s, transform 0.15s, box-shadow 0.15s;
    display: block;
}
.sgc-img:hover {
    border-color: #1976d2;
    transform: scale(1.06);
    box-shadow: 0 2px 8px rgba(25,118,210,0.18);
}
/* /images/missingimg.jpg на catyears.php?type=postcover — винаги еднакъв размер,
   независимо дали групата е в "few" (1-2 снимки, 130px) или "wide" (3+, 88px) режим. */
.sgc-img-wrap.sgc-img-wrap--placeholder,
.sgc-images--few .sgc-img-wrap.sgc-img-wrap--placeholder {
    flex: 0 0 88px !important;
    width: 88px !important;
}
.sgc-img.sgc-img--placeholder,
.sgc-images--few .sgc-img.sgc-img--placeholder {
    width: 88px !important;
    height: 88px !important;
    max-height: 88px !important;
    object-fit: contain;
}
.sgc-img-bk {
    font-size: 0.78rem;
    color: #64748b;
    font-weight: 700;
    text-align: center;
    line-height: 1.2;
}
.sgc-img-michel {
    font-size: 0.72rem;
    color: #94a3b8;
    text-align: center;
    line-height: 1.2;
    font-style: italic;
}

/* Right panel: price table + detail link */
.sgc-right {
    flex: 1;
    min-width: 0;
    padding: 8px 12px;
}

/* Group price table */
.group-price-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.72rem;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    overflow: hidden;
}
.group-price-table thead th {
    background: #1976d2;
    color: #fff;
    font-weight: 700;
    padding: 3px 6px;
    text-align: left;
    border-bottom: 2px solid #1565c0;
    font-size: 0.68rem;
    white-space: nowrap;
}
.group-price-table tbody tr {
    border-bottom: 1px solid #e9ecef;
    transition: background 0.1s;
}
.group-price-table tbody tr:hover { background: #f0f7ff; }
.group-price-table tbody td {
    padding: 2px 6px;
    color: #374151;
    vertical-align: middle;
}
.group-price-table td.gpt-price {
    text-align: center;
    font-variant-numeric: tabular-nums;
    font-size: 0.76rem;
    color: #14532d;
    font-weight: 700;
    white-space: nowrap;
    background: #f0fdf4;
}
.group-price-table thead th {
    text-align: center;
}
.group-price-table .stamp-group-bk {
    font-size: 0.66rem;
    padding: 1px 5px;
    white-space: nowrap;
}
.group-price-table tfoot .gpt-total td {
    padding: 3px 6px;
    border-top: 2px solid #bfdbfe;
    background: #e8f0fe;
    font-weight: 700;
    color: #111827;
}
.group-price-table tfoot .gpt-total td.gpt-price {
    font-size: 0.78rem;
    color: #1565c0;
    background: #dbeafe;
}
.group-price-table tbody tr.gpt-kurioz td {
    color: #dc2626;
    font-style: italic;
}
.gpt-nominal {
    font-size: 0.78rem;
    font-style: italic;
    color: #6b7280;
    font-weight: 500;
}

/* Wraps the meta info strip and the extra group images box side by side */
.sgc-meta-extra-wrap {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    margin-bottom: 6px;
}
.sgc-meta-extra-wrap > .sgc-meta-info { flex: 1; min-width: 0; margin-bottom: 0; }

/* Extra group images box (admin-managed, per group, with BG/EN captions) */
.sgc-extra-imgs {
    flex: 0 0 auto;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-content: flex-start;
    max-width: 220px;
    background: #f8fafc;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    padding: 8px;
}
.sgc-extra-img-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    width: 72px;
}
/* Type description images (?type=... announce box), desktop/tablet only (≥771px):
   3 columns once there are more than 4 photos, 4 columns once there are more than 6. */
@media (min-width: 771px) {
    .sgc-extra-imgs.dop-type-announce-imgs:has(.sgc-extra-img-item:nth-child(5)) {
        max-width: 258px;
    }
    .sgc-extra-imgs.dop-type-announce-imgs:has(.sgc-extra-img-item:nth-child(7)) {
        max-width: 338px;
    }
}
/* Mobile (≤770px): let the type description photos flow left-to-right and wrap onto
   as many rows as the screen width needs (natural row-wrap, not a fixed column count). */
@media (max-width: 770px) {
    .sgc-extra-imgs.dop-type-announce-imgs {
        flex-direction: row;
        justify-content: center;
        max-width: 100%;
    }
}
.sgc-extra-img {
    width: 72px;
    height: 72px;
    object-fit: contain;
    background: #fff;
    border: 1px solid #222;
    border-radius: 6px;
    cursor: zoom-in;
    display: block;
    transition: border-color 0.15s, transform 0.15s, box-shadow 0.15s;
}
.sgc-extra-img:hover {
    border-color: #1976d2;
    transform: scale(1.06);
    box-shadow: 0 2px 8px rgba(25,118,210,0.18);
}
.sgc-extra-img-cap {
    font-size: 0.68rem;
    color: #64748b;
    text-align: center;
    line-height: 1.2;
    word-break: break-word;
}

/* Meta info strip (artist / perf / paper / circ) above price table */
.sgc-meta-info {
    display: flex;
    flex-wrap: wrap;
    gap: 0;
    flex-direction: column;
    background: #f8fafc;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    padding: 4px 10px;
    margin-bottom: 6px;
    font-size: 0.78rem;
}
.sgc-meta-row {
    display: block;
    padding: 1px 0;
    color: #374151;
    border-bottom: 1px dotted #e2e8f0;
    line-height: 1.5;
}
.sgc-meta-row > span:not(.sgc-meta-label),
.sgc-meta-row > a.sgc-meta-artist {
    overflow-wrap: break-word;
    word-break: break-word;
}
.sgc-meta-row:last-child { border-bottom: none; }
.sgc-desc-more {
    display: inline;
    margin-left: 4px;
    color: #1976d2;
    font-size: 0.76rem;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
}
.sgc-desc-more:hover { text-decoration: underline; }

/* ── Related items strip (subgroup 2) ───────────────────────────────────── */
.sgc-related-details > summary {
    cursor: pointer;
    font-size: 0.82rem;
    font-weight: 700;
    color: #7c3aed;
    padding: 2px 0;
    user-select: none;
    list-style: none;
    display: flex;
    align-items: center;
    gap: 5px;
}
.sgc-related-details > summary::before {
    content: '\25B6';
    font-size: 0.65rem;
    transition: transform 0.18s;
    display: inline-block;
}
.sgc-related-details[open] > summary::before {
    transform: rotate(90deg);
}
.sgc-related-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding: 8px 0 4px;
    align-items: flex-start;
}
.sgc-related-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    width: 80px !important;
    max-width: 80px !important;
    flex: 0 0 80px !important;
    min-width: 0;
}
.sgc-related-item img {
    width: 80px !important;
    max-width: 80px !important;
    height: auto;
    max-height: 100px;
    object-fit: contain;
    border: 1px solid #ddd;
    border-radius: 5px;
    background: #fff;
    cursor: zoom-in;
    transition: border-color 0.15s, transform 0.15s;
    display: block;
    flex-shrink: 0;
}
.sgc-related-item img:hover {
    border-color: #7c3aed;
    transform: scale(1.06);
}
.sgc-related-noimg {
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    background: #f3f4f6;
    border-radius: 5px;
    border: 1px solid #e5e7eb;
}
.sgc-related-type {
    font-size: 0.68rem;
    color: #7c3aed;
    font-weight: 700;
    text-align: center;
    background: #f5f3ff;
    border: 1px solid #ddd6fe;
    border-radius: 4px;
    padding: 1px 5px;
    max-width: 80px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.sgc-meta-label {
    font-weight: 700;
    color: #1e40af;
    font-size: 0.76rem;
    white-space: nowrap;
    display: inline;
    margin-right: 4px;
}
.sgc-meta-artist {
    color: #1976d2;
    text-decoration: none;
    font-weight: 500;
}
.sgc-meta-artist:hover { text-decoration: underline; }
.cat-kw-link {
    color: #1976d2;
    cursor: pointer;
    text-decoration: underline dotted;
    text-underline-offset: 2px;
    font-weight: 600;
}
.cat-kw-link:hover { text-decoration-style: solid; background: #eff6ff; }
.sgc-meta-details {
    flex: 1;
    min-width: 0;
}
.sgc-meta-details summary {
    cursor: pointer;
    color: #1e40af;
    font-weight: 700;
    font-size: 0.76rem;
    user-select: none;
    list-style: none;
    display: flex;
    align-items: center;
    gap: 4px;
}
.sgc-meta-details summary::-webkit-details-marker { display: none; }
.sgc-meta-details summary::before {
    content: '\25B6';
    font-size: 0.6rem;
    color: #94a3b8;
    transition: transform 0.15s;
    display: inline-block;
    flex-shrink: 0;
}
.sgc-meta-details[open] summary::before {
    transform: rotate(90deg);
}
.sgc-meta-details-text {
    display: block;
    margin-top: 4px;
    font-size: 0.8rem;
    color: #374151;
    padding-left: 14px;
    line-height: 1.5;
}
.sgc-detail-link {
    margin-top: 12px;
    text-align: right;
}
.sgc-detail-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: #fff;
    background: #1976d2;
    font-size: 0.72rem;
    font-weight: 600;
    text-decoration: none;
    padding: 4px 10px;
    border-radius: 6px;
    border: 1px solid #1976d2;
    transition: background 0.15s, border-color 0.15s, box-shadow 0.15s;
}
.sgc-detail-btn:hover {
    background: #125ea3;
    border-color: #125ea3;
    color: #fff;
    text-decoration: none;
    box-shadow: 0 2px 8px rgba(25,118,210,0.3);
}

/* ── On This Date page — year divider ───────────────────────────────────── */
.otd-year-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 32px 0 12px;
    padding-bottom: 6px;
    border-bottom: 2px solid #1565c0;
}
.otd-year-link {
    font-size: 1.2rem;
    font-weight: 800;
    color: #1565c0;
    text-decoration: none;
}
.otd-year-link:hover { text-decoration: underline; }
.otd-year-count {
    font-size: .83rem;
    color: #94a3b8;
    background: #f1f5fb;
    border: 1px solid #dbe6f5;
    border-radius: 10px;
    padding: 1px 8px;
}

/* ── Responsive ──────────────────────────────────────────────────────────── */

/* ── SGC card: images stack ABOVE info on tablets & phones (≤900px) ─────── */
@media (max-width: 900px) {
    .sgc-body {
        flex-direction: column !important;
        align-items: flex-start !important;
    }
    .sgc-images,
    .sgc-images.sgc-images-mid,
    .sgc-images.sgc-images-wide,
    .sgc-images.sgc-images--few {
        order: 0 !important;
        display: flex !important;
        flex-direction: row !important;
        flex-wrap: wrap !important;
        justify-content: center !important;
        align-content: flex-start !important;
        width: 100% !important;
        flex: 0 0 auto !important;
        border-right: none !important;
        border-bottom: 1px solid #f1f5f9;
        padding: 8px 10px !important;
    }
    .sgc-right {
        order: 1 !important;
        width: 100% !important;
    }

    /* ── search_stamps.php result cards use a different wrapper (.stamp-group-card
       with .sgc-images + .stamp-group-info as direct flex children) — the fixed
       296px image column (see .sgc-images above, now 100% wide) squeezed
       .stamp-group-info between 641–900px. Stack them the same way as the
       .sgc-body cards above. ── */
    .stamp-group-card {
        flex-direction: column !important;
        align-items: stretch !important;
    }
    .stamp-group-info {
        width: 100% !important;
        box-sizing: border-box;
    }
}

@media (min-width: 641px) and (max-width: 770px) {
    .dop-type-announce { flex-direction: column; }
    .dop-type-announce-imgs { margin-left: 0; max-width: 100%; }
}

@media (max-width: 640px) {
    .cat-hero-title { font-size: 0.93rem; }
    .year-grid { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
    .stamp-group-card { flex-direction: column; }
    .stamp-group-thumb, .stamp-group-thumb-placeholder { width: 100%; height: 160px; flex: 0 0 auto; }
    .stamp-detail-header-img img { width: 150px; }
    .stamp-detail-header-inner {
        flex-direction: column;
        align-items: stretch;
    }
    .stamp-detail-header-img {
        max-width: 100% !important;
        width: 100%;
        margin: 0;
    }
    .stamp-detail-header-img:not(.multi) img {
        display: block;
        margin: 0 auto;
    }
    /* Multiple images: fill the top row edge-to-edge, wrapping to a new row
       only once it no longer fits — not a fixed column grid. */
    .stamp-detail-header-img.multi {
        display: flex !important;
        flex-wrap: wrap;
        width: 100%;
    }
    .stamp-detail-header-img.multi img {
        width: auto !important;
        flex: 1 1 70px;
        max-height: 100px !important;
    }
    .stamp-detail-header-text {
        width: 100%;
    }
    .emission-grid { grid-template-columns: 1fr; }
    .emission-card { flex-direction: column; }
    .emission-card-img-wrap { max-width: 100%; border-right: none; border-bottom: 1px solid #f1f5f9; min-width: 0; max-height: 220px; }
    .cat-search-grid { grid-template-columns: 1fr; }
    .cat-type-tab { padding: 10px 14px; font-size: 0.82rem; }
    .sgc-header { flex-direction: column; align-items: flex-start; }
    .sgc-meta-extra-wrap { flex-direction: column; }
    .sgc-extra-imgs { max-width: 100%; }
    .dop-type-announce { flex-direction: column; }
    .dop-type-announce-imgs { margin-left: 0; max-width: 100%; }
    .sgc-right { padding: 10px 12px; }
    .group-price-table { font-size: 0.62rem; }
    .group-price-table thead th { font-size: 0.58rem; padding: 2px 4px; }
    .group-price-table tbody td { padding: 2px 4px; }
    .group-price-table td.gpt-price { font-size: 0.65rem; }
    .group-price-table .stamp-group-bk { font-size: 0.58rem; padding: 1px 3px; }
    .group-price-table tfoot .gpt-total td { padding: 2px 4px; }
    .group-price-table tfoot .gpt-total td.gpt-price { font-size: 0.65rem; }
    /* Old-style tables (≤1886) have 6 columns — shrink further + allow scroll */
    .group-price-table--old { font-size: 0.55rem; display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }
    .group-price-table--old thead th,
    .group-price-table--old tbody td,
    .group-price-table--old tfoot td { padding: 2px 3px; }

    /* Search page – hide less important columns on mobile */
    .cat-col-sm-hide { display: none; }

    /* Search panel – compact padding */
    .cat-search-panel { padding: 14px; }
    .cat-search-actions { gap: 8px; }
    .cat-search-actions .btn { flex: 1 1 0; text-align: center; justify-content: center; }

    /* Results table – tighten cells on mobile */
    .cat-results-table td { padding: 8px 8px; font-size: 0.8rem; }
    .cat-results-table thead th { padding: 8px 8px; }
    .cat-results-table td.td-img img { width: 44px; height: 50px; }
}

/* ── Language switcher ─────────────────────────────────────────────────────── */
.cat-lang-switcher {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-left: auto;
    flex-shrink: 0;
}
.cat-lang-btn {
    display: inline-block;
    padding: 5px 12px;
    border-radius: 5px;
    font-size: 0.82rem;
    font-weight: 700;
    text-decoration: none;
    color: rgba(255,255,255,0.80);
    border: 1.5px solid rgba(255,255,255,0.35);
    background: rgba(255,255,255,0.12);
    transition: background 0.15s, color 0.15s, border-color 0.15s;
    letter-spacing: 0.05em;
}
.cat-lang-btn:hover {
    background: rgba(255,255,255,0.25);
    color: #fff;
    border-color: rgba(255,255,255,0.6);
}
.cat-lang-btn.active {
    background: #fff;
    color: #1565c0;
    border-color: #fff;
    font-weight: 800;
}

/* ═══════════════════════════════════════════════════════════════
   Artists page  (artists.php)
   ═══════════════════════════════════════════════════════════════ */

/* Hero search row */
.artists-hero { padding-bottom: 28px; }

.artists-search-wrap {
    display: flex;
    align-items: center;
    gap: 14px;
    max-width: 520px;
    margin: 0 auto;
    flex-wrap: wrap;
    justify-content: center;
}
.artists-search-input {
    flex: 1;
    min-width: 200px;
    padding: 12px 18px;
    font-size: 0.96rem;
    border: none;
    border-radius: 10px;
    outline: none;
    background: #fff;
    color: #111;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}
.artists-total-badge {
    background: rgba(255,255,255,0.18);
    border: 1px solid rgba(255,255,255,0.35);
    color: #fff;
    border-radius: 999px;
    padding: 6px 16px;
    font-size: 0.82rem;
    font-weight: 600;
    white-space: nowrap;
}
.artists-stats-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(255,255,255,0.18);
    border: 1px solid rgba(255,255,255,0.35);
    color: #fff;
    border-radius: 999px;
    padding: 6px 16px;
    font-size: 0.82rem;
    font-weight: 600;
    white-space: nowrap;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.15s, transform 0.15s;
}
.artists-stats-btn:hover {
    background: rgba(255,255,255,0.32);
    transform: translateY(-1px);
}

/* ── Artist stats (ranking) page ─────────────────────────────────────────── */
.artist-stats-back {
    display: inline-block;
    margin-bottom: 16px;
    font-size: 0.85rem;
    font-weight: 600;
    color: #1565c0;
    text-decoration: none;
}
.artist-stats-back:hover { text-decoration: underline; }
.artist-stats-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 820px;
    margin: 0 auto;
}
.artist-stats-row {
    display: flex;
    align-items: center;
    gap: 14px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 10px 16px;
    text-decoration: none;
    color: inherit;
    transition: box-shadow 0.15s, transform 0.15s;
}
.artist-stats-row:hover {
    box-shadow: 0 4px 14px rgba(0,0,0,0.08);
    transform: translateY(-1px);
}
.artist-stats-rank {
    flex: 0 0 34px;
    height: 34px;
    border-radius: 50%;
    background: #eef2f7;
    color: #374151;
    font-weight: 800;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    justify-content: center;
}
.artist-stats-rank.r1 { background: #fde68a; color: #92400e; }
.artist-stats-rank.r2 { background: #e5e7eb; color: #374151; }
.artist-stats-rank.r3 { background: #fed7aa; color: #9a3412; }
.artist-stats-body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 5px;
}
.artist-stats-name {
    font-weight: 700;
    color: #111827;
    font-size: 0.92rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.artist-stats-bar-track {
    background: #eef2f7;
    border-radius: 6px;
    height: 8px;
    overflow: hidden;
}
.artist-stats-bar-fill {
    display: block;
    height: 100%;
    background: linear-gradient(90deg, #1976d2, #1565c0);
    border-radius: 6px;
}
.artist-stats-count {
    flex: 0 0 auto;
    font-weight: 800;
    color: #1565c0;
    font-size: 1rem;
    min-width: 52px;
    text-align: right;
}

/* Grid */
.artists-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 16px;
}

/* Card */
.artist-card {
    border-radius: 14px;
    background: #fff;
    border: 1.5px solid #e2e8f0;
    overflow: hidden;
    transition: box-shadow 0.18s, border-color 0.18s, transform 0.15s;
}
.artist-card:hover {
    box-shadow: 0 6px 22px rgba(15,23,42,0.12);
    border-color: #93c5fd;
    transform: translateY(-2px);
}
.artist-card-link {
    display: flex;
    align-items: center;
    gap: 0;
    padding: 0;
    text-decoration: none;
    color: inherit;
    min-height: 80px;
}

/* Avatar / preview image */
.artist-card-avatar {
    flex: 0 0 76px;
    width: 76px;
    height: 86px;
    overflow: hidden;
    background: #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: center;
    border-right: 1.5px solid #f1f5f9;
    position: relative;
}
.artist-card-avatar img {
    width: 76px;
    height: 86px;
    object-fit: contain;
    background: #f8fafc;
}

/* Colourful initials fallback */
.artist-card-initials {
    width: 76px;
    height: 86px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.9rem;
    font-weight: 800;
    color: #fff;
    background: hsl(var(--ac-hue, 220), 55%, 50%);
    letter-spacing: -0.02em;
    user-select: none;
}

/* Text body */
.artist-card-body {
    flex: 1;
    padding: 10px 12px;
    min-width: 0;
}
.artist-card-name {
    font-size: 0.9rem;
    font-weight: 700;
    color: #111827;
    line-height: 1.4;
    word-break: break-word;
    overflow-wrap: break-word;
}
.artist-card:hover .artist-card-name { color: #1565c0; }
.artist-card-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 5px;
    font-size: 0.75rem;
    color: #64748b;
    flex-wrap: wrap;
}
.artist-meta-series strong,
.artist-meta-items strong { color: #1976d2; }
.artist-meta-sep { color: #cbd5e1; }

/* Arrow */
.artist-card-arrow {
    flex: 0 0 auto;
    padding: 0 12px;
    font-size: 1rem;
    color: #cbd5e1;
    transition: color 0.15s, transform 0.15s;
}
.artist-card:hover .artist-card-arrow {
    color: #1976d2;
    transform: translateX(3px);
}

/* Responsive */
@media (max-width: 640px) {
    .artists-grid { grid-template-columns: 1fr; gap: 10px; }
    .artists-subgrid { grid-template-columns: 1fr; gap: 10px; }
    .artists-search-input { font-size: 0.9rem; }
}

/* ── Artists: group sections ─────────────────────────────────────────────── */
.artists-group {
    margin-bottom: 32px;
}
.artists-group-title {
    font-size: 1rem;
    font-weight: 700;
    color: #1565c0;
    border-bottom: 2px solid #dbeafe;
    padding-bottom: 8px;
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.artists-subgrid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 14px;
}

/* ── Catalog statistics page (newcat/catalog_stats.php) ──────────────────── */
.cstat-source-note {
    text-align: center;
    font-size: 0.74rem;
    color: #64748b;
    margin: -4px 0 18px;
}
.cstat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 12px;
    margin-bottom: 26px;
}
.cstat-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 14px 16px;
    text-align: center;
}
.cstat-num {
    font-size: 1.4rem;
    font-weight: 800;
    color: #1565c0;
    line-height: 1.2;
}
.cstat-num .cstat-eur { display: block; font-size: 1.05rem; }
.cstat-num .cstat-bgn { display: block; font-size: 0.66rem; font-weight: 500; color: #94a3b8; margin-top: 2px; }
.cstat-lbl {
    font-size: 0.72rem;
    color: #64748b;
    margin-top: 4px;
}
.cstat-subtabs {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    border-bottom: 2px solid #e2e8f0;
    margin-bottom: 20px;
}
.cstat-subtab-btn {
    padding: 8px 16px;
    border: 1px solid #e2e8f0;
    border-bottom: none;
    background: #f8fafc;
    cursor: pointer;
    border-radius: 8px 8px 0 0;
    font-size: 0.82rem;
    color: #475569;
    font-weight: 600;
    font-family: inherit;
}
.cstat-subtab-btn.active {
    background: #fff;
    border-color: #1976d2;
    color: #1565c0;
    box-shadow: inset 0 2px 0 #1976d2;
}
.cstat-subtab-btn:hover:not(.active) { background: #eef2f7; }
.cstat-panel { display: none; }
.cstat-panel.active { display: block; }
.cstat-section { margin-bottom: 30px; }
.cstat-section-title {
    font-size: 0.98rem;
    font-weight: 700;
    color: #111827;
    margin: 0 0 12px;
    padding-bottom: 6px;
    border-bottom: 2px solid #e2e8f0;
    display: flex;
    align-items: center;
    gap: 8px;
}
.cstat-two-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 26px;
}
.cstat-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8rem;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    overflow: hidden;
}
.cstat-table thead th {
    background: #1976d2;
    color: #fff;
    font-weight: 700;
    padding: 7px 10px;
    text-align: left;
    white-space: nowrap;
    font-size: 0.72rem;
}
.cstat-table tbody tr { border-bottom: 1px solid #eef2f7; }
.cstat-table tbody tr:hover { background: #f0f7ff; }
.cstat-table tbody td { padding: 6px 10px; color: #374151; vertical-align: middle; }
.cstat-table td.num { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.cstat-table td.price { text-align: right; font-variant-numeric: tabular-nums; font-weight: 700; color: #14532d; }
.cstat-table th.cstat-col-total,
.cstat-table td.cstat-col-total {
    min-width: 190px;
    padding-left: 28px;
    white-space: nowrap;
}
.cstat-scroll { overflow: visible; }
.cstat-thumb { height: 34px; width: auto; border: 1px solid #e2e8f0; border-radius: 3px; background: #fff; }
.cstat-rank {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #1565c0;
    color: #fff;
    font-size: 0.68rem;
    font-weight: 800;
}
.cstat-rank.r1 { background: #d4a017; }
.cstat-rank.r2 { background: #9aa4b2; }
.cstat-rank.r3 { background: #b5651d; }
.cstat-bar-row { display: flex; align-items: center; gap: 10px; padding: 4px 0; font-size: 0.8rem; }
.cstat-bar-lbl { min-width: 68px; color: #475569; white-space: nowrap; }
.cstat-bar-track { flex: 1; background: #eef2f7; border-radius: 4px; height: 12px; overflow: hidden; }
.cstat-bar-fill { background: linear-gradient(90deg, #1976d2, #1565c0); height: 100%; border-radius: 4px; }
.cstat-bar-val { min-width: 55px; text-align: right; color: #1565c0; font-weight: 700; }
.cstat-src-tag {
    display: inline-block;
    font-size: 0.6rem;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 5px;
    margin-left: 5px;
    vertical-align: middle;
}
.cstat-src-tag.main { background: #dbeafe; color: #1565c0; }
.cstat-src-tag.dop  { background: #fef3c7; color: #92400e; }
.cstat-artist-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 10px;
    text-decoration: none;
    color: inherit;
    border-bottom: 1px solid #eef2f7;
}
.cstat-artist-row:hover { background: #f0f7ff; }
.cstat-artist-name {
    flex: 1;
    min-width: 0;
    font-weight: 600;
    color: #111827;
    font-size: 0.85rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
@media (max-width: 768px) {
    .cstat-two-col { grid-template-columns: 1fr; }
}
