/* =====================================================================
   KAS Frontend UI
   Da Kasberger · betheme-child

   Generelles Stylesheet für mehrere Unterseiten.
   Verwendung: Kühlgeräte, Brennstoffe, Aktionsangebote, weitere.

   Klassen-Übersicht:
     Layout .......... .kas-container, .kas-section
     Grid ............ .b-row, .b-col, .b-col-lg-5, .b-row-cols-2/lg-4, .b-h-100
     Hero-Banner ..... .kas-hero (+ --sm, --light)
     Karten .......... .kas-card, .kas-card__image, .kas-card__name, .kas-card__price
     Filter-Pills .... .kas-pills, .kas-pill, .kas-pill--active
     Tabs ............ .kas-tabs, .kas-tab, .kas-tab--active
     Buttons ......... .kas-btn, .kas-btn--primary, .kas-btn--outline, .kas-btn--block
     Notices ......... .kas-notice (+ --success, --error, --warning)
     Utilities ....... .kas-back-link, .kas-divider
   ===================================================================== */

/* =====================================================================
   Layout
   ===================================================================== */

.kas-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 20px 48px;
    width: 100%;
    box-sizing: border-box; /* Betheme erbt content-box global – ohne border-box ist width:100%+padding breiter als der Elternblock */
}

.kas-section {
    margin-bottom: 40px;
}

/* =====================================================================
   Grid  (Bootstrap-compatible naming)
   ===================================================================== */

.b-row {
    display: flex;
    flex-wrap: wrap;
}

.b-row-gap-4 {
    gap: 24px;
}

.b-col {
    flex: 1 1 0;
    min-width: 0;
}

/* 2 cards per row (default mobile) */
.b-row-cols-2 > .b-col {
    flex: 0 0 auto;
    width: calc(50% - 12px);
}

/* 4 cards per row on ≥ 992 px */
@media (min-width: 992px) {
    .b-row-cols-lg-4 > .b-col {
        flex: 0 0 auto;
        width: calc(25% - 18px);
    }

    /* ≈ 5/12 column – product image in detail view */
    .b-col-lg-5 {
        flex: 0 0 auto !important;
        width: 41.6667% !important;
        max-width: 420px !important;
    }
}

.b-h-100 { height: 100%; }

/* =====================================================================
   Hero / Page banner
   ===================================================================== */

.kas-hero {
    background: linear-gradient(135deg, #094a7e 0%, #1565c0 100%);
    color: #fff;
    padding: 48px 32px;
    border-radius: 12px;
    margin-bottom: 32px;
    position: relative;
    overflow: hidden;
}

/* Small variant – less padding, smaller text */
.kas-hero--sm {
    padding: 28px 24px;
}

.kas-hero--sm .kas-hero__title {
    font-size: 20px;
}

/* Light variant – white background, dark text */
.kas-hero--light {
    background: #f4f8ff;
    color: #094a7e;
}

.kas-hero--light .kas-hero__title,
.kas-hero--light .kas-hero__lead {
    color: #094a7e;
}

.kas-hero--light .kas-hero__badge {
    background: rgba(9, 74, 126, .1);
    border-color: rgba(9, 74, 126, .25);
    color: #094a7e;
}

/* Decorative icon (override via data-icon or CSS custom prop) */
.kas-hero::after {
    content: attr(data-icon);
    position: absolute;
    right: 40px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 100px;
    opacity: .1;
    pointer-events: none;
    line-height: 1;
}

.kas-hero__title {
    font-size: 28px;
    font-weight: 700;
    margin: 0 0 10px;
    color: inherit;
    line-height: 1.2;
}

.kas-hero__lead {
    font-size: 15px;
    margin: 0;
    opacity: .9;
    max-width: 640px;
}

.kas-hero__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 16px;
}

.kas-hero__badge {
    background: rgba(255, 255, 255, .18);
    border: 1px solid rgba(255, 255, 255, .35);
    border-radius: 20px;
    padding: 4px 14px;
    font-size: 13px;
    color: #fff;
}

/* =====================================================================
   Product / content cards
   ===================================================================== */

.kas-card {
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 1px solid #e8e8e8;
    border-radius: 10px;
    overflow: hidden;
    height: 100%;
    transition: box-shadow .2s ease, transform .2s ease;
}

.kas-card:hover {
    box-shadow: 0 8px 28px rgba(9, 74, 126, .14) !important;
    transform: translateY(-2px);
}

.kas-card--shadow {
    box-shadow: 0 2px 8px rgba(0, 0, 0, .08);
}

/* Link-Wrapper füllt verfügbare Kartenhöhe, Footer-Button bleibt unten */
.kas-card > a {
    flex: 1;
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
}

.kas-card__image {
    background: #f8f9fa;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.kas-card__image--placeholder {
    height: 180px;
    background: #f0f4f8;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #b0c4d8;
    font-size: 40px;
}

.kas-card__body {
    padding: 10px 14px;
    flex-grow: 1;
}

.kas-card__name {
    font-size: 14px;
    font-weight: 600;
    color: #1a1a1a;
    line-height: 1.2;
    padding: 10px 14px 4px;
    box-sizing: border-box; /* min-height muss padding einschließen (Betheme erbt content-box global) */
    /* Auf max. 2 Zeilen kürzen */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    /* border-box: min-height = 2 Zeilen × 1.2em (=16.8px) + Padding 10px + 4px = 44.8px */
    min-height: calc(2.4em + 14px);
}

.kas-card__meta {
    padding: 0 14px 4px;
    font-size: 12px;
    line-height: 1.35;
    color: #999;
}

.kas-card__price {
    padding: 4px 14px 14px;
    font-size: 15px;
    font-weight: 700;
    color: #094a7e;
    margin-top: auto; /* Preis immer am unteren Ende der Karte, direkt über dem Button */
}

.kas-card__price .kas-card__price-net {
    font-size: 19px;
    font-weight: 700;
    color: #094a7e;
}

.kas-card__price .kas-card__price-note {
    font-weight: 400;
    font-size: 12px;
    color: #999;
}

.kas-card__footer {
    padding: 0 14px 14px;
}

/* =====================================================================
   Filter pills
   ===================================================================== */

.kas-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin-bottom: 24px;
}

.kas-pill {
    display: inline-block;
    padding: 5px 16px;
    border-radius: 20px;
    border: 1px solid #ccc;
    font-size: 13px;
    text-decoration: none !important;
    color: #444;
    background: #fff;
    cursor: pointer;
    transition: background .15s, border-color .15s, color .15s;
    line-height: 1.4;
}

.kas-pill:hover {
    border-color: #094a7e;
    color: #094a7e;
}

.kas-pill--active,
.kas-pill--active:hover {
    background: #094a7e !important;
    color: #fff !important;
    border-color: #094a7e !important;
}

/* =====================================================================
   Tabs
   ===================================================================== */

.kas-tabs {
    border-bottom: 2px solid #dee2e6;
    margin-bottom: 20px;
    display: flex;
    gap: 0;
}

.kas-tab {
    padding: 9px 22px;
    border: none;
    background: none;
    cursor: pointer;
    font-size: 14px;
    color: #777;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    transition: color .15s, border-color .15s;
    font-weight: 500;
}

.kas-tab:hover {
    color: #094a7e;
}

.kas-tab--active {
    color: #094a7e !important;
    border-bottom-color: #094a7e !important;
    font-weight: 700 !important;
}

/* =====================================================================
   Buttons
   ===================================================================== */

.kas-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 20px;
    border-radius: 6px;
    border: 2px solid transparent;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none !important;
    transition: background .15s, color .15s, border-color .15s;
    line-height: 1.4;
}

.kas-btn--primary {
    background: #094a7e;
    color: #fff !important;
    border-color: #094a7e;
}

.kas-btn--primary:hover {
    background: #073e6a;
    border-color: #073e6a;
}

.kas-btn--outline {
    background: transparent;
    color: #094a7e !important;
    border-color: #094a7e;
}

.kas-btn--outline:hover {
    background: #094a7e;
    color: #fff !important;
}

.kas-btn--sm {
    padding: 5px 14px;
    font-size: 13px;
}

.kas-btn--block {
    width: 100%;
}

/* =====================================================================
   Notices / alerts
   ===================================================================== */

.kas-notice {
    border-radius: 10px;
    padding: 20px 24px;
    margin-bottom: 24px;
    border: 1px solid transparent;
}

.kas-notice--success {
    background: #d1e7dd;
    border-color: #a3cfbb;
    color: #0a3622;
}

.kas-notice--error {
    background: #f8d7da;
    border-color: #f5c2c7;
    color: #58151c;
}

.kas-notice--warning {
    background: #fff3cd;
    border-color: #ffe69c;
    color: #664d03;
}

.kas-notice--info {
    background: #cff4fc;
    border-color: #9eeaf9;
    color: #055160;
}

/* =====================================================================
   Utilities
   ===================================================================== */

.kas-back-link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 14px;
    color: #094a7e !important;
    text-decoration: none !important;
}

.kas-back-link:hover {
    text-decoration: underline !important;
}

.kas-divider {
    border: none;
    border-top: 1px solid #dee2e6;
    margin: 24px 0;
}

.kas-empty {
    text-align: center;
    color: #999;
    padding: 48px 16px;
    font-size: 15px;
}

/* =====================================================================
   Responsive
   ===================================================================== */

@media (max-width: 991px) {
    .b-row-cols-lg-4 > .b-col {
        flex: 0 0 auto;
        width: calc(50% - 12px);
    }

    .b-col-lg-5 {
        width: 100% !important;
        max-width: 100% !important;
    }
}

@media (max-width: 600px) {
    .kas-container {
        padding-left: 12px;
        padding-right: 12px;
    }

    .b-row-cols-2 > .b-col {
        width: 100%;
    }

    .kas-hero {
        padding: 28px 18px;
    }

    .kas-hero__title {
        font-size: 20px;
    }

    .kas-hero::after {
        font-size: 56px;
        right: 14px;
    }

    .kas-pills {
        gap: 6px;
    }
}
