/* =========================================================
 *  REDISEÑO TIENDA — paleta marca (azul #171770 / amarillo #FCC62E)
 *  Tipografía global: Inter
 *  Sidebar, toolbar, cards y paginación renovados
 *  Cargado al final por wp_enqueue_scripts después de shop-archive.css
 * ========================================================= */
:root {
	--oz-sa-blue:        #171770;
	--oz-sa-blue-dark:   #0f0f55;
	--oz-sa-yellow:      #FCC62E;
	--oz-sa-yellow-dark: #e6b021;
	--oz-sa-ink:         #111827;
	--oz-sa-muted:       #6b7280;
	--oz-sa-line:        #e5e7eb;
	--oz-sa-radius:      16px;
	--oz-sa-font:        'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

/* Tipografía Inter para títulos, textos y controles de la tienda
   (se excluyen iconos de webfont como FontAwesome / Dashicons para no romperlos) */
body.woocommerce-shop .site-main--woo-archive,
body.archive.woocommerce .site-main--woo-archive,
body.tax-product_cat .site-main--woo-archive,
body.tax-product_tag .site-main--woo-archive,
body.woocommerce-shop .site-main--woo-archive h1,
body.woocommerce-shop .site-main--woo-archive h2,
body.woocommerce-shop .site-main--woo-archive h3,
body.woocommerce-shop .site-main--woo-archive h4,
body.woocommerce-shop .site-main--woo-archive h5,
body.woocommerce-shop .site-main--woo-archive h6,
body.woocommerce-shop .site-main--woo-archive p,
body.woocommerce-shop .site-main--woo-archive a,
body.woocommerce-shop .site-main--woo-archive span,
body.woocommerce-shop .site-main--woo-archive li,
body.woocommerce-shop .site-main--woo-archive label,
body.woocommerce-shop .site-main--woo-archive button,
body.woocommerce-shop .site-main--woo-archive input,
body.woocommerce-shop .site-main--woo-archive select,
body.woocommerce-shop .site-main--woo-archive textarea,
body.archive.woocommerce .site-main--woo-archive h1,
body.archive.woocommerce .site-main--woo-archive h2,
body.archive.woocommerce .site-main--woo-archive h3,
body.archive.woocommerce .site-main--woo-archive h4,
body.archive.woocommerce .site-main--woo-archive h5,
body.archive.woocommerce .site-main--woo-archive h6,
body.archive.woocommerce .site-main--woo-archive p,
body.archive.woocommerce .site-main--woo-archive a,
body.archive.woocommerce .site-main--woo-archive span,
body.archive.woocommerce .site-main--woo-archive li,
body.archive.woocommerce .site-main--woo-archive label,
body.archive.woocommerce .site-main--woo-archive button,
body.archive.woocommerce .site-main--woo-archive input,
body.archive.woocommerce .site-main--woo-archive select,
body.archive.woocommerce .site-main--woo-archive textarea,
.oz-shop-page-banner,
.oz-shop-page-banner *,
.oz-page-hero,
.oz-page-hero *,
.oz-shop-layout,
.oz-shop-layout h1,
.oz-shop-layout h2,
.oz-shop-layout h3,
.oz-shop-layout h4,
.oz-shop-layout h5,
.oz-shop-layout h6,
.oz-shop-layout p,
.oz-shop-layout a,
.oz-shop-layout span:not([class*="dashicon"]):not([class*="fa-"]):not([class*="icon"]),
.oz-shop-layout li,
.oz-shop-layout label,
.oz-shop-layout button,
.oz-shop-layout input,
.oz-shop-layout select,
.oz-shop-layout textarea {
	font-family: var(--oz-sa-font) !important;
	font-style: normal !important;
}

body.woocommerce-shop .site-main--woo-archive,
body.archive.woocommerce .site-main--woo-archive {
	background: #f5f7fa;
}

.oz-shop-layout {
	max-width: 1500px !important;
	border-radius: var(--oz-sa-radius) !important;
	box-shadow: 0 18px 40px -22px rgba(23, 23, 112, 0.22) !important;
	border: 1px solid var(--oz-sa-line) !important;
	padding: 1.75rem !important;
	gap: 1.75rem !important;
}

.oz-shop-archive .oz-shop-sidebar,
.oz-shop-archive aside.oz-shop-sidebar {
	background: #ffffff;
	border: 1px solid var(--oz-sa-line);
	border-radius: 14px;
	padding: 1.1rem 1rem 1.25rem;
}

.oz-shop-sidebar .oz-shop-sidebar__widget {
	position: relative;
	margin-bottom: 1.25rem;
}

.oz-shop-toolbar {
	background: #ffffff !important;
	border: 1px solid var(--oz-sa-line) !important;
	border-radius: 12px !important;
	padding: 0.65rem 0.85rem !important;
	box-shadow: 0 1px 0 rgba(23, 23, 112, 0.04) !important;
}

.oz-shop-grid-btn:hover {
	border-color: var(--oz-sa-blue) !important;
	color: var(--oz-sa-blue) !important;
}

.oz-shop-toolbar .orderby,
.oz-shop-toolbar select {
	border-radius: 999px !important;
	border: 1px solid var(--oz-sa-line) !important;
	padding: 0.5rem 1rem !important;
	font-size: 0.9rem !important;
	color: var(--oz-sa-ink) !important;
	background: #ffffff !important;
	transition: border-color 0.18s ease, box-shadow 0.18s ease;
}
.oz-shop-toolbar .orderby:focus,
.oz-shop-toolbar select:focus {
	outline: none;
	border-color: var(--oz-sa-blue) !important;
	box-shadow: 0 0 0 3px rgba(23, 23, 112, 0.18) !important;
}

.oz-shop-toolbar .woocommerce-result-count,
.oz-shop-layout__main .woocommerce-result-count {
	color: var(--oz-sa-muted) !important;
	font-size: 0.92rem !important;
	font-weight: 500 !important;
}

/* ===== Columnas responsive de la grid de productos =====
   Tablet (<=1280px): máximo 3 columnas, ignora la selección del usuario.
   Móvil pequeño (<=767px): 2 columnas.
   Móvil (<=480px): 1 columna. */
@media (max-width: 1280px) {
	body .oz-shop-layout__main ul.products,
	body.ozc-loops--replace .oz-shop-layout__main ul.products,
	body.oz-shop-user-cols-2 .oz-shop-layout__main ul.products,
	body.oz-shop-user-cols-3 .oz-shop-layout__main ul.products,
	body.oz-shop-user-cols-4 .oz-shop-layout__main ul.products,
	body.oz-shop-user-cols-5 .oz-shop-layout__main ul.products,
	body.oz-shop-user-cols-2.ozc-loops--replace .oz-shop-layout__main ul.products,
	body.oz-shop-user-cols-3.ozc-loops--replace .oz-shop-layout__main ul.products,
	body.oz-shop-user-cols-4.ozc-loops--replace .oz-shop-layout__main ul.products,
	body.oz-shop-user-cols-5.ozc-loops--replace .oz-shop-layout__main ul.products {
		grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
	}
}
@media (max-width: 767px) {
	body .oz-shop-layout__main ul.products,
	body.ozc-loops--replace .oz-shop-layout__main ul.products,
	body.oz-shop-user-cols-2 .oz-shop-layout__main ul.products,
	body.oz-shop-user-cols-3 .oz-shop-layout__main ul.products,
	body.oz-shop-user-cols-4 .oz-shop-layout__main ul.products,
	body.oz-shop-user-cols-5 .oz-shop-layout__main ul.products,
	body.oz-shop-user-cols-2.ozc-loops--replace .oz-shop-layout__main ul.products,
	body.oz-shop-user-cols-3.ozc-loops--replace .oz-shop-layout__main ul.products,
	body.oz-shop-user-cols-4.ozc-loops--replace .oz-shop-layout__main ul.products,
	body.oz-shop-user-cols-5.ozc-loops--replace .oz-shop-layout__main ul.products {
		grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
	}
}
@media (max-width: 480px) {
	body .oz-shop-layout__main ul.products,
	body.ozc-loops--replace .oz-shop-layout__main ul.products {
		grid-template-columns: 1fr !important;
	}
}

/* También oculta el grid switcher de la toolbar en tablet (no tiene sentido elegir 4 o 5 cols cuando se fuerza a 3) */
@media (max-width: 1280px) {
	.oz-shop-toolbar__grid {
		display: none !important;
	}
}

/* Reduce el espacio en blanco vacío entre el banner y la toolbar */
.oz-shop-archive__shell {
	padding-top: 1rem !important;
	padding-bottom: 2rem !important;
}
.oz-shop-archive__main,
.oz-shop-archive__header,
.oz-shop-archive__results {
	gap: 0.75rem !important;
}
.oz-shop-archive__header:empty,
.oz-shop-archive__header:has(> .oz-shop-archive__intro:empty):not(:has(.oz-shop-archive__intro :not(:empty))) {
	display: none !important;
}
.oz-shop-archive__intro:empty,
.oz-shop-archive__intro:has(> .term-description:empty),
.oz-shop-archive__intro:has(> .woocommerce-products-header__description:empty) {
	display: none !important;
	margin: 0 !important;
	padding: 0 !important;
}
.oz-shop-archive__intro .term-description:empty,
.oz-shop-archive__intro .woocommerce-products-header__description:empty {
	display: none !important;
	margin: 0 !important;
	padding: 0 !important;
}
.woocommerce-notices-wrapper:empty {
	display: none !important;
	margin: 0 !important;
	padding: 0 !important;
}
.oz-shop-archive__main > .oz-shop-archive__header:empty + .oz-shop-archive__results,
.oz-shop-archive__main > .oz-shop-archive__header:not(:has(*:not(:empty))) + .oz-shop-archive__results {
	margin-top: 0 !important;
}

/* ===== Cards de producto — respeta el diseño del plugin oz-cotizador =====
   El plugin renderiza con .ozc-product-card y aplica su propio layout.
   Solo añadimos color de marca (azul/amarillo) donde se necesite, sin
   sobrescribir estructura, padding, tipografía, ni el botón. */

/* Acento azul en categoría y nombre al hacer hover */
body .ozc-product-card .ozc-product-card__category {
	color: var(--oz-sa-blue);
}
body .ozc-product-card:hover .ozc-product-card__title a {
	color: var(--oz-sa-blue);
}

/* Badge "Oferta" — azul marca con texto blanco */
.woocommerce span.onsale,
.ozc-product-card .ozc-product-card__badge {
	background: var(--oz-sa-blue) !important;
	color: #ffffff !important;
}

/* ===== Paginación ===== */
.woocommerce nav.woocommerce-pagination ul,
nav.woocommerce-pagination ul {
	border: 0 !important;
	display: inline-flex !important;
	gap: 6px;
	background: transparent !important;
}
.woocommerce nav.woocommerce-pagination ul li,
nav.woocommerce-pagination ul li {
	border: 0 !important;
	background: transparent !important;
}
.woocommerce nav.woocommerce-pagination ul li a,
.woocommerce nav.woocommerce-pagination ul li span,
nav.woocommerce-pagination ul li a,
nav.woocommerce-pagination ul li span {
	display: inline-flex !important;
	align-items: center;
	justify-content: center;
	min-width: 38px !important;
	height: 38px !important;
	padding: 0 10px !important;
	border-radius: 10px !important;
	background: #ffffff !important;
	border: 1px solid var(--oz-sa-line) !important;
	color: var(--oz-sa-ink) !important;
	font-weight: 700 !important;
	transition: border-color 0.18s ease, background-color 0.18s ease, color 0.18s ease;
}
.woocommerce nav.woocommerce-pagination ul li a:hover,
nav.woocommerce-pagination ul li a:hover {
	border-color: var(--oz-sa-blue) !important;
	color: var(--oz-sa-blue) !important;
}
.woocommerce nav.woocommerce-pagination ul li span.current,
nav.woocommerce-pagination ul li span.current {
	background: var(--oz-sa-blue) !important;
	border-color: var(--oz-sa-blue) !important;
	color: #ffffff !important;
}

/* Limpiar filtros */
.oz-shop-clear-filters,
button.oz-shop-clear-filters {
	background: #ffffff !important;
	border: 1px dashed rgba(23, 23, 112, 0.4) !important;
	color: var(--oz-sa-blue) !important;
	border-radius: 12px !important;
	font-weight: 700 !important;
	transition: background-color 0.18s ease, border-color 0.18s ease;
}
.oz-shop-clear-filters:hover {
	background: rgba(23, 23, 112, 0.06) !important;
	border-color: var(--oz-sa-blue) !important;
	border-style: solid !important;
}

@media (max-width: 991px) {
	.oz-shop-layout {
		padding: 1rem !important;
		border-radius: 12px !important;
	}
}

/* =========================================================
 *  DRAWER MÓVIL DE FILTROS — solo <= 991px
 * ========================================================= */
.oz-shop-filters-toggle {
	display: none;
}
.oz-shop-filters-close {
	display: none;
}
.oz-shop-filters-backdrop {
	display: none;
}

@media (max-width: 991px) {
	/* Botón "Filtros" — visible solo en móvil/tablet */
	.oz-shop-filters-toggle {
		display: inline-flex !important;
		align-items: center;
		gap: 8px;
		margin: 0 0 1rem !important;
		padding: 0.7rem 1.1rem !important;
		background: var(--oz-sa-blue) !important;
		color: #ffffff !important;
		border: 0 !important;
		border-radius: 999px !important;
		font-family: var(--oz-sa-font) !important;
		font-size: 0.95rem !important;
		font-weight: 700 !important;
		cursor: pointer;
		box-shadow: 0 8px 20px -10px rgba(23, 23, 112, 0.6) !important;
		transition: background-color 0.18s ease, transform 0.18s ease;
	}
	.oz-shop-filters-toggle:hover {
		background: var(--oz-sa-blue-dark) !important;
		transform: translateY(-1px);
	}
	.oz-shop-filters-toggle svg {
		flex: 0 0 auto;
	}

	/* Sidebar como drawer off-canvas (izquierda).
	   Anula el display:none que el CSS legacy aplica en <768px y el position:sticky desktop. */
	body .oz-shop-archive__sidebar,
	body aside.oz-shop-archive__sidebar,
	body .oz-shop-layout__sidebar,
	body aside.oz-shop-layout__sidebar {
		display: flex !important;
		flex-direction: column !important;
		position: fixed !important;
		top: 0 !important;
		left: 0 !important;
		bottom: 0 !important;
		right: auto !important;
		z-index: 9999 !important;
		width: min(86vw, 340px) !important;
		max-width: 340px !important;
		height: 100dvh !important;
		max-height: 100dvh !important;
		margin: 0 !important;
		padding: 0 !important;
		background: #ffffff !important;
		border: 0 !important;
		border-radius: 0 18px 18px 0 !important;
		box-shadow: 18px 0 40px -10px rgba(23, 23, 112, 0.35) !important;
		overflow: hidden !important;
		transform: translateX(-105%);
		transition: transform 0.28s cubic-bezier(0.2, 0.8, 0.2, 1);
		visibility: hidden;
	}

	/* El contenedor interno es el scroller */
	body .oz-shop-archive__sidebar .oz-shop-archive__sidebar-inner {
		flex: 1 1 auto !important;
		min-height: 0 !important;
		overflow-y: auto !important;
		overflow-x: hidden !important;
		-webkit-overflow-scrolling: touch !important;
		overscroll-behavior: contain !important;
		padding: 56px 18px 80px !important;
	}
	body .oz-shop-archive__sidebar.is-open,
	body aside.oz-shop-archive__sidebar.is-open,
	body .oz-shop-layout__sidebar.is-open {
		transform: translateX(0);
		visibility: visible;
	}

	/* Garantiza visibilidad de TODOS los widgets dentro del drawer */
	body .oz-shop-archive__sidebar .oz-shop-sidebar__widget,
	body .oz-shop-archive__sidebar .widget {
		display: block !important;
		visibility: visible !important;
		opacity: 1 !important;
		margin-bottom: 1.25rem !important;
	}

	/* Asegura que el contenido del widget se muestre (anula is-collapsed para móvil drawer) */
	body .oz-shop-archive__sidebar .oz-shop-sidebar__widget.is-collapsed > *:not(.oz-shop-sidebar__widget-title),
	body .oz-shop-archive__sidebar .oz-shop-sidebar__widget.is-collapsed ul,
	body .oz-shop-archive__sidebar .oz-shop-sidebar__widget.is-collapsed .woocommerce-widget-layered-nav-list,
	body .oz-shop-archive__sidebar .oz-shop-sidebar__widget.is-collapsed .product-categories,
	body .oz-shop-archive__sidebar .oz-shop-sidebar__widget.is-collapsed .oz-shop-categories {
		display: block !important;
		max-height: none !important;
		height: auto !important;
		overflow: visible !important;
	}

	/* Las subcategorías SÍ deben cerrarse cuando is-collapsed (comportamiento estándar) */
	body .oz-shop-archive__sidebar .oz-shop-categories li.cat-parent.is-collapsed > ul.children,
	body .oz-shop-archive__sidebar .product-categories li.cat-parent.is-collapsed > ul.children {
		display: none !important;
	}
	body .oz-shop-archive__sidebar .oz-shop-categories li.cat-parent.is-expanded > ul.children,
	body .oz-shop-archive__sidebar .product-categories li.cat-parent.is-expanded > ul.children {
		display: block !important;
	}

	/* Botón "X" para cerrar el drawer */
	.oz-shop-archive__sidebar .oz-shop-filters-close {
		display: inline-flex !important;
		align-items: center;
		justify-content: center;
		position: absolute;
		top: 12px;
		right: 12px;
		width: 36px;
		height: 36px;
		padding: 0;
		background: rgba(23, 23, 112, 0.08);
		border: 0;
		border-radius: 50%;
		color: var(--oz-sa-blue);
		cursor: pointer;
		transition: background-color 0.18s ease, color 0.18s ease;
	}
	.oz-shop-archive__sidebar .oz-shop-filters-close:hover {
		background: var(--oz-sa-blue);
		color: #ffffff;
	}

	/* Backdrop */
	.oz-shop-filters-backdrop {
		display: block !important;
		position: fixed !important;
		inset: 0 !important;
		z-index: 9998 !important;
		background: rgba(15, 23, 42, 0.5);
		opacity: 0;
		visibility: hidden;
		transition: opacity 0.22s ease, visibility 0s linear 0.22s;
	}
	.oz-shop-filters-backdrop.is-open {
		opacity: 1;
		visibility: visible;
		transition: opacity 0.22s ease;
	}

	/* Bloquea scroll del body cuando el drawer está abierto */
	body.oz-shop-filters-locked {
		overflow: hidden !important;
	}
}

