@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700;800&family=Inter:wght@400;500;600;700&display=swap');

/* Variables compartidas. El modal y la barra de carrito se anaden al <body>
   (fuera de .wb), asi que necesitan las variables tambien, o var(--wb-accent)
   quedaria vacio y los botones perderian el fondo naranja. */
.wb,
.wb-modal,
.wb-cartbar {
	--wb-bg: #f5f5f3;
	--wb-card: #ffffff;
	--wb-text: #16181d;
	--wb-muted: #6b7280;
	--wb-accent: #e4572e;
	--wb-accent-soft: rgba(228, 87, 46, .10);
	--wb-line: rgba(0, 0, 0, .08);
	--wb-radius: 18px;
	--wb-font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	--wb-font-title: "Poppins", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.wb {
	font-family: var(--wb-font);
	color: var(--wb-text);
	background: var(--wb-bg);
	padding: 4px 0 34px;
	max-width: 100%;
	box-sizing: border-box;
}

/* Titulos con la fuente bonita */
.wb__title,
.wb__brandName,
.wb__panelTitle,
.wb__sectionTitle,
.wb__prodName {
	font-family: var(--wb-font-title);
}

.wb * {
	box-sizing: border-box;
}

/* Cabecera */
.wb__head {
	padding: 0 20px 2px;
	text-align: center;
}

.wb__title {
	margin: 0;
	font-size: 22px;
	font-weight: 800;
	letter-spacing: -.01em;
}

.wb__sub {
	margin: 5px 0 0;
	font-size: 13px;
	color: var(--wb-muted);
}

/* Fila de marcas (siempre visible) */
.wb__brands {
	display: flex;
	gap: 12px;
	padding: 0 20px 4px;
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
	scrollbar-width: none;
}

.wb__brands::-webkit-scrollbar {
	display: none;
}

@media (min-width: 900px) {
	.wb__brands {
		justify-content: center;
		flex-wrap: wrap;
		overflow: visible;
	}
}

.wb__brand {
	position: relative;
	flex: 0 0 auto;
	/* Marco HORIZONTAL (apaisado): mas ancho que alto. En movil mostramos
	   2 marcas completas y un poco de la 3a para que se note que hay mas y
	   se puede deslizar. Se resta el padding izquierdo (20px) y los gaps. */
	width: calc((100vw - 20px - 36px) / 2.4);
	max-width: 210px;
	background: var(--wb-card);
	border: 2px solid var(--wb-line);
	border-radius: var(--wb-radius);
	padding: 10px 12px;
	display: flex;
	flex-direction: column;
	align-items: center;
	text-align: center;
	cursor: pointer;
	transition: border-color .18s ease, transform .18s ease, box-shadow .18s ease;
}

/* En pantallas medianas y grandes fijamos un rectangulo apaisado. */
@media (min-width: 640px) {
	.wb__brand {
		width: 210px;
		padding: 12px 16px;
	}
}

.wb__brand:active {
	transform: scale(.98);
}

.wb__brand.is-active {
	border-color: var(--wb-accent);
	box-shadow: 0 8px 22px rgba(228, 87, 46, .18);
}

/* Marca con enlace externo: se comporta como un boton/enlace, nunca queda
   "seleccionada" porque al pulsarla redirige a su URL. */
.wb__brand--link.is-active {
	border-color: var(--wb-line);
	box-shadow: none;
}

/* Marca fuera de horario: visible pero deshabilitada. */
.wb__brand.is-closed {
	cursor: not-allowed;
	opacity: .55;
	filter: grayscale(1);
	box-shadow: none;
}

.wb__brand.is-closed:active {
	transform: none;
}

/* Etiqueta "Cerrado": oculta por defecto, visible solo si esta cerrada. */
.wb__brandClosed {
	display: none;
	margin-top: 8px;
	padding: 3px 10px;
	border-radius: 999px;
	background: rgba(0, 0, 0, .08);
	color: var(--wb-text);
	font-size: 11px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: .04em;
}

.wb__brand.is-closed .wb__brandClosed {
	display: inline-block;
}

.wb__brandLogo {
	width: 100%;
	height: 68px;
	border-radius: 8px;
	object-fit: contain;
	margin-bottom: 8px;
}

.wb__brandName {
	margin: 0;
	font-size: 12px;
	font-weight: 800;
	line-height: 1.15;
}

.wb__brandType {
	margin: 2px 0 0;
	font-size: 10px;
	color: var(--wb-muted);
}

@media (min-width: 640px) {
	.wb__brandLogo {
		height: 84px;
		margin-bottom: 10px;
	}

	.wb__brandName {
		font-size: 13px;
	}

	.wb__brandType {
		font-size: 11px;
	}
}

/* Panel de la carta */
.wb__panel {
	margin: 18px 16px 0;
	background: var(--wb-card);
	border: 1px solid var(--wb-line);
	border-radius: var(--wb-radius);
	/* overflow:hidden eliminado para que .wb__panelHead pueda usar position:sticky */
	box-shadow: 0 6px 24px rgba(0, 0, 0, .06);
}

.wb__panelHead {
	padding: 16px 16px 0;
	border-bottom: 1px solid var(--wb-line);

	/* STICKY: el logo + pestanas de categorias quedan pegados arriba al hacer scroll */
	position: sticky;
	top: 0;
	z-index: 10;
	background: var(--wb-card);
	border-radius: var(--wb-radius) var(--wb-radius) 0 0;
	transition: box-shadow .2s ease;
}

/* Sombra que aparece cuando el header esta pegado (clase anadida por JS) */
.wb__panelHead.is-stuck {
	box-shadow: 0 4px 14px rgba(0, 0, 0, .10);
}

.wb__panelTop {
	display: flex;
	align-items: center;
	gap: 12px;
	padding-bottom: 12px;
}

.wb__panelLogo {
	width: 54px;
	height: 44px;
	border-radius: 6px;
	object-fit: contain;
}

.wb__panelTitle {
	margin: 0;
	font-size: 18px;
	font-weight: 800;
}

.wb__panelType {
	margin: 2px 0 0;
	font-size: 12.5px;
	color: var(--wb-muted);
}

/* Pestanas de categorias */
.wb__cats {
	display: flex;
	gap: 8px;
	overflow-x: auto;
	padding: 4px 0 12px;
	scrollbar-width: none;
}

.wb__cats::-webkit-scrollbar {
	display: none;
}

.wb__cat {
	flex: 0 0 auto;
	border: 1px solid var(--wb-line);
	background: var(--wb-bg);
	color: var(--wb-text);
	font-size: 13px;
	font-weight: 600;
	white-space: nowrap;
	padding: 8px 14px;
	border-radius: 999px;
	cursor: pointer;
	transition: all .18s ease;
}

.wb__cat.is-active {
	background: var(--wb-accent);
	color: #fff;
	border-color: var(--wb-accent);
}

/* Productos */
.wb__body {
	padding: 18px 16px 22px;
}

.wb__section {
	margin-bottom: 24px;
}

.wb__section:last-child {
	margin-bottom: 0;
}

.wb__sectionTitle {
	margin: 0 0 12px;
	font-size: 15px;
	font-weight: 800;
	display: flex;
	align-items: center;
	gap: 8px;
}

.wb__sectionTitle::after {
	content: "";
	flex: 1;
	height: 1px;
	background: var(--wb-line);
}

.wb__grid {
	display: grid;
	grid-template-columns: 1fr;
	gap: 12px;
}

@media (min-width: 640px) {
	.wb__grid {
		grid-template-columns: 1fr 1fr;
	}
}

@media (min-width: 1000px) {
	.wb__grid {
		grid-template-columns: 1fr 1fr 1fr;
	}
}

.wb__prod {
	display: flex;
	gap: 12px;
	align-items: center;
	background: var(--wb-bg);
	border: 1px solid var(--wb-line);
	border-radius: 14px;
	padding: 10px;
}

.wb__prodImg {
	width: 66px;
	height: 66px;
	border-radius: 10px;
	object-fit: cover;
	flex: 0 0 auto;
	background: #e9e9e6;
}

.wb__prodInfo {
	flex: 1;
	min-width: 0;
}

.wb__prodName {
	margin: 0;
	font-size: 15px;
	font-weight: 700;
}

.wb__prodDesc {
	margin: 3px 0 0;
	font-size: 12.5px;
	color: var(--wb-muted);
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.wb__prodBottom {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	margin-top: 8px;
}

.wb__prodPrice {
	font-size: 14px;
	font-weight: 800;
	color: var(--wb-accent);
}

.wb__prodPrice del {
	color: var(--wb-muted);
	font-weight: 600;
	margin-right: 5px;
}

.wb__btn {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	border: 2px solid var(--wb-accent) !important;
	background: var(--wb-accent) !important;
	color: #fff !important;
	font-size: 13px;
	font-weight: 700;
	padding: 8px 14px;
	border-radius: 999px;
	cursor: pointer;
	text-decoration: none !important;
	text-shadow: none;
	box-shadow: none !important;
	white-space: nowrap;
	transition: opacity .18s ease;
}

.wb__btn:hover,
.wb__btn:focus,
.wb__btn:visited {
	opacity: .9;
	background: var(--wb-accent) !important;
	color: #fff !important;
	border-color: var(--wb-accent) !important;
}

.wb__btn.added {
	background: #2e7d32 !important;
	border-color: #2e7d32 !important;
}

.wb__btn[disabled] {
	background: #c9c9c4 !important;
	border-color: #c9c9c4 !important;
	cursor: not-allowed;
}

.wb__btn.loading {
	opacity: .7;
	pointer-events: none;
}

/* Boton "Elegir opciones" (productos variables) */
.wb__btn.wb__choose {
	background: var(--wb-card) !important;
	color: var(--wb-accent) !important;
	border: 2px solid var(--wb-accent) !important;
}

.wb__btn.wb__choose:hover {
	background: var(--wb-accent-soft) !important;
	color: var(--wb-accent) !important;
}

/* ============================================================
 * Barra de carrito flotante
 * ============================================================ */
.wb-cartbar {
	position: fixed;
	left: 50%;
	bottom: 16px;
	transform: translate(-50%, 200%);
	z-index: 99998;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	width: calc(100% - 24px);
	max-width: 460px;
	background: #ffffff;
	color: var(--wb-text);
	padding: 10px 12px 10px 16px;
	border: 1px solid var(--wb-line);
	border-radius: 999px;
	box-shadow: 0 12px 34px rgba(0, 0, 0, .18);
	opacity: 0;
	transition: transform .3s cubic-bezier(.16, 1, .3, 1), opacity .3s ease;
	font-family: var(--wb-font);
}

.wb-cartbar.is-visible {
	transform: translate(-50%, 0);
	opacity: 1;
}

/* Animacion al anadir un producto: pequeno rebote de la barra
   y un destello en el icono del carrito. */
.wb-cartbar.is-bump {
	animation: wbcartbump .55s cubic-bezier(.16, 1, .3, 1);
}

@keyframes wbcartbump {
	0%   { transform: translate(-50%, 0) scale(1); }
	30%  { transform: translate(-50%, -6px) scale(1.05); }
	55%  { transform: translate(-50%, 0) scale(.98); }
	100% { transform: translate(-50%, 0) scale(1); }
}

.wb-cartbar.is-bump .wb-cartbar__icon {
	animation: wbiconpop .55s ease;
}

@keyframes wbiconpop {
	0%   { transform: scale(1); background: var(--wb-accent-soft); color: var(--wb-accent); }
	35%  { transform: scale(1.35) rotate(-8deg); background: var(--wb-accent); color: #fff; }
	70%  { transform: scale(.92) rotate(4deg); background: var(--wb-accent); color: #fff; }
	100% { transform: scale(1) rotate(0); background: var(--wb-accent-soft); color: var(--wb-accent); }
}

.wb-cartbar__info {
	display: flex;
	align-items: center;
	gap: 10px;
	min-width: 0;
}

.wb-cartbar__icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 34px;
	height: 34px;
	border-radius: 50%;
	background: var(--wb-accent-soft);
	color: var(--wb-accent);
}

.wb-cartbar__count {
	font-size: 13px;
	font-weight: 600;
	color: var(--wb-text);
	white-space: nowrap;
}

.wb-cartbar__right {
	display: flex;
	align-items: center;
	gap: 12px;
}

.wb-cartbar__total {
	font-family: var(--wb-font-title);
	font-size: 15px;
	font-weight: 800;
	color: var(--wb-text);
	white-space: nowrap;
}

.wb-cartbar__total .woocommerce-Price-amount {
	color: var(--wb-text);
}

.wb-cartbar__btn {
	display: inline-block;
	background: var(--wb-accent) !important;
	color: #fff !important;
	font-family: var(--wb-font-title);
	font-size: 14px;
	font-weight: 700;
	padding: 10px 20px;
	border: 2px solid var(--wb-accent) !important;
	border-radius: 999px;
	text-decoration: none !important;
	text-shadow: none;
	white-space: nowrap;
	box-shadow: none;
}

.wb-cartbar__btn:hover,
.wb-cartbar__btn:focus,
.wb-cartbar__btn:visited {
	opacity: .92;
	background: var(--wb-accent) !important;
	color: #fff !important;
	border-color: var(--wb-accent) !important;
}

/* ============================================================
 * Ventana modal de producto variable
 * ============================================================ */
.wb-modal {
	position: fixed;
	inset: 0;
	z-index: 100000;
	display: none;
}

.wb-modal.is-open {
	display: block;
}

.wb-modal__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, .55);
	animation: wbfade .2s ease;
}

.wb-modal__box {
	position: absolute;
	left: 50%;
	top: 50%;
	transform: translate(-50%, -50%);
	width: calc(100% - 88px);
	max-width: 400px;
	max-height: 86vh;
	overflow-y: auto;
	background: #ffffff !important;
	color: var(--wb-text) !important;
	border: 1px solid var(--wb-line);
	border-radius: 22px;
	padding: 24px 22px 26px;
	box-shadow: 0 24px 70px rgba(0, 0, 0, .28);
	font-family: var(--wb-font);
	animation: wbpop .22s cubic-bezier(.16, 1, .3, 1);
}

/* Aseguramos que TODO el texto del modal sea legible sobre el blanco */
.wb-modal__box,
.wb-modal__box h1,
.wb-modal__box h2,
.wb-modal__box h3,
.wb-modal__box h4,
.wb-modal__box p,
.wb-modal__box label,
.wb-modal__box span,
.wb-modal__box div {
	text-shadow: none;
}

@keyframes wbfade {
	from { opacity: 0; }
	to { opacity: 1; }
}

@keyframes wbpop {
	from { opacity: 0; transform: translate(-50%, -46%); }
	to { opacity: 1; transform: translate(-50%, -50%); }
}

.wb-modal__close {
	position: absolute;
	top: 12px;
	right: 12px;
	width: 34px;
	height: 34px;
	border: none;
	background: var(--wb-bg);
	color: var(--wb-text);
	border-radius: 50%;
	font-size: 22px;
	line-height: 1;
	cursor: pointer;
}

.wb-modal__head {
	display: flex;
	gap: 14px;
	align-items: center;
	margin-bottom: 14px;
	padding-right: 30px;
}

.wb-modal__img {
	width: 72px;
	height: 72px;
	border-radius: 12px;
	object-fit: cover;
	flex: 0 0 auto;
}

.wb-modal__name {
	margin: 0;
	font-family: var(--wb-font-title);
	font-size: 19px;
	font-weight: 700;
	letter-spacing: -.01em;
	color: var(--wb-text);
}

.wb-modal__price {
	margin-top: 4px;
	font-family: var(--wb-font-title);
	font-size: 16px;
	font-weight: 700;
	color: var(--wb-accent);
}

.wb-modal__desc {
	margin: 0 0 16px;
	font-size: 14px;
	font-weight: 500;
	color: #3d4149;
	line-height: 1.55;
}

.wb-modal__form {
	display: flex;
	flex-direction: column;
	gap: 12px;
	margin-bottom: 14px;
}

.wb-modal__label {
	display: block;
	font-size: 17px;
	font-weight: 800;
	color: var(--wb-text);
	margin-bottom: 6px;
}

.wb-modal__select {
	width: 100%;
	padding: 12px 13px;
	border: 2px solid var(--wb-line);
	border-radius: 10px;
	background: var(--wb-bg);
	color: var(--wb-text);
	font-size: 16px;
	font-weight: 600;
}

.wb-modal__hint {
	margin: 0 0 14px;
	font-size: 14px;
	font-weight: 800;
	color: var(--wb-accent);
	text-align: center;
}

.wb-modal__add {
	width: 100%;
	justify-content: center;
	padding: 14px;
	font-family: var(--wb-font-title);
	font-size: 15px;
	font-weight: 700;
	background: var(--wb-accent) !important;
	color: #fff !important;
	border: 2px solid var(--wb-accent) !important;
	text-shadow: none;
	box-shadow: none;
}

.wb-modal__add:hover,
.wb-modal__add:focus {
	background: var(--wb-accent) !important;
	color: #fff !important;
	border-color: var(--wb-accent) !important;
	opacity: .92;
}

/* Cuando aun no se han elegido las opciones: se ve deshabilitado pero con contorno */
.wb-modal__add[disabled] {
	background: #ffffff !important;
	color: var(--wb-accent) !important;
	border: 2px solid var(--wb-accent) !important;
	box-shadow: none;
	opacity: .65;
}

/* Estado "anadido" */
.wb-modal__add.added {
	background: #2e7d32 !important;
	color: #fff !important;
	border-color: #2e7d32 !important;
}

/* Mensajes / cargando */
.wb__msg {
	padding: 30px 16px;
	text-align: center;
	color: var(--wb-muted);
	font-size: 14px;
}

.wb__spin {
	width: 26px;
	height: 26px;
	margin: 0 auto 10px;
	border-radius: 50%;
	border: 3px solid var(--wb-line);
	border-top-color: var(--wb-accent);
	animation: wbspin .8s linear infinite;
}

@keyframes wbspin {
	to {
		transform: rotate(360deg);
	}
}
