/* ==========================================================================
   E18b — Style de l'espace restaurateur (.eav-espace-resto)
   Fichier : assets/css/espace-resto.css
   Déclaré conditionnellement (is_page('espace-resto')) dans functions.php.

   Conventions (cf. form-resa.css + theme.json) : tokens --atq-* (lie #7A2E33,
   vigne #2E9A8D, terre #3E2A22, papier #F7F1E7…). Focus anneau vigne.
   Bouton primaire lie → survol terre. Bouton danger lie profond.
   ========================================================================== */

/* --- Conteneur --- */
.eav-espace-resto {
	font-family: Inter, system-ui, -apple-system, sans-serif;
	color: var(--atq-encre, #2A231F);
	max-width: 720px;
	margin: 2rem auto;
	padding: 0 1rem;
}

/* --- En-tête de page (titre propre, cohérent avec le thème) --- */
.eav-espace-resto h2 {
	font-family: Fraunces, serif;
	color: var(--atq-terre, #3E2A22);
	font-size: 1.75rem;
	margin: 0 0 0.5rem;
}

/* --- Message de statut (succès / erreur / chargement) --- */
.eav-espace-resto .eav-espace-status {
	border-radius: var(--atq-radius, 9px);
	font-family: Inter, sans-serif;
	font-size: 0.95rem;
	font-weight: 500;
	padding: 1rem 1.25rem;
	margin: 0 0 1.5rem;
	line-height: 1.5;
}
.eav-espace-resto .eav-espace-status.is-success {
	background: var(--atq-vigne-clair, #eef2e8);
	border: 1px solid var(--atq-vigne, #2E9A8D);
	color: var(--atq-vigne-texte, #1F6E64);
}
.eav-espace-resto .eav-espace-status.is-error {
	background: var(--atq-lie-clair, #fdf5f2);
	border: 1px solid var(--atq-lie, #7A2E33);
	color: var(--atq-lie, #7A2E33);
}
.eav-espace-resto .eav-espace-status.is-loading {
	background: #f4efe4;
	border: 1px solid #cabda8;
	color: var(--atq-terre, #3E2A22);
}
/* Gate : pas de token */
.eav-espace-resto .eav-espace-gate {
	margin-bottom: 2rem;
}

/* --- Form : fieldsets & champs (calque form-resa.css) --- */
.eav-resto-config-form .eav-field,
.eav-resto-config-form fieldset.eav-field {
	margin: 0 0 1.5rem;
	border: none;
	padding: 0;
}
.eav-resto-config-form legend {
	display: block;
	font-family: Inter, sans-serif;
	font-size: 0.95rem;
	font-weight: 600;
	color: var(--atq-terre, #3E2A22);
	margin: 0 0 0.6rem;
	padding: 0;
	letter-spacing: 0.01em;
}
.eav-resto-config-form .eav-req {
	color: var(--atq-lie, #7A2E33);
	margin-left: 2px;
}
.eav-resto-config-form .eav-field-help {
	display: block;
	font-size: 0.78rem;
	color: var(--atq-aide, #6b5d4e);
	margin: 0.4rem 0 0;
	line-height: 1.45;
}
.eav-resto-config-form label.eav-field {
	display: flex;
	flex-direction: column;
	font-size: 0.8125rem;
	font-weight: 600;
	color: var(--atq-terre, #3E2A22);
	gap: 0.35rem;
}

/* Inputs génériques */
.eav-resto-config-form input[type="text"],
.eav-resto-config-form input[type="number"],
.eav-resto-config-form input[type="date"],
.eav-resto-config-form select,
.eav-espace-resto input[type="text"],
.eav-espace-resto input[type="number"],
.eav-espace-resto input[type="date"],
.eav-espace-resto select {
	width: 100%;
	background-color: #ffffff;
	border: 1px solid #cabda8;
	border-radius: var(--atq-radius, 9px);
	color: var(--atq-encre, #2A231F);
	font-family: Inter, system-ui, sans-serif;
	font-size: 1rem;
	line-height: 1.5;
	padding: 0.6rem 0.8rem;
	min-height: 46px;
	box-sizing: border-box;
	transition: border-color .15s ease, box-shadow .15s ease;
}
.eav-resto-config-form input:focus,
.eav-espace-resto input:focus,
.eav-espace-resto select:focus {
	border-color: var(--atq-vigne-texte, #1F6E64);
	box-shadow: 0 0 0 3px rgba(76, 97, 65, .18);
	background-color: #ffffff;
}
.eav-resto-config-form input:disabled,
.eav-espace-resto input:disabled {
	background: #f4efe4;
	color: var(--atq-aide, #6b5d4e);
	cursor: not-allowed;
}

/* --- Jours d'ouverture : grille 7 colonnes (checkbox + couverts) --- */
.eav-resto-config-form .eav-jours-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
	gap: 0.6rem;
}
.eav-resto-config-form .eav-jour {
	display: flex;
	flex-direction: column;
	gap: 0.35rem;
	padding: 0.6rem;
	border: 1px solid #e4dbcb;
	border-radius: var(--atq-radius, 9px);
	background: #fdfaf3;
	font-weight: 600;
	font-size: 0.85rem;
	color: var(--atq-terre, #3E2A22);
	cursor: pointer;
}
.eav-resto-config-form .eav-jour > span:first-of-type {
	display: flex;
	align-items: center;
	gap: 0.4rem;
}
.eav-resto-config-form .eav-jour input[type="checkbox"] {
	width: 20px; height: 20px; min-height: 20px;
	accent-color: var(--atq-vigne-texte, #1F6E64);
	cursor: pointer;
}
.eav-resto-config-form .eav-jour-couverts {
	min-height: 38px;
	font-size: 0.9rem;
	font-weight: 400;
}

/* --- Bouchon : 2 colonnes --- */
.eav-resto-config-form .eav-row-2col {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 0.8rem;
}

/* --- Formules : liste + principale --- */
.eav-resto-config-form .eav-formules-list {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
	gap: 0.5rem;
	margin-bottom: 0.8rem;
}
.eav-resto-config-form .eav-formule {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	font-size: 0.9rem;
	font-weight: 400;
	color: var(--atq-encre, #2A231F);
	cursor: pointer;
	padding: 0.5rem 0.6rem;
	border: 1px solid #e4dbcb;
	border-radius: var(--atq-radius-sm, 6px);
	background: #fdfaf3;
}
.eav-resto-config-form .eav-formule input[type="checkbox"] {
	width: 20px; height: 20px;
	accent-color: var(--atq-vigne-texte, #1F6E64);
	cursor: pointer;
	flex-shrink: 0;
}
.eav-resto-config-form .eav-formule-code {
	font-weight: 600;
	color: var(--atq-lie, #7A2E33);
	font-size: 0.85rem;
}
.eav-resto-config-form .eav-formule-principale {
	max-width: 320px;
}

/* --- Périodes : lignes éditables --- */
.eav-resto-config-form .eav-periodes-list {
	display: flex;
	flex-direction: column;
	gap: 0.6rem;
	margin-bottom: 0.6rem;
}
.eav-resto-config-form .eav-periode-row {
	display: grid;
	grid-template-columns: 1.2fr 1.4fr 1fr 1fr 1fr auto;
	gap: 0.5rem;
	align-items: end;
	padding: 0.6rem;
	border: 1px solid #e4dbcb;
	border-radius: var(--atq-radius-sm, 6px);
	background: #fdfaf3;
}
.eav-resto-config-form .eav-periode-field {
	display: flex;
	flex-direction: column;
	font-size: 0.72rem;
	font-weight: 600;
	color: var(--atq-terre, #3E2A22);
	gap: 0.2rem;
}
.eav-resto-config-form .eav-periode-couverts {
	display: flex;
	flex-direction: column;
	font-size: 0.72rem;
	font-weight: 600;
	color: var(--atq-terre, #3E2A22);
	gap: 0.2rem;
}
.eav-resto-config-form .eav-periodes-empty {
	font-size: 0.85rem;
	color: var(--atq-aide, #6b5d4e);
	margin: 0;
}
.eav-resto-config-form .eav-periode-remove {
	background: none;
	border: none;
	color: var(--atq-lie, #7A2E33);
	font-size: 0.8rem;
	cursor: pointer;
	text-decoration: underline;
	padding: 0.5rem;
}

/* --- Boutons --- */
.eav-espace-resto .eav-btn-submit {
	width: 100%;
	background: var(--atq-lie, #7A2E33);
	color: var(--atq-papier, #F7F1E7);
	border: none;
	border-radius: var(--atq-radius, 9px);
	font-family: Inter, sans-serif;
	font-weight: 600;
	font-size: 1rem;
	padding: 0.9rem 1.5rem;
	min-height: 50px;
	cursor: pointer;
	transition: background-color .18s ease;
	-webkit-appearance: none;
	appearance: none;
}
.eav-espace-resto .eav-btn-submit:hover { background: var(--atq-terre, #3E2A22); }
.eav-espace-resto .eav-btn-submit:focus-visible { box-shadow: 0 0 0 3px rgba(76,97,65,.35); }
.eav-espace-resto .eav-btn-submit:disabled,
.eav-espace-resto .eav-btn-submit.is-loading { opacity: 0.7; cursor: progress; }

.eav-espace-resto .eav-btn-secondary {
	background: transparent;
	color: var(--atq-vigne-texte, #1F6E64);
	border: 1px solid var(--atq-vigne, #2E9A8D);
	border-radius: var(--atq-radius, 9px);
	font-family: Inter, sans-serif;
	font-weight: 600;
	font-size: 0.9rem;
	padding: 0.55rem 1rem;
	cursor: pointer;
	transition: background-color .15s ease;
}
.eav-espace-resto .eav-btn-secondary:hover { background: var(--atq-vigne-clair, #eef2e8); }
.eav-espace-resto .eav-btn-secondary:disabled { opacity: 0.6; cursor: progress; }

.eav-espace-resto .eav-btn-danger {
	color: var(--atq-lie, #7A2E33);
	border-color: var(--atq-lie, #7A2E33);
}
.eav-espace-resto .eav-btn-danger:hover {
	background: var(--atq-lie-clair, #fdf5f2);
}

.eav-espace-resto .eav-btn-link {
	background: none; border: none; cursor: pointer; text-decoration: underline;
}

/* --- Form actions --- */
.eav-resto-config-form .eav-form-actions { margin-top: 1.5rem; }

/* --- Separator + rotate block --- */
.eav-espace-resto .eav-separator {
	border: none;
	border-top: 1px solid #e4dbcb;
	margin: 2.5rem 0 1.5rem;
}
.eav-espace-resto .eav-rotate-block summary {
	font-family: Inter, sans-serif;
	font-weight: 600;
	color: var(--atq-lie, #7A2E33);
	cursor: pointer;
	font-size: 0.95rem;
	margin-bottom: 0.5rem;
}
.eav-espace-resto .eav-rotate-block[open] summary { margin-bottom: 1rem; }
.eav-espace-resto .eav-rotate-block p.eav-field-help { margin-bottom: 0.8rem; }

/* --- Responsive --- */
@media (max-width: 700px) {
	.eav-resto-config-form .eav-periode-row {
		grid-template-columns: 1fr 1fr;
	}
	.eav-resto-config-form .eav-row-2col {
		grid-template-columns: 1fr;
	}
}
@media (max-width: 600px) {
	.eav-espace-resto input[type="number"],
	.eav-espace-resto input[type="date"],
	.eav-espace-resto select { font-size: 16px; }
}


/* ==========================================================================
   E19 — Onglet Réservations (jour / semaine / mois) + fiche détaillée
   ========================================================================== */
.eav-espace-resto { max-width: 960px; }
.eav-resas {
	background: var(--atq-carte, #fdfaf3);
	border: 1px solid var(--atq-sable, #E4DBCB);
	border-radius: 16px;
	padding: 1.25rem 1.25rem 1.5rem;
	margin: 0 0 2rem;
	box-shadow: 0 1px 2px rgba(42,35,31,.05), 0 4px 14px rgba(42,35,31,.05);
}
.eav-resas-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.eav-resas-head h2 { margin: 0; }
.eav-resas-badge {
	background: #fbeede; color: #7a4a10; border: 1px solid #B5701F;
	border-radius: 999px; padding: .3rem .8rem; font-size: .85rem; font-weight: 600;
}
.eav-tabs { display: inline-flex; gap: .25rem; background: #efe7d7; padding: .25rem; border-radius: 999px; margin: 1rem 0; }
.eav-tab {
	min-height: 38px; padding: 0 1rem; border: 0; border-radius: 999px; background: transparent;
	font: 600 .9rem Inter, sans-serif; color: #3E2A22; cursor: pointer;
}
.eav-tab.is-active { background: #fff; box-shadow: 0 1px 3px rgba(42,35,31,.15); color: #7A2E33; }
.eav-jour-nav { display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; }
.eav-btn-ghost {
	min-height: 38px; min-width: 38px; padding: 0 .8rem; border: 1px solid #E4DBCB; border-radius: 999px;
	background: #fff; font: 600 .9rem Inter, sans-serif; color: #3E2A22; cursor: pointer;
}
.eav-btn-ghost:hover { border-color: #3E2A22; }
.eav-jour-pick { min-height: 38px; border: 1px solid #E4DBCB; border-radius: 10px; padding: 0 .6rem; font: inherit; }
.eav-jour-titre { font-family: Fraunces, serif; font-size: 1.2rem; text-transform: capitalize; margin: .9rem 0 .5rem; color: #3E2A22; }
.eav-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .6rem; margin: 0 0 1rem; }
.eav-kpi { background: #fff; border: 1px solid #E4DBCB; border-radius: 12px; padding: .7rem .9rem; display: flex; flex-direction: column; }
.eav-kpi-v { font: 700 1.4rem Fraunces, serif; color: #1F6E64; }
.eav-kpi-l { font-size: .8rem; color: #6b5d50; }
.eav-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid #E4DBCB; border-radius: 12px; background: #fff; }
.eav-table { width: 100%; border-collapse: collapse; font-size: .9rem; min-width: 560px; }
.eav-table th, .eav-table td { padding: .6rem .75rem; text-align: left; border-bottom: 1px solid #efe7d7; white-space: nowrap; }
.eav-table thead th { background: #f7f1e7; font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; color: #6b5d50; }
.eav-table tbody tr:hover { background: #fdfaf3; }
.eav-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.eav-table tfoot th, .eav-table tfoot td { background: #f7f1e7; font-weight: 700; border-bottom: 0; }
.eav-table tr.is-annulee td, .eav-table tr.is-refusee td { color: #9a8c7b; text-decoration: line-through; text-decoration-color: rgba(154,140,123,.5); }
.eav-statut { display: inline-block; padding: .15rem .55rem; border-radius: 999px; font-size: .78rem; font-weight: 600; text-decoration: none; }
.s-demande { background: #fbeede; color: #7a4a10; }
.s-confirmee, .s-honoree { background: #eef2e8; color: #1F6E64; }
.s-refusee, .s-annulee, .s-no_show { background: #fdf5f2; color: #7A2E33; }
.eav-tag { font-size: .7rem; background: #efe7d7; border-radius: 6px; padding: .05rem .35rem; }
.eav-resas-vide { color: #6b5d50; padding: 1rem 0; }

/* Fiche détaillée */
.eav-fiche { border: 1px solid #E4DBCB; border-radius: 16px; background: #fdfaf3; margin: 0 0 2rem; }
.eav-fiche > summary { cursor: pointer; padding: 1rem 1.25rem; display: flex; flex-direction: column; list-style: none; }
.eav-fiche > summary::-webkit-details-marker { display: none; }
.eav-fiche > summary::after { content: "▾"; position: absolute; right: 1.25rem; }
.eav-fiche { position: relative; }
.eav-fiche-titre { font: 600 1.15rem Fraunces, serif; color: #3E2A22; }
.eav-fiche-sous { font-size: .85rem; color: #6b5d50; }
.eav-fiche-form { padding: 0 1.25rem 1.25rem; }
.eav-fiche-form textarea, .eav-fiche-form input[type="number"] { width: 100%; border: 1px solid #E4DBCB; border-radius: 10px; padding: .6rem .75rem; font: inherit; background: #fff; }
.eav-field-court input { max-width: 8rem; }
.eav-photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: .6rem; margin: .5rem 0; }
.eav-photos figure { margin: 0; position: relative; border-radius: 10px; overflow: hidden; aspect-ratio: 4 / 3; background: #efe7d7; }
.eav-photos img { width: 100%; height: 100%; object-fit: cover; display: block; }
.eav-photo-rm { position: absolute; right: .3rem; bottom: .3rem; min-height: 30px !important; font-size: .75rem; border: 0; border-radius: 999px; background: rgba(42,35,31,.8); color: #fff; padding: 0 .6rem; cursor: pointer; }
.eav-fiche-msg { margin-left: .8rem; font-weight: 600; }
.eav-fiche-msg.is-ok { color: #1F6E64; }
.eav-fiche-msg.is-err { color: #7A2E33; }

/* E20 — Mon abonnement */
.eav-abo { background: #fff; border: 1px solid #E4DBCB; border-radius: 16px; padding: 1.25rem; margin: 0 0 2rem; }
.eav-abo h2 { margin: 0 0 .3rem; }
.eav-abo-grille { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: .5rem; margin: 1rem 0; }
.eav-abo-choix { position: relative; border: 1.5px solid #E4DBCB; border-radius: 12px; padding: .8rem; display: flex; flex-direction: column; cursor: pointer; }
.eav-abo-choix input { position: absolute; opacity: 0; }
.eav-abo-choix:has(input:checked) { border-color: #7A2E33; box-shadow: 0 0 0 3px rgba(122,46,51,.15); }
.eav-abo-choix .d { font: 600 1rem Fraunces, serif; }
.eav-abo-choix .p { font: 700 1.2rem Inter, sans-serif; color: #7A2E33; }
.eav-abo-choix .p small { font-size: .7rem; color: #6b5d50; font-weight: 500; }
.eav-abo-choix .t { font-size: .75rem; color: #6b5d50; }
.eav-abo-msg { margin: .8rem 0 0; font-weight: 600; }
.eav-abo-msg.is-ok { color: #1F6E64; } .eav-abo-msg.is-err { color: #7A2E33; }
