/**
 * flugbuchen.de — Deals Page Styles
 *
 * Curated deals listing with category filter, deal cards,
 * price display, badges, and newsletter teaser.
 * Mobile-first, WCAG 2.1 AA compliant.
 *
 * @copyright reDim GmbH | @link https://www.redim.de | @contact team@redim.de
 */

/* ========================================
   Screen Reader Only Utility
   ======================================== */

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ========================================
   Breadcrumb
   ======================================== */

.deals-breadcrumb {
    padding: 1rem 0 0;
}

.deals-breadcrumb__list {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--color-text-secondary);
    flex-wrap: wrap;
}

.deals-breadcrumb__list li + li::before {
    content: "/";
    margin-right: 0.5rem;
    color: var(--color-border);
}

.deals-breadcrumb__list a {
    color: var(--color-text-secondary);
}

.deals-breadcrumb__list a:hover {
    color: var(--color-secondary);
}

.deals-breadcrumb__list [aria-current="page"] {
    color: var(--color-text);
    font-weight: 500;
}

/* ========================================
   Hero Banner
   ======================================== */

.deals-hero {
    background: var(--color-primary);
    padding: 2.5rem 0 2rem;
    text-align: center;
}

.deals-hero__inner {
    max-width: 48rem;
    margin: 0 auto;
}

.deals-hero__title {
    font-size: 1.75rem;
    color: #fff;
    margin-bottom: 0.5rem;
}

.deals-hero__subtitle {
    font-size: 1.0625rem;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 1rem;
    line-height: 1.5;
}

.deals-hero__counter {
    display: inline-block;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--color-secondary);
    background: rgba(13, 148, 136, 0.15);
    padding: 0.375rem 1rem;
    border-radius: 9999px;
}

@media (min-width: 768px) {
    .deals-hero {
        padding: 3rem 0 2.5rem;
    }

    .deals-hero__title {
        font-size: 2.25rem;
    }

    .deals-hero__subtitle {
        font-size: 1.125rem;
    }
}

/* ========================================
   Category Filter Bar (Sticky)
   ======================================== */

.deals-filter {
    position: sticky;
    top: 4rem; /* Below site header */
    z-index: 50;
    background: rgba(255, 255, 255, 0.97);
    border-bottom: 1px solid var(--color-border);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.deals-filter__list {
    display: flex;
    gap: 0.5rem;
    padding: 0.75rem 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.deals-filter__list::-webkit-scrollbar {
    display: none;
}

.deals-filter__pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1.25rem;
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--color-text);
    background: var(--color-bg-alt);
    border: 1px solid var(--color-border);
    border-radius: 9999px;
    white-space: nowrap;
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
    min-height: 2.75rem;
    min-width: 2.75rem;
}

.deals-filter__pill:hover {
    border-color: var(--color-secondary);
    color: var(--color-secondary);
}

.deals-filter__pill.is-active {
    background: var(--color-secondary);
    color: #fff;
    border-color: var(--color-secondary);
}

.deals-filter__pill:focus-visible {
    outline: 2px solid var(--color-secondary);
    outline-offset: 2px;
}

/* ========================================
   Deals Grid
   ======================================== */

.deals-listing {
    padding: 2rem 0 3rem;
    background: var(--color-bg-alt);
}

.deals-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

@media (min-width: 640px) {
    .deals-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .deals-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* ========================================
   Deal Card
   ======================================== */

.deal-card {
    background: var(--color-bg);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: box-shadow 0.2s ease, transform 0.2s ease;
    display: flex;
    flex-direction: column;
}

.deal-card:hover {
    box-shadow: var(--shadow-lift);
    transform: translateY(-3px);
}

.deal-card.is-hidden {
    display: none;
}

/* Card Image */

.deal-card__image {
    position: relative;
    aspect-ratio: 16 / 10;
    overflow: hidden;
}

.deal-card__image .image-placeholder {
    width: 100%;
    height: 100%;
    font-size: 0.75rem;
}

/* Badges */

.deal-badge {
    position: absolute;
    top: 0.75rem;
    left: 0.75rem;
    display: inline-flex;
    align-items: center;
    padding: 0.3125rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 700;
    border-radius: var(--radius-sm);
    z-index: 2;
    letter-spacing: 0.01em;
}

.deal-badge--top {
    background: var(--color-secondary);
    color: #fff;
}

.deal-badge--lastminute {
    background: var(--color-cta);
    color: #fff;
}

.deal-badge--bestseller {
    background: var(--color-primary);
    color: #fff;
}

.deal-badge--schnaeppchen {
    background: var(--color-price);
    color: #fff;
}

.deal-badge--geheimtipp {
    background: #7C3AED;
    color: #fff;
}

.deal-badge--familie {
    background: #0284C7;
    color: #fff;
}

.deal-badge--default {
    background: var(--color-text-secondary);
    color: #fff;
}

/* Card Body */

.deal-card__body {
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.deal-card__header {
    margin-bottom: 0.5rem;
}

.deal-card__destination {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--color-primary);
    margin-bottom: 0.125rem;
    line-height: 1.3;
}

.deal-card__country {
    font-size: 0.8125rem;
    color: var(--color-text-secondary);
    font-weight: 500;
}

.deal-card__description {
    font-size: 0.875rem;
    color: var(--color-text-secondary);
    line-height: 1.5;
    margin-bottom: 1rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Price Section */

.deal-card__pricing {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.deal-card__prices {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
}

.deal-card__original-price {
    font-size: 0.8125rem;
    color: var(--color-text-secondary);
    text-decoration: line-through;
    font-weight: 400;
}

.deal-card__current-price {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--color-price);
    line-height: 1.2;
}

.deal-card__discount {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.25rem 0.625rem;
    font-size: 0.8125rem;
    font-weight: 700;
    color: var(--color-price);
    background: rgba(22, 163, 74, 0.1);
    border-radius: 9999px;
    white-space: nowrap;
    flex-shrink: 0;
}

/* Valid Until */

.deal-card__valid {
    font-size: 0.8125rem;
    color: var(--color-text-secondary);
    margin-bottom: 1rem;
}

/* CTA Button */

.deal-card__cta {
    width: 100%;
    text-align: center;
    margin-top: auto;
}

/* ========================================
   Empty State
   ======================================== */

.deals-empty {
    text-align: center;
    padding: 3rem 1rem;
}

.deals-empty__title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--color-primary);
    margin-bottom: 0.5rem;
}

.deals-empty__text {
    font-size: 0.9375rem;
    color: var(--color-text-secondary);
    max-width: 28rem;
    margin: 0 auto;
    line-height: 1.5;
}

/* ========================================
   Newsletter / Preisalarm Teaser
   ======================================== */

.deals-newsletter {
    padding: 3rem 0 4rem;
    background: var(--color-bg);
}

.deals-newsletter__card {
    background: var(--color-primary);
    border-radius: var(--radius-lg);
    padding: 2.5rem 1.5rem;
    text-align: center;
    max-width: 44rem;
    margin: 0 auto;
}

@media (min-width: 768px) {
    .deals-newsletter__card {
        padding: 3rem 3rem;
    }
}

.deals-newsletter__title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 0.5rem;
}

@media (min-width: 768px) {
    .deals-newsletter__title {
        font-size: 1.75rem;
    }
}

.deals-newsletter__subtitle {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 1.5rem;
    line-height: 1.5;
}

.deals-newsletter__form {
    max-width: 28rem;
    margin: 0 auto 0.75rem;
}

.deals-newsletter__input-group {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

@media (min-width: 480px) {
    .deals-newsletter__input-group {
        flex-direction: row;
        gap: 0;
    }
}

.deals-newsletter__input {
    flex: 1;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    font-family: var(--font-body);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    min-height: 2.75rem;
}

@media (min-width: 480px) {
    .deals-newsletter__input {
        border-radius: var(--radius-sm) 0 0 var(--radius-sm);
        border-right: none;
    }
}

.deals-newsletter__input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.deals-newsletter__input:focus {
    outline: none;
    border-color: var(--color-secondary);
    background: rgba(255, 255, 255, 0.15);
}

.deals-newsletter__submit {
    flex-shrink: 0;
    min-height: 2.75rem;
}

@media (min-width: 480px) {
    .deals-newsletter__submit {
        border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    }
}

.deals-newsletter__hint {
    font-size: 0.8125rem;
    color: rgba(255, 255, 255, 0.5);
    margin-top: 0.75rem;
}

/* ========================================
   Skeleton Loading States
   ======================================== */

@keyframes deals-skeleton-pulse {
    0% { opacity: 0.6; }
    50% { opacity: 1; }
    100% { opacity: 0.6; }
}

.deal-skeleton {
    background: var(--color-bg);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.deal-skeleton__image {
    aspect-ratio: 16 / 10;
    background: var(--color-border);
    animation: deals-skeleton-pulse 1.5s ease-in-out infinite;
}

.deal-skeleton__body {
    padding: 1.25rem;
}

.deal-skeleton__line {
    height: 0.875rem;
    background: var(--color-border);
    border-radius: 4px;
    margin-bottom: 0.625rem;
    animation: deals-skeleton-pulse 1.5s ease-in-out infinite;
}

.deal-skeleton__line--short {
    width: 40%;
}

.deal-skeleton__line--medium {
    width: 70%;
}

.deal-skeleton__line--full {
    width: 100%;
}

.deal-skeleton__line--price {
    width: 50%;
    height: 1.5rem;
    margin-top: 0.75rem;
}

.deal-skeleton__line--btn {
    width: 100%;
    height: 2.75rem;
    margin-top: 1rem;
    border-radius: var(--radius-sm);
}

/* ========================================
   Reduced Motion
   ======================================== */

@media (prefers-reduced-motion: reduce) {
    .deal-card {
        transition: none;
    }

    .deal-card:hover {
        transform: none;
    }

    .deals-filter__pill {
        transition: none;
    }

    .deal-skeleton__image,
    .deal-skeleton__line {
        animation: none;
    }
}
