/* ===== RESET & ROOT ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --gold: #c9a84c;
    --gold-light: #e8c97a;
    --rust: #b5523b;
    --dark: #111110;
    --dark2: #1a1917;
    --dark3: #222220;
    --mid: #2e2c28;
    --border: #333330;
    --text: #e8e4dc;
    --text-muted: #888880;
    --text-dim: #555550;
    --teal: #5fa7a3;
    --bg-body: #f0ebe3;
    --card-bg: #ffffff;
    --sidebar-bg: #fdfaf5;
    --sidebar-border: #ddd8d0;
}

html { scroll-behavior: smooth; }

body {
    background: var(--bg-body);
    font-family: 'DM Sans', sans-serif;
    color: var(--dark);
    margin: 0;
}

/* L’attribut hidden doit masquer l’élément même si une classe impose display (ex. .hero-delivery { display: block }). */
[hidden] {
    display: none !important;
}

/* ===== TOPNAV ===== */
.topnav {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--bg-body);
    border-bottom: 2px solid var(--rust);
}

.topnav-inner {
    max-width: 1300px;
    margin: 0 auto;
    padding: 10px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
}

.logo-bp {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: var(--rust);
    color: white;
    font-family: 'Cinzel', serif;
    font-size: 0.9rem;
    font-weight: 600;
    border-radius: 6px;
    letter-spacing: 1px;
}

.logo-text { display: flex; flex-direction: column; }

.logo-name {
    font-family: 'Playfair Display', serif;
    font-size: 1rem;
    color: var(--rust);
    font-weight: 700;
    line-height: 1;
}

.logo-sub {
    font-size: 0.6rem;
    color: var(--teal);
    letter-spacing: 0.12em;
    margin-top: 2px;
    text-transform: uppercase;
    font-weight: 500;
}

.nav-links { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: flex-end; }

.nav-link {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--rust);
    text-decoration: none;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    border: 1.5px solid var(--rust);
    padding: 7px 16px;
    border-radius: 6px;
    transition: all 0.15s;
}
.nav-link:hover { background: var(--rust); color: white; }

.nav-link-admin {
    border-color: var(--teal);
    color: var(--teal);
}

.nav-link-admin:hover {
    background: var(--teal);
    color: #fff;
}

/* ===== HERO (maquette centrée beige + cadre teal / ligne rouille intérieure) ===== */
.hero {
    position: relative;
    background: #ebe4d9;
    padding: 52px clamp(20px, 5vw, 32px) 58px;
    text-align: center;
    overflow: hidden;
    border-bottom: 4px solid var(--rust);
    /* Badge hero : cadre plein échelle (base partagée avec le bloc livraison) */
    --hero-framed-base: 700px;
    --hero-framed-max: min(var(--hero-framed-base), 100%);
    --hero-framed-pad: 24px;
    --hero-framed-border: 5px;
    --hero-framed-radius-outer: 20px;
    --hero-framed-radius-inner: 13px;
    --hero-framed-inner-pad: 26px clamp(40px, 10vw, 88px);
    /* Livraison : cadre + contenu à 90 % du badge */
    --hero-delivery-scale: 0.9;
    /* Rayon des coins du visuel livraison (rouge), partagé bord + image pour un collage net */
    --hero-delivery-img-corner: clamp(12px, 3vw, 16px);
    --hero-delivery-rust-border: 3px;
}

.hero-texture {
    position: absolute;
    inset: 0;
    background-image: repeating-linear-gradient(
        135deg,
        transparent,
        transparent 11px,
        rgba(0, 0, 0, 0.038) 11px,
        rgba(0, 0, 0, 0.038) 12px
    );
    pointer-events: none;
}

.hero-badge {
    position: relative;
    z-index: 1;
    display: block;
    box-sizing: border-box;
    width: 100%;
    max-width: var(--hero-framed-max);
    margin: 0 auto 28px;
    border: var(--hero-framed-border) solid var(--teal);
    border-radius: var(--hero-framed-radius-outer);
    padding: var(--hero-framed-pad);
    text-align: center;
    background: linear-gradient(180deg, #fefdfb 0%, #faf7f4 100%);
    box-shadow:
        0 2px 16px rgba(17, 17, 16, 0.08),
        0 0 0 1px rgba(255, 255, 255, 0.55) inset;
}

.hero-badge::before {
    content: '';
    position: absolute;
    inset: var(--hero-framed-pad);
    border: 1px solid var(--rust);
    border-radius: var(--hero-framed-radius-inner);
    pointer-events: none;
    box-sizing: border-box;
}

/* Cadre livraison : même style que le badge mais dimensions × var(--hero-delivery-scale) */
.hero-delivery {
    position: relative;
    z-index: 1;
    display: block;
    box-sizing: border-box;
    width: 100%;
    max-width: min(calc(var(--hero-framed-base) * var(--hero-delivery-scale)), calc(100% * var(--hero-delivery-scale)));
    margin-left: auto;
    margin-right: auto;
    border: calc(var(--hero-framed-border) * var(--hero-delivery-scale)) solid var(--teal);
    border-radius: calc(var(--hero-framed-radius-outer) * var(--hero-delivery-scale));
    padding: calc(var(--hero-framed-pad) * var(--hero-delivery-scale));
    text-align: center;
    background: linear-gradient(180deg, #fefdfb 0%, #faf7f4 100%);
    box-shadow:
        0 2px 16px rgba(17, 17, 16, 0.08),
        0 0 0 1px rgba(255, 255, 255, 0.55) inset;
    margin-bottom: 29px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

.hero-delivery::before {
    content: '';
    position: absolute;
    inset: calc(var(--hero-framed-pad) * var(--hero-delivery-scale));
    border: 1px solid var(--rust);
    border-radius: calc(var(--hero-framed-radius-inner) * var(--hero-delivery-scale));
    pointer-events: none;
    box-sizing: border-box;
}

/* Livraison en image : le rouge épouse directement la bannière (plus de grande zone beige entre teal et motif) */
.hero-delivery:has(.hero-delivery-inner--banner)::before {
    display: none;
}

.hero-badge-inner,
.hero-delivery-inner {
    position: relative;
    z-index: 1;
    overflow: visible;
}

.hero-badge-inner {
    padding: var(--hero-framed-inner-pad);
}

/* Padding intérieur cohérent avec le cadre livraison réduit */
.hero-delivery-inner {
    padding: calc(20px * var(--hero-delivery-scale) * var(--hero-delivery-scale))
        clamp(29px, 8.1vw, 59px);
}

.hero-delivery-inner--banner {
    padding: 0;
    margin: 0 auto;
    max-width: min(52rem, 100%);
}

.hero-badge-title {
    font-family: 'Playfair Display', serif;
    font-size: clamp(2.65rem, 6.2vw, 4.15rem);
    color: var(--rust);
    font-weight: 700;
    line-height: 1.03;
    margin: 0 0 12px;
    letter-spacing: 0.01em;
}

.hero-badge-tagline {
    font-family: 'DM Sans', sans-serif;
    font-size: 0.82rem;
    letter-spacing: 0.35em;
    color: var(--teal);
    margin: 0;
    font-weight: 700;
}

.hero-desc {
    position: relative;
    z-index: 1;
    color: var(--dark);
    font-family: 'Libre Baskerville', serif;
    font-size: clamp(0.95rem, 2.4vw, 1.05rem);
    line-height: 1.78;
    margin-bottom: 22px;
    max-width: min(720px, 100%);
    margin-left: auto;
    margin-right: auto;
    padding: 0 clamp(8px, 3vw, 16px);
    text-wrap: balance;
}

.hero-location {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
    width: 100%;
    color: var(--teal);
    font-size: clamp(0.68rem, 1.8vw, 0.78rem);
    letter-spacing: clamp(0.14em, 1.5vw, 0.26em);
    font-weight: 700;
    margin-bottom: 24px;
    font-family: 'DM Sans', sans-serif;
    line-height: 1.45;
    padding: 0 12px;
}

/* Trait rouille sur le bloc image : même rayon que le masque pour épouser sans décalage */
.hero-delivery-banner-wrap {
    width: 100%;
    margin: 0;
    max-width: none;
    aspect-ratio: 10 / 3;
    box-sizing: border-box;
    border: var(--hero-delivery-rust-border) solid var(--rust);
    border-radius: var(--hero-delivery-img-corner);
    overflow: hidden;
    isolation: isolate;
    background: linear-gradient(180deg, rgba(12, 11, 10, 0.35) 0%, rgba(18, 16, 14, 0.5) 100%);
}

.hero-delivery-banner {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    border-radius: max(6px, calc(var(--hero-delivery-img-corner) - var(--hero-delivery-rust-border)));
}

.tombola-widget {
    position: relative;
    z-index: 1;
    display: block;
    width: 100%;
    max-width: 1080px;
    margin: 0 auto;
    text-align: center;
}

.tombola-header {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    background: linear-gradient(180deg, #c45d44 0%, var(--rust) 55%, #9a422e 100%);
    color: white;
    font-family: 'Cinzel', serif;
    font-size: clamp(0.95rem, 2.6vw, 1.2rem);
    letter-spacing: 0.16em;
    font-weight: 600;
    padding: 17px clamp(28px, 7vw, 52px);
    border-radius: 40px;
    margin-bottom: 22px;
    box-shadow:
        0 4px 22px rgba(181, 82, 59, 0.38),
        0 0 0 1px rgba(255, 255, 255, 0.12) inset;
}

.tombola-header svg {
    width: 1.2em;
    height: 1.2em;
    flex-shrink: 0;
}

/* Double trait rouge, photo à ras bord (sans marge crème) */
.tombola-img-wrap {
    position: relative;
    box-sizing: border-box;
    padding: 0;
    margin-bottom: 14px;
    border: 5px double var(--rust);
    border-radius: 16px;
    background: transparent;
}

.tombola-img-media {
    position: relative;
    z-index: 0;
    width: 100%;
    height: 204px;
    border-radius: 11px;
    overflow: hidden;
    background: transparent;
}

.tombola-img-media img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    display: block;
    transition: filter 0.25s ease;
}

.tombola-img-overlay {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px;
    border-radius: inherit;
    background: rgba(26, 25, 23, 0.68);
    opacity: 0;
    transition: opacity 0.25s ease;
    pointer-events: none;
}

.tombola-overlay-price {
    font-family: 'Playfair Display', serif;
    font-size: clamp(1rem, 3.2vw, 1.35rem);
    font-weight: 700;
    color: #fdfaf5;
    letter-spacing: 0.04em;
    text-align: center;
    text-shadow: 0 2px 12px rgba(0, 0, 0, 0.45);
}

@media (hover: hover) and (pointer: fine) {
    .tombola-img-wrap:hover .tombola-img-overlay {
        opacity: 1;
    }

    .tombola-img-wrap:hover .tombola-img-media img {
        filter: grayscale(1) brightness(0.9);
    }
}

.tombola-list {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: stretch;
    gap: 16px;
}

.tombola-list:empty {
    min-height: 220px;
}

.tombola-card {
    box-sizing: border-box;
    flex: 0 0 auto;
    width: 332px;
    max-width: min(332px, 100%);
    min-width: 0;
    background: linear-gradient(180deg, #f4ebe0 0%, #efe3d3 100%);
    border: 3px solid var(--teal);
    border-radius: 16px;
    padding: 12px 12px 16px;
    box-shadow:
        0 0 0 5px rgba(95, 167, 163, 0.14),
        0 4px 14px rgba(17, 17, 16, 0.06);
}

.tombola-name {
    font-family: 'Cinzel', serif;
    font-size: 0.9rem;
    letter-spacing: 0.15em;
    color: var(--rust);
    font-weight: 600;
    margin-top: 0;
    margin-bottom: 0;
}

.tombola-description {
    margin: 8px 0 0;
    padding: 0 4px 2px;
    font-family: 'Libre Baskerville', serif;
    font-size: clamp(0.72rem, 1.85vw, 0.82rem);
    line-height: 1.42;
    color: var(--mid);
    letter-spacing: 0.02em;
    white-space: pre-line;
    text-wrap: balance;
}

/* ===== ADMIN ===== */
.admin-modal {
    position: fixed;
    inset: 0;
    z-index: 300;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(17, 17, 16, 0.62);
}

.admin-modal.open { display: flex; }

.admin-panel {
    position: relative;
    width: min(1120px, 100%);
    max-height: 90vh;
    overflow: auto;
    background: var(--sidebar-bg);
    border: 2px solid var(--teal);
    border-radius: 10px;
    padding: 28px;
    box-shadow: 0 22px 60px rgba(0, 0, 0, 0.25);
}

.admin-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 34px;
    height: 34px;
    border: 1px solid var(--rust);
    border-radius: 6px;
    background: white;
    color: var(--rust);
    cursor: pointer;
    font-weight: 700;
}

.admin-login { max-width: 420px; margin: 0 auto; }

.admin-login h2,
.admin-content h2,
.admin-box h3 {
    font-family: 'Playfair Display', serif;
    color: var(--rust);
    margin-bottom: 8px;
}

.admin-login p,
.admin-head p {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-bottom: 18px;
}

.admin-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 22px;
}

.admin-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(300px, 0.65fr);
    gap: 22px;
}

.admin-box {
    border: 1px solid #d8e9e7;
    border-radius: 8px;
    background: white;
    padding: 18px;
}

.admin-box label,
.admin-login label {
    display: block;
    margin-bottom: 12px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    color: #555;
    text-transform: uppercase;
}

.admin-box input,
.admin-box select,
.admin-login input {
    width: 100%;
    margin-top: 6px;
    padding: 10px 12px;
    border: 1.5px solid var(--teal);
    border-radius: 6px;
    font-family: 'DM Sans', sans-serif;
    font-size: 0.9rem;
    color: var(--dark);
    background: #fff;
}

.admin-fields {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px 14px;
}

.admin-fields .wide { grid-column: 1 / -1; }

.admin-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 14px;
}

.admin-primary,
.admin-secondary,
.admin-danger {
    border-radius: 6px;
    padding: 10px 14px;
    font-family: 'DM Sans', sans-serif;
    font-weight: 700;
    cursor: pointer;
}

.admin-primary {
    border: 1px solid var(--rust);
    background: var(--rust);
    color: white;
}

.admin-secondary {
    border: 1px solid var(--teal);
    background: white;
    color: var(--teal);
}

.admin-danger {
    border: 1px solid var(--rust);
    background: white;
    color: var(--rust);
}

.admin-error {
    color: var(--rust);
    font-weight: 700;
    min-height: 18px;
}

.admin-modal.open {
    align-items: stretch;
    justify-content: stretch;
    padding: 0;
    background: var(--bg-body);
}

.admin-panel {
    width: 100%;
    max-height: none;
    border: none;
    border-radius: 0;
    padding: 0;
    box-shadow: none;
    background: var(--bg-body);
}

.admin-close {
    z-index: 2;
}

.admin-content {
    min-height: 100vh;
}

.admin-login {
    margin: 120px auto 0;
    border: 2px solid var(--teal);
    border-radius: 14px;
    background: rgba(253, 250, 245, 0.92);
    padding: 28px;
}

.admin-topbar {
    min-height: 78px;
    padding: 0 32px;
    display: flex;
    align-items: center;
    gap: 14px;
    border-bottom: 4px solid var(--rust);
    background: var(--bg-body);
    background-image: repeating-linear-gradient(
        -45deg,
        transparent,
        transparent 8px,
        rgba(181, 82, 59, 0.04) 8px,
        rgba(181, 82, 59, 0.04) 9px
    );
}

.admin-brand {
    width: 182px;
    border: 2px solid var(--rust);
    border-radius: 10px;
    padding: 8px 12px;
    text-align: center;
    background: rgba(253, 250, 245, 0.82);
    box-shadow: 0 0 0 4px rgba(95, 167, 163, 0.24);
}

.admin-brand-small {
    display: block;
    color: var(--teal);
    font-family: 'Cinzel', serif;
    font-size: 0.58rem;
    font-weight: 700;
    letter-spacing: 0.24em;
    text-transform: uppercase;
}

.admin-brand-name {
    display: block;
    color: var(--rust);
    font-family: 'Playfair Display', serif;
    font-size: 1.15rem;
    font-weight: 900;
    line-height: 1;
}

.admin-pill,
.admin-count-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #bde1df;
    border-radius: 999px;
    background: #eef8f6;
    color: var(--teal);
    padding: 8px 14px;
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.admin-tabs {
    margin-left: auto;
    display: flex;
    gap: 12px;
}

.admin-tab {
    border: 2px solid var(--teal);
    border-radius: 8px;
    background: white;
    padding: 12px 22px;
    font-family: 'DM Sans', sans-serif;
    font-weight: 800;
    cursor: pointer;
}

.admin-tab.active,
.admin-tab:hover {
    color: var(--rust);
    box-shadow: 0 8px 18px rgba(95, 167, 163, 0.14);
}

.admin-view {
    display: none;
    max-width: 1252px;
    margin: 34px auto 60px;
    padding: 0 18px;
}

.admin-view.active {
    display: block;
}

.admin-hero-row,
.admin-filter-panel,
.admin-box,
.admin-tombola-form {
    border: 2px solid var(--teal);
    border-radius: 14px;
    background: rgba(253, 250, 245, 0.9);
    box-shadow: 0 12px 30px rgba(17, 17, 16, 0.04);
}

.admin-hero-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 28px;
    margin-bottom: 24px;
}

.admin-hero-row h2,
#adminEditTitle {
    font-family: 'Playfair Display', serif;
    color: var(--rust);
    font-size: 2rem;
    margin-bottom: 8px;
}

.admin-hero-row p {
    color: var(--dark);
    font-size: 0.9rem;
}

.admin-hero-actions {
    display: flex;
    align-items: center;
    gap: 14px;
}

.admin-filter-panel {
    position: relative;
    z-index: 10;
    padding: 20px 22px;
    margin-bottom: 24px;
}

.admin-filter-panel p {
    margin-bottom: 16px;
    color: #555;
}

.admin-filter-panel strong {
    color: var(--teal);
}

.admin-filter-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(200px, 260px);
    gap: 12px;
    margin-bottom: 16px;
    align-items: start;
}

.admin-filter-row > input[type="text"] {
    width: 100%;
    border: 2px solid var(--teal);
    border-radius: 8px;
    padding: 12px 14px;
    background: white;
    font-family: 'DM Sans', sans-serif;
}

.admin-filter-row .sort-ui {
    width: 100%;
    min-width: 0;
}

.admin-filter-row .sort-trigger {
    padding: 10px 12px 10px 14px;
}

.admin-filter-row .sort-trigger-kicker {
    font-size: 0.58rem;
    letter-spacing: 0.1em;
}

.admin-filter-row .sort-trigger-value {
    font-size: 0.76rem;
}

.admin-category-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.admin-cat {
    border: 2px solid var(--teal);
    border-radius: 999px;
    background: white;
    color: #333;
    padding: 7px 13px;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    cursor: pointer;
}

.admin-cat.active {
    background: var(--teal);
    color: white;
}

.admin-table-wrap {
    border: 2px solid var(--teal);
    border-radius: 12px;
    overflow: auto;
    background: rgba(253, 250, 245, 0.9);
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 980px;
}

.admin-table th {
    padding: 16px;
    text-align: left;
    color: var(--teal);
    font-size: 0.68rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    background: #eef8f6;
    border-bottom: 2px solid var(--teal);
}

.admin-table td {
    padding: 14px 16px;
    border-bottom: 1px solid #dfe8e5;
    vertical-align: middle;
}

.admin-table strong {
    display: block;
    color: var(--rust);
    font-family: 'Playfair Display', serif;
    font-size: 1rem;
}

.admin-table small {
    display: block;
    margin-top: 4px;
    color: #777;
}

.admin-thumb {
    width: 72px;
    height: 44px;
    object-fit: cover;
    border: 1px solid #bde1df;
    border-radius: 6px;
}

.admin-thumb.img-pending,
.tombola-img-media img.img-pending,
.tombola-img-media .tombola-card-img.img-pending,
.img-container img.img-pending {
    background: linear-gradient(110deg, #e8e0d5 8%, #f5f0e8 18%, #e8e0d5 33%);
    background-size: 200% 100%;
    animation: bp-img-shimmer 1.2s ease-in-out infinite;
}

@keyframes bp-img-shimmer {
    0% { background-position: 100% 0; }
    100% { background-position: -100% 0; }
}

.admin-chip {
    display: inline-flex;
    border: 1px solid #bde1df;
    border-radius: 999px;
    background: #eef8f6;
    color: var(--teal);
    padding: 4px 10px;
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.admin-row-actions {
    display: flex;
    gap: 8px;
}

.admin-row-actions .admin-secondary,
.admin-row-actions .admin-danger {
    padding: 9px 14px;
}

.admin-edit-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 410px;
    gap: 24px;
    margin: 20px 0 24px;
}

.admin-preview {
    border: 2px dashed var(--teal);
    border-radius: 8px;
    overflow: hidden;
    margin: 14px 0;
    background: #eef0ed;
}

.admin-preview img {
    width: 100%;
    height: 190px;
    display: block;
    object-fit: cover;
}

.admin-fields.two {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.admin-fields.three {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.admin-check {
    display: flex !important;
    align-items: center;
    gap: 10px;
    border: 2px solid var(--teal);
    border-radius: 8px;
    padding: 12px;
    background: #eef8f6;
}

.admin-check input {
    width: auto;
    margin: 0;
}

.admin-tombola-form {
    margin-top: 22px;
    padding: 20px;
    display: grid;
    grid-template-columns: minmax(220px, 0.5fr) minmax(260px, 1fr);
    gap: 14px;
}

.admin-tombola-form .admin-actions {
    grid-column: 1 / -1;
}

/* ===== LAYOUT ===== */
.layout {
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 1320px;
    margin: 0 auto;
    padding: 40px 24px 60px;
    gap: 32px;
}

/* ===== SIDEBAR ===== */
.sidebar {
    width: 100%;
    max-width: 1260px;
    margin: 0 auto;
    position: static;
    max-height: none;
    overflow: visible;
    background: var(--sidebar-bg);
    border: 2px solid var(--teal);
    border-radius: 10px;
    padding: 24px 26px;
    display: grid;
    grid-template-columns: minmax(360px, 1fr) minmax(250px, 280px);
    column-gap: 48px;
    row-gap: 18px;
}

.filter-block {
    padding: 0;
    border-bottom: none;
}
.filter-block:last-child { border-bottom: none; }

.filter-block:nth-child(1) {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.filter-block:nth-child(2) {
    grid-column: 1;
}

.filter-block:nth-child(3) {
    grid-column: 2;
    align-self: center;
    position: relative;
}

.filter-block:nth-child(4),
.filter-block:nth-child(5),
.filter-block:nth-child(6) {
    grid-column: 1 / -1;
}

.filter-title {
    font-family: 'Playfair Display', serif;
    font-size: 1.35rem;
    color: var(--rust);
    font-weight: 700;
    margin-bottom: 0;
}

.filter-title::before {
    content: "☷";
    display: inline-block;
    margin-right: 8px;
    color: var(--rust);
    font-family: 'DM Sans', sans-serif;
    font-size: 1rem;
    transform: translateY(-1px);
}

.filter-count {
    font-size: 0.78rem;
    color: var(--text-muted);
}
.filter-count span { font-weight: 700; color: var(--rust); }

/* Search */
.search-wrap {
    position: relative;
}
.search-icon {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 14px;
    height: 14px;
    color: var(--teal);
}
.search-input {
    width: 100%;
    padding: 13px 12px 13px 36px;
    border: 2px solid var(--teal);
    border-radius: 10px;
    font-size: 0.92rem;
    font-family: 'DM Sans', sans-serif;
    background: white;
    color: var(--dark);
    outline: none;
    transition: border-color 0.2s;
}
.search-input:focus { border-color: var(--rust); }

/* Tri : menu sur mesure (plus de liste OS bleue) */
.sort-ui {
    position: relative;
    width: 100%;
}

.sort-trigger {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 16px 11px 18px;
    border: 2px solid var(--teal);
    border-radius: 999px;
    background: #fff;
    font-family: 'DM Sans', sans-serif;
    cursor: pointer;
    text-align: left;
    box-shadow: 0 2px 10px rgba(17, 17, 16, 0.06);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.sort-trigger:hover {
    border-color: var(--rust);
    box-shadow: 0 4px 16px rgba(181, 82, 59, 0.12);
}

.sort-trigger:focus-visible {
    outline: none;
    border-color: var(--rust);
    box-shadow: 0 0 0 3px rgba(181, 82, 59, 0.2);
}

.sort-trigger-kicker {
    flex-shrink: 0;
    font-size: 0.65rem;
    font-weight: 800;
    letter-spacing: 0.14em;
    color: var(--teal);
}

.sort-trigger-sep {
    flex-shrink: 0;
    color: rgba(95, 167, 163, 0.35);
    font-weight: 300;
    font-size: 0.9rem;
}

.sort-trigger-value {
    flex: 1;
    min-width: 0;
    font-size: 0.84rem;
    font-weight: 700;
    color: var(--rust);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sort-chevron {
    flex-shrink: 0;
    color: var(--teal);
    transition: transform 0.2s ease;
}

.sort-trigger[aria-expanded="true"] .sort-chevron {
    transform: rotate(180deg);
}

.sort-dropdown {
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% + 8px);
    z-index: 90;
    margin: 0;
    padding: 8px;
    list-style: none;
    background: linear-gradient(180deg, #fefdfb 0%, #faf7f4 100%);
    border: 2px solid var(--teal);
    border-radius: 14px;
    box-shadow: 0 18px 48px rgba(17, 17, 16, 0.18);
    max-height: min(320px, 55vh);
    overflow-y: auto;
}

.sort-option {
    padding: 11px 14px;
    margin: 2px 0;
    border-radius: 10px;
    font-size: 0.86rem;
    font-weight: 600;
    font-family: 'DM Sans', sans-serif;
    color: var(--dark);
    cursor: pointer;
    transition: background 0.12s ease, color 0.12s ease;
}

.sort-option:hover,
.sort-option:focus {
    outline: none;
    background: rgba(95, 167, 163, 0.16);
    color: var(--rust);
}

.sort-option.is-selected {
    background: var(--teal);
    color: #fff;
}

.sort-option.is-selected:hover {
    background: var(--rust);
    color: #fff;
}

/* Select natif : uniquement pour la logique JS (valeur / change) */
.sort-select-native {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Section label */
.filter-section-label {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    text-transform: uppercase;
    margin-bottom: 10px;
}

/* Tags */
.tags-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
}

.tag {
    border: 2px solid var(--teal);
    background: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.78rem;
    cursor: pointer;
    color: #666;
    font-family: 'DM Sans', sans-serif;
    font-weight: 500;
    transition: all 0.15s;
    white-space: nowrap;
}
.tag:hover { border-color: var(--teal); color: var(--teal); }
.tag.active { background: var(--teal); border-color: var(--teal); color: white; }

/* ===== Toggles "Particularités" — couleurs assorties aux badges des cartes ===== */
.feature-tags-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: flex-start;
}

.tag-feature {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 8px 16px 8px 12px;
    font-weight: 600;
}

.tag-feature-icon {
    font-size: 1.1rem;
    line-height: 1;
    transform: translateY(-1px);
}

.tag-feature-img {
    display: inline-block;
    width: 22px;
    height: 22px;
    background-color: currentColor;
    -webkit-mask: url('images/attelage-icon.png') no-repeat center / contain;
    mask: url('images/attelage-icon.png') no-repeat center / contain;
    transform: translateY(-1px);
    transition: background-color 0.15s ease;
}

/* Variante "Électrique" : vert */
.tag-feature-ev {
    border-color: #1f9d55;
    color: #1f9d55;
}
.tag-feature-ev:hover {
    border-color: #168a48;
    color: #168a48;
    background: #eafaf1;
}
.tag-feature-ev.active,
.tag-feature-ev.active:hover {
    background: linear-gradient(135deg, #1f9d55 0%, #168a48 100%);
    border-color: #168a48;
    color: #fff;
    box-shadow: 0 4px 12px rgba(31, 157, 85, 0.28);
}

/* Variante "Attelage" : rust orangé */
.tag-feature-tow {
    border-color: #c75d3f;
    color: #c75d3f;
}
.tag-feature-tow:hover {
    border-color: #a8472d;
    color: #a8472d;
    background: #fbede7;
}
.tag-feature-tow.active,
.tag-feature-tow.active:hover {
    background: linear-gradient(135deg, #c75d3f 0%, #a8472d 100%);
    border-color: #a8472d;
    color: #fff;
    box-shadow: 0 4px 12px rgba(199, 93, 63, 0.28);
}

/* Sliders */
.slider-section { margin-bottom: 20px; }
.slider-section:last-child { margin-bottom: 0; }

.filter-block:nth-child(5) {
    display: grid;
    grid-template-columns: 1fr 1fr;
    column-gap: 24px;
    row-gap: 18px;
}

.filter-block:nth-child(5) .slider-section:first-child {
    grid-column: 1 / -1;
}

.slider-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 10px;
    margin-bottom: 6px;
}

.slider-label {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    color: #444;
    text-transform: uppercase;
    line-height: 1.2;
}

.slider-range-label {
    font-size: 0.78rem;
    color: #999;
}

.slider-row {
    display: flex;
    align-items: center;
    gap: 16px;
}

.input-unit {
    position: relative;
    width: 90px;
    flex-shrink: 0;
}
.input-unit input {
    width: 100%;
    padding: 9px 20px 9px 8px;
    border: 2px solid var(--teal);
    border-radius: 6px;
    text-align: center;
    font-size: 0.82rem;
    font-weight: bold;
    color: var(--dark);
    font-family: 'DM Sans', sans-serif;
    outline: none;
}
.input-unit .u {
    position: absolute;
    right: 4px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--teal);
    font-size: 0.6rem;
    font-weight: bold;
    pointer-events: none;
}

.track-area {
    position: relative;
    flex: 1;
    height: 6px;
    background: #ddd;
    border-radius: 2px;
}

.bar {
    position: absolute;
    height: 100%;
    background: var(--teal);
    border-radius: 2px;
}

input[type="range"] {
    position: absolute;
    width: 100%;
    -webkit-appearance: none;
    background: none;
    pointer-events: none;
    top: -7px;
    margin: 0;
}
input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    pointer-events: auto;
    width: 18px;
    height: 18px;
    background: var(--rust);
    border: 2px solid white;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

/* Reset */
.btn-reset {
    display: block;
    width: min(720px, 95%);
    margin: 0 auto;
    background: white;
    border: 1.5px solid var(--rust);
    color: var(--rust);
    padding: 14px 32px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    font-family: 'DM Sans', sans-serif;
    transition: all 0.15s;
}
.btn-reset:hover { background: var(--rust); color: white; }

/* ===== CATALOGUE AREA ===== */
.catalogue-area {
    width: 100%;
    min-width: 0;
}

/* ===== GRID ===== */
.grid-display {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 294px));
    justify-content: center;
    max-width: 1260px;
    margin: 0 auto;
    gap: 28px;
}

/* ===== COMPARAISON (vitrine) ===== */
.compare-filter-hint,
.filter-block-reset {
    grid-column: 1 / -1;
}

.compare-hint-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: linear-gradient(180deg, #f4ebe0 0%, #ede2d0 100%);
    border: 1px solid rgba(45, 138, 138, 0.25);
    border-radius: 8px;
}

.compare-hint-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    flex-shrink: 0;
    border-radius: 50%;
    background: #fff;
    color: var(--teal);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

.compare-hint-text {
    margin: 0;
    font-size: 0.82rem;
    line-height: 1.45;
    color: var(--mid, #4a4a48);
}

.compare-hint-text strong {
    color: var(--rust);
    font-weight: 700;
}

.card-compare-label {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 5;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin: 0;
    padding: 4px 9px 4px 6px;
    background: rgba(253, 250, 245, 0.95);
    border: 1.25px solid var(--teal);
    border-radius: 999px;
    font-family: 'DM Sans', sans-serif;
    font-size: 0.55rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--teal);
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(4px);
    transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.card-compare-label:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
}

.card-compare-label input.compare-check {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    width: 12px;
    height: 12px;
    margin: 0;
    background: #fff;
    border: 1.25px solid var(--teal);
    border-radius: 3px;
    cursor: pointer;
    position: relative;
    flex-shrink: 0;
    transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.card-compare-label input.compare-check:hover {
    transform: scale(1.08);
}

.card-compare-label input.compare-check:checked {
    background: var(--rust);
    border-color: var(--rust);
}

.card-compare-label input.compare-check:checked::after {
    content: '';
    position: absolute;
    top: 0;
    left: 3px;
    width: 3px;
    height: 6px;
    border: solid #fff;
    border-width: 0 1.5px 1.5px 0;
    transform: rotate(45deg);
}

.card-compare-label:has(input.compare-check:checked) {
    background: var(--teal);
    border-color: var(--teal);
    color: #fff;
    box-shadow: 0 4px 16px rgba(45, 138, 138, 0.35);
}

.card-compare-label:has(input.compare-check:checked) input.compare-check {
    background: #fff;
    border-color: #fff;
}

.card-compare-label:has(input.compare-check:checked) input.compare-check::after {
    border-color: var(--teal);
}

.card-compare-text {
    user-select: none;
    line-height: 1;
}

.compare-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 200;
    padding: 12px 16px;
    background: linear-gradient(180deg, rgba(244, 235, 224, 0.98) 0%, #efe3d3 100%);
    border-top: 3px solid var(--teal);
    box-shadow: 0 -6px 24px rgba(0, 0, 0, 0.12);
}

.compare-bar-inner {
    max-width: 960px;
    margin: 0 auto;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 12px 16px;
}

.compare-bar-label {
    font-family: 'DM Sans', sans-serif;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--dark);
}

.compare-bar-primary,
.compare-bar-secondary {
    font-family: 'DM Sans', sans-serif;
    font-size: 0.82rem;
    font-weight: 700;
    padding: 10px 18px;
    border-radius: 8px;
    cursor: pointer;
    border: none;
}

.compare-bar-primary {
    background: var(--rust);
    color: #fff;
}

.compare-bar-primary:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.compare-bar-secondary {
    background: transparent;
    color: var(--teal);
    border: 2px solid var(--teal);
}

.compare-modal {
    position: fixed;
    inset: 0;
    z-index: 400;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
}

.compare-modal.open {
    display: flex;
}

.compare-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(17, 17, 16, 0.55);
    backdrop-filter: blur(4px);
}

.compare-modal-dialog {
    position: relative;
    z-index: 1;
    width: min(1100px, 100%);
    max-height: min(88vh, 900px);
    overflow: auto;
    background: #fdfaf5;
    border: 3px solid var(--teal);
    border-radius: 14px;
    padding: 22px 22px 26px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.22);
}

.compare-modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 38px;
    height: 38px;
    border: 2px solid var(--rust);
    border-radius: 8px;
    background: #fff;
    color: var(--rust);
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    font-weight: 700;
}

.compare-modal-title {
    font-family: 'Playfair Display', serif;
    font-size: 1.35rem;
    color: var(--rust);
    margin: 0 40px 6px 0;
}

.compare-modal-sub {
    margin: 0 0 16px;
    font-size: 0.82rem;
    color: var(--mid);
}

.compare-modal-body {
    margin-top: 8px;
}

.compare-modal-empty {
    margin: 0;
    padding: 16px;
    text-align: center;
    color: var(--mid);
}

.compare-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.compare-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
    min-width: 520px;
}

.compare-table th,
.compare-table td {
    padding: 10px 12px;
    border: 1px solid #9ec7c2;
    vertical-align: top;
}

.compare-table thead th {
    background: #e9f7f5;
    color: var(--teal);
    font-family: 'DM Sans', sans-serif;
    font-weight: 700;
    text-align: center;
}

.compare-th-brand {
    font-size: 0.68rem;
    letter-spacing: 0.08em;
}

.compare-th-model {
    font-family: 'Playfair Display', serif;
    font-size: 1rem;
    color: var(--rust);
}

.compare-table tbody th[scope='row'] {
    text-align: left;
    background: #f4ebe0;
    font-family: 'DM Sans', sans-serif;
    font-weight: 700;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--mid);
    white-space: nowrap;
}

.compare-table tbody td {
    text-align: center;
    background: #fff;
}

.compare-cell-img {
    width: 100%;
    max-width: 140px;
    height: 88px;
    object-fit: cover;
    border-radius: 8px;
    display: block;
    margin: 0 auto;
}

.compare-cell-muted {
    color: #aaa;
}

body.compare-modal-open {
    overflow: hidden;
}

/* Évite que le pied de page passe sous la barre fixe */
body:has(.compare-bar:not([hidden])) {
    padding-bottom: calc(76px + env(safe-area-inset-bottom, 0px));
}

/* ===== CARD ===== */
.card {
    position: relative;
    background: #fdfaf5;
    border-radius: 10px;
    overflow: hidden;
    border: 2px solid var(--teal);
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
}
.card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.1);
}

.card-cat {
    position: absolute;
    top: 8px;
    left: 12px;
    background: #e9fbf8;
    color: var(--teal);
    font-size: 0.6rem;
    letter-spacing: 0.08em;
    padding: 5px 12px;
    border-radius: 999px;
    text-transform: uppercase;
    font-weight: 700;
    backdrop-filter: blur(4px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.12);
}

.img-container {
    position: relative;
    width: 100%;
    height: 150px;
    overflow: hidden;
    background: #eee;
    border-bottom: 2px solid var(--teal);
}

.img-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s;
}
.card:hover .img-container img { transform: scale(1.04); }

.p-box { padding: 18px 20px 20px; }

.brand {
    font-size: 0.65rem;
    color: var(--teal);
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.model {
    font-family: 'Playfair Display', serif;
    font-size: 1.45rem;
    color: var(--rust);
    margin: 5px 0 14px;
    line-height: 1.2;
    font-weight: 700;
}

.ev-badge {
    position: absolute;
    bottom: 8px;
    right: 10px;
    z-index: 3;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 10px 5px 8px;
    background: linear-gradient(135deg, #1f9d55 0%, #168a48 100%);
    color: #fff;
    font-family: 'DM Sans', sans-serif;
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    border-radius: 999px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.18), 0 0 0 1.5px rgba(255, 255, 255, 0.18) inset;
    user-select: none;
    pointer-events: none;
}

.ev-badge-icon {
    font-size: 0.85rem;
    line-height: 1;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.25));
}

.ev-badge-text {
    line-height: 1;
}

.card-ev {
    border-color: #1f9d55;
}

.card-ev .card-cat {
    background: #fff;
}

.tow-badge {
    position: absolute;
    bottom: 8px;
    left: 10px;
    z-index: 3;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 10px 5px 8px;
    background: linear-gradient(135deg, #c75d3f 0%, #a8472d 100%);
    color: #fff;
    font-family: 'DM Sans', sans-serif;
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    border-radius: 999px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.18), 0 0 0 1.5px rgba(255, 255, 255, 0.18) inset;
    user-select: none;
    pointer-events: none;
}

.img-container .tow-badge img.tow-badge-icon {
    width: 16px;
    height: 16px;
    object-fit: contain;
    display: block;
    transition: none;
    filter: brightness(0) invert(1) drop-shadow(0 1px 2px rgba(0, 0, 0, 0.35));
}

.card:hover .img-container .tow-badge img.tow-badge-icon {
    transform: none;
}

.tow-badge-text {
    line-height: 1;
}

.price {
    background: var(--rust);
    color: white;
    padding: 10px 14px;
    border-radius: 8px;
    display: inline-block;
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 16px;
    box-shadow: 0 8px 18px rgba(181, 82, 59, 0.18);
}
.price small { font-weight: 300; opacity: 0.8; font-size: 0.7em; }

.stats {
    display: flex;
    gap: 8px;
}

.s-item {
    flex: 1;
    background: #e3f0ee;
    padding: 10px 12px;
    border-radius: 8px;
    border: 1.5px solid #8fc8c4;
    display: flex;
    align-items: center;
    gap: 10px;
}

.s-icon {
    color: var(--teal);
    font-size: 1rem;
}

.s-info small {
    display: block;
    font-size: 0.55rem;
    color: #5f706d;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 700;
}
.s-info b { font-size: 0.82rem; color: #1e2523; }

/* ===== PAGINATION ===== */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 32px;
    flex-wrap: wrap;
}

.page-info {
    text-align: center;
    font-size: 0.75rem;
    color: #888;
    margin-top: 12px;
}

.pag-btn {
    min-width: 36px;
    height: 36px;
    border: 1px solid #ccc;
    background: white;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.8rem;
    font-family: 'DM Sans', sans-serif;
    color: #444;
    padding: 0 10px;
    transition: all 0.15s;
}
.pag-btn:hover { border-color: var(--teal); color: var(--teal); }
.pag-btn.active { background: var(--rust); border-color: var(--rust); color: white; font-weight: 700; }
.pag-btn.ellipsis { cursor: default; border-color: transparent; background: none; }
.pag-btn.ellipsis:hover { color: #444; border-color: transparent; }

/* ===== FOOTER ===== */
.site-footer {
    background: var(--dark);
    color: var(--text-muted);
    padding: 50px 24px 30px;
}

.footer-inner {
    max-width: 1300px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 40px;
    padding-bottom: 30px;
    border-bottom: 1px solid var(--border);
}

.footer-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 14px;
    font-size: 0.78rem;
    line-height: 1.6;
}

.footer-nav a {
    color: var(--teal);
    text-decoration: none;
    font-weight: 600;
}

.footer-nav a:hover {
    color: var(--gold-light);
    text-decoration: underline;
}

.footer-heading {
    font-family: 'Playfair Display', serif;
    color: var(--text);
    font-size: 0.9rem;
    margin-bottom: 10px;
}

.footer-text {
    font-size: 0.78rem;
    line-height: 1.8;
    color: var(--text-muted);
}

.footer-bottom {
    max-width: 1300px;
    margin: 20px auto 0;
    display: flex;
    justify-content: space-between;
    font-size: 0.7rem;
    color: var(--text-dim);
    flex-wrap: wrap;
    gap: 8px;
}

.footer-est { font-style: italic; }

/* ===== ADMIN PAGE (admin.html) ===== */
body.admin-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    margin: 0;
    padding: 24px 16px 40px;
    box-sizing: border-box;
    font-family: 'DM Sans', sans-serif;
    background:
        radial-gradient(ellipse 70% 45% at 50% -15%, rgba(95, 167, 163, 0.18), transparent 52%),
        radial-gradient(ellipse 50% 40% at 100% 100%, rgba(181, 82, 59, 0.12), transparent 45%),
        linear-gradient(168deg, #141312 0%, #1f1e1c 42%, #1a1917 100%);
    color: var(--dark);
}

body.admin-page .admin-standalone-wrapper {
    position: relative;
    width: 100%;
    max-width: min(1200px, 100%);
    margin: 0;
    padding: 36px clamp(20px, 4vw, 44px) 42px;
    background: #ebe4d9;
    border-radius: 20px;
    border: 4px solid var(--teal);
    box-shadow:
        0 32px 100px rgba(0, 0, 0, 0.55),
        0 0 0 1px rgba(255, 255, 255, 0.45) inset;
    overflow: hidden;
}

body.admin-page .admin-standalone-wrapper::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: repeating-linear-gradient(
        135deg,
        transparent,
        transparent 11px,
        rgba(0, 0, 0, 0.038) 11px,
        rgba(0, 0, 0, 0.038) 12px
    );
    pointer-events: none;
}

body.admin-page .admin-standalone-wrapper > * {
    position: relative;
    z-index: 1;
}

body.admin-page .admin-standalone-header {
    text-align: center;
    margin-bottom: 28px;
    padding-bottom: 26px;
    border-bottom: 1px solid rgba(181, 82, 59, 0.22);
}

body.admin-page .admin-standalone-eyebrow {
    font-family: 'DM Sans', sans-serif;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.28em;
    text-transform: uppercase;
    color: var(--teal);
    margin: 0 0 10px;
}

body.admin-page .admin-standalone-header h1 {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 8px 14px;
    font-family: 'Playfair Display', serif;
    font-size: clamp(1.85rem, 4.5vw, 2.45rem);
    font-weight: 700;
    margin: 0 0 10px;
    line-height: 1.15;
    color: var(--rust);
}

body.admin-page .admin-standalone-brand {
    color: var(--rust);
}

body.admin-page .admin-standalone-h1-sep {
    display: inline-block;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--teal);
    opacity: 0.85;
    flex-shrink: 0;
}

body.admin-page .admin-standalone-h1-muted {
    font-family: 'DM Sans', sans-serif;
    font-size: clamp(0.68rem, 2.2vw, 0.78rem);
    font-weight: 800;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--dark);
}

body.admin-page .admin-standalone-lead {
    font-family: 'Libre Baskerville', serif;
    font-size: 0.95rem;
    color: var(--mid);
    margin: 0 0 16px;
    line-height: 1.55;
}

body.admin-page .admin-standalone-back {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: 999px;
    border: 2px solid var(--rust);
    background: rgba(255, 255, 255, 0.65);
    color: var(--rust);
    font-family: 'DM Sans', sans-serif;
    font-size: 0.82rem;
    font-weight: 700;
    text-decoration: none;
    letter-spacing: 0.04em;
    transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
    box-shadow: 0 2px 10px rgba(17, 17, 16, 0.06);
}

body.admin-page .admin-standalone-back::before {
    content: '←';
    font-size: 1rem;
    opacity: 0.85;
}

body.admin-page .admin-standalone-back:hover {
    background: var(--rust);
    color: #fff;
    box-shadow: 0 6px 20px rgba(181, 82, 59, 0.35);
}

body.admin-page .admin-standalone-nav {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px 18px;
}

body.admin-page .admin-standalone-aux {
    font-family: 'DM Sans', sans-serif;
    font-size: 0.84rem;
    font-weight: 600;
    color: var(--teal);
    text-decoration: none;
    border-bottom: 1px solid transparent;
}

body.admin-page .admin-standalone-aux:hover {
    color: var(--rust);
    border-bottom-color: var(--rust);
}

body.admin-page .admin-panel {
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    background: transparent;
    border: none;
    box-shadow: none;
    padding: 0;
}

body.admin-page .admin-close {
    position: fixed;
    top: 18px;
    right: 18px;
    z-index: 1000;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.22);
    background: rgba(26, 25, 23, 0.88);
    color: #f5f2eb;
    font-size: 1.45rem;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    backdrop-filter: blur(10px);
    box-shadow: 0 6px 28px rgba(0, 0, 0, 0.4);
    transition: background 0.15s ease, transform 0.15s ease, border-color 0.15s ease;
}

body.admin-page .admin-close:hover {
    background: var(--rust);
    border-color: transparent;
    color: #fff;
    transform: scale(1.05);
}

body.admin-page .admin-login {
    margin: 4px auto 0;
    max-width: 420px;
    border: 4px solid var(--teal);
    border-radius: 16px;
    padding: 26px 28px 28px;
    background: linear-gradient(180deg, #fefdfb 0%, #faf7f4 100%);
    box-shadow:
        inset 0 0 0 1px rgba(181, 82, 59, 0.32),
        0 16px 48px rgba(17, 17, 16, 0.1);
}

body.admin-page .admin-login h2 {
    font-size: 1.35rem;
    margin-bottom: 6px;
}

body.admin-page .admin-login p {
    color: #555;
    margin-bottom: 20px;
}

body.admin-page .admin-login input:focus {
    outline: none;
    border-color: var(--rust);
    box-shadow: 0 0 0 3px rgba(181, 82, 59, 0.15);
}

body.admin-page .admin-login .admin-primary {
    width: 100%;
    margin-top: 6px;
    padding: 12px 18px;
    border-radius: 10px;
    font-size: 0.92rem;
    letter-spacing: 0.06em;
    box-shadow: 0 4px 14px rgba(181, 82, 59, 0.25);
}

body.admin-page .admin-login .admin-primary:hover {
    filter: brightness(1.05);
}

body.admin-page .admin-content {
    min-height: auto;
}

body.admin-page .admin-topbar {
    border-radius: 14px;
    margin-bottom: 8px;
    border: 2px solid rgba(95, 167, 163, 0.35);
    box-shadow: 0 8px 24px rgba(17, 17, 16, 0.06);
}

body.admin-page .admin-site-options {
    border: 2px solid rgba(95, 167, 163, 0.28);
    border-radius: 14px;
    box-shadow: 0 6px 20px rgba(17, 17, 16, 0.05);
}

/* ===== EMPTY STATE ===== */
.empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    color: #999;
}
.empty-state h3 { font-family: 'Playfair Display', serif; color: #ccc; margin-bottom: 8px; }

/* ===== RESPONSIVE ===== */
@media (max-width: 840px) {
    .tombola-card {
        width: min(360px, calc(50% - 8px));
        max-width: min(360px, calc(50% - 8px));
    }
}

@media (max-width: 900px) {
    .layout { flex-direction: column; }
    .sidebar {
        width: 100%;
        position: static;
        max-height: none;
        display: block;
    }
    .filter-block { margin-bottom: 18px; }
    .filter-block:nth-child(1) { display: block; }
    .filter-block:nth-child(5) { display: block; }
    .hero { flex-direction: column; }
    .tombola-widget { min-width: auto; width: 100%; max-width: 760px; }
    .admin-grid { grid-template-columns: 1fr; }
    .admin-head { display: block; }
    .admin-topbar { flex-wrap: wrap; height: auto; padding: 14px; }
    .admin-tabs { width: 100%; margin-left: 0; flex-wrap: wrap; }
    .admin-tab { flex: 1; min-width: 140px; }
    .admin-hero-row { display: block; }
    .admin-hero-actions { margin-top: 16px; flex-wrap: wrap; }
    .admin-filter-row { grid-template-columns: 1fr; }
    .admin-edit-layout { grid-template-columns: 1fr; }
    .admin-fields.three { grid-template-columns: 1fr; }
    .admin-tombola-form { grid-template-columns: 1fr; }
    .footer-inner { grid-template-columns: 1fr; gap: 20px; }
}

@media (max-width: 1280px) {
    .grid-display {
        grid-template-columns: repeat(3, minmax(0, 294px));
    }
}

@media (max-width: 980px) {
    .grid-display {
        grid-template-columns: repeat(2, minmax(0, 294px));
    }
}

@media (max-width: 600px) {
    .hero { padding: 40px 16px 30px; }
    .layout { padding: 20px 16px 40px; }
    .tombola-card {
        width: min(400px, 100%);
        max-width: 100%;
    }
    .admin-panel { padding: 22px 16px; }
    .admin-fields { grid-template-columns: 1fr; }
    .grid-display {
        grid-template-columns: minmax(0, 294px);
    }
}
