/* Jimmy · Ficha del plato. Usa las variables --jimmy-* del tema, con valores de respaldo. */

/* ---------- Foto de la tarjeta: se puede tocar ---------- */
.jimmy-plato__abrir {
	all: unset; box-sizing: border-box; display: block; position: relative; overflow: hidden; cursor: zoom-in;
}
.jimmy-plato__abrir:focus-visible { outline: 2px solid var(--jimmy-azul, #0d4a6b); outline-offset: 2px; }
.jimmy-plato__abrir .jimmy-plato__img { display: block; transition: transform .6s cubic-bezier(.2, .7, .2, 1); }
.jimmy-plato__abrir:hover .jimmy-plato__img { transform: scale(1.05); }
.jimmy-plato--tarjetas .jimmy-plato__abrir { width: 100%; }
.jimmy-plato--lista .jimmy-plato__abrir { flex: none; border-radius: 10px; align-self: flex-start; }
.jimmy-plato--tarjetas .jimmy-plato__nombre, .jimmy-plato--lista .jimmy-plato__nombre { cursor: pointer; }
[data-jimmy-producto]:has(.jimmy-plato__abrir) .jimmy-plato__nombre:hover { color: var(--jimmy-azul, #0d4a6b); }

/* Indicador "3 fotos" */
.jimmy-plato__fotos {
	position: absolute; left: 10px; bottom: 10px; display: inline-flex; align-items: center; gap: 5px;
	padding: 4px 9px 4px 7px; border-radius: 999px; background: rgb(9 30 43 / 55%); color: #fff;
	font: 600 .7rem/1 var(--jimmy-sans, sans-serif); letter-spacing: .02em;
	-webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
	transition: opacity .3s, transform .3s;
}
.jimmy-plato__fotos::before {
	content: ""; width: 13px; height: 13px; background: currentColor;
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Crect x='3' y='3' width='18' height='18' rx='3'/%3E%3Ccircle cx='9' cy='9' r='2'/%3E%3Cpath d='M21 15l-5-5L5 21'/%3E%3C/svg%3E") center / contain no-repeat;
	mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Crect x='3' y='3' width='18' height='18' rx='3'/%3E%3Ccircle cx='9' cy='9' r='2'/%3E%3Cpath d='M21 15l-5-5L5 21'/%3E%3C/svg%3E") center / contain no-repeat;
}
.jimmy-plato--lista .jimmy-plato__fotos { display: none; }
@media (hover: hover) {
	.jimmy-plato--tarjetas .jimmy-plato__fotos { opacity: 0; transform: translateY(4px); }
	.jimmy-plato--tarjetas:hover .jimmy-plato__fotos { opacity: 1; transform: none; }
}

/* ---------- Ventana ---------- */
html.jimmy-ficha-abierta { overflow: hidden; }

.jimmy-ficha {
	padding: 0; border: 0; background: transparent; color: var(--jimmy-tinta, #1c2a33);
	max-width: none; max-height: none; width: 100%; height: 100%; margin: 0;
	display: none; place-items: center; overflow: hidden;
}
.jimmy-ficha[open] { display: grid; }
.jimmy-ficha::backdrop {
	background: rgb(6 26 38 / 62%);
	-webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
	animation: jimmy-ficha-velo .35s ease both;
}
.jimmy-ficha.is-cerrando::backdrop { animation: jimmy-ficha-velo .22s ease reverse both; }

.jimmy-ficha__panel {
	position: relative; display: grid; grid-template-columns: min(600px, 56vw) minmax(0, 400px);
	width: max-content; max-width: calc(100vw - 48px); max-height: calc(100vh - 48px);
	background: var(--jimmy-fondo, #fff); border-radius: 22px; overflow: hidden;
	box-shadow: 0 30px 80px rgb(0 0 0 / 35%);
	animation: jimmy-ficha-entra .45s cubic-bezier(.2, .8, .2, 1) both;
}
.jimmy-ficha.is-cerrando .jimmy-ficha__panel { animation: jimmy-ficha-sale .22s ease-in both; }

/* Foto principal: abierta, cuadrada, protagonista */
.jimmy-ficha__principal { margin: 0; aspect-ratio: 1; max-height: calc(100vh - 48px); overflow: hidden; background: var(--jimmy-fondo-suave, #f1f5f7); }
.jimmy-ficha__principal img {
	width: 100%; height: 100%; object-fit: cover; display: block;
	animation: jimmy-ficha-zoom 1.4s cubic-bezier(.2, .7, .2, 1) both;
	transition: opacity .18s ease, transform .18s ease;
}
.jimmy-ficha__principal img.is-cambiando { opacity: 0; transform: scale(1.02); }

/* Columna derecha: dos detalles + información */
.jimmy-ficha__lado { display: flex; flex-direction: column; min-height: 0; overflow-y: auto; }
.jimmy-ficha__detalles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 10px 10px 0; }
.jimmy-ficha__detalles[hidden] { display: none; }
.jimmy-ficha__detalle {
	all: unset; box-sizing: border-box; aspect-ratio: 1; border-radius: 14px; overflow: hidden; cursor: pointer;
	background: var(--jimmy-fondo-suave, #f1f5f7);
	animation: jimmy-ficha-sube .5s cubic-bezier(.2, .8, .2, 1) both;
}
.jimmy-ficha__detalle:nth-child(1) { animation-delay: .12s; }
.jimmy-ficha__detalle:nth-child(2) { animation-delay: .2s; }
.jimmy-ficha__detalle img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .5s cubic-bezier(.2, .7, .2, 1); }
.jimmy-ficha__detalle:hover img { transform: scale(1.08); }
.jimmy-ficha__detalle:focus-visible { outline: 2px solid var(--jimmy-azul, #0d4a6b); outline-offset: 2px; }

.jimmy-ficha__info {
	display: flex; flex-direction: column; flex: 1; padding: 26px 30px 30px;
	animation: jimmy-ficha-sube .5s .26s cubic-bezier(.2, .8, .2, 1) both;
}
.jimmy-ficha__nombre {
	margin: 0; font: 600 clamp(1.7rem, 2.4vw, 2.15rem)/1.1 var(--jimmy-serif, Georgia, serif); color: var(--jimmy-tinta, #1c2a33);
	text-wrap: balance;
}
.jimmy-ficha__greca { display: block; width: 72px; height: 11px; margin: 14px 0 16px; background: var(--jimmy-greca, none) round no-repeat left center / auto 100%; }
.jimmy-ficha__desc { margin: 0; color: var(--jimmy-gris, #6b7780); font-size: .95rem; line-height: 1.6; }
.jimmy-ficha__pie {
	display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px;
	margin-top: auto; padding-top: 22px;
}
.jimmy-ficha__pie:empty { display: none; }
.jimmy-ficha__precio { font: 600 1.45rem/1 var(--jimmy-sans, sans-serif); color: var(--jimmy-azul, #0d4a6b); white-space: nowrap; }
.jimmy-ficha__pie .jimmy-plato__agregar { padding: .85em 1.8em; background: var(--jimmy-azul, #0d4a6b); color: #fff; }
.jimmy-ficha__pie .jimmy-plato__agregar:hover { background: var(--jimmy-azul-oscuro, #093a55); }
.jimmy-ficha__pie .jimmy-plato__variable { flex-wrap: wrap; }
.jimmy-ficha__pie .jimmy-plato__tamano { font-size: .85rem; padding: .6em; }
.jimmy-ficha .added_to_cart { display: none; }

.jimmy-ficha__cerrar {
	all: unset; box-sizing: border-box; position: absolute; top: 14px; left: 14px; z-index: 2;
	width: 42px; height: 42px; display: grid; place-items: center; border-radius: 50%; cursor: pointer;
	background: rgb(255 255 255 / 82%); color: var(--jimmy-tinta, #1c2a33);
	-webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); box-shadow: 0 4px 14px rgb(0 0 0 / 18%);
	transition: transform .2s, background .2s;
}
.jimmy-ficha__cerrar:hover { transform: rotate(90deg); background: #fff; }
.jimmy-ficha__cerrar:focus-visible { outline: 2px solid var(--jimmy-azul, #0d4a6b); outline-offset: 2px; }

/* ---------- Celular y tablet vertical: hoja que sube desde abajo ---------- */
@media (max-width: 860px) {
	.jimmy-ficha { place-items: end stretch; }
	.jimmy-ficha__panel {
		display: block; width: 100%; max-width: none; max-height: 94dvh; overflow-y: auto; overscroll-behavior: contain;
		border-radius: 22px 22px 0 0; animation-name: jimmy-ficha-hoja;
	}
	.jimmy-ficha.is-cerrando .jimmy-ficha__panel { animation: jimmy-ficha-hoja .22s ease-in reverse both; }
	.jimmy-ficha__principal { max-height: none; }
	.jimmy-ficha__lado { overflow: visible; }
	.jimmy-ficha__detalles { gap: 8px; padding: 8px 8px 0; }
	.jimmy-ficha__detalle { border-radius: 12px; }
	.jimmy-ficha__info { padding: 22px 20px calc(26px + env(safe-area-inset-bottom)); }
	/* Queda fijo arriba a la derecha mientras se desliza la hoja. */
	.jimmy-ficha__cerrar { position: sticky; top: 12px; left: auto; display: grid; margin: 12px 12px -54px auto; }
	@media (min-width: 600px) {
		.jimmy-ficha__panel { width: min(640px, 100%); margin-inline: auto; }
	}
}

/* Pedidos en celular: tarjeta compacta con la foto a la izquierda */
@media (max-width: 860px) {
	.jimmy-menu--pestanas .jimmy-plato--tarjetas .jimmy-plato__abrir { width: 104px; min-height: 104px; flex: none; align-self: stretch; }
	.jimmy-menu--pestanas .jimmy-plato--tarjetas .jimmy-plato__abrir .jimmy-plato__img { position: absolute; inset: 0; width: 100%; height: 100%; min-height: 0; object-fit: cover; }
	.jimmy-menu--pestanas .jimmy-plato__fotos { left: 6px; bottom: 6px; padding: 3px 7px 3px 5px; font-size: .62rem; }
}

@keyframes jimmy-ficha-velo { from { opacity: 0; } }
@keyframes jimmy-ficha-entra { from { opacity: 0; transform: translateY(26px) scale(.97); } }
@keyframes jimmy-ficha-sale { to { opacity: 0; transform: translateY(14px) scale(.98); } }
@keyframes jimmy-ficha-hoja { from { transform: translateY(100%); } }
@keyframes jimmy-ficha-zoom { from { transform: scale(1.08); } }
@keyframes jimmy-ficha-sube { from { opacity: 0; transform: translateY(14px); } }

@media (prefers-reduced-motion: reduce) {
	.jimmy-ficha *, .jimmy-ficha::backdrop, .jimmy-plato__abrir .jimmy-plato__img { animation: none !important; transition: none !important; }
}
