/* ============================================================
   SUPER MASCOTA - Sistema de diseno (ui.css v4)
   v1: capa de tokens (variables CSS, sin estilos aplicados).
   v2: press-states y transiciones especificas en botones.
   v3: tokens de rojos (--sm-brand-darker, --sm-discount).
   v4: tipografia unica del sitio (Nunito, auto-alojada).
   Prefijo --sm- para no chocar con Bootstrap/Materialize.
   Este archivo carga DESPUES de los <style>/CSS de cada vista:
   a igual especificidad, estas reglas ganan la cascada.
   ============================================================ */

/* Nunito variable auto-alojada (pesos 400-800, subset latino con
   acentos y n). Reemplaza Open Sans (escritorio) y Roboto (movil). */
@font-face {
	font-family: 'Nunito';
	src: url('../fonts/nunito.woff2') format('woff2');
	font-weight: 400 800;
	font-style: normal;
	font-display: swap;
}

body,
input,
button,
select,
textarea,
.form-control,
.browser-default {
	font-family: 'Nunito', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

:root {
	/* Marca y accion */
	--sm-brand: #e63c2f;
	--sm-brand-dark: #c0392b;
	--sm-brand-darker: #a93226; /* tope oscuro de degradados */
	--sm-discount: #d62c67;     /* acento de descuento (% OFF) */
	--sm-pay: #27ae60;
	--sm-pay-dark: #219a52;

	/* Texto */
	--sm-text: #222;
	--sm-text-strong: #1a1a2e;
	--sm-text-2: #555;
	--sm-text-3: #6b6b6b;
	--sm-text-soft: #888;

	/* Superficies y bordes */
	--sm-bg: #f6f7f9;
	--sm-surface: #fff;
	--sm-surface-alt: #f9f9f9;
	--sm-border: #f0f0f0;
	--sm-border-strong: #e0e0e0;

	/* Avisos (bloque ambar) */
	--sm-note-bg: #fff8f0;
	--sm-note-border: #fde8c8;
	--sm-note-text: #7a4f00;

	/* Radios */
	--sm-radius-sm: 6px;
	--sm-radius: 8px;
	--sm-radius-md: 10px;
	--sm-radius-lg: 12px;
	--sm-radius-xl: 14px;
	--sm-radius-badge: 20px;
	--sm-radius-pill: 999px;

	/* Sombras */
	--sm-shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.06);
	--sm-shadow: 0 2px 16px rgba(0, 0, 0, 0.07);
	--sm-shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.13);

	/* Espaciado */
	--sm-space-1: 4px;
	--sm-space-2: 8px;
	--sm-space-3: 12px;
	--sm-space-4: 16px;
	--sm-space-5: 24px;
	--sm-space-6: 32px;

	/* Movimiento */
	--sm-ease-out: cubic-bezier(0.23, 1, 0.32, 1);
	--sm-dur-fast: 120ms;
	--sm-dur: 180ms;
	--sm-dur-slow: 250ms;
}

/* ------------------------------------------------------------
   3.2 - Botones: transiciones especificas (nunca "all") y
   feedback al presionar. Cubre las clases de boton reales del
   sitio; los estados :disabled existentes se respetan.
   NOTA: las vistas definen estos botones con selectores anidados
   de mayor especificidad (ej. ".products .product .product-btn"),
   por eso transition/transform llevan !important aqui. Es deuda
   controlada: se retira en 3.5 cuando el CSS de componentes se
   unifique en este archivo.
   ------------------------------------------------------------ */
.btn-add-cart,
.btn-pay,
.btn-pay-m,
.btn-auth,
.btn-lp,
.product-btn,
.m-prod-btn,
.qty-btn,
.m-qty-btn,
.cart-item-delete,
.m-cart-item-delete {
	transition: background-color var(--sm-dur) var(--sm-ease-out),
		color var(--sm-dur) var(--sm-ease-out),
		border-color var(--sm-dur) var(--sm-ease-out),
		transform var(--sm-dur-fast) var(--sm-ease-out),
		box-shadow var(--sm-dur) var(--sm-ease-out) !important;
}

.btn-add-cart:active:not(:disabled),
.btn-pay:active:not(:disabled),
.btn-pay-m:active:not(:disabled),
.btn-auth:active,
.btn-lp:active,
.product-btn:active,
.m-prod-btn:active,
.qty-btn:active:not(:disabled),
.m-qty-btn:active:not(:disabled),
.cart-item-delete:active,
.m-cart-item-delete:active {
	transform: scale(0.97) !important;
}

@media (prefers-reduced-motion: reduce) {
	.btn-add-cart:active,
	.btn-pay:active,
	.btn-pay-m:active,
	.btn-auth:active,
	.btn-lp:active,
	.product-btn:active,
	.m-prod-btn:active,
	.qty-btn:active,
	.m-qty-btn:active,
	.cart-item-delete:active,
	.m-cart-item-delete:active {
		transform: none !important;
	}
}

/* ------------------------------------------------------------
   3.5a - Tarjeta de producto de ESCRITORIO (unificada).
   Fuente unica de la tarjeta ".products .product". Al cargar
   despues de los <style> de cada vista y del style.css legacy,
   esta definicion gana la cascada, asi todas las paginas
   (home, tienda, categoria, busqueda, marca) muestran la misma
   tarjeta "pulida". Las copias por-vista quedan inertes y se
   retiran en una limpieza posterior.
   ------------------------------------------------------------ */
.products .product {
	border-radius: 12px;
	overflow: hidden;
	transition: transform .25s ease, box-shadow .25s ease;
	height: 100%;
	background-color: #fff;
	border: 1px solid #f0f0f0;
}
.products .product:hover {
	transform: translateY(-6px);
	box-shadow: 0 16px 40px rgba(0, 0, 0, 0.12) !important;
	border-color: transparent;
}
.products .product > a {
	display: flex;
	flex-direction: column;
	height: 100%;
	background-image: none;
	text-decoration: none;
}
.products .product .product-img {
	width: 100%;
	height: 180px;
	overflow: hidden;
	background-color: #f9f9f9;
	display: flex;
	align-items: center;
	justify-content: center;
	position: relative;
}
.products .product .product-img img {
	width: 100%;
	height: 100%;
	object-fit: contain;
	padding: 12px;
	transition: transform .35s ease;
}
.products .product:hover .product-img img { transform: scale(1.07); }
.products .product .discount-badge {
	position: absolute;
	top: 10px;
	left: 10px;
	background: linear-gradient(135deg, #e63c2f, #c0392b);
	color: #fff;
	font-size: 0.7em;
	font-weight: 800;
	padding: 4px 9px;
	border-radius: 6px;
	z-index: 2;
	box-shadow: 0 2px 8px rgba(230, 60, 47, 0.35);
	letter-spacing: 0.3px;
}
.products .product .product-info {
	padding: 14px;
	flex: 1;
	display: flex;
	flex-direction: column;
}
.products .product .product-title {
	color: #222;
	font-size: 0.87em;
	font-weight: 600;
	line-height: 1.35;
	margin-bottom: 4px;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
	transition: color .2s;
}
.products .product:hover .product-title { color: #e63c2f; }
.products .product .product-cat {
	color: #6b6b6b;
	font-size: 0.72em;
	margin-bottom: 10px;
}
.products .product .product-price {
	color: #e63c2f;
	font-weight: 800;
	font-size: 1em;
	margin-top: auto;
	margin-bottom: 12px;
	line-height: 1.2;
}
.products .product .product-price small {
	color: #6b6b6b;
	font-size: 0.78em;
	text-decoration: line-through;
	display: block;
	font-weight: normal;
	margin-bottom: 2px;
}
.products .product .product-btn {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	background: linear-gradient(135deg, #e63c2f 0%, #c0392b 100%);
	color: #fff !important;
	text-align: center;
	padding: 9px 12px;
	border-radius: 8px;
	font-size: 0.82em;
	font-weight: 700;
	box-shadow: 0 4px 12px rgba(230, 60, 47, 0.25);
	text-decoration: none;
}
.products .product:hover .product-btn {
	background: linear-gradient(135deg, #c0392b 0%, var(--sm-brand-darker) 100%);
	box-shadow: 0 6px 16px rgba(230, 60, 47, 0.38);
}
@media (max-width: 576px) {
	.products .product .product-img { height: 130px; }
	.products .product .product-title { font-size: 0.8em; }
	.products .product .product-info { padding: 10px; }
}

/* ------------------------------------------------------------
   3.5b - Tarjeta de producto MOVIL (unificada).
   Fuente unica de ".m-product-card". Al cargar despues de los
   <style> de cada vista, iguala todas las paginas moviles
   (home, tienda, categoria, busqueda, marca) a la tarjeta
   pulida. Las copias por-vista quedan inertes (limpieza aparte).
   ------------------------------------------------------------ */
.m-product-card {
	background: #fff;
	border-radius: 12px;
	box-shadow: 0 2px 12px rgba(0, 0, 0, 0.07);
	overflow: hidden;
	margin-bottom: 10px;
	display: flex;
	flex-direction: column;
	height: 100%;
	position: relative;
	border: 1px solid #f5f5f5;
	transition: transform .2s ease, box-shadow .2s ease;
}
.m-product-card:active { transform: scale(0.98); }
.m-product-card .m-discount-badge {
	position: absolute;
	top: 7px;
	left: 7px;
	background: linear-gradient(135deg, #e63c2f, #c0392b);
	color: #fff;
	font-size: 0.65em;
	font-weight: 800;
	padding: 3px 7px;
	border-radius: 5px;
	z-index: 2;
	box-shadow: 0 2px 6px rgba(230, 60, 47, 0.3);
	letter-spacing: 0.3px;
}
.m-product-card .m-prod-img {
	width: 100%;
	height: 130px;
	object-fit: contain;
	background: #f8f9fb;
	padding: 8px;
}
.m-product-card .m-prod-body {
	padding: 8px 10px 10px;
	flex: 1;
	display: flex;
	flex-direction: column;
}
.m-product-card .m-prod-name {
	font-size: 0.81em;
	font-weight: 600;
	color: #222;
	line-height: 1.35;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
	margin-bottom: 5px;
	flex: 1;
	text-decoration: none;
}
.m-product-card .m-prod-cat {
	font-size: 0.7em;
	color: #6b6b6b;
	margin-bottom: 6px;
	display: -webkit-box;
	-webkit-line-clamp: 1;
	-webkit-box-orient: vertical;
	overflow: hidden;
}
.m-product-card .m-prod-price {
	font-size: 0.9em;
	font-weight: 800;
	color: #e63c2f;
	margin-top: 4px;
	line-height: 1.2;
}
.m-product-card .m-prod-price-old {
	font-size: 0.72em;
	color: #6b6b6b;
	text-decoration: line-through;
	display: block;
	font-weight: normal;
	margin-bottom: 1px;
}
.m-product-card .m-prod-btn {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 5px;
	background: linear-gradient(135deg, #e63c2f 0%, #c0392b 100%);
	color: #fff !important;
	text-align: center;
	padding: 8px;
	font-size: 0.76em;
	font-weight: 700;
	text-decoration: none;
	margin-top: 9px;
	border-radius: 7px;
	box-shadow: 0 3px 10px rgba(230, 60, 47, 0.22);
}
.m-product-card .m-prod-btn i { font-size: 0.9em; }

/* ------------------------------------------------------------
   Grid de productos MOVIL: tarjetas de igual altura.
   Las filas .row de Materialize son float-based y no igualan la
   altura -> quedan huecos entre productos. Volverlas flex hace
   que cada fila de tarjetas quede pareja. En escritorio .row ya
   es flex (Bootstrap) y no hay ".col" pelado, asi que no afecta.
   ------------------------------------------------------------ */
.products .row { display: flex; flex-wrap: wrap; }
.products .row > .col { display: flex; flex-direction: column; }
