/**
 * Current Bonus Codes Slider Section
 * Styles match Figma design exactly
 * Built with design system variables
 *
 * @package Bonusovekody
 * @since 2.0.0
 */

/* ============================================
 * SECTION WRAPPER
 * ============================================ */

#current-bonus-codes-slider {
    /* Background and spacing handled by .container */
    overflow-x: hidden;
}

/* ============================================
 * MAIN SLIDER CONTAINER
 * Desktop: 4-column grid (hero + 3 cards)
 * Mobile: Stacked layout
 * ============================================ */

.bonuses-slider {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-6);
    margin-bottom: var(--space-6);
}

/* ============================================
 * HERO BOX (Blue Card with Date)
 * ============================================ */

.bonuses-slider__hero {
    position: relative;
    background: var(--blue-500);
    border-radius: var(--radius-md);
    padding: var(--container-padding);
    color: var(--white);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 280px;
}

/* Counter "1/3" (Desktop only) */
.bonuses-slider__counter {
    text-align: right;
    font-size: var(--font-size-h2);
    font-weight: var(--font-weight-normal);
    color: var(--white);
}

/* Hero Title */
.bonuses-slider__title {
    color: var(--white);
    margin-bottom: 0;
}

/* Date Display Container */
.bonuses-slider__date {
    display: flex;
    gap: var(--space-3);
    align-items: center;
}

/* Date Boxes (Day, Month, Year) */
.bonuses-slider__date-day,
.bonuses-slider__date-month,
.bonuses-slider__date-year {
    background: #5795ED;
    color: var(--white);
    padding: var(--space-4);
    border-radius: var(--radius-base);
    font-weight: var(--font-weight-bold);
    text-align: center;
    min-width: 60px;
}

.bonuses-slider__date-day {
    position: relative;
}

/* Date Label "Dnes" - positioned ABOVE the date box */
.bonuses-slider__date-day::before {
    content: 'Dnes';
    background-color: #D9F8C3;
    color: #37621A;
    position: absolute;
    top: -9px;
    right: -6px;
    font-size: var(--font-size-xs);
    padding: var(--space-2) var(--space-3);
    border-radius: var(--radius-xs);
    align-items: center;
    font-weight: var(--font-weight-medium);
    line-height: var(--font-size-xs);
}

.bonuses-slider__date-year {
    min-width: 120px;
}

/* ============================================
 * BONUS CARDS CONTAINER
 * Desktop: Slider showing 3 cards at a time
 * Mobile: Carousel (1 card visible)
 * ============================================ */

.bonuses-slider__cards {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-6);
    grid-column: 1 / -1;
}

/* ============================================
 * BONUS CARD
 * White card with logo, title, description, button
 * ============================================ */

.bonus-card {
    background: var(--white);
    border: none;
    border-radius: var(--card-radius);
    padding: 20px;
    box-shadow: none;
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
    transition: all var(--transition-base) var(--ease-out);
    min-height: 280px;
    box-sizing: border-box;
}

.bonus-card:hover {
    box-shadow: none;
    transform: none;
}

/* Card Logo */
.bonus-card__logo {
    width: 80px;
    height: 80px;
    border-radius: var(--radius-md);
    overflow: hidden;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-3);
    box-sizing: border-box;
}

.bonus-card__logo img,
.bonus-card__logo-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

/* Card Title */
.bonus-card__title {
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-bold);
    line-height: var(--line-height-base);
    color: var(--color-text-primary);
    margin: 0;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* Card Description */
.bonus-card__description {
    color: #666;
    margin: 0;
    flex-grow: 1;
    overflow-wrap: break-word;
}

/* Card Button */
.bonus-card__button {
    margin-top: var(--space-3);
    align-self: flex-start;
}

.bonus-card__icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    display: block;
}

/* ============================================
 * FOOTER SECTION
 * Warning text (left) + CTA + Nav arrows (right)
 * ============================================ */

.bonuses-slider__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-6);
    flex-wrap: wrap;
}

/* Warning Text Section */
.bonuses-slider__warning {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    flex: 1;
    min-width: 0;
}

.bonuses-slider__warning-link {
    display: block;
    flex-shrink: 0;
}

.bonuses-slider__warning-icon {
    width: var(--space-6);
    height: var(--space-6);
    flex-shrink: 0;
    display: block;
}

.bonuses-slider__warning-text {
    font-size: var(--font-size-xs);
    line-height: var(--line-height-small);
    color: var(--color-text-muted);
    margin: 0;
}

/* Actions Section (CTA + Navigation) */
.bonuses-slider__actions {
    display: flex;
    align-items: center;
    gap: var(--space-5);
}

/* CTA Link "Ověřte si výhodnost bonusů" */
.bonuses-slider__cta {
    display: inline-flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--button-padding-y) var(--button-padding-x);
    background: transparent;
    color: var(--blue-500);
    border: var(--space-1) solid var(--blue-500);
    border-radius: var(--button-radius);
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-semibold);
    text-decoration: none;
    transition: all var(--transition-base) var(--ease-out);
    white-space: nowrap;
}

.bonuses-slider__cta:hover {
    background: var(--blue-500);
    color: var(--white);
}

.bonuses-slider__cta-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    display: block;
}

/* Navigation Arrows (Desktop only) */
.bonuses-slider__nav {
    display: none;
    gap: var(--space-3);
}

.bonuses-slider__nav-button {
    width: var(--space-9);
    height: var(--space-9);
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--grey-600);
    color: var(--white);
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition-base) var(--ease-out);
}

.bonuses-slider__nav-button:hover {
    background: var(--black);
    transform: scale(1.05);
}

.bonuses-slider__nav-button img {
    width: var(--space-6);
    height: var(--space-6);
    display: block;
}

/* ============================================
 * CAROUSEL DOTS (Mobile Only)
 * ============================================ */

.bonuses-slider__dots {
    display: none;
    justify-content: center;
    gap: var(--space-3);
    margin-top: var(--space-5);
}

.bonuses-slider__dot {
    width: 8px;
    height: 8px;
    border-radius: 4px;
    background: #E8E8E8;
    border: none;
    cursor: pointer;
    transition: width 0.3s ease, background-color 0.3s ease;
    padding: 0;
}

.bonuses-slider__dot--active {
    width: 48px;
    height: 8px;
    border-radius: 4px;
    background: #2D7AE9;
}

.bonuses-slider__dot:hover {
    background: #D0D0D0;
}

.bonuses-slider__dot--active:hover {
    background: #2563C7;
}

/* ============================================
 * RESPONSIVE ADJUSTMENTS
 * ============================================ */

/* Accessibility */
.bonuses-slider__nav-button:focus,
.bonuses-slider__dot:focus {
    outline: var(--space-1) solid var(--blue-500);
    outline-offset: var(--space-1);
}

.bonus-card__button:focus,
.bonuses-slider__cta:focus {
    outline: var(--space-1) solid var(--blue-500);
    outline-offset: var(--space-1);
}

/* ============================================
 * MEDIA QUERIES
 * ============================================ */

@media (min-width: 768px) {
    .bonuses-slider {
        grid-template-columns: 0.7fr 2fr;
        gap: var(--space-6);
    }

    .bonuses-slider__cards {
        grid-column: 2;
        overflow: hidden;
        position: relative;
    }

    .bonuses-slider__cards-track {
        display: flex !important;
        flex-wrap: nowrap !important;
        gap: var(--space-6);
        transition: transform var(--transition-base) var(--ease-out);
        will-change: transform;
        width: 100%;
    }

    .bonuses-slider__cards-track .bonus-card {
        flex-shrink: 0;
        box-sizing: border-box;
        /* Width set by JavaScript based on visible container */
    }

    .bonuses-slider__nav {
        display: flex;
    }
}

@media (max-width: 1024px) {
    .bonus-card {
        align-items: center;
    }

    .bonus-card__description {
        text-align: center;
    }

    .bonus-card__button {
        align-self: center;
    }
}

@media (max-width: 767px) {
    .bonuses-slider__counter {
        display: none;
    }

    .bonuses-slider__title {
        max-width: 100%;
    }

    .bonuses-slider__cards {
        overflow-x: auto;
        overflow-y: hidden;
        scroll-snap-type: x mandatory;
        scroll-behavior: smooth;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        margin: 0;
        padding: 0;
    }

    .bonuses-slider__cards::-webkit-scrollbar {
        display: none;
    }

    .bonuses-slider__cards-track {
        display: flex;
        flex-wrap: nowrap;
        gap: var(--space-4);
    }

    .bonus-card {
        flex-shrink: 0;
        scroll-snap-align: start;
        scroll-snap-stop: always;
        width: calc(100vw - var(--container-padding) * 2 - 60px);
        max-width: 340px;
    }

    .bonuses-slider__footer {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--space-5);
    }

    .bonuses-slider__actions {
        width: 100%;
        flex-direction: column;
        gap: var(--space-5);
    }

    .bonuses-slider__cta {
        width: 100%;
        justify-content: center;
    }

    .bonuses-slider__dots {
        display: flex;
        margin-top: 0;
        order: 2;
    }

    .bonuses-slider__footer {
        order: 3;
    }

    .bonuses-slider__hero {
        min-height: unset;
        gap: 20px;
    }

    /* Ensure cards and dots are in correct visual order */
    .bonuses-slider {
        display: flex;
        flex-direction: column;
    }

    .bonuses-slider__hero {
        order: 1;
    }

    .bonuses-slider__cards {
        order: 2;
    }

    .bonus-card {
        align-items: flex-start;
        border-radius: 16px;
        padding: 16px;
        border: 1px solid #E8E8E8;
    }

    .bonus-card__description {
        text-align: left;
    }

    .bonus-card__button {
        align-self: flex-start;
        padding: 12px;
    }
}
