/* ==================== BOOK SLIDER ==================== */
/* Wraps two .book-promo blocks; slides travel right-to-left. */
.book-slider {
    position: relative;
}

.book-slider__viewport {
    overflow: hidden;
}

.book-slider__track {
    display: flex;
    align-items: flex-start;
    transition: transform 0.7s cubic-bezier(0.22, 0.61, 0.36, 1);
    will-change: transform;
}

.book-slider__slide {
    flex: 0 0 100%;
    min-width: 0;
    box-sizing: border-box;
    padding: 0.5rem 0.25rem;
}

.book-slider__slide[aria-hidden="true"] .book-promo {
    visibility: hidden;
}

.book-slider__slide .book-promo__image {
    margin: 0 auto;
}

.book-slider__slide .book-promo__image img {
    cursor: zoom-in;
}

.book-promo__badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    margin-bottom: 0.75rem;
    background: var(--color-red);
    color: var(--color-white);
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

/* Arrows */
.book-slider__arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 2;
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 9999px;
    border: 1px solid var(--color-slate-200, #E2E8F0);
    background: var(--color-white);
    color: var(--color-dark-2);
    box-shadow: var(--shadow-lg, 0 10px 15px -3px rgba(0,0,0,0.1));
    display: none;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.book-slider__arrow:hover,
.book-slider__arrow:focus-visible {
    background: var(--color-red);
    color: var(--color-white);
    border-color: var(--color-red);
    transform: translateY(-50%) scale(1.05);
}

.book-slider__arrow--prev { left: -0.75rem; }
.book-slider__arrow--next { right: -0.75rem; }

.dark .book-slider__arrow {
    background: var(--color-dark-2);
    color: var(--color-white);
    border-color: rgba(255,255,255,0.15);
}

@media (min-width: 1024px) {
    .book-slider { padding: 0 3.5rem; }
    .book-slider > .book-slider__arrow { display: flex; }
    .book-slider__arrow--prev { left: 0; }
    .book-slider__arrow--next { right: 0; }
}

/* Dots */
.book-slider__dots {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin-top: 2rem;
}

.book-slider__dot {
    position: relative;
    width: 0.75rem;
    height: 0.75rem;
    padding: 0;
    border: none;
    border-radius: 9999px;
    background: var(--color-slate-300);
    cursor: pointer;
    transition: all var(--transition, 0.2s ease);
}

.dark .book-slider__dot {
    background: var(--color-slate-500);
}

.book-slider__dot--active {
    background: var(--color-red);
    width: 2rem;
}

.book-slider__dot::before {
    /* invisible 44px tap target around the small dot */
    content: '';
    position: absolute;
    inset: -1rem -0.5rem;
}

.book-slider__dot:focus-visible {
    outline: 2px solid var(--color-red);
    outline-offset: 3px;
}

/* Mobile: arrows sit inline with the dots */
@media (max-width: 1023px) {
    .book-slider__dots .book-slider__arrow {
        position: static;
        transform: none;
        display: flex;
        width: 2.75rem;
        height: 2.75rem;
        margin: 0 0.5rem;
    }
    .book-slider__dots .book-slider__arrow:hover,
    .book-slider__dots .book-slider__arrow:focus-visible {
        transform: scale(1.05);
    }
}

/* Price row never breaks "25 CHF" onto two lines */
.book-slider .book-promo__price { flex-wrap: wrap; }
.book-slider .book-promo__amount { white-space: nowrap; flex-shrink: 0; }

/* Tablet portrait: theme's 380px + 1fr grid is too tight, stay single column */
@media (min-width: 768px) and (max-width: 899px) {
    .book-slider .book-promo { grid-template-columns: 1fr; gap: 2rem; }
    .book-slider .book-promo__image { max-width: 440px; }
}

/* Small landscape tablets: two columns with a narrower cover */
@media (min-width: 900px) and (max-width: 1023px) {
    .book-slider .book-promo { grid-template-columns: 300px 1fr; gap: 2rem; }
    .book-slider .book-promo__image { max-width: 300px; }
}

/* Small desktops / iPad landscape: give the text column more room */
@media (min-width: 1024px) and (max-width: 1279px) {
    .book-slider .book-promo { grid-template-columns: 320px 1fr; gap: 2.5rem; }
}

/* Phones: single column, no clipped text, full-width buttons */
@media (max-width: 767px) {
    .book-slider__slide { padding: 0.25rem 0; }
    .book-slider .book-promo { gap: 1.75rem; min-width: 0; }
    .book-slider .book-promo__image { width: 100%; max-width: 360px; }
    .book-slider .book-promo__content { min-width: 0; }
    .book-slider .book-promo__title { font-size: 1.5rem; line-height: 1.25; overflow-wrap: anywhere; }
    .book-slider .book-promo__subtitle { font-size: 1rem; }
    .book-slider .book-promo__desc { font-size: 0.95rem; }
    .book-slider .book-promo__price { flex-wrap: wrap; gap: 0.75rem; }
    .book-slider .book-promo__amount { white-space: nowrap; flex-shrink: 0; font-size: 1.35rem; }
    .book-slider .book-promo__buttons { flex-direction: column; gap: 0.75rem; }
    .book-slider .book-promo__buttons .btn { width: 100%; justify-content: center; }
    .book-slider__dots { margin-top: 1.5rem; }
}

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