/* ============================================================
   Restaurant Click & Collect v1.6 — Carte Menu
   Tabs AJAX + Grille horizontale + Modal produit
   ============================================================ */

/* ── Variables ─────────────────────────────────────────────────────────────── */
.rcc-carte {
    --rc-red:      #7B1A1A;
    --rc-red-h:    #5e1414;
    --rc-red-light: rgba(123,26,26,.07);
    --rc-green:    #2a7d4f;
    --rc-grey:     #f5f5f5;
    --rc-border:   #e8e8e8;
    --rc-text:     #1a1a1a;
    --rc-muted:    #6b6b6b;
    --rc-nav-h:    52px;
    --rc-radius:   12px;
    --rc-shadow:   0 4px 20px rgba(0,0,0,.08);
    --rc-shadow-lg:0 8px 32px rgba(0,0,0,.12);

    max-width: 1200px;
    margin: 0 auto;
    padding: 0 8px 64px;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
    color: var(--rc-text);
}

/* ── Navigation (tabs filtre) ───────────────────────────────────────────────── */

.rcc-carte-nav {
    position: relative;
    z-index: 0;
    background: #fff;
    border-bottom: 2px solid var(--rc-border);
    box-shadow: 0 2px 10px rgba(0,0,0,.06);
    margin: 0 -8px 20px;
}

.rcc-carte-nav-inner {
    display: flex;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding: 0 8px;
    max-width: 1200px;
    margin: 0 auto;
}

.rcc-carte-nav-inner::-webkit-scrollbar { display: none; }

.rcc-carte-nav-tab {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    padding: 0 20px;
    height: var(--rc-nav-h);
    font-size: 14px;
    font-weight: 600;
    color: var(--rc-muted);
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    cursor: pointer;
    transition: color .18s, border-color .18s;
    white-space: nowrap;
    letter-spacing: .01em;
}

.rcc-carte-nav-tab:hover   { color: var(--rc-red); }

.rcc-carte-nav-tab.is-active {
    color: var(--rc-red);
    border-bottom-color: var(--rc-red);
}

/* ── Compteur résultats ─────────────────────────────────────────────────────── */

.rcc-carte-count {
    font-size: 12px;
    color: var(--rc-muted);
    margin-bottom: 16px;
    font-weight: 500;
    letter-spacing: .02em;
    text-transform: uppercase;
}

/* ── Grille de cartes ───────────────────────────────────────────────────────── */

.rcc-carte-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
}

/* ── Carte produit (layout horizontal) ─────────────────────────────────────── */

.rcc-carte-card {
    display: flex;
    align-items: stretch;
    background: #fff;
    border: 1px solid var(--rc-border);
    border-radius: 12px;
    cursor: pointer;
    transition: background .16s, box-shadow .16s;
    position: relative;
    min-height: 120px;
    padding: 16px;
    gap: 16px;
}

.rcc-carte-card:first-child { border-top: 1px solid var(--rc-border); }

.rcc-carte-card:hover { background: rgba(123,26,26,.025); }

.rcc-carte-card:focus {
    outline: 2px solid var(--rc-red);
    outline-offset: -2px;
}

.rcc-carte-card.is-out-of-stock { opacity: .55; cursor: default; }
.rcc-carte-card.is-out-of-stock:hover { background: #fff; }

/* Card hidden by filter */
.rcc-carte-card.is-cat-hidden {
    display: none;
}

/* Corps textuel */
.rcc-carte-card-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-width: 0;
    padding-right: 4px;
}

.rcc-carte-card-top { margin-bottom: 10px; }

.rcc-carte-card-name {
    margin: 0 0 6px;
    font-size: 15px;
    font-weight: 700;
    line-height: 1.3;
    color: var(--rc-text);
}

.rcc-carte-card-desc {
    margin: 0 0 8px;
    font-size: 13px;
    color: var(--rc-muted);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.rcc-carte-card-badges {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

/* Footer de la carte (prix + bouton +) */
.rcc-carte-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.rcc-carte-card-price {
    font-size: 15px;
    font-weight: 800;
    color: var(--rc-text);
    white-space: nowrap;
}

.rcc-carte-card-price .woocommerce-Price-amount { color: inherit; }

/* Bouton + rond */
.rcc-carte-add-btn {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--rc-red);
    color: #ffffff !important;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    transition: background .18s, transform .15s, box-shadow .18s;
    box-shadow: 0 2px 8px rgba(123,26,26,.25);
    line-height: 1;
    overflow: hidden;
}

.rcc-carte-add-btn:hover {
    background: var(--rc-red-h);
    transform: scale(1.10);
    box-shadow: 0 4px 14px rgba(123,26,26,.35);
}

.rcc-carte-add-btn.is-added {
    background: var(--rc-green);
    animation: rcc-btn-pop .3s cubic-bezier(.34,1.56,.64,1) both;
}

@keyframes rcc-btn-pop {
    0%   { transform: scale(.8);  opacity: .6; }
    100% { transform: scale(1);   opacity: 1;  }
}

/* Image (droite) */
.rcc-carte-card-img-wrap {
    width: 104px;
    min-width: 104px;
    height: 104px;
    flex-shrink: 0;
    border-radius: 10px;
    overflow: hidden;
    background: var(--rc-grey);
    align-self: center;
    position: relative; /* nécessaire pour le bandeau promo */
}

.rcc-carte-card-img,
.rcc-carte-card-img-wrap img {
    width: 100% !important;
    height: 100% !important;
    max-width: none !important;
    max-height: none !important;
    min-height: 0 !important;
    object-fit: cover !important;
    object-position: center !important;
    display: block !important;
    transition: transform .35s ease;
}

.rcc-carte-card:hover .rcc-carte-card-img { transform: scale(1.06); }

/* ── Badge PROMO ─────────────────────────────────────────────────────────── */
.rcc-carte-promo-ribbon {
    position: absolute;
    bottom: 7px;
    left: 7px;
    background: linear-gradient(135deg, #e53e3e 0%, #c53030 100%);
    color: #fff;
    font-size: 11px;
    font-weight: 900;
    padding: 3px 10px;
    border-radius: 20px;
    line-height: 1.5;
    z-index: 2;
    box-shadow: 0 2px 6px rgba(0,0,0,.28);
    letter-spacing: .01em;
    pointer-events: none;
    white-space: nowrap;
}

/* Badges */
.rcc-carte-badge {
    display: inline-block;
    padding: 3px 9px;
    border-radius: 30px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
    line-height: 1.4;
}

.rcc-carte-badge--formula { background: rgba(123,26,26,.1); color: var(--rc-red); }
.rcc-carte-badge--opts    { background: rgba(34,113,177,.1); color: #1a5a8a; }
.rcc-carte-badge--stock   { background: #f0f0f0; color: #888; }

/* Aucun résultat */
.rcc-carte-no-results {
    text-align: center;
    padding: 48px 20px;
    color: var(--rc-muted);
}

.rcc-carte-no-results svg { margin-bottom: 12px; opacity: .4; }
.rcc-carte-no-results p   { font-size: 15px; margin: 0; }

/* ── Fix icônes SVG dans boutons rouges — règles SÉPARÉES (évite les conflits) */

/* Bouton + sur la carte produit */
.rcc-carte-add-btn svg {
    display: block;
    stroke: #ffffff !important;
    fill: none !important;
    flex-shrink: 0;
    pointer-events: none;
}

/* Bouton × fermer le modal — icône SOMBRE (fond gris clair) */
.rcc-carte-modal-close {
    color: #1a1a1a !important;
}
.rcc-carte-modal-close svg {
    display: block;
    stroke: #1a1a1a !important;
    fill: none !important;
    flex-shrink: 0;
    pointer-events: none;
}

/* Boutons − / + quantité dans le modal — icône SOMBRE (fond gris clair) */
.rcc-carte-qty-btn {
    color: #1a1a1a !important;
}
.rcc-carte-qty-btn svg {
    display: block;
    stroke: #1a1a1a !important;
    fill: none !important;
    flex-shrink: 0;
    pointer-events: none;
}

/* Supprime lien Astra "Voir le panier" injecté */
.rcc-carte-card-footer a.added_to_cart,
.rcc-carte-card-footer .added_to_cart { display: none !important; }

/* ── Modal overlay ──────────────────────────────────────────────────────────── */

.rcc-carte-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 99999;
    background: rgba(0,0,0,.48);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity .22s;
}

.rcc-carte-modal-overlay.is-open {
    opacity: 1;
    pointer-events: auto;
}

@media (min-width: 600px) {
    .rcc-carte-modal-overlay {
        align-items: center;
        padding: 20px;
    }
}

/* Boîte modale */
.rcc-carte-modal {
    background: #fff;
    width: 100%;
    max-width: 480px;
    max-height: 94vh;
    border-radius: 20px 20px 0 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    position: relative;
    transform: translateY(60px);
    transition: transform .3s cubic-bezier(.34,1.22,.64,1);
    box-shadow: 0 -4px 40px rgba(0,0,0,.14);
}

.rcc-carte-modal-overlay.is-open .rcc-carte-modal {
    transform: translateY(0);
}

@media (min-width: 600px) {
    .rcc-carte-modal {
        border-radius: 18px;
        transform: scale(.94) translateY(0);
        box-shadow: var(--rc-shadow-lg);
    }
    .rcc-carte-modal-overlay.is-open .rcc-carte-modal {
        transform: scale(1) translateY(0);
    }
}

/* Bouton fermer — fond neutre pour rester visible sur fond blanc */
.rcc-carte-modal-close {
    position: absolute;
    top: 14px;
    right: 14px;
    z-index: 20;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(0,0,0,.08);
    color: #1a1a1a;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .18s, transform .15s;
    box-shadow: none;
}

.rcc-carte-modal-close:hover {
    background: rgba(0,0,0,.15);
    transform: scale(1.08);
}

/* Override Astra qui force background:transparent sur button */
button#rcc-carte-modal-close-btn,
.rcc-carte-modal button.rcc-carte-modal-close {
    background:       rgba(0,0,0,.08) !important;
    background-color: rgba(0,0,0,.08) !important;
    color:            #1a1a1a !important;
    box-shadow:       none !important;
    text-shadow:      none !important;
    border:           none !important;
}

/* ── En-tête du modal (image + info) ───────────────────────────────────────── */

.rcc-carte-modal-header {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 22px 20px 16px;
    border-bottom: 1px solid var(--rc-border);
    flex-shrink: 0;
}

.rcc-carte-modal-img-wrap {
    width: 120px;
    height: 120px;
    border-radius: 12px;
    overflow: hidden;
    background: var(--rc-grey);
    flex-shrink: 0;
}

.rcc-carte-modal-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.rcc-carte-modal-img-wrap.is-hidden { display: none; }

.rcc-carte-modal-info {
    flex: 1;
    min-width: 0;
    padding-right: 32px; /* room for close button */
}

.rcc-carte-modal-title {
    font-size: 18px;
    font-weight: 800;
    margin: 0 0 8px;
    line-height: 1.25;
    color: var(--rc-text);
    letter-spacing: -.2px;
}

/* ── Override styles Astra sur le h2 du modal (sélecteur ID pour max spécificité) */
#rcc-carte-modal-title,
.rcc-carte-modal-overlay #rcc-carte-modal-title,
.rcc-carte-modal h2.rcc-carte-modal-title,
.rcc-carte-modal .rcc-carte-modal-title {
    font-size: 18px !important;
    font-weight: 800 !important;
    line-height: 1.25 !important;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif !important;
    text-transform: none !important;
    letter-spacing: -.2px !important;
    margin: 0 0 8px !important;
    padding: 0 !important;
    border: none !important;
    border-bottom: none !important;
    background: none !important;
    color: #1a1a1a !important;
    box-shadow: none !important;
    word-break: break-word !important;
}

.rcc-carte-modal-price {
    font-size: 18px;
    font-weight: 800;
    color: var(--rc-text);
    margin-bottom: 8px;
}

.rcc-carte-modal-price .woocommerce-Price-amount { color: inherit; }

.rcc-carte-modal-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

/* Description */
.rcc-carte-modal-desc {
    padding: 14px 20px;
    font-size: 13px;
    color: var(--rc-muted);
    line-height: 1.6;
    border-bottom: 1px solid var(--rc-border);
    flex-shrink: 0;
}

.rcc-carte-modal-desc:empty { display: none; }

/* ── Corps scrollable ───────────────────────────────────────────────────────── */

.rcc-carte-modal-body {
    flex: 1;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    display: flex;
    flex-direction: column;
}

.rcc-carte-modal-section:not(:empty) {
    padding: 18px 20px 0;
    border-bottom: 1px solid var(--rc-border);
    margin-bottom: 2px;
}

.rcc-carte-modal-section:last-of-type { border-bottom: none; }

/* ── Groupes d'options ──────────────────────────────────────────────────────── */

.rcc-carte-opt-group,
.rcc-carte-supp-group,
.rcc-carte-formula-step {
    margin-bottom: 20px;
}

.rcc-carte-opt-label {
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    color: var(--rc-text);
}

.rcc-carte-opt-sublabel {
    font-size: 12px;
    color: var(--rc-muted);
    font-weight: 400;
    margin-bottom: 10px;
}

.rcc-carte-opt-required {
    font-size: 11px;
    background: var(--rc-red);
    color: #fff;
    padding: 2px 8px;
    border-radius: 30px;
    font-weight: 600;
}

.rcc-carte-opt-optional {
    font-size: 11px;
    background: var(--rc-grey);
    color: var(--rc-muted);
    padding: 2px 8px;
    border-radius: 30px;
    font-weight: 600;
}

/* Choix */
.rcc-carte-choices {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.rcc-carte-choice-label {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 14px;
    border: 1.5px solid var(--rc-border);
    border-radius: 10px;
    cursor: pointer;
    transition: border-color .14s, background .14s;
    font-size: 14px;
    user-select: none;
}

.rcc-carte-choice-label:hover { border-color: var(--rc-red); background: var(--rc-red-light); }

.rcc-carte-choice-label.is-selected {
    border-color: var(--rc-red);
    background: var(--rc-red-light);
}

.rcc-carte-choice-label input[type="radio"],
.rcc-carte-choice-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--rc-red);
    flex-shrink: 0;
    cursor: pointer;
}

.rcc-carte-choice-name { flex: 1; }

.rcc-carte-choice-price {
    font-weight: 700;
    color: var(--rc-muted);
    font-size: 13px;
    white-space: nowrap;
}

/* Erreur validation */
.rcc-carte-opt-group.rcc-carte-opt-error .rcc-carte-choice-label,
.rcc-carte-formula-step.rcc-carte-opt-error .rcc-carte-formula-product {
    border-color: #d63638;
    background: rgba(214,54,56,.04);
}

.rcc-carte-error-msg {
    color: #d63638;
    font-size: 12px;
    font-weight: 600;
    margin: 6px 0 0;
}

/* Formule — produits */
.rcc-carte-formula-step-products {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 220px;
    overflow-y: auto;
}

.rcc-carte-formula-product {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border: 1.5px solid var(--rc-border);
    border-radius: 10px;
    cursor: pointer;
    transition: border-color .14s, background .14s;
    user-select: none;
}

.rcc-carte-formula-product:hover { border-color: var(--rc-red); background: var(--rc-red-light); }
.rcc-carte-formula-product.is-selected { border-color: var(--rc-red); background: var(--rc-red-light); }

.rcc-carte-formula-product input[type="radio"] {
    width: 16px; height: 16px;
    accent-color: var(--rc-red);
    flex-shrink: 0;
    cursor: pointer;
}

.rcc-carte-formula-product-img {
    width: 44px; height: 44px;
    border-radius: 7px;
    object-fit: cover;
    background: var(--rc-grey);
    flex-shrink: 0;
}

.rcc-carte-formula-product-name {
    flex: 1;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.3;
}

/* ── Pied de page modal (sticky) ────────────────────────────────────────────── */

.rcc-carte-modal-footer {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    border-top: 1px solid var(--rc-border);
    background: #fff;
    flex-shrink: 0;
}

/* Quantité */
.rcc-carte-qty {
    display: flex;
    align-items: center;
    gap: 0;
    flex-shrink: 0;
}

.rcc-carte-qty-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #ebebeb;
    color: #1a1a1a;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .16s, transform .14s;
    flex-shrink: 0;
}

.rcc-carte-qty-btn:hover { background: #d5d5d5; transform: scale(1.08); }

/* Override Astra sur les boutons de quantité */
.rcc-carte-qty button.rcc-carte-qty-btn,
.rcc-carte-modal-footer button.rcc-carte-qty-btn {
    background:       #ebebeb !important;
    background-color: #ebebeb !important;
    color:            #1a1a1a !important;
    box-shadow:       none !important;
    text-shadow:      none !important;
    border:           none !important;
}
.rcc-carte-qty button.rcc-carte-qty-btn:hover,
.rcc-carte-modal-footer button.rcc-carte-qty-btn:hover {
    background:       #d5d5d5 !important;
    background-color: #d5d5d5 !important;
}

.rcc-carte-qty-val {
    min-width: 36px;
    text-align: center;
    font-size: 16px;
    font-weight: 700;
    color: var(--rc-text);
}

/* Bouton Ajouter au panier */
.rcc-carte-modal-submit {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 13px 20px;
    background: var(--rc-red);
    color: #fff;
    border: none;
    border-radius: 30px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: background .18s, box-shadow .18s;
    white-space: nowrap;
}

/* Override Astra/Elementor : sélecteur ID + chaîne longue pour gagner en spécificité */
button#rcc-carte-modal-submit,
.rcc-carte-modal-overlay button.rcc-carte-modal-submit,
.rcc-carte-modal-footer button.rcc-carte-modal-submit {
    background: #7B1A1A !important;
    background-color: #7B1A1A !important;
    color: #ffffff !important;
    border: none !important;
    border-radius: 30px !important;
    font-size: 15px !important;
    font-weight: 700 !important;
    text-transform: none !important;
    letter-spacing: 0 !important;
    padding: 13px 20px !important;
    box-shadow: none !important;
    text-shadow: none !important;
    line-height: 1.4 !important;
    width: auto !important;
    height: auto !important;
}

button#rcc-carte-modal-submit:hover:not(:disabled),
.rcc-carte-modal-footer button.rcc-carte-modal-submit:hover:not(:disabled) {
    background: #5e1414 !important;
    background-color: #5e1414 !important;
    box-shadow: 0 4px 16px rgba(123,26,26,.30) !important;
}

.rcc-carte-modal-submit:disabled { opacity: .55; cursor: not-allowed; }
.rcc-carte-modal-submit.is-loading { opacity: .75; pointer-events: none; }
.rcc-carte-modal-submit.is-added,
button#rcc-carte-modal-submit.is-added {
    background: #2a7d4f !important;
    background-color: #2a7d4f !important;
}

/* ── Loader modal ───────────────────────────────────────────────────────────── */

.rcc-carte-modal-loader {
    position: absolute;
    inset: 0;
    background: rgba(255,255,255,.92);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    border-radius: inherit;
}

.rcc-carte-spin {
    width: 28px;
    height: 28px;
    border: 3px solid var(--rc-border);
    border-top-color: var(--rc-red);
    border-radius: 50%;
    animation: rcc-spin .65s linear infinite;
}

@keyframes rcc-spin { to { transform: rotate(360deg); } }

/* ── Empty ──────────────────────────────────────────────────────────────────── */

.rcc-carte-empty {
    text-align: center;
    color: var(--rc-muted);
    padding: 40px;
    font-size: 15px;
}

/* ── Responsive ─────────────────────────────────────────────────────────────── */

/* Tablet : 2 colonnes */
@media (min-width: 600px) {
    .rcc-carte-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;          /* espace visible entre les cartes */
        background: transparent;
        border: none;
        border-radius: 0;
        overflow: visible;
    }

    /* Chaque carte garde ses coins arrondis et sa bordure */
    .rcc-carte-card {
        background: #fff;
        border: 1px solid var(--rc-border);
        border-radius: 12px;
        padding: 16px;
    }

    .rcc-carte-card:hover {
        background: rgba(123,26,26,.025);
        box-shadow: 0 2px 12px rgba(0,0,0,.07);
    }
    .rcc-carte-card:focus { outline: 2px solid var(--rc-red); outline-offset: -2px; }
    .rcc-carte-card.is-cat-hidden { display: none; }
    .rcc-carte-card:first-child { border-top: 1px solid var(--rc-border); }
}

/* Desktop : 3 colonnes */
@media (min-width: 900px) {
    .rcc-carte-grid { grid-template-columns: repeat(3, 1fr); gap: 14px; }
    .rcc-carte-card-img-wrap { width: 120px; min-width: 120px; height: 120px; }
}

/* Mobile */
@media (max-width: 599px) {
    .rcc-carte-nav-tab { padding: 0 14px; font-size: 13px; }
    .rcc-carte-modal-header { flex-direction: column; }
    .rcc-carte-modal-img-wrap { width: 100%; height: 180px; border-radius: 0; }
    .rcc-carte-modal-info { padding-right: 40px; }
}
