/**
 * CSS del sitio completo: variables de marca, reset base, header y footer.
 * Mobile-first (reglas base = movil, @media min-width sube a tablet/desktop).
 * Estilos que son SOLO del home van en assets/css/homepage.css, no aca.
 */

/* ---------------------------------------------------------------------
 * 1. Variables de marca -- Paleta MediasYa (azul + gris azulado)
 * --------------------------------------------------------------------- */
:root {
	--mdsy-primary: #2872fa;       /* Azul primario (links) */
	--mdsy-primary-hover: #1559ed; /* Azul hover */
	--mdsy-primary-light: #e8f0ff; /* tint claro, derivado, para fondos hover/badges */
	--mdsy-accent-light: #a9c6ff;  /* azul claro, derivado, para acentos sobre fondos oscuros */

	--mdsy-ink: #3a4f66;   /* Texto base / encabezados */
	--mdsy-text: #3a4f66;  /* alias de --mdsy-ink */
	--mdsy-text-soft: #64798d; /* variante mas suave, derivada, para texto secundario */
	--mdsy-white: #ffffff;
	--mdsy-bg: #fafbfc;       /* Fondo */
	--mdsy-bg-soft: #eef2f6;  /* panel suave, derivado, cerca de --mdsy-bg/--mdsy-border */
	--mdsy-border: #e1e8ed;   /* Bordes */

	--mdsy-gradient: linear-gradient(135deg, #2872fa 0%, #3a4f66 100%); /* Gradiente hero */

	--mdsy-radius-sm: 8px;
	--mdsy-radius: 14px;
	--mdsy-radius-lg: 22px;
	--mdsy-shadow: 0 10px 30px -12px rgba(40, 114, 250, 0.28);
	--mdsy-shadow-sm: 0 2px 10px rgba(58, 79, 102, 0.12);

	--mdsy-max-width: 1240px;
	--mdsy-header-h: 68px;
	--mdsy-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* ---------------------------------------------------------------------
 * 2. Reset base minimo
 * --------------------------------------------------------------------- */
.mediasya-site,
.mediasya-site * ,
.mediasya-site *::before,
.mediasya-site *::after {
	box-sizing: border-box;
}

.mediasya-site {
	font-family: var(--mdsy-font);
	color: var(--mdsy-text);
	background: var(--mdsy-bg);
	scroll-behavior: smooth;
}

/*
 * Todo este bloque de reset usa :where() a proposito: :where() aporta
 * especificidad CERO, asi que ".mediasya-site :where(img)" pesa lo mismo que
 * un simple ".mediasya-site" (0,1,0). Sin esto, un reset como
 * ".mediasya-site img { max-width:100% }" (especificidad 0,1,1, clase+tag)
 * le gana por especificidad a cualquier regla de un solo componente como
 * ".mediasya-hero__photo { max-width:380px }" (0,1,0) -- ya nos paso dos
 * veces (colores de botones/carrito, y el ancho de la foto del hero) y por
 * eso quedo asi en todo el reset, no solo donde ya dolio.
 */
.mediasya-site :where(img) {
	max-width: 100%;
	height: auto;
	display: block;
}

.mediasya-site :where(a) {
	text-decoration: none;
	color: inherit;
}

.mediasya-site :where(ul) {
	list-style: none;
	margin: 0;
	padding: 0;
}

.mediasya-site :where(button) {
	font-family: inherit;
}

.mediasya-skip-link {
	position: absolute;
	left: -9999px;
	top: 0;
	z-index: 10000;
	background: var(--mdsy-primary-hover);
	color: var(--mdsy-white);
	padding: 12px 18px;
	border-radius: 0 0 var(--mdsy-radius-sm) 0;
}

.mediasya-skip-link:focus {
	left: 0;
}

/* ---------------------------------------------------------------------
 * 3. Header
 * --------------------------------------------------------------------- */
.mediasya-header {
	position: sticky;
	top: 0;
	z-index: 999;
	background: var(--mdsy-bg);
	border-bottom: 1px solid var(--mdsy-border);
}

.mediasya-header__inner {
	max-width: var(--mdsy-max-width);
	margin: 0 auto;
	min-height: var(--mdsy-header-h);
	padding: 10px 20px;
	display: flex;
	align-items: center;
	gap: 16px;
	flex-wrap: wrap;
}

.mediasya-logo {
	display: flex;
	align-items: center;
	margin-right: auto;
}

.mediasya-logo__img {
	max-height: 46px;
	width: auto;
}

.mediasya-logo__text {
	font-size: 22px;
	font-weight: 800;
	background: var(--mdsy-gradient);
	-webkit-background-clip: text;
	background-clip: text;
	color: transparent;
}

/* Boton hamburguesa (solo movil) */
.mediasya-nav-toggle {
	order: 2;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 4px;
	background: none;
	border: 0;
	cursor: pointer;
	padding: 8px 6px;
	color: var(--mdsy-ink);
}

.mediasya-nav-toggle__bar {
	width: 24px;
	height: 2px;
	background: currentColor;
	border-radius: 2px;
	transition: transform 0.2s ease, opacity 0.2s ease;
}

.mediasya-nav-toggle__label {
	font-size: 11px;
	font-weight: 600;
}

.mediasya-nav-toggle[aria-expanded="true"] .mediasya-nav-toggle__bar:nth-child(1) {
	transform: translateY(6px) rotate(45deg);
}

.mediasya-nav-toggle[aria-expanded="true"] .mediasya-nav-toggle__bar:nth-child(2) {
	opacity: 0;
}

.mediasya-nav-toggle[aria-expanded="true"] .mediasya-nav-toggle__bar:nth-child(3) {
	transform: translateY(-6px) rotate(-45deg);
}

/* Nav: colapsada por defecto en movil */
.mediasya-nav {
	order: 4;
	flex-basis: 100%;
	max-height: 0;
	overflow: hidden;
	transition: max-height 0.25s ease;
}

.mediasya-nav.is-open {
	max-height: 400px;
}

.mediasya-nav__list {
	display: flex;
	flex-direction: column;
	padding: 8px 0 16px;
	border-top: 1px solid var(--mdsy-border);
	margin-top: 8px;
}

.mediasya-nav__list .menu-item > a {
	display: block;
	padding: 12px 4px;
	font-weight: 600;
	color: var(--mdsy-ink);
	border-bottom: 1px solid var(--mdsy-border);
}

.mediasya-nav__list .menu-item > a:hover,
.mediasya-nav__list .menu-item > a:focus-visible {
	color: var(--mdsy-primary);
}

/* Submenus (ej. "Sobre Nosotros" > Quienes Somos/Contacto/Preguntas
   Frecuentes/Blog). WordPress marca el <li> padre con la clase
   "menu-item-has-children" solo. En movil el menu ya es un panel que se
   despliega entero, asi que el submenu simplemente queda siempre visible,
   indentado y mas chico -- no hace falta un acordeon aparte. */
.mediasya-nav__list .menu-item-has-children > a::after {
	content: "▾";
	display: inline-block;
	margin-left: 4px;
	font-size: 11px;
}

.mediasya-nav__list .sub-menu {
	padding-left: 16px;
}

.mediasya-nav__list .sub-menu .menu-item > a {
	font-weight: 500;
	font-size: 14px;
	padding-top: 10px;
	padding-bottom: 10px;
}

.mediasya-header__actions {
	order: 3;
	display: flex;
	align-items: center;
	gap: 12px;
}

/* Boton CTA del header ("Comprar al por mayor" -> WhatsApp). Solo en
   desktop: en movil no entra junto al logo + hamburguesa + carrito sin
   amontonarse, y el mismo CTA ya esta bien visible mas abajo en el hero y
   en la seccion de "Haces tu pedido al por mayor". */
.mediasya-header-cta {
	display: none;
}

@media (min-width: 900px) {
	.mediasya-header-cta {
		display: inline-flex;
		align-items: center;
		white-space: nowrap;
		background: var(--mdsy-primary);
		color: var(--mdsy-white);
		font-weight: 700;
		font-size: 14px;
		padding: 10px 18px;
		border-radius: 999px;
		transition: background 0.15s ease, transform 0.15s ease;
	}

	.mediasya-header-cta:hover,
	.mediasya-header-cta:focus-visible {
		background: var(--mdsy-primary-hover);
		transform: translateY(-1px);
	}
}

.mediasya-cart {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	border-radius: 50%;
	background: var(--mdsy-bg-soft);
	color: var(--mdsy-primary-hover);
}

.mediasya-cart:hover {
	background: var(--mdsy-primary-light);
}

.mediasya-cart__icon {
	width: 20px;
	height: 20px;
}

.mediasya-cart__count {
	position: absolute;
	top: -4px;
	right: -4px;
	min-width: 18px;
	height: 18px;
	padding: 0 4px;
	border-radius: 999px;
	background: var(--mdsy-primary);
	color: var(--mdsy-white);
	font-size: 11px;
	font-weight: 700;
	line-height: 18px;
	text-align: center;
}

/* Desktop: header en una sola fila, nav siempre visible */
@media (min-width: 900px) {
	.mediasya-nav-toggle {
		display: none;
	}

	.mediasya-header__inner {
		flex-wrap: nowrap;
	}

	.mediasya-nav {
		order: 2;
		flex-basis: auto;
		max-height: none;
		overflow: visible;
	}

	.mediasya-nav__list {
		flex-direction: row;
		align-items: center;
		gap: 8px;
		border-top: 0;
		margin-top: 0;
		padding: 0;
	}

	.mediasya-nav__list .menu-item > a {
		border-bottom: 0;
		padding: 8px 14px;
		border-radius: 999px;
	}

	.mediasya-nav__list .menu-item > a:hover,
	.mediasya-nav__list .menu-item > a:focus-visible {
		background: var(--mdsy-bg-soft);
		color: var(--mdsy-primary-hover);
	}

	.mediasya-header__actions {
		order: 3;
	}

	/* Submenu tipo dropdown en desktop: oculto por defecto, aparece al
	   pasar el mouse o al enfocar con teclado (accesible por Tab, no solo
	   con mouse). */
	.mediasya-nav__list .menu-item-has-children {
		position: relative;
	}

	.mediasya-nav__list .sub-menu {
		position: absolute;
		top: 100%;
		left: 0;
		min-width: 220px;
		background: var(--mdsy-white);
		border: 1px solid var(--mdsy-border);
		border-radius: var(--mdsy-radius);
		box-shadow: var(--mdsy-shadow);
		padding: 8px;
		margin: 6px 0 0;
		opacity: 0;
		visibility: hidden;
		transform: translateY(-6px);
		transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s;
		z-index: 20;
	}

	.mediasya-nav__list .menu-item-has-children:hover > .sub-menu,
	.mediasya-nav__list .menu-item-has-children:focus-within > .sub-menu {
		opacity: 1;
		visibility: visible;
		transform: translateY(0);
	}

	.mediasya-nav__list .sub-menu .menu-item > a {
		border-radius: var(--mdsy-radius-sm);
		padding: 10px 12px;
	}
}

/* ---------------------------------------------------------------------
 * 4. Footer
 * --------------------------------------------------------------------- */
.mediasya-footer {
	background: var(--mdsy-white);
	color: #000000;
	border-top: 1px solid var(--mdsy-border);
	margin-top: 48px;
}

.mediasya-footer__inner {
	max-width: var(--mdsy-max-width);
	margin: 0 auto;
	padding: 48px 20px 24px;
	display: grid;
	grid-template-columns: 1fr;
	gap: 32px;
}

.mediasya-footer__logo {
	font-size: 22px;
	font-weight: 800;
	color: #000000;
}

.mediasya-footer__tagline {
	margin-top: 12px;
	font-size: 14px;
	line-height: 1.6;
	color: #4d4d4d;
	max-width: 32em;
}

.mediasya-footer__heading {
	color: #000000;
	font-size: 15px;
	font-weight: 700;
	margin: 0 0 14px;
}

.mediasya-footer__list li {
	margin-bottom: 10px;
	font-size: 14px;
}

.mediasya-footer__list a:hover,
.mediasya-footer__list a:focus-visible {
	color: var(--mdsy-primary);
}

.mediasya-footer__social {
	display: flex;
	gap: 12px;
}

.mediasya-footer__social a {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 38px;
	height: 38px;
	border-radius: 50%;
	background: var(--mdsy-bg-soft);
	color: #000000;
}

.mediasya-footer__social a svg {
	width: 18px;
	height: 18px;
}

.mediasya-footer__social a:hover {
	background: var(--mdsy-primary);
	color: var(--mdsy-white);
}

.mediasya-footer__payments {
	max-width: var(--mdsy-max-width);
	margin: 0 auto;
	padding: 20px 20px;
	border-top: 1px solid var(--mdsy-border);
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 10px;
	font-size: 13px;
}

.mediasya-footer__payments-label {
	color: #4d4d4d;
	margin-right: 4px;
}

.mediasya-footer__payment-badge {
	background: var(--mdsy-bg-soft);
	color: #000000;
	padding: 6px 12px;
	border-radius: 999px;
	font-weight: 600;
}

.mediasya-footer__bottom {
	border-top: 1px solid var(--mdsy-border);
	padding: 16px 20px;
	text-align: center;
	font-size: 12px;
	color: #4d4d4d;
}

@media (min-width: 700px) {
	.mediasya-footer__inner {
		grid-template-columns: 1.4fr 1fr 1fr 1fr;
	}
}
