/* ============================================================
   Kataloge Page — technomed.at/kataloge
   Modern catalog browser with CSS grid cards.

   Design system: inherits --matblue / --matgreen from site.css
   DevExpress Material theme overrides handled via .ctlg scope.
   ============================================================ */

/* ---------- Page scroll container ---------- */
.ctlg {
    width: 100%;
    height: 100%;
    overflow-y: auto;
    overflow-x: hidden;
    font-family: 'Roboto', sans-serif !important;
    color: #333;
    line-height: 1.6;
    position: relative;
    z-index: 0;
    scroll-behavior: smooth;
}

/* DX typography reset within our page */
.ctlg h1, .ctlg h2, .ctlg h3, .ctlg h4, .ctlg p, .ctlg span, .ctlg a {
    font-family: 'Roboto', sans-serif !important;
    letter-spacing: normal;
}

/* ---------- Section rhythm ---------- */
.ctlg-section {
    width: 100%;
    padding: 60px 24px;
    box-sizing: border-box;
}

.ctlg-inner {
    max-width: 1200px;
    margin: 0 auto;
}

/* ---------- HERO ---------- */
.ctlg-hero {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 36px 24px 28px;
    background: transparent;
    border-bottom: 1px solid rgba(0,0,0,0.06);
}

/* When a catalog is selected, hero becomes the detail header */
.ctlg-hero.ctlg-hero--selected {
    text-align: left;
    justify-content: flex-start;
    padding: 44px 24px 36px;
    background: linear-gradient(135deg, rgba(3,169,244,0.04) 0%, rgba(139,195,74,0.04) 100%);
    border-bottom: 1px solid rgba(3,169,244,0.10);
}

.ctlg-hero--selected .ctlg-hero-content {
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 32px;
    align-items: center;
}

.ctlg-hero--selected .ctlg-hero-text {
    display: flex;
    flex-direction: column;
}

.ctlg-hero-content {
    position: relative;
    z-index: 1;
}

.ctlg-hero-badge {
    display: inline-block;
    background: rgba(3, 169, 244, 0.08);
    border: 1px solid rgba(3, 169, 244, 0.25);
    color: var(--matblue);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    padding: 3px 14px;
    border-radius: 20px;
    margin-bottom: 10px;
}

.ctlg-hero h1 {
    color: #1a1a1a !important;
    font-size: 30px !important;
    font-weight: 300 !important;
    margin: 0 0 6px !important;
    line-height: 1.2 !important;
}

.ctlg-hero h1 strong {
    font-weight: 700 !important;
}

.ctlg-hero-sub {
    color: #666 !important;
    font-size: 14px !important;
    max-width: 560px;
    margin: 0 auto !important;
    line-height: 1.5 !important;
}

.ctlg-hero--selected .ctlg-hero-sub {
    margin: 0 !important;
}

/* Hero detail image (shown when catalog selected) */
.ctlg-hero-img {
    width: 220px;
    height: 220px;
    background-position: center;
    background-size: contain;
    background-repeat: no-repeat;
    border-radius: 14px;
    background-color: #fff;
    box-shadow: 0 2px 16px rgba(0,0,0,0.07);
}

.ctlg-hero-detail-html {
    font-size: 14px;
    color: #555;
    line-height: 1.6;
    margin-top: 12px;
}

.ctlg-hero-detail-html p {
    margin: 0 0 8px !important;
}

.ctlg-hero-detail-html b {
    color: #333;
}

/* breadcrumb */
.ctlg-breadcrumb {
    margin-top: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
}

.ctlg-hero--selected .ctlg-breadcrumb {
    justify-content: flex-start;
    grid-column: 1 / -1;
}

.ctlg-breadcrumb a,
.ctlg-breadcrumb span {
    color: #999 !important;
    font-size: 13px !important;
    text-decoration: none;
    cursor: pointer;
    transition: color 0.2s;
}

.ctlg-breadcrumb a:hover {
    color: var(--matblue) !important;
}

.ctlg-breadcrumb .ctlg-bc-sep {
    color: #ccc !important;
    font-size: 11px !important;
}

.ctlg-breadcrumb .ctlg-bc-current {
    color: #333 !important;
    font-weight: 500;
}

/* ---------- SECTION HEADER ---------- */
.ctlg-section-label {
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--matblue);
    margin-bottom: 8px;
}

.ctlg-section-title {
    font-size: 26px !important;
    font-weight: 300 !important;
    color: #1a1a1a !important;
    margin: 0 0 32px !important;
    line-height: 1.3 !important;
}

.ctlg-section-title strong {
    font-weight: 700 !important;
}

/* ---------- CATALOG CARD GRID ---------- */
.ctlg-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
}

.ctlg-card {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06), 0 2px 12px rgba(0,0,0,0.04);
    cursor: pointer;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    display: flex;
    flex-direction: column;
    text-decoration: none !important;
    color: inherit !important;
    opacity: 0;
    animation: ctlg-card-in 0.45s ease forwards;
}

.ctlg-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 32px rgba(0,0,0,0.10), 0 2px 8px rgba(0,0,0,0.06);
}

.ctlg-card-img {
    width: 100%;
    height: 220px;
    background-position: center;
    background-size: contain;
    background-repeat: no-repeat;
    background-color: #fafafa;
    border-bottom: 1px solid #f0f0f0;
    transition: background-color 0.25s;
    position: relative;
}

/* Image fallback placeholder (shown via .ctlg-img-err class) */
.ctlg-card-img.ctlg-img-err,
.ctlg-product-img.ctlg-img-err {
    background-image: none !important;
}

.ctlg-card-img.ctlg-img-err::after,
.ctlg-product-img.ctlg-img-err::after {
    content: '';
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background:
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='48' height='48' fill='%23ccc' viewBox='0 0 24 24'%3E%3Cpath d='M21 19V5c0-1.1-.9-2-2-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2zM8.5 13.5l2.5 3.01L14.5 12l4.5 6H5l3.5-4.5z'/%3E%3C/svg%3E")
        center / 48px no-repeat,
        linear-gradient(135deg, #f5f5f5 0%, #ebebeb 100%);
}

.ctlg-card:hover .ctlg-card-img {
    background-color: #f5f8ff;
}

.ctlg-card-body {
    padding: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.ctlg-card-title {
    font-size: 17px !important;
    font-weight: 600 !important;
    color: #1a1a1a !important;
    margin: 0 0 6px !important;
    line-height: 1.3 !important;
}

.ctlg-card-descr {
    font-size: 13px !important;
    color: #777 !important;
    margin: 0 !important;
    line-height: 1.5 !important;
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.ctlg-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    border-top: 1px solid #f0f0f0;
    background: #fafbfc;
}

.ctlg-card-count {
    font-size: 12px;
    color: #999;
    font-weight: 500;
}

.ctlg-card-arrow {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--matblue);
    color: #fff;
    font-size: 13px;
    transition: transform 0.2s;
}

.ctlg-card:hover .ctlg-card-arrow {
    transform: translateX(2px);
}

/* ---------- PRODUCT CARD GRID ---------- */
.ctlg-products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 20px;
}

.ctlg-product {
    background: #fff;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(0,0,0,0.05);
    cursor: pointer;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    display: flex;
    flex-direction: column;
    text-decoration: none !important;
    color: inherit !important;
    opacity: 0;
    animation: ctlg-card-in 0.45s ease forwards;
}

.ctlg-product:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 24px rgba(0,0,0,0.09);
}

.ctlg-product-img {
    width: 100%;
    height: 200px;
    background-position: center;
    background-size: contain;
    background-repeat: no-repeat;
    background-color: #fafafa;
    border-bottom: 1px solid #f0f0f0;
    transition: background-color 0.25s;
    position: relative;
}

.ctlg-product:hover .ctlg-product-img {
    background-color: #f5f8ff;
}

.ctlg-product-body {
    padding: 16px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.ctlg-product-title {
    font-size: 15px !important;
    font-weight: 600 !important;
    color: #1a1a1a !important;
    margin: 0 0 4px !important;
    line-height: 1.3 !important;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.ctlg-product-group {
    font-size: 12px !important;
    color: #999 !important;
    font-style: italic;
    margin: 0 !important;
}

.ctlg-product-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 16px;
    border-top: 1px solid #f0f0f0;
    background: #fafbfc;
}

.ctlg-product-btn {
    height: 30px;
    border-radius: 6px;
    border: 1px solid #e0e0e0;
    background: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 0 10px;
    transition: all 0.2s;
    color: #666;
    font-family: 'Roboto', sans-serif !important;
    font-size: 11px;
    font-weight: 500;
    white-space: nowrap;
}

.ctlg-product-btn:hover {
    border-color: var(--matblue);
    color: var(--matblue);
    background: #f0f8ff;
}

.ctlg-product-btn svg {
    width: 14px;
    height: 14px;
    fill: currentColor;
    flex-shrink: 0;
}

/* ---------- SKELETON LOADING ---------- */
.ctlg-skeleton-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 60px 24px;
}

.ctlg-skeleton-card {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

.ctlg-skeleton-img {
    width: 100%;
    height: 220px;
    background: linear-gradient(90deg, #f0f0f0 25%, #e8e8e8 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: ctlg-shimmer 1.5s ease infinite;
}

.ctlg-skeleton-body {
    padding: 20px;
}

.ctlg-skeleton-line {
    height: 14px;
    border-radius: 7px;
    background: linear-gradient(90deg, #f0f0f0 25%, #e8e8e8 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: ctlg-shimmer 1.5s ease infinite;
    margin-bottom: 10px;
}

.ctlg-skeleton-line:first-child {
    width: 70%;
    height: 18px;
    border-radius: 9px;
}

.ctlg-skeleton-line:nth-child(2) {
    width: 100%;
}

.ctlg-skeleton-line:nth-child(3) {
    width: 50%;
}

.ctlg-skeleton-footer {
    height: 44px;
    border-top: 1px solid #f0f0f0;
    background: linear-gradient(90deg, #fafbfc 25%, #f5f6f7 50%, #fafbfc 75%);
    background-size: 200% 100%;
    animation: ctlg-shimmer 1.5s ease infinite;
}

@keyframes ctlg-shimmer {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ---------- EMPTY STATE ---------- */
.ctlg-empty {
    text-align: center;
    padding: 60px 24px;
    max-width: 400px;
    margin: 0 auto;
}

.ctlg-empty svg {
    width: 56px;
    height: 56px;
    fill: #ccc;
    margin-bottom: 16px;
}

.ctlg-empty-title {
    font-size: 18px !important;
    font-weight: 600 !important;
    color: #555 !important;
    margin: 0 0 8px !important;
}

.ctlg-empty-sub {
    font-size: 14px !important;
    color: #999 !important;
    margin: 0 !important;
    line-height: 1.5 !important;
}

/* ---------- CARD ENTRANCE ANIMATION ---------- */
@keyframes ctlg-card-in {
    from {
        opacity: 0;
        transform: translateY(16px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ---------- LOADING SPINNER (legacy fallback) ---------- */
.ctlg-loading {
    display: none;
}

/* ---------- BACK LINK ---------- */
.ctlg-back {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--matblue) !important;
    text-decoration: none !important;
    font-weight: 500;
    cursor: pointer;
    margin-bottom: 20px;
    transition: gap 0.2s;
    width: fit-content;
}

.ctlg-back:hover {
    gap: 10px;
}

.ctlg-back svg {
    width: 16px;
    height: 16px;
    fill: var(--matblue);
    flex-shrink: 0;
}

/* ---------- RESPONSIVE ---------- */
@media (max-width: 600px) {
    .ctlg-hero {
        padding: 28px 16px 20px;
    }
    .ctlg-hero--selected .ctlg-hero-content {
        grid-template-columns: 1fr;
        gap: 16px;
        text-align: center;
    }
    .ctlg-hero--selected .ctlg-breadcrumb {
        justify-content: center;
    }
    .ctlg-hero-img {
        width: 160px;
        height: 160px;
        margin: 0 auto;
    }
    .ctlg-hero h1 {
        font-size: 24px !important;
    }
    .ctlg-hero-sub {
        font-size: 13px !important;
    }
    .ctlg-section {
        padding: 40px 16px;
    }
    .ctlg-section-title {
        font-size: 22px !important;
    }
    .ctlg-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    .ctlg-products-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    .ctlg-card-img {
        height: 180px;
    }
    .ctlg-product-img {
        height: 160px;
    }
    .ctlg-skeleton-grid {
        grid-template-columns: 1fr;
        padding: 40px 16px;
    }
}

@media (max-width: 768px) {
    .ctlg-hero--selected .ctlg-hero-content {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    .ctlg-hero-img {
        width: 180px;
        height: 180px;
        margin: 0 auto;
    }
    .ctlg-hero--selected {
        text-align: center;
    }
    .ctlg-hero--selected .ctlg-breadcrumb {
        justify-content: center;
    }
}

@media (min-width: 601px) and (max-width: 900px) {
    .ctlg-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .ctlg-products-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
