/**
 * Mini carrito lateral — drawer moderno.
 */

.es-cart-drawer,
.es-cart-drawer * {
	box-sizing: border-box;
}

.es-cart-toggle {
	position: relative;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 46px;
	height: 46px;
	border: 1px solid var(--es-border, #e7e7e7);
	border-radius: 50%;
	background: #fff;
	color: var(--es-navy, #2A2E65);
	cursor: pointer;
	transition: box-shadow 0.35s ease, border-color 0.35s ease, background 0.35s ease, color 0.35s ease;
}

.es-cart-toggle:hover {
	border-color: #2A2E65;
	color: #2A2E65;
	background: rgba(0, 33, 87, 0.06);
}

.es-cart-toggle i {
	font-size: 18px;
}

.es-cart-count {
	position: absolute;
	top: -4px;
	right: -4px;
	min-width: 20px;
	height: 20px;
	padding: 0 6px;
	border-radius: 999px;
	background: #E62020;
	color: #fff;
	font-size: 11px;
	font-weight: 800;
	line-height: 20px;
	text-align: center;
}

.es-cart-count--empty {
	display: none;
}

.es-cart-drawer {
	position: fixed;
	inset: 0;
	z-index: 99999;
	pointer-events: none;
	visibility: hidden;
}

.es-cart-drawer.is-open {
	pointer-events: auto;
	visibility: visible;
}

.es-cart-drawer__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(15, 28, 42, 0.45);
	opacity: 0;
	transition: opacity 0.3s ease;
}

.es-cart-drawer.is-open .es-cart-drawer__backdrop {
	opacity: 1;
}

.es-cart-drawer__panel {
	position: absolute;
	top: 0;
	right: 0;
	width: min(420px, 100vw);
	height: 100%;
	display: flex;
	flex-direction: column;
	background: #fff;
	transform: translateX(100%);
	transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
	overflow: hidden;
}

.es-cart-drawer.is-open .es-cart-drawer__panel {
	transform: translateX(0);
}

.es-cart-drawer .es-cart-drawer__header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	flex-shrink: 0;
	margin: 0;
	padding: 24px 28px 20px;
	border-bottom: 1px solid #eef1f4;
}

.es-cart-drawer .es-cart-drawer__title {
	display: flex;
	align-items: center;
	gap: 10px;
	margin: 0;
	font-size: 1.15rem;
	font-weight: 800;
	color: #2A2E65;
}

.es-cart-drawer .es-cart-drawer__title i {
	color: #E62020;
}

.es-cart-drawer .es-cart-drawer__close {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	border: none;
	border-radius: 50%;
	background: #f4f6f8;
	color: #2A2E65;
	cursor: pointer;
	transition: background 0.2s ease, transform 0.2s ease;
}

.es-cart-drawer .es-cart-drawer__close:hover {
	background: #e8edf2;
	transform: rotate(90deg);
}

.es-cart-drawer .es-cart-drawer__body {
	flex: 1;
	overflow-y: auto;
	margin: 0;
	padding: 20px 28px;
	-webkit-overflow-scrolling: touch;
}

/* Evita subtotal duplicado si hay fragmentos WC cacheados */
.es-cart-drawer .es-cart-drawer__body .es-mini-cart-summary {
	display: none !important;
}

.es-cart-drawer .es-cart-drawer__footer {
	flex-shrink: 0;
	margin: 0;
	padding: 20px 28px 28px;
	border-top: 1px solid #eef1f4;
	background: #f8fafc;
}

.es-cart-drawer .es-cart-drawer__footer:empty {
	display: none;
	padding: 0;
	border-top: none;
}

.es-cart-drawer .es-mini-cart-empty {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 12px;
	min-height: 220px;
	padding: 12px 8px;
	text-align: center;
	color: #6b7785;
}

.es-cart-drawer .es-mini-cart-empty__icon {
	width: 72px;
	height: 72px;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	background: #f4f7fb;
	color: #E62020;
	font-size: 28px;
}

.es-cart-drawer .es-mini-cart-empty__link {
	display: inline-flex;
	padding: 10px 18px;
	border-radius: 999px;
	background: #2A2E65;
	color: #fff !important;
	font-weight: 700;
	font-size: 14px;
	transition: background 0.4s ease, box-shadow 0.4s ease, color 0.4s ease;
}

.es-cart-drawer .es-mini-cart-empty__link:hover {
	background: #E62020;
	color: #fff !important;
}

.es-cart-drawer .es-mini-cart-list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 16px;
}

.es-cart-drawer .es-mini-cart-item {
	display: grid;
	grid-template-columns: 72px 1fr auto;
	gap: 12px;
	align-items: start;
	margin: 0;
	padding: 16px;
	border: 1px solid #eef1f4;
	border-radius: 14px;
	background: #fff;
	transition: box-shadow 0.3s ease, border-color 0.3s ease;
}

.es-cart-drawer .es-mini-cart-item:hover {
	border-color: rgba(0, 33, 87, 0.15);
}

.es-cart-drawer .es-mini-cart-item__media img {
	width: 72px;
	height: 72px;
	object-fit: cover;
	border-radius: 10px;
}

.es-cart-drawer .es-mini-cart-item__title {
	display: block;
	margin: 0 0 6px;
	font-size: 14px;
	font-weight: 700;
	line-height: 1.35;
	color: #2A2E65 !important;
}

.es-cart-drawer .es-mini-cart-item__meta {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin: 0;
	font-size: 13px;
	color: #6b7785;
}

.es-cart-drawer .es-mini-cart-item__price {
	font-weight: 700;
	color: #E62020;
}

.es-cart-drawer .es-mini-cart-item__remove {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 32px;
	height: 32px;
	border-radius: 50%;
	color: #9aa5b1 !important;
	transition: background 0.2s ease, color 0.2s ease;
}

.es-cart-drawer .es-mini-cart-item__remove:hover {
	background: #feeceb;
	color: #F20000 !important;
}

.es-cart-drawer .es-mini-cart-summary {
	margin: 0;
	padding: 0;
	border-top: none;
}

.es-cart-drawer .es-mini-cart-summary__row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	margin-bottom: 8px;
	font-size: 15px;
}

.es-cart-drawer .es-mini-cart-summary__row strong {
	font-size: 1.1rem;
	color: #2A2E65;
}

.es-cart-drawer .es-mini-cart-summary__note {
	margin: 0 0 18px;
	font-size: 12px;
	line-height: 1.45;
	color: #9aa5b1;
}

.es-cart-drawer .es-mini-cart-summary__actions {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 12px;
}

.es-cart-drawer .es-mini-cart-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 13px 16px;
	border-radius: 10px;
	font-size: 13px;
	font-weight: 700;
	text-align: center;
	text-decoration: none;
	transition: background 0.45s ease, border-color 0.45s ease, color 0.45s ease, box-shadow 0.45s ease;
}

.es-cart-drawer .es-mini-cart-btn--outline {
	border: 2px solid #2A2E65;
	color: #2A2E65 !important;
	background: #fff;
}

.es-cart-drawer .es-mini-cart-btn--primary {
	background: #E62020;
	color: #fff !important;
}

body.es-cart-open {
	overflow: hidden;
}

@media (max-width: 480px) {
	.es-cart-drawer .es-cart-drawer__header {
		padding: 20px 20px 16px;
	}

	.es-cart-drawer .es-cart-drawer__body {
		padding: 16px 20px;
	}

	.es-cart-drawer .es-cart-drawer__footer {
		padding: 16px 20px 24px;
	}

	.es-cart-drawer .es-mini-cart-summary__actions {
		grid-template-columns: 1fr;
	}
}

/* -----------------------------
   Enhancements: filtros, precios,
   botón WhatsApp y paginador
   ----------------------------- */

:root {
	--whatsapp: #25D366;
	--accent: #E62020;
	--navy: #2A2E65;
}

.product-filters {
	display: flex;
	gap: 12px;
	flex-wrap: wrap;
	margin: 18px 0;
}
.product-filters .filter {
	background: #fff;
	border: 1px solid #eef1f4;
	padding: 8px 12px;
	border-radius: 10px;
	cursor: pointer;
	color: #2b3440;
	font-weight: 700;
	transition: box-shadow 0.22s ease, border-color 0.22s ease, transform 0.12s ease;
}
.product-filters .filter:hover {
	transform: translateY(-2px);
}
.product-filters .filter.active {
	border-color: var(--accent);
	box-shadow: 0 8px 22px rgba(226,32,32,0.08);
	color: var(--navy);
}

.product-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
	gap: 18px;
}
.product-card {
	border: 1px solid #eef1f4;
	border-radius: 12px;
	overflow: hidden;
	background: #fff;
	display: flex;
	flex-direction: column;
	transition: box-shadow 0.25s ease, transform 0.18s ease;
}
.product-card:hover {
	transform: translateY(-6px);
	box-shadow: 0 18px 40px rgba(13,28,60,0.06);
}
.product-card__media img { width:100%; height:160px; object-fit:cover; }
.product-card__body { padding: 12px; display:flex; flex-direction:column; gap:8px; flex:1; }
.product-card__title { margin:0; font-size:14px; font-weight:800; color:var(--navy); }
.product-card__meta { font-size:13px; color:#6b7785; }
.product-card__price { font-weight:900; color:var(--accent); font-size:16px; }
.product-card__price .price-old { text-decoration: line-through; color:#9aa5b1; font-weight:700; margin-right:8px; }
.product-card__badge { display:inline-block; margin-left:8px; background:var(--accent); color:#fff; padding:4px 8px; border-radius:8px; font-weight:800; font-size:12px; }

/* Paginador */
.paginator { display:flex; gap:8px; align-items:center; justify-content:center; padding:18px 0; }
.paginator .page { width: 44px; height: 44px; min-width: 44px; padding: 0; border-radius: 50%; border:1px solid #eef1f4; background:#fff; color:var(--navy); font-weight:700; cursor:pointer; display:flex; align-items:center; justify-content:center; }
.paginator .page:hover { box-shadow: 0 10px 24px rgba(42,46,101,0.06); }
.paginator .page.active { background: var(--navy); color: #fff; border-color: var(--navy); box-shadow: 0 10px 28px rgba(42,46,101,0.14); }
.paginator .page[disabled] { opacity:0.45; cursor:default; }

/* Oculta la paginación nativa de WooCommerce cuando usamos el paginador personalizado */
.es-shop-container .woocommerce-pagination,
.es-shop-page .woocommerce-pagination,
.es-shop-main .woocommerce-pagination,
.es-shop-page nav.woocommerce-pagination,
.es-shop-container nav.woocommerce-pagination {
	display: none !important;
}

@media (max-width: 560px) {
	.product-grid { grid-template-columns: 1fr; }
	.whatsapp-button { right: 14px; bottom: 14px; width:48px; height:48px; }
}

/* Nota: la funcionalidad de filtros y paginador requiere JS/PHP para integración completa. */
