/* Google Font Import */
@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@400;600;700;800&display=swap');

:root {
    --primary-color: #e30613; /* Tonie-Rot */
    --primary-gradient: linear-gradient(135deg, #e30613 0%, #ff4d4d 100%);
    --dark-bg: #212529;
    --light-bg: #f4f6f9;
    --card-shadow: 0 10px 20px rgba(0,0,0,0.05);
    --card-hover: 0 15px 30px rgba(227, 6, 19, 0.15);
}

body {
    font-family: 'Nunito', sans-serif;
    background-color: var(--light-bg);
    color: #333;
}

/* --- Navigation --- */
.navbar {
    background: white !important;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    padding: 1rem 0;
}

.navbar-brand {
    font-weight: 800;
    color: var(--primary-color) !important;
    font-size: 1.5rem;
    letter-spacing: -0.5px;
}

.nav-link {
    font-weight: 700;
    color: #555 !important;
    margin-left: 20px;
    transition: color 0.3s;
}

.nav-link:hover {
    color: var(--primary-color) !important;
}

/* --- Cards (Das Herzstück) --- */
.card {
    border: none;
    border-radius: 16px;
    background: white;
    box-shadow: var(--card-shadow);
    transition: all 0.3s ease;
    overflow: hidden;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: var(--card-hover);
}

.tonie-image-container {
    height: 220px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    padding: 20px;
    position: relative;
}

.tonie-image-container img {
    max-height: 100%;
    max-width: 100%;
    object-fit: contain;
    transition: transform 0.3s;
}

.card:hover .tonie-image-container img {
    transform: scale(1.05);
}

/* Badge oben rechts im Bild (für Rabatt) */
.discount-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    background: var(--primary-color);
    color: white;
    padding: 5px 10px;
    border-radius: 20px;
    font-weight: 800;
    font-size: 0.8rem;
    box-shadow: 0 4px 10px rgba(227, 6, 19, 0.3);
}

.card-body {
    padding: 1.5rem;
}

.card-title {
    font-weight: 700;
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* --- Preise & Buttons --- */
.price-tag {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--primary-color);
}

.btn-primary {
    background: var(--primary-gradient);
    border: none;
    border-radius: 12px;
    padding: 10px 20px;
    font-weight: 700;
    box-shadow: 0 4px 15px rgba(227, 6, 19, 0.2);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #c4040f 0%, #e30613 100%);
    box-shadow: 0 6px 20px rgba(227, 6, 19, 0.3);
    transform: translateY(-2px);
}

.btn-outline-secondary {
    border-radius: 12px;
    border: 2px solid #eee;
    color: #666;
    font-weight: 600;
}
.btn-outline-secondary:hover {
    background: #eee;
    color: #333;
    border-color: #eee;
}

/* --- Tabelle im Katalog --- */
.table-custom {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--card-shadow);
}
.table-custom th {
    background: #f8f9fa;
    border: none;
    padding: 20px;
    font-weight: 700;
    color: #666;
}
.table-custom td {
    padding: 20px;
    vertical-align: middle;
    border-bottom: 1px solid #eee;
}
.table-custom tr:last-child td {
    border-bottom: none;
}

/* Die Ampel-Punkte */
.status-dot {
    height: 12px;
    width: 12px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 8px;
    border: 1px solid rgba(0,0,0,0.1);
}

.status-green { background-color: #2ecc71; box-shadow: 0 0 5px #2ecc71; }
.status-yellow { background-color: #f1c40f; }
.status-red { background-color: #e74c3c; }

/* Tabelle für Angebote */
.offer-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    border-bottom: 1px solid #eee;
}

.shop-info { display: flex; align-items: center; }
.price-tag { font-weight: bold; font-size: 1.1em; }
.buy-btn {
    background-color: #3498db;
    color: white;
    padding: 5px 10px;
    text-decoration: none;
    border-radius: 4px;
    font-size: 0.9em;
}
.buy-btn:hover { background-color: #2980b9; }
.not-available { opacity: 0.5; text-decoration: line-through; }

/* --- Neues Katalog Styling --- */

/* Tabelle luftiger machen */
.table-clean td {
    vertical-align: middle;
    border-bottom: 1px solid #f0f0f0; /* Sehr feine Linie */
    transition: background-color 0.2s;
}

/* Hover Effekt für die ganze Zeile */
.table-clean tr:hover td {
    background-color: #fcfcfc; /* Ganz leichtes Grau beim Hover */
}

/* Entferne Border vom letzten Element */
.table-clean tr:last-child td {
    border-bottom: none;
}

/* Dropdown Menu schöner machen */
.dropdown-menu {
    border: none;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.dropdown-item {
    padding: 10px 20px;
    font-weight: 600;
    color: #555;
}

.dropdown-item:active, .dropdown-item.active {
    background-color: var(--light-bg); /* Kein blaues Highlight, sondern hellgrau */
    color: var(--primary-color);
}

/* Nav Pills (Filter) */
.nav-pills .nav-link {
    font-weight: 700;
    transition: all 0.2s;
}

.nav-pills .nav-link.active {
    background-color: #212529 !important; /* Dunkelgrau statt Blau */
    color: white !important;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

/* SUCHE: .navbar-brand { ... } */
/* ERSETZE DURCH (Anpassung damit Bild + Text gut aussehen): */
.navbar-brand {
    font-weight: 800;
    color: #333 !important; /* Dunkelgrau statt Rot, da das Logo schon rot ist */
    font-size: 1.4rem;
    letter-spacing: -0.5px;
    text-decoration: none;
}

/* Optional: Falls du das rote "Radar" im Text hervorheben willst,
   müsstest du im HTML <span> nutzen. Aber dunkelgrau wirkt oft seriöser neben dem bunten Logo. */


/* ============================================================
   MOBILE RESPONSIVE STYLES
   ============================================================ */

@media (max-width: 767.98px) {

    /* --- Navbar --- */
    .navbar {
        padding: 0.5rem 0;
    }

    .navbar .container {
        padding-left: 12px;
        padding-right: 12px;
    }

    .navbar-brand img {
        height: 55px !important;
        max-width: 220px;
    }

    .navbar-toggler {
        border: none;
        padding: 4px 8px;
        font-size: 1.1rem;
    }

    .navbar-toggler:focus {
        box-shadow: none;
    }

    /* Collapsed nav menu */
    .navbar-collapse .navbar-nav {
        padding: 1rem 0 0.5rem;
        gap: 4px;
    }

    .navbar-collapse .nav-link {
        margin-left: 0;
        padding: 10px 16px;
        border-radius: 10px;
        transition: background 0.2s;
    }

    .navbar-collapse .nav-link:hover {
        background: var(--light-bg);
    }

    .navbar-collapse .nav-item.ms-3 {
        margin-left: 0 !important;
        margin-top: 8px;
        padding: 0 16px;
    }

    .navbar-collapse .nav-item.ms-3 .btn {
        width: 100%;
        justify-content: center;
    }

    /* --- Main Container --- */
    main.container {
        padding-top: 1.5rem !important;
        padding-bottom: 2rem !important;
        padding-left: 16px;
        padding-right: 16px;
    }

    /* --- Hero / Typography --- */
    .display-4 {
        font-size: 1.75rem !important;
    }

    .display-6 {
        font-size: 1.35rem !important;
    }

    h1 {
        font-size: 1.5rem;
    }

    h3 {
        font-size: 1.15rem;
    }

    .lead {
        font-size: 0.95rem;
    }

    /* --- Index Page: Hero badges --- */
    .d-flex.justify-content-center.gap-3 {
        flex-direction: column;
        align-items: center;
        gap: 8px !important;
    }

    /* --- Index Page: Deal cards --- */
    .tonie-image-container {
        height: 180px;
        padding: 15px;
    }

    .card-body {
        padding: 1rem;
    }

    .card:hover {
        transform: translateY(-2px);
    }

    /* --- Catalogue Page: Header row --- */
    .row.mb-5.align-items-end {
        margin-bottom: 1.5rem !important;
    }

    .row.mb-5.align-items-end .col-md-7 {
        margin-bottom: 1rem;
    }

    /* --- Catalogue Page: Filter pills --- */
    .nav.nav-pills {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        padding-bottom: 2px;
    }

    .nav.nav-pills::-webkit-scrollbar {
        display: none;
    }

    .nav.nav-pills .nav-link {
        white-space: nowrap;
        padding-left: 16px;
        padding-right: 16px;
        font-size: 0.85rem;
    }

    /* Filters + sort row */
    .d-flex.flex-column.flex-md-row {
        gap: 12px !important;
    }

    /* --- Catalogue Table --- */
    .table-clean td {
        padding: 10px 8px;
    }

    .table-clean td.ps-4 {
        padding-left: 12px !important;
    }

    .table-clean td.pe-4 {
        padding-right: 12px !important;
    }

    /* Thumbnail */
    .table-clean td .bg-white.rounded.p-1.border {
        width: 65px !important;
        height: 65px !important;
    }

    .table-clean td:first-child {
        width: 80px !important;
    }

    /* Product name in table */
    .table-clean h5 {
        font-size: 0.95rem;
        margin-bottom: 2px;
    }

    /* Price in table */
    .table-clean .fs-4 {
        font-size: 1.15rem !important;
    }

    .table-clean small {
        font-size: 0.7rem;
    }

    /* Badges in table */
    .table-clean .badge {
        font-size: 0.65rem;
        padding: 3px 6px;
    }

    /* --- Detail Page --- */
    .row.mt-4 {
        margin-top: 0.5rem !important;
    }

    /* Product image */
    .row.mt-4 .img-fluid {
        max-width: 200px;
        margin: 0 auto;
        display: block;
    }

    /* Offer list items — stack vertically */
    .list-group-item.d-flex {
        flex-direction: column;
        align-items: flex-start !important;
        gap: 12px;
    }

    .list-group-item .text-end {
        width: 100%;
        display: flex;
        align-items: center;
        justify-content: space-between;
    }

    .list-group-item .text-end .fs-4 {
        font-size: 1.3rem !important;
        margin-bottom: 0 !important;
    }

    .list-group-item .btn-primary.btn-sm {
        padding: 8px 20px;
    }

    /* Chart container */
    .card.shadow-sm.p-3 {
        padding: 0.75rem !important;
    }

    /* --- Detail info card --- */
    .list-group-item.d-flex.justify-content-between {
        flex-direction: row;
        align-items: center !important;
        gap: 0;
    }

    /* --- Footer --- */
    footer {
        padding: 2rem 0 !important;
        margin-top: 2rem !important;
    }

    footer .mb-4 {
        margin-bottom: 1.5rem !important;
    }

    /* --- Sort dropdown --- */
    .dropdown .btn {
        font-size: 0.85rem;
        padding: 8px 16px !important;
    }

    /* --- Search input --- */
    .form-control-lg {
        font-size: 0.95rem;
        padding: 12px 16px 12px 20px !important;
    }
}

/* Small phones (< 375px) */
@media (max-width: 374.98px) {
    .navbar-brand img {
        height: 45px !important;
        max-width: 180px;
    }

    .display-4 {
        font-size: 1.5rem !important;
    }

    .table-clean td .bg-white.rounded.p-1.border {
        width: 55px !important;
        height: 55px !important;
    }

    .table-clean td:first-child {
        width: 65px !important;
    }
}