/* ============================================================
   1860 Travels — Flight & Hotel Deals Grid
   Public cards on /, /flight, /hotels and /deals, and the live
   preview in OMS → Sales & Marketing → Deals Grid (same markup).
   Sizes are in px: the public site's root font is 10px.
   ============================================================ */

.dg-section {
    --dg-navy: #003087;
    --dg-ink: #0b1430;
    --dg-amber: #F3A316;
    --dg-amber-ink: #8a5a00;
    --dg-muted: #5b6478;
    --dg-gap: 20px;
    --dg-per: 5;
    font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    max-width: 1320px;
    margin: 56px auto;
    padding: 0 16px;
    box-sizing: border-box;
    color: var(--dg-ink);
}
.dg-section *, .dg-section *::before, .dg-section *::after { box-sizing: border-box; }
.dg-shell { position: relative; }

/* ── Editorial header (no band) ─────────────────────────── */
.dg-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 22px; }
.dg-head-l { min-width: 0; }
.dg-eyebrow {
    display: inline-flex; align-items: center; gap: 8px;
    font-size: 12.5px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--dg-amber-ink);
}
.dg-eyebrow svg { width: 15px; height: 15px; }
.dg-eyebrow::after { content: ""; width: 36px; height: 2px; border-radius: 2px; background: var(--dg-amber); margin-left: 4px; }
.dg-h { margin: 10px 0 6px; font-size: 34px; line-height: 1.15; font-weight: 800; letter-spacing: -.02em; color: var(--dg-ink); }
.dg-lede { margin: 0; font-size: 15px; color: var(--dg-muted); font-weight: 500; }
.dg-all {
    flex: 0 0 auto; display: inline-flex; align-items: center; gap: 8px; padding: 11px 20px;
    border: 1.5px solid #d6dbe6; border-radius: 999px; background: #fff;
    font-size: 14px; font-weight: 700; color: var(--dg-ink) !important; text-decoration: none !important; white-space: nowrap;
    transition: border-color .2s ease, background .2s ease, transform .2s ease;
}
.dg-all svg { width: 16px; height: 16px; transition: transform .2s ease; }
.dg-all:hover { border-color: var(--dg-ink); background: var(--dg-ink); color: #fff !important; }
.dg-all:hover svg { transform: translateX(3px); }

/* ── Collection tabs ─────────────────────────────────────── */
.dg-pills { display: flex; gap: 8px; margin: 0 0 20px; overflow-x: auto; scrollbar-width: none; }
.dg-pills::-webkit-scrollbar { display: none; }
.dg-pill {
    flex: 0 0 auto; padding: 9px 18px; border-radius: 999px; cursor: pointer;
    border: 1.5px solid #e1e4ec; background: #fff; color: var(--dg-muted);
    font: 700 13.5px/1 inherit; font-family: inherit; transition: all .18s ease;
}
.dg-pill:hover { border-color: var(--dg-ink); color: var(--dg-ink); }
.dg-pill[aria-selected="true"] { background: var(--dg-ink); border-color: var(--dg-ink); color: #fff; }
.dg-pill:focus-visible, .dg-all:focus-visible, .dg-arrow:focus-visible, .dg-card:focus-visible { outline: 3px solid var(--dg-amber); outline-offset: 3px; }

/* ── Track ───────────────────────────────────────────────── */
.dg-panel[hidden] { display: none; }
.dg-viewport { position: relative; }
.dg-track {
    list-style: none; margin: 0; padding: 6px 2px 18px;
    display: flex; gap: var(--dg-gap);
    overflow-x: auto; scroll-snap-type: x mandatory; scroll-behavior: smooth;
    scrollbar-width: none; overscroll-behavior-x: contain;
}
.dg-track::-webkit-scrollbar { display: none; }
.dg-item {
    flex: 0 0 calc((100% - (var(--dg-per) - 1) * var(--dg-gap)) / var(--dg-per));
    min-width: 0; scroll-snap-align: start; display: flex;
}
.dg-arrow {
    position: absolute; top: calc(50% - 30px); z-index: 4; width: 48px; height: 48px; border-radius: 50%;
    display: grid; place-items: center; cursor: pointer; padding: 0;
    border: 0; background: #fff; color: var(--dg-ink);
    box-shadow: 0 10px 28px rgba(11, 20, 48, .22); transition: opacity .2s ease, transform .2s ease;
}
.dg-arrow svg { width: 20px; height: 20px; }
.dg-arrow:hover { transform: scale(1.07); }
.dg-prev { left: -20px; }
.dg-next { right: -20px; }
.dg-arrow[disabled] { opacity: 0; pointer-events: none; }

/* ── Card: full-bleed photo, details over a soft gradient ── */
.dg-card {
    position: relative; display: block; width: 100%; aspect-ratio: 4 / 5; min-height: 340px;
    border-radius: 22px; overflow: hidden; isolation: isolate;
    background: #1a2540; color: #fff !important; text-decoration: none !important;
    box-shadow: 0 2px 4px rgba(11, 20, 48, .06), 0 12px 28px rgba(11, 20, 48, .12);
    transition: transform .35s cubic-bezier(.2,.7,.2,1), box-shadow .35s ease;
}
.dg-card:hover { transform: translateY(-6px); box-shadow: 0 4px 8px rgba(11, 20, 48, .08), 0 24px 48px rgba(11, 20, 48, .22); }

.dg-media { position: absolute; inset: 0; z-index: -2; background: linear-gradient(110deg, #22304f 30%, #2d3d62 50%, #22304f 70%); background-size: 200% 100%; animation: dg-shimmer 1.4s linear infinite; }
.dg-media.is-loaded { animation: none; }
.dg-media img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .9s cubic-bezier(.2,.7,.2,1); }
.dg-card:hover .dg-media img { transform: scale(1.07); }
@keyframes dg-shimmer { to { background-position: -200% 0; } }

.dg-shade {
    position: absolute; inset: 0; z-index: -1; pointer-events: none;
    background:
        linear-gradient(180deg, rgba(6, 12, 30, .38) 0%, rgba(6, 12, 30, 0) 22%),
        linear-gradient(180deg, rgba(6, 12, 30, 0) 30%, rgba(6, 12, 30, .45) 46%, rgba(6, 12, 30, .82) 64%, rgba(6, 12, 30, .96) 100%);
}

/* Badge: a solid, high-contrast label — reads on any photo. */
.dg-badge {
    position: absolute; top: 14px; left: 14px; max-width: calc(100% - 100px);
    display: inline-flex; align-items: center; padding: 7px 12px; border-radius: 8px;
    font-size: 11px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; line-height: 1;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    color: #fff; background: #0b2a6f;
    box-shadow: 0 6px 16px rgba(0, 0, 0, .28), inset 0 0 0 1px rgba(255, 255, 255, .12);
}
.dg-tone-black { background: linear-gradient(135deg, #141414 0%, #2a2a2a 100%); color: #f7c35a; box-shadow: 0 6px 16px rgba(0, 0, 0, .35), inset 0 0 0 1px rgba(247, 195, 90, .55); }
.dg-tone-red { background: linear-gradient(135deg, #ef4135 0%, #c81e1e 100%); }
.dg-tone-green { background: linear-gradient(135deg, #16a34a 0%, #0f7a37 100%); }
.dg-tone-amber { background: linear-gradient(135deg, #ffc247 0%, #f3a316 100%); color: #2a1a00; }
.dg-tone-purple { background: linear-gradient(135deg, #7c3aed 0%, #5b21b6 100%); }
.dg-tone-navy { background: linear-gradient(135deg, #123a8f 0%, #0b2a6f 100%); }
.dg-tone-blue { background: linear-gradient(135deg, #1e9be6 0%, #0b6fb8 100%); }

/* The saving, top-right: only on discounted cards. */
.dg-save {
    position: absolute; top: 14px; right: 14px;
    display: inline-flex; align-items: center; justify-content: center; min-width: 52px; height: 30px; padding: 0 10px;
    border-radius: 999px; background: #e5322d; color: #fff; font-size: 13px; font-weight: 800; letter-spacing: .01em;
    box-shadow: 0 6px 16px rgba(229, 50, 45, .4);
}

.dg-body { position: absolute; left: 0; right: 0; bottom: 0; padding: 18px 18px 18px; display: flex; flex-direction: column; }
.dg-place {
    display: inline-flex; align-items: center; gap: 5px; margin-bottom: 6px;
    font-size: 11.5px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: rgba(255, 255, 255, .78);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.dg-place svg { width: 12px; height: 12px; flex: 0 0 auto; }
.dg-title { margin: 0; font-size: 21px; line-height: 1.2; font-weight: 800; letter-spacing: -.01em; color: #fff; text-shadow: 0 1px 12px rgba(0, 0, 0, .25); overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.dg-sub { margin: 5px 0 0; min-height: 18px; font-size: 13.5px; font-weight: 500; color: rgba(255, 255, 255, .82); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dg-stars { color: var(--dg-amber); letter-spacing: 1px; margin-right: 6px; }

.dg-foot { display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; margin-top: 14px; padding-top: 14px; border-top: 1px solid rgba(255, 255, 255, .18); }
.dg-price { min-width: 0; display: flex; flex-direction: column; }
.dg-from { display: flex; align-items: baseline; gap: 8px; font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: rgba(255, 255, 255, .7); white-space: nowrap; }
.dg-was { font-size: 12.5px; font-weight: 600; letter-spacing: 0; text-transform: none; color: rgba(255, 255, 255, .62); text-decoration: line-through; text-decoration-color: rgba(255, 120, 110, .9); text-decoration-thickness: 1.5px; }
.dg-amt { font-size: 22px; line-height: 1.15; font-weight: 800; color: #fff; white-space: nowrap; letter-spacing: -.01em; }
.dg-unit { font-size: 12px; font-weight: 500; color: rgba(255, 255, 255, .72); white-space: nowrap; }

/* A round arrow button, so the price always has the full width; it gains a label on phones,
   where it sits under the price instead (see the mobile block). */
.dg-cta {
    flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    width: 46px; height: 46px; padding: 0; border-radius: 50%;
    font-size: 13.5px; font-weight: 800; background: #fff; color: var(--dg-ink);
    box-shadow: 0 6px 16px rgba(0, 0, 0, .28); transition: transform .25s ease, background .25s ease;
}
.dg-cta-t { display: none; }
.dg-cta svg { width: 18px; height: 18px; transition: transform .25s ease; }
.dg-amber .dg-cta { background: var(--dg-amber); color: #1d1400; }
.dg-card:hover .dg-cta { transform: scale(1.08); }
.dg-card:hover .dg-cta svg { transform: translateX(2px); }

/* ── Dots + note ─────────────────────────────────────────── */
.dg-dots { display: flex; justify-content: center; gap: 7px; min-height: 8px; }
.dg-dots button { width: 8px; height: 8px; padding: 0; border: 0; border-radius: 999px; background: #cfd5e2; cursor: pointer; transition: width .25s ease, background .25s ease; }
.dg-dots button.on { width: 26px; background: var(--dg-ink); }
.dg-note { margin: 14px 0 0; font-size: 12.5px; color: #7a8295; text-align: center; }

/* ── Responsive: 5 / 4 / 3 / 2 per row ───────────────────── */
@media (max-width: 1199px) { .dg-section { --dg-per: 4; } }
@media (max-width: 991px)  { .dg-section { --dg-per: 3; } .dg-h { font-size: 28px; } }
@media (max-width: 767px) { .dg-head { flex-direction: column; align-items: flex-start; gap: 14px; } }
@media (max-width: 639px) {
    .dg-section { --dg-per: 2; --dg-gap: 12px; margin: 36px auto; }
    .dg-h { font-size: 23px; margin: 8px 0 4px; }
    .dg-lede { font-size: 13px; }
    .dg-all { padding: 9px 16px; font-size: 13px; }
    .dg-arrow { display: none; }
    .dg-card { border-radius: 16px; min-height: 270px; aspect-ratio: 3 / 4.4; }
    .dg-badge { top: 10px; left: 10px; padding: 5px 8px; font-size: 9px; letter-spacing: .08em; border-radius: 6px; max-width: calc(100% - 66px); }
    .dg-save { top: 10px; right: 10px; min-width: 40px; height: 24px; padding: 0 7px; font-size: 11px; }
    .dg-was { font-size: 10.5px; }
    .dg-body { padding: 12px; }
    .dg-place { font-size: 9.5px; margin-bottom: 4px; }
    .dg-title { font-size: 15px; }
    .dg-sub { font-size: 11.5px; min-height: 15px; }
    .dg-foot { margin-top: 10px; padding-top: 10px; flex-direction: column; align-items: stretch; gap: 10px; }
    .dg-amt { font-size: 17px; }
    .dg-from, .dg-unit { font-size: 10px; }
    .dg-cta { width: auto; height: 36px; border-radius: 999px; font-size: 12.5px; }
    .dg-cta-t { display: inline; }
    .dg-card:hover .dg-cta { transform: none; }
}

@media (prefers-reduced-motion: reduce) {
    .dg-track { scroll-behavior: auto; }
    .dg-card, .dg-media img, .dg-cta, .dg-cta svg, .dg-all, .dg-arrow { transition: none; }
    .dg-card:hover, .dg-card:hover .dg-media img { transform: none; }
    .dg-media { animation: none; }
}
