/**
 * Homepage "Best Selling Packages" carousel (Views/Home/_BestSellingPackages).
 *
 * Plain CSS on purpose - no Tailwind build step. Every colour comes from the
 * six custom properties at the top of .bsp, so the palette lives in one place.
 * Logical properties (inset-inline-start, margin-inline...) keep it correct in RTL.
 */

.bsp {
    --bsp-accent: #8B2225;
    --bsp-accent-text: #FFFFFF;
    --bsp-badge: #C8A04A;
    --bsp-bg: #FBF6F1;
    --bsp-heading: #1F1A17;
    --bsp-price: #8B2225;

    --bsp-radius: 22px;
    --bsp-gap: 20px;
    --bsp-muted: color-mix(in srgb, var(--bsp-heading) 62%, transparent);
    --bsp-line: color-mix(in srgb, var(--bsp-heading) 12%, transparent);

    /* Columns follow the section's own width rather than the viewport's. */
    container: bsp / inline-size;

    position: relative;
    isolation: isolate;
    overflow: hidden;
    padding-block: 48px 40px;
    background:
        radial-gradient(60% 80% at 0% 0%, color-mix(in srgb, var(--bsp-accent) 9%, transparent), transparent 70%),
        radial-gradient(50% 70% at 100% 100%, color-mix(in srgb, var(--bsp-badge) 14%, transparent), transparent 70%),
        var(--bsp-bg);
}

.bsp .material-symbols-outlined {
    font-size: 18px;
    line-height: 1;
}

/* ---- Heading row ------------------------------------------------------ */

.bsp-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
    margin-block-end: 24px;
}

.bsp-title {
    margin: 0;
    color: var(--bsp-heading);
    font-size: 28px;
    font-weight: 900;
    line-height: 1.1;
    letter-spacing: -0.02em;
}

.bsp-subtitle {
    max-width: 580px;
    margin: 10px 0 0;
    color: var(--bsp-muted);
    font-size: 15px;
    line-height: 1.6;
}

.bsp-nav {
    display: none;
    flex-shrink: 0;
    gap: 10px;
}

.bsp-arrow {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border: 1.5px solid var(--bsp-accent);
    border-radius: 999px;
    background: #FFFFFF;
    color: var(--bsp-accent);
    cursor: pointer;
    box-shadow: 0 6px 18px -8px color-mix(in srgb, var(--bsp-accent) 45%, transparent);
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.bsp-arrow:hover:not(:disabled) {
    transform: translateY(-2px);
}

.bsp-arrow:disabled {
    opacity: 0.35;
    cursor: default;
    box-shadow: none;
}

.bsp-arrow-icon {
    font-size: 22px !important;
}

/* ---- Track ------------------------------------------------------------ */

.bsp-track {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: 84%;
    gap: var(--bsp-gap);
    margin: -10px -6px 0;
    padding: 10px 6px 26px;
    list-style: none;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-snap-type: x mandatory;
    scroll-padding-inline: 6px;
    scrollbar-width: none;
}

.bsp-track::-webkit-scrollbar {
    display: none;
}

.bsp-slide {
    display: flex;
    scroll-snap-align: start;
}

/* ---- Card ------------------------------------------------------------- */

.bsp-card {
    display: flex;
    flex-direction: column;
    width: 100%;
    overflow: hidden;
    border-radius: var(--bsp-radius);
    background: #FFFFFF;
    box-shadow:
        0 1px 2px rgba(20, 12, 8, 0.05),
        0 16px 36px -18px rgba(20, 12, 8, 0.28);
    transition: transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.35s ease;
}

.bsp-card:hover {
    transform: translateY(-6px);
    box-shadow:
        0 1px 2px rgba(20, 12, 8, 0.05),
        0 26px 48px -20px rgba(20, 12, 8, 0.38);
}

.bsp-media {
    position: relative;
    height: 220px;
    overflow: hidden;
    background: color-mix(in srgb, var(--bsp-heading) 8%, #FFFFFF);
}

.bsp-image {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.7s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.bsp-card:hover .bsp-image {
    transform: scale(1.06);
}

.bsp-shade {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(10, 6, 4, 0.72) 0%, rgba(10, 6, 4, 0.12) 45%, rgba(10, 6, 4, 0.05) 70%, rgba(10, 6, 4, 0.3) 100%);
}

/* Ribbon flush to the card's start edge. */
.bsp-badge {
    position: absolute;
    inset-block-start: 16px;
    inset-inline-start: 0;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 14px 6px 10px;
    border-start-end-radius: 999px;
    border-end-end-radius: 999px;
    background: var(--bsp-badge);
    color: #FFFFFF;
    font-size: 11.5px;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    text-shadow: 0 1px 1px rgba(0, 0, 0, 0.2);
    box-shadow: 0 6px 14px -6px rgba(0, 0, 0, 0.45);
}

.bsp-badge .material-symbols-outlined {
    font-size: 16px;
}

.bsp-duration {
    position: absolute;
    inset-block-start: 14px;
    inset-inline-end: 14px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 11px;
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.18);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    color: #FFFFFF;
    font-size: 12.5px;
    font-weight: 700;
}

.bsp-duration .material-symbols-outlined {
    font-size: 16px;
}

.bsp-destination {
    position: absolute;
    inset-inline: 16px;
    inset-block-end: 14px;
    display: flex;
    align-items: center;
    gap: 4px;
    margin: 0;
    overflow: hidden;
    color: #FFFFFF;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.01em;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.bsp-body {
    display: flex;
    flex: 1;
    flex-direction: column;
    padding: 18px 20px 16px;
}

.bsp-name {
    margin: 0;
    color: var(--bsp-heading);
    font-size: 18px;
    font-weight: 800;
    line-height: 1.3;
    letter-spacing: -0.01em;
}

/* Two lines, always - a short summary still reserves both, so every card's
   inclusions and price start at the same height. */
.bsp-description {
    display: -webkit-box;
    min-height: calc(2 * 1.55em);
    margin: 6px 0 0;
    overflow: hidden;
    color: var(--bsp-muted);
    font-size: 13.5px;
    line-height: 1.55;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;
}

.bsp-inclusions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 14px 0 0;
    padding: 0;
    list-style: none;
}

.bsp-inclusion {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px 4px 7px;
    border: 1px solid color-mix(in srgb, var(--bsp-accent) 16%, transparent);
    border-radius: 999px;
    background: color-mix(in srgb, var(--bsp-accent) 6%, #FFFFFF);
    color: color-mix(in srgb, var(--bsp-heading) 85%, transparent);
    font-size: 12px;
    font-weight: 600;
}

.bsp-inclusion .material-symbols-outlined {
    color: var(--bsp-accent);
    font-size: 16px;
}

/* ---- Boarding-pass tear line ----------------------------------------- */

.bsp-perforation {
    position: relative;
    margin-inline: 20px;
    border-block-start: 2px dashed var(--bsp-line);
}

.bsp-perforation::before,
.bsp-perforation::after {
    content: "";
    position: absolute;
    inset-block-start: -12px;
    width: 22px;
    height: 22px;
    border-radius: 999px;
    background: var(--bsp-bg);
    box-shadow: inset 0 2px 4px rgba(20, 12, 8, 0.08);
}

.bsp-perforation::before {
    inset-inline-start: -32px;
}

.bsp-perforation::after {
    inset-inline-end: -32px;
}

/* ---- Price + Book Now ------------------------------------------------- */

.bsp-foot {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 20px 20px;
}

.bsp-price {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.bsp-price-label,
.bsp-price-suffix {
    color: var(--bsp-muted);
    font-size: 11.5px;
    font-weight: 600;
}

.bsp-price-label {
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.bsp-price-value {
    color: var(--bsp-price);
    font-size: 24px;
    font-weight: 900;
    line-height: 1.15;
    letter-spacing: -0.01em;
    white-space: nowrap;
}

.bsp-currency {
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0.04em;
}

.bsp-book {
    display: inline-flex;
    flex-shrink: 0;
    align-items: center;
    gap: 6px;
    padding: 12px 16px;
    border-radius: 12px;
    background: var(--bsp-accent);
    color: var(--bsp-accent-text);
    font-size: 14px;
    font-weight: 800;
    text-decoration: none;
    box-shadow: 0 10px 20px -10px color-mix(in srgb, var(--bsp-accent) 70%, transparent);
}

.bsp-book-icon {
    transition: transform 0.25s ease;
}

.bsp-book:hover .bsp-book-icon {
    transform: translateX(3px);
}

.bsp-book:focus-visible,
.bsp-arrow:focus-visible {
    outline: 3px solid color-mix(in srgb, var(--bsp-accent) 45%, transparent);
    outline-offset: 2px;
}

/* ---- Progress --------------------------------------------------------- */

.bsp-progress {
    position: relative;
    height: 4px;
    overflow: hidden;
    border-radius: 999px;
    background: var(--bsp-line);
}

.bsp-progress-bar {
    position: absolute;
    inset-block: 0;
    inset-inline-start: 0;
    width: 100%;
    border-radius: inherit;
    background: var(--bsp-accent);
    transition: transform 0.2s ease-out, width 0.2s ease-out;
}

/* ---- RTL -------------------------------------------------------------- */

[dir="rtl"] .bsp-arrow-icon,
[dir="rtl"] .bsp-book-icon {
    transform: scaleX(-1);
}

[dir="rtl"] .bsp-book:hover .bsp-book-icon {
    transform: scaleX(-1) translateX(3px);
}

/* ---- Breakpoints ------------------------------------------------------ */
/* Container widths (the section's own width); the card stays ~280px+ wide. */

@container bsp (min-width: 600px) {
    .bsp-track {
        grid-auto-columns: calc((100% - var(--bsp-gap)) / 2);
    }

    .bsp-nav {
        display: flex;
    }
}

@container bsp (min-width: 900px) {
    .bsp-head {
        margin-block-end: 32px;
    }

    .bsp-title {
        font-size: 40px;
    }

    .bsp-track {
        grid-auto-columns: calc((100% - 2 * var(--bsp-gap)) / 3);
    }

    .bsp-media {
        height: 230px;
    }
}

@container bsp (min-width: 1240px) {
    .bsp-track {
        grid-auto-columns: calc((100% - 3 * var(--bsp-gap)) / 4);
    }
}

/* Vertical rhythm matches the promo banner's: 900px = the site's compact breakpoint. */
@media (min-width: 900px) {
    .bsp {
        padding-block: 72px 56px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .bsp-card,
    .bsp-image,
    .bsp-arrow,
    .bsp-book-icon,
    .bsp-progress-bar {
        transition: none;
    }

    .bsp-card:hover,
    .bsp-card:hover .bsp-image {
        transform: none;
    }
}
