/* Cars Empire brand layer. Loaded after Bootstrap and style.css.
   Palette taken from the logo: black tile, royal blue car, yellow lights. */
:root {
    /* brand */
    --ce-black: #0a0a0a;
    --ce-ink: #1a1a1a;
    --ce-blue: #0542d4;
    --ce-blue-dark: #0e308f;
    --ce-blue-deep: #02092e;
    --ce-yellow: #facb0b;
    --ce-yellow-dark: #e0b400;
    /* neutrals */
    --ce-white: #ffffff;
    --ce-surface: #f4f5f7;
    --ce-line: #dfe2e8;
    --ce-muted: #5b6472;
    /* meaning */
    --ce-good: #15803d;
    --ce-bad: #b91c1c;
    /* shape and type */
    --ce-radius: 12px;
    --ce-radius-lg: 20px;
    --ce-shadow: 0 10px 30px rgba(10, 10, 10, 0.12);
    --ce-font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans Arabic", Tahoma, sans-serif;
    --ce-display: "Barlow Condensed", "Arial Narrow", "Roboto Condensed", var(--ce-font);

    /* map the old stylesheet's names and Bootstrap onto the brand */
    --primary-color: var(--ce-blue);
    --primary-dark: var(--ce-blue-dark);
    --accent-color: var(--ce-yellow);
    --light-color: var(--ce-surface);
    --dark-color: var(--ce-ink);
    --border-color: var(--ce-line);
    --bs-primary: #0542d4;
    --bs-primary-rgb: 5, 66, 212;
    --bs-link-color: #0542d4;
    --bs-link-color-rgb: 5, 66, 212;
    --bs-link-hover-color: #0e308f;
    --bs-link-hover-color-rgb: 14, 48, 143;
    --bs-body-color: #1a1a1a;
    --bs-body-bg: #f4f5f7;
    --bs-border-radius: 12px;
    --bs-border-color: #dfe2e8;
}

body {
    font-family: var(--ce-font);
    background: var(--ce-surface);
    color: var(--ce-ink);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}
main { flex: 1 0 auto; }

h1, h2, .ce-display {
    font-family: var(--ce-display);
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.01em;
    line-height: 1.02;
}
h1 { font-size: clamp(2.2rem, 5vw, 3.6rem); }
h2 { font-size: clamp(1.7rem, 3.2vw, 2.4rem); }
h3, h4, h5, h6 { font-weight: 700; letter-spacing: -0.01em; }
.text-gradient { background: none; -webkit-text-fill-color: currentColor; color: inherit; }
.text-primary { color: var(--ce-blue) !important; }
.bg-primary { background-color: var(--ce-blue) !important; }
.text-muted { color: var(--ce-muted) !important; }

/* visible keyboard focus everywhere */
a:focus-visible, button:focus-visible, .btn:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, [tabindex]:focus-visible {
    outline: 3px solid var(--ce-blue);
    outline-offset: 2px;
    box-shadow: none;
}
.ce-header a:focus-visible, .ce-header button:focus-visible, .ce-hero a:focus-visible, .ce-footer a:focus-visible { outline-color: var(--ce-yellow); }

/* ---------- buttons: yellow is the one call to action ---------- */
.btn {
    min-height: 44px;
    padding: 0.6rem 1.25rem;
    border-radius: var(--ce-radius);
    font-weight: 700;
    transition: background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease, transform 0.12s ease;
}
.btn:active { transform: translateY(1px); }
.btn-sm { min-height: 36px; padding: 0.35rem 0.85rem; }
.btn-lg { min-height: 54px; padding: 0.8rem 1.6rem; font-size: 1.05rem; }
.btn-primary, .btn-primary:disabled, .btn-warning {
    background: var(--ce-yellow);
    border-color: var(--ce-yellow);
    color: var(--ce-black);
}
.btn-primary:hover, .btn-primary:focus, .btn-primary:active, .btn-warning:hover,
.btn-check:checked + .btn-primary, .btn-primary.active {
    background: var(--ce-yellow-dark) !important;
    border-color: var(--ce-yellow-dark) !important;
    color: var(--ce-black) !important;
}
.btn-outline-primary { border: 2px solid var(--ce-ink); color: var(--ce-ink); background: transparent; }
.btn-outline-primary:hover, .btn-outline-primary:focus, .btn-outline-primary:active {
    background: var(--ce-ink) !important;
    border-color: var(--ce-ink) !important;
    color: var(--ce-white) !important;
}
.btn-secondary, .btn-dark { background: var(--ce-ink); border-color: var(--ce-ink); color: var(--ce-white); }
.btn-secondary:hover, .btn-dark:hover { background: #000; border-color: #000; }
.btn-outline-secondary { border: 2px solid var(--ce-line); color: var(--ce-ink); }
.btn-outline-secondary:hover { background: var(--ce-surface); border-color: var(--ce-ink); color: var(--ce-ink); }
.btn-light { background: var(--ce-white); border-color: var(--ce-white); color: var(--ce-black); }

/* ---------- surfaces ---------- */
.card {
    border: 1px solid var(--ce-line);
    border-radius: var(--ce-radius-lg);
    box-shadow: none;
    overflow: hidden;
    background: var(--ce-white);
}
a.card, .card.card-hover, .merchant-card, .deal-card, .category-card { transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease; }
a.card:hover, .card.card-hover:hover, .merchant-card:hover, .deal-card:hover, .category-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--ce-shadow);
    border-color: var(--ce-ink);
}
.card-header { background: var(--ce-white); border-bottom: 1px solid var(--ce-line); font-weight: 700; }
.card-header.bg-primary, .card-header.bg-info, .card-header.bg-warning { background: var(--ce-black) !important; color: var(--ce-white) !important; }
.badge { font-weight: 700; border-radius: 999px; padding: 0.4em 0.75em; }
.badge.bg-primary { background: var(--ce-blue) !important; }
.badge.bg-warning, .badge.bg-danger.discount, .discount-badge { background: var(--ce-yellow) !important; color: var(--ce-black) !important; }
.badge.bg-success { background: var(--ce-good) !important; }
.alert { border-radius: var(--ce-radius); border: 1px solid var(--ce-line); }
.list-group-item.active { background: var(--ce-black); border-color: var(--ce-black); }
.dropdown-menu { border-radius: var(--ce-radius); border-color: var(--ce-line); box-shadow: var(--ce-shadow); padding: 0.4rem; }
.dropdown-item { border-radius: 8px; min-height: 40px; display: flex; align-items: center; }
.dropdown-item:active { background: var(--ce-black); }
.modal-content { border-radius: var(--ce-radius-lg); border: 0; }
.table > :not(caption) > * > * { padding: 0.85rem 0.75rem; }

/* ---------- forms ---------- */
.form-control, .form-select {
    min-height: 48px;
    border-radius: var(--ce-radius);
    border: 1px solid var(--ce-line);
    font-size: 1rem;
    background-color: var(--ce-white);
}
.form-control:focus, .form-select:focus { border-color: var(--ce-blue); box-shadow: 0 0 0 3px rgba(5, 66, 212, 0.18); }
.form-label { font-weight: 600; font-size: 0.9rem; margin-bottom: 0.35rem; }
.form-range::-webkit-slider-thumb { background: var(--ce-blue); }
.form-range::-moz-range-thumb { background: var(--ce-blue); }
.form-check-input:checked { background-color: var(--ce-blue); border-color: var(--ce-blue); }

/* ---------- header ---------- */
.ce-strip { background: var(--ce-yellow); color: var(--ce-black); font-weight: 600; font-size: 0.875rem; text-align: center; padding: 0.45rem 1rem; }
.ce-header { background: var(--ce-black); color: var(--ce-white); position: sticky; top: 0; z-index: 1030; }
.ce-header .ce-bar { display: flex; align-items: center; gap: 1rem; padding: 0.75rem 0; }
.ce-brand { display: flex; align-items: center; gap: 0.7rem; color: var(--ce-white); text-decoration: none; margin-inline-end: auto; }
.ce-brand img { width: 44px; height: 44px; border-radius: 10px; }
.ce-brand span { font-family: var(--ce-display); font-weight: 800; font-size: 1.7rem; letter-spacing: 0.02em; text-transform: uppercase; line-height: 1; }
.ce-brand span b { color: var(--ce-yellow); font-weight: 800; }
.ce-brand:hover { color: var(--ce-white); }
.ce-tools { display: flex; align-items: center; gap: 0.35rem; }
.ce-tool {
    display: inline-flex; align-items: center; gap: 0.5rem; min-height: 44px; padding: 0 0.85rem;
    border: 0; border-radius: var(--ce-radius); background: transparent; color: var(--ce-white);
    font-weight: 600; font-size: 0.95rem; text-decoration: none; position: relative; white-space: nowrap;
}
.ce-tool:hover, .ce-tool:focus, .ce-tool[aria-expanded="true"] { background: rgba(255, 255, 255, 0.12); color: var(--ce-white); }
.ce-tool i { font-size: 1.25rem; }
.ce-tool .ce-count {
    position: absolute; top: 4px; inset-inline-start: 26px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
    background: var(--ce-yellow); color: var(--ce-black); font-size: 11px; font-weight: 800; line-height: 18px; text-align: center;
}
.ce-tool.ce-join { background: var(--ce-yellow); color: var(--ce-black); }
.ce-tool.ce-join:hover { background: var(--ce-yellow-dark); color: var(--ce-black); }
.ce-nav { display: flex; gap: 0.5rem; padding-bottom: 0.85rem; overflow-x: auto; scrollbar-width: none; }
.ce-nav::-webkit-scrollbar { display: none; }
.ce-nav a {
    flex: none; display: inline-flex; align-items: center; gap: 0.55rem; min-height: 44px; padding: 0 1rem;
    border: 2px solid transparent; border-radius: 999px; color: rgba(255, 255, 255, 0.82);
    font-weight: 600; text-decoration: none; white-space: nowrap;
}
.ce-nav a:hover { color: var(--ce-white); background: rgba(255, 255, 255, 0.1); }
.ce-nav a.active { color: var(--ce-white); border-color: var(--ce-yellow); }
.ce-nav i { font-size: 1.15rem; }
.ce-search { position: relative; flex: 1 1 320px; max-width: 420px; }
.ce-search input {
    width: 100%; min-height: 44px; border: 1px solid rgba(255, 255, 255, 0.25); border-radius: 999px;
    background: rgba(255, 255, 255, 0.08); color: var(--ce-white); padding: 0 1rem 0 2.6rem; font-size: 1rem;
}
.ce-search input::placeholder { color: rgba(255, 255, 255, 0.65); }
.ce-search input:focus { background: var(--ce-white); color: var(--ce-ink); border-color: var(--ce-white); outline: 3px solid var(--ce-yellow); outline-offset: 2px; }
.ce-search i { position: absolute; top: 50%; inset-inline-start: 1rem; transform: translateY(-50%); color: rgba(255, 255, 255, 0.75); pointer-events: none; }
.ce-search input:focus + i, .ce-search:focus-within i { color: var(--ce-muted); }

/* ---------- home hero with the search card ---------- */
.ce-hero { background: linear-gradient(180deg, var(--ce-black) 0%, #15171c 70%, #2a2d34 100%); color: var(--ce-white); padding: 1.5rem 0 5.5rem; }
.ce-hero h1 { color: var(--ce-white); margin: 0 0 0.6rem; }
.ce-hero h1 em { font-style: normal; color: var(--ce-yellow); }
.ce-hero p.lead { color: rgba(255, 255, 255, 0.82); max-width: 44ch; font-size: 1.1rem; margin-bottom: 1.5rem; }
.ce-finder { background: var(--ce-white); color: var(--ce-ink); border-radius: var(--ce-radius-lg); padding: 1.25rem; box-shadow: var(--ce-shadow); }
.ce-tabs { display: inline-flex; gap: 0.4rem; margin-bottom: 1rem; }
.ce-tabs label {
    display: inline-flex; align-items: center; gap: 0.5rem; min-height: 44px; padding: 0 1.1rem; border-radius: 999px;
    background: var(--ce-surface); color: var(--ce-ink); font-weight: 700; cursor: pointer; margin: 0;
}
.ce-tabs input { position: absolute; opacity: 0; pointer-events: none; }
.ce-tabs input:checked + label { background: var(--ce-black); color: var(--ce-white); }
.ce-tabs input:focus-visible + label { outline: 3px solid var(--ce-blue); outline-offset: 2px; }
.ce-finder .ce-fields { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr) auto; gap: 0.85rem; align-items: end; }
.ce-finder .form-control, .ce-finder .form-select { min-height: 54px; background-color: var(--ce-surface); border-color: transparent; }
.ce-finder .btn { min-height: 54px; min-width: 160px; }
@media (max-width: 767.98px) {
    .ce-finder .ce-fields { grid-template-columns: minmax(0, 1fr); }
    .ce-finder .btn { width: 100%; }
    .ce-hero { padding-bottom: 4rem; }
}

/* ---------- brand band and value props ---------- */
.ce-band { background: var(--ce-blue); color: var(--ce-white); text-align: center; padding: 2.75rem 1rem; margin-top: -3rem; }
.ce-band .ce-display { font-size: clamp(2.6rem, 8vw, 6rem); margin: 0; color: var(--ce-white); }
.ce-band .ce-display em { font-style: normal; color: var(--ce-yellow); }
.ce-band p { margin: 0.6rem 0 0; font-weight: 600; font-size: 1.1rem; }
.ce-props { padding: 3.5rem 0 1rem; }
.ce-prop .ce-kicker { display: flex; align-items: center; gap: 0.6rem; font-weight: 700; color: var(--ce-ink); margin-bottom: 0.5rem; }
.ce-prop .ce-kicker i { font-size: 1.5rem; color: var(--ce-blue); }
.ce-prop h3 { font-size: 1.45rem; line-height: 1.2; margin: 0 0 0.4rem; }
.ce-prop p { color: var(--ce-muted); margin: 0; }

/* ---------- sections ---------- */
.ce-section { padding: 3rem 0 0; }
.ce-section > .ce-head, .ce-head { display: flex; align-items: end; justify-content: space-between; gap: 1rem; margin-bottom: 1.5rem; }
.ce-head h2 { margin: 0; }
.ce-head a { font-weight: 700; color: var(--ce-ink); text-decoration: underline; text-underline-offset: 4px; white-space: nowrap; }
main h2.text-center { text-align: start !important; }
.category-card { border: 1px solid var(--ce-line); border-radius: var(--ce-radius-lg); background: var(--ce-white); padding: 1.1rem 0.75rem; height: 100%; }
.category-card:hover { border-color: var(--ce-ink); }
.swiper-button-next, .swiper-button-prev { color: var(--ce-ink); }
#merchant-map { border-radius: var(--ce-radius-lg); border: 1px solid var(--ce-line); height: 460px; }
.merchant-map .card { border-radius: var(--ce-radius-lg); }
.merchant-popup .btn { color: var(--ce-black); }
.loading-spinner .spinner-border, .spinner-border.text-primary { color: var(--ce-blue) !important; }
.page-link { color: var(--ce-ink); min-width: 44px; min-height: 44px; display: grid; place-items: center; }
.page-item.active .page-link { background: var(--ce-black); border-color: var(--ce-black); }

/* ---------- footer ---------- */
.ce-footer { background: var(--ce-black); color: rgba(255, 255, 255, 0.78); margin-top: 4rem; padding: 3rem 0 1.5rem; flex-shrink: 0; }
.ce-footer h3 { color: var(--ce-white); font-size: 1rem; margin-bottom: 0.9rem; }
.ce-footer a { color: rgba(255, 255, 255, 0.78); text-decoration: none; display: inline-flex; align-items: center; min-height: 36px; }
.ce-footer a:hover { color: var(--ce-yellow); }
.ce-footer ul { list-style: none; padding: 0; margin: 0; }
.ce-footer .ce-legal { border-top: 1px solid rgba(255, 255, 255, 0.16); margin-top: 2rem; padding-top: 1.25rem; font-size: 0.9rem; display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; justify-content: space-between; }

/* sections inside the page container must not add a second set of side paddings */
main.container .container { padding-left: 0; padding-right: 0; max-width: none; }
.category-card .card-body { padding: 0.5rem; }
.category-circle { width: 84px !important; height: 84px !important; max-width: 100%; object-fit: contain; border-radius: 50%; background: var(--ce-surface); padding: 12px; }
.category-card .card-title { font-size: 1rem; margin: 0.6rem 0 0.2rem; }

@media (max-width: 767.98px) {
    .ce-header .ce-bar { flex-wrap: wrap; gap: 0.5rem; }
    .ce-brand { flex: 1 1 auto; min-width: 0; gap: 0.5rem; }
    .ce-brand img { width: 38px; height: 38px; }
    .ce-brand span { font-size: 1.25rem; white-space: nowrap; }
    .ce-tools { flex: none; gap: 0; }
    .ce-tool { padding: 0 0.6rem; }
    .ce-tool .ce-label { display: none; }
    .ce-tool.ce-join { padding: 0 0.8rem; font-size: 0.9rem; }
    .ce-search { order: 3; flex: 1 1 100%; max-width: none; }
    .ce-strip { font-size: 0.8rem; }
    #merchant-map { height: 380px; }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; scroll-behavior: auto !important; }
}

/* ---------- deals ---------- */
.ce-noimage { aspect-ratio: 3 / 2; width: 100%; background: var(--ce-black) url("../images/logo-192.png") center / 34% no-repeat; }
.ce-noimage-lg { border-radius: var(--ce-radius-lg); }
.deal-card .card-img-top, .card-img-top { aspect-ratio: 3 / 2; object-fit: cover; }
.merchant-card .card-img-top { object-fit: contain; padding: 1rem; background: var(--ce-white); }
/* A whole card opens its page; phone numbers and other links inside it stay clickable on top */
.merchant-card .card a:not(.stretched-link), .deal-card a:not(.stretched-link), .deal-card button { position: relative; z-index: 2; }
.merchant-card .card, .deal-card { cursor: pointer; }
.deal-price { color: var(--ce-ink) !important; font-size: 1.6rem; font-weight: 800; }
.deal-original-price { color: var(--ce-muted); }
.deal-discount, .badge-flash, .badge-trending {
    display: inline-block; background: var(--ce-yellow) !important; color: var(--ce-black) !important;
    border-radius: 999px; padding: 0.3em 0.8em; font-size: 0.8rem; font-weight: 800; animation: none;
}
.badge-featured { background: var(--ce-blue) !important; color: var(--ce-white) !important; }
.card-header.bg-primary, .card-header.bg-info, .card-header.bg-warning, .card-header.bg-success { background: var(--ce-black) !important; color: var(--ce-white) !important; }
.card-header.bg-primary *, .card-header.bg-info *, .card-header.bg-warning * { color: var(--ce-white) !important; }
.accordion-button { font-family: var(--ce-font); font-size: 1rem; font-weight: 700; text-transform: none; letter-spacing: 0; }
.accordion-button:not(.collapsed) { background: var(--ce-surface); color: var(--ce-ink); box-shadow: none; }
.accordion-item { border-color: var(--ce-line); }
.btn-group > .btn-outline-primary.active, .btn-group > .btn-check:checked + .btn-outline-primary {
    background: var(--ce-ink) !important; border-color: var(--ce-ink) !important; color: var(--ce-white) !important;
}
.breadcrumb a { color: var(--ce-ink); }

/* ---------- every screen size: phone, tablet, laptop, desktop ---------- */
/* Nothing may push the page wider than the screen */
html, body { overflow-x: clip; }
img, video, iframe, svg { max-width: 100%; }
.card-title, .card-text, h1, h2, h3, h4, h5, p, td, th, .breadcrumb-item { overflow-wrap: anywhere; }
/* The home map section holds a filter card and the map; an old rule gave the whole section a fixed height,
   so on a phone the map spilled out underneath the next section */
section.merchant-map { height: auto; box-shadow: none; border-radius: 0; }
#merchant-map { height: clamp(320px, 55vh, 520px); }
/* Prices stay on one line each; the crossed-out price drops below when there is no room */
.deal-price, .deal-original-price, .deal-discount, .text-decoration-line-through { white-space: nowrap; }
.ce-prices { display: flex; flex-wrap: wrap; align-items: baseline; column-gap: 0.6rem; row-gap: 0.15rem; }
.ce-prices .ms-2, .ce-prices .ms-3 { margin-inline-start: 0 !important; }
.deal-card .deal-price { font-size: clamp(1.25rem, 2.2vw, 1.6rem); }
/* Buttons and fields are large enough to tap */
.btn { min-height: 44px; display: inline-flex; align-items: center; justify-content: center; gap: 0.35rem; }
.btn.btn-sm { min-height: 38px; }
.btn-group > .btn { display: inline-flex; }
.btn.d-none, .btn[hidden] { display: none !important; }
.table-responsive { -webkit-overflow-scrolling: touch; }
.table-responsive > .table { min-width: 460px; }

@media (max-width: 575.98px) {
    /* five menu entries fit a phone without sideways scrolling */
    .ce-nav { gap: 0.15rem; justify-content: space-between; }
    .ce-nav a { padding: 0 0.6rem; font-size: 0.92rem; gap: 0.3rem; }
    .ce-nav i { display: none; }
    h1 { font-size: clamp(1.9rem, 8.5vw, 2.4rem); }
    h2 { font-size: clamp(1.5rem, 6.5vw, 1.9rem); }
    .ce-head { flex-wrap: wrap; align-items: baseline; gap: 0.25rem 1rem; margin-bottom: 1rem; }
    .ce-props { padding-top: 2.5rem; }
    .ce-footer .row > * { margin-bottom: 0.5rem; }
    main.container, .container { padding-inline: 14px; }
    .card-body { padding: 1rem; }
    .breadcrumb { font-size: 0.9rem; }
}
@media (min-width: 576px) and (max-width: 991.98px) {
    /* tablets: the menu still fits on one line */
    .ce-nav a { padding: 0 0.9rem; }
}
@media (min-width: 1400px) {
    /* large desktop screens get a little more room, not just wider margins */
    .container { max-width: 1360px; }
}

/* ---------- advertising space ---------- */
/* Slides of different shapes share one frame, so the page does not jump as they change */
/* The picture is shown whole. Where its shape leaves room at the sides or top, a blurred, enlarged copy of the
   same picture fills the frame, so every advert fits edge to edge with no black bars and nothing cropped. */
.ce-advert { border-radius: var(--ce-radius-lg); overflow: hidden; background: var(--ce-surface); }
.ce-advert .carousel-item { overflow: hidden; }
.ce-advert .ce-advert-picture { position: relative; aspect-ratio: 16 / 7; object-fit: contain; }
.ce-advert .ce-advert-fill { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; filter: blur(28px) saturate(1.15); transform: scale(1.25); }
.ce-advert .carousel-indicators { margin-bottom: 0.6rem; }
.ce-advert .carousel-indicators [data-bs-target] { width: 10px; height: 10px; border-radius: 50%; border: 0; margin: 0 5px; }
.ce-advert .carousel-control-prev, .ce-advert .carousel-control-next { width: 12%; }
@media (max-width: 767.98px) { .ce-advert .ce-advert-picture { aspect-ratio: 4 / 3; } }
/* merchant gallery: same frame, a little taller since these are photographs rather than banners */
.ce-gallery .ce-advert-picture { aspect-ratio: 16 / 9; }
.ce-gallery .carousel-caption { bottom: 1.6rem; }
@media (max-width: 767.98px) { .ce-gallery .ce-advert-picture { aspect-ratio: 4 / 3; } }
