/**
 * Pedidos por chat — estilos del catálogo.
 * Todas las clases usan el prefijo .pwdw- para no chocar con el tema ni con WooCommerce.
 */

:root {
	--pwdw-btn-bg: #25d366;
	--pwdw-btn-color: #ffffff;
	--pwdw-radius: 10px;
	--pwdw-border: rgba(0, 0, 0, 0.12);
	--pwdw-muted: rgba(0, 0, 0, 0.6);
	--pwdw-surface: #ffffff;
	--pwdw-text: #1d2327;
	--pwdw-sale: #c62828;
	--pwdw-ok: #1b7f3b;
	--pwdw-gap: 1.25rem;
}

.pwdw-catalog,
.pwdw-product,
.pwdw-list {
	box-sizing: border-box;
}

.pwdw-catalog *,
.pwdw-product *,
.pwdw-list * {
	box-sizing: inherit;
}

.screen-reader-text {
	border: 0;
	clip: rect(1px, 1px, 1px, 1px);
	clip-path: inset(50%);
	height: 1px;
	margin: -1px;
	overflow: hidden;
	padding: 0;
	position: absolute;
	width: 1px;
	word-wrap: normal !important;
}

/* ---------- Botones ---------- */

.pwdw-btn {
	align-items: center;
	border: 2px solid transparent;
	border-radius: var(--pwdw-radius);
	cursor: pointer;
	display: inline-flex;
	font: inherit;
	font-size: 0.95em;
	font-weight: 600;
	gap: 0.5em;
	justify-content: center;
	line-height: 1.2;
	min-height: 44px;
	padding: 0.65em 1.1em;
	text-align: center;
	text-decoration: none !important;
	transition: filter 0.15s ease, transform 0.15s ease;
}

.pwdw-btn:hover {
	filter: brightness(0.95);
}

.pwdw-btn:active {
	transform: translateY(1px);
}

.pwdw-btn:focus-visible {
	outline: 3px solid currentColor;
	outline-offset: 2px;
}

.pwdw-btn--whatsapp {
	background: var(--pwdw-btn-bg);
	color: var(--pwdw-btn-color) !important;
}

.pwdw-btn--secondary {
	background: transparent;
	border-color: var(--pwdw-btn-bg);
	color: inherit;
}

.pwdw-btn--outline {
	background: transparent;
	border-color: currentColor;
	color: inherit !important;
}

.pwdw-btn--disabled {
	background: rgba(0, 0, 0, 0.08);
	color: var(--pwdw-muted);
	cursor: not-allowed;
}

.pwdw-icon {
	flex: none;
}

/* ---------- Filtro por categoría ---------- */

.pwdw-filter ul {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	list-style: none;
	margin: 0 0 var(--pwdw-gap);
	padding: 0;
}

.pwdw-filter__item {
	border: 1px solid var(--pwdw-border);
	border-radius: 999px;
	color: inherit;
	display: inline-block;
	font-size: 0.9em;
	padding: 0.4em 1em;
	text-decoration: none;
}

.pwdw-filter__item:hover,
.pwdw-filter__item.is-active {
	background: var(--pwdw-btn-bg);
	border-color: var(--pwdw-btn-bg);
	color: var(--pwdw-btn-color);
}

/* ---------- Cuadrícula y tarjetas ---------- */

.pwdw-grid {
	display: grid;
	gap: var(--pwdw-gap);
	grid-template-columns: repeat(var(--pwdw-columns, 3), minmax(0, 1fr));
}

@media (max-width: 900px) {
	.pwdw-grid {
		grid-template-columns: repeat(min(var(--pwdw-columns, 3), 3), minmax(0, 1fr));
	}
}

@media (max-width: 680px) {
	.pwdw-grid {
		grid-template-columns: repeat(min(var(--pwdw-columns, 3), 2), minmax(0, 1fr));
		gap: 0.75rem;
	}
}

@media (max-width: 380px) {
	.pwdw-grid {
		grid-template-columns: minmax(0, 1fr);
	}
}

.pwdw-card {
	background: var(--pwdw-surface);
	border: 1px solid var(--pwdw-border);
	border-radius: var(--pwdw-radius);
	color: var(--pwdw-text);
	display: flex;
	flex-direction: column;
	overflow: hidden;
	position: relative;
}

.pwdw-card__media {
	aspect-ratio: 1 / 1;
	background: rgba(0, 0, 0, 0.04);
	display: block;
	overflow: hidden;
}

.pwdw-card__media img,
.pwdw-card__img {
	display: block;
	height: 100%;
	object-fit: cover;
	transition: transform 0.3s ease;
	width: 100%;
}

.pwdw-card:hover .pwdw-card__media img {
	transform: scale(1.03);
}

.pwdw-card.is-out-of-stock .pwdw-card__media img {
	opacity: 0.6;
}

.pwdw-card__badges {
	left: 0.6rem;
	position: absolute;
	top: 0.6rem;
}

.pwdw-badge {
	border-radius: 999px;
	color: #fff;
	display: inline-block;
	font-size: 0.75rem;
	font-weight: 700;
	letter-spacing: 0.02em;
	padding: 0.25em 0.7em;
	text-transform: uppercase;
}

.pwdw-badge--sale {
	background: var(--pwdw-sale);
}

.pwdw-badge--out {
	background: #50575e;
}

.pwdw-card__body {
	display: flex;
	flex: 1;
	flex-direction: column;
	gap: 0.4rem;
	padding: 0.9rem;
}

.pwdw-card__title {
	font-size: 1rem;
	line-height: 1.3;
	margin: 0;
}

.pwdw-card__title a {
	color: inherit;
	text-decoration: none;
}

.pwdw-card__title a:hover {
	text-decoration: underline;
}

.pwdw-card__actions {
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
	margin-top: auto;
	padding-top: 0.4rem;
}

.pwdw-card__actions .pwdw-btn {
	width: 100%;
}

@media (max-width: 680px) {
	.pwdw-card__body {
		padding: 0.7rem;
	}

	.pwdw-card__actions .pwdw-btn {
		font-size: 0.85em;
		padding: 0.6em 0.5em;
	}
}

/* ---------- Precio ---------- */

.pwdw-price {
	font-size: 1.15em;
	font-weight: 700;
	margin: 0;
}

.pwdw-price del {
	color: var(--pwdw-muted);
	font-size: 0.85em;
	font-weight: 400;
	margin-right: 0.35em;
}

.pwdw-price ins {
	color: var(--pwdw-sale);
	text-decoration: none;
}

/* ---------- Ficha de producto ---------- */

.pwdw-product {
	display: grid;
	gap: calc(var(--pwdw-gap) * 1.5);
	grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
	margin: 0 0 2rem;
}

@media (max-width: 768px) {
	.pwdw-product {
		grid-template-columns: minmax(0, 1fr);
	}
}

.pwdw-product__summary {
	display: flex;
	flex-direction: column;
	gap: 0.9rem;
}

.pwdw-product__title {
	margin: 0;
}

.pwdw-product__title a {
	color: inherit;
	text-decoration: none;
}

.pwdw-product .pwdw-price {
	font-size: 1.6em;
}

.pwdw-product__meta {
	color: var(--pwdw-muted);
	font-size: 0.9em;
	margin: 0;
}

.pwdw-stock--in {
	color: var(--pwdw-ok);
	font-weight: 600;
}

.pwdw-stock--out {
	color: var(--pwdw-sale);
	font-weight: 600;
}

.pwdw-product__excerpt p:last-child {
	margin-bottom: 0;
}

/* Galería */

.pwdw-gallery__main {
	background: rgba(0, 0, 0, 0.04);
	border-radius: var(--pwdw-radius);
	display: block;
	overflow: hidden;
}

.pwdw-gallery__main img {
	aspect-ratio: 1 / 1;
	display: block;
	height: auto;
	object-fit: cover;
	width: 100%;
}

.pwdw-gallery__thumbs {
	display: grid;
	gap: 0.5rem;
	grid-template-columns: repeat(5, minmax(0, 1fr));
	list-style: none;
	margin: 0.6rem 0 0;
	padding: 0;
}

.pwdw-gallery__thumb {
	background: none;
	border: 2px solid transparent;
	border-radius: 6px;
	cursor: pointer;
	display: block;
	overflow: hidden;
	padding: 0;
	width: 100%;
}

.pwdw-gallery__thumb img {
	aspect-ratio: 1 / 1;
	display: block;
	height: auto;
	object-fit: cover;
	width: 100%;
}

.pwdw-gallery__thumb.is-active,
.pwdw-gallery__thumb:hover {
	border-color: var(--pwdw-btn-bg);
}

.pwdw-gallery--empty,
.pwdw-placeholder {
	align-items: center;
	aspect-ratio: 1 / 1;
	background: rgba(0, 0, 0, 0.05);
	border-radius: var(--pwdw-radius);
	color: rgba(0, 0, 0, 0.25);
	display: flex;
	justify-content: center;
	width: 100%;
}

.pwdw-gallery--empty .pwdw-placeholder {
	background: none;
}

/* Formulario de pedido */

.pwdw-order {
	display: flex;
	flex-direction: column;
	gap: 0.9rem;
	margin: 0;
}

.pwdw-order__field label {
	display: block;
	font-weight: 600;
	margin-bottom: 0.3rem;
}

.pwdw-order__field select {
	border: 1px solid var(--pwdw-border);
	border-radius: var(--pwdw-radius);
	font: inherit;
	max-width: 100%;
	min-height: 44px;
	padding: 0.5em 0.75em;
	width: 100%;
}

.pwdw-order__field select[aria-invalid="true"] {
	border-color: var(--pwdw-sale);
}

.pwdw-qty {
	align-items: stretch;
	border: 1px solid var(--pwdw-border);
	border-radius: var(--pwdw-radius);
	display: inline-flex;
	overflow: hidden;
}

.pwdw-qty__btn {
	background: rgba(0, 0, 0, 0.04);
	border: 0;
	color: inherit;
	cursor: pointer;
	font: inherit;
	font-size: 1.2em;
	line-height: 1;
	min-height: 44px;
	min-width: 44px;
	padding: 0;
}

.pwdw-qty__btn:hover {
	background: rgba(0, 0, 0, 0.09);
}

.pwdw-qty input[type="number"] {
	-moz-appearance: textfield;
	appearance: textfield;
	border: 0;
	font: inherit;
	margin: 0;
	padding: 0;
	text-align: center;
	width: 3.5em;
}

.pwdw-qty input::-webkit-outer-spin-button,
.pwdw-qty input::-webkit-inner-spin-button {
	-webkit-appearance: none;
	margin: 0;
}

.pwdw-qty--small .pwdw-qty__btn {
	font-size: 1em;
	min-height: 34px;
	min-width: 34px;
}

.pwdw-qty__value {
	align-self: center;
	min-width: 2em;
	text-align: center;
}

.pwdw-order__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 0.6rem;
}

.pwdw-order__actions .pwdw-btn {
	flex: 1 1 200px;
}

.pwdw-order__error {
	color: var(--pwdw-sale);
	font-weight: 600;
	margin: 0;
}

.pwdw-description__title {
	font-size: 1.25em;
}

/* ---------- Paginación y vacíos ---------- */

.pwdw-pagination ul {
	display: flex;
	flex-wrap: wrap;
	gap: 0.4rem;
	justify-content: center;
	list-style: none;
	margin: var(--pwdw-gap) 0 0;
	padding: 0;
}

.pwdw-pagination .page-numbers {
	border: 1px solid var(--pwdw-border);
	border-radius: 6px;
	color: inherit;
	display: inline-block;
	min-width: 2.5em;
	padding: 0.45em 0.75em;
	text-align: center;
	text-decoration: none;
}

.pwdw-pagination .page-numbers.current {
	background: var(--pwdw-btn-bg);
	border-color: var(--pwdw-btn-bg);
	color: var(--pwdw-btn-color);
}

.pwdw-empty {
	color: var(--pwdw-muted);
	padding: 1rem 0;
}

/* ---------- Lista de pedido ---------- */

.pwdw-no-scroll {
	overflow: hidden;
}

.pwdw-list__toggle {
	align-items: center;
	background: #1d2327;
	border: 0;
	border-radius: 999px;
	bottom: 20px;
	box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
	color: #fff;
	cursor: pointer;
	display: inline-flex;
	font: inherit;
	font-weight: 600;
	gap: 0.5em;
	min-height: 52px;
	padding: 0.6em 1.1em;
	position: fixed;
	z-index: 99990;
}

.pwdw-list__toggle[hidden] {
	display: none;
}

.pwdw-list--left .pwdw-list__toggle {
	left: 20px;
}

.pwdw-list--right .pwdw-list__toggle {
	right: 20px;
}

.pwdw-list__count {
	background: var(--pwdw-btn-bg);
	border-radius: 999px;
	color: var(--pwdw-btn-color);
	font-size: 0.85em;
	min-width: 1.6em;
	padding: 0.1em 0.45em;
	text-align: center;
}

.pwdw-list__overlay {
	background: rgba(0, 0, 0, 0.45);
	inset: 0;
	position: fixed;
	z-index: 99998;
}

.pwdw-list__panel {
	background: #fff;
	bottom: 0;
	box-shadow: 0 0 30px rgba(0, 0, 0, 0.25);
	color: #1d2327;
	display: flex;
	flex-direction: column;
	max-width: 100%;
	position: fixed;
	right: 0;
	top: 0;
	width: 420px;
	z-index: 99999;
}

.pwdw-list--left .pwdw-list__panel {
	left: 0;
	right: auto;
}

.pwdw-list__panel[hidden],
.pwdw-list__overlay[hidden] {
	display: none;
}

.pwdw-list__header {
	align-items: center;
	border-bottom: 1px solid var(--pwdw-border);
	display: flex;
	justify-content: space-between;
	padding: 1rem 1.25rem;
}

.pwdw-list__header h2 {
	font-size: 1.25rem;
	margin: 0;
}

.pwdw-list__close {
	background: none;
	border: 0;
	color: inherit;
	cursor: pointer;
	font-size: 1.8rem;
	line-height: 1;
	min-height: 44px;
	min-width: 44px;
}

.pwdw-list__items {
	flex: 1;
	list-style: none;
	margin: 0;
	overflow-y: auto;
	padding: 0.5rem 1.25rem;
}

.pwdw-list__item {
	align-items: center;
	border-bottom: 1px solid var(--pwdw-border);
	display: grid;
	gap: 0.75rem;
	grid-template-columns: minmax(0, 1fr) auto auto;
	padding: 0.85rem 0;
}

.pwdw-list__info {
	display: flex;
	flex-direction: column;
	gap: 0.15rem;
	min-width: 0;
}

.pwdw-list__info a {
	color: inherit;
	font-weight: 600;
	text-decoration: none;
}

.pwdw-list__info small {
	color: var(--pwdw-muted);
}

.pwdw-list__price {
	font-size: 0.9em;
}

.pwdw-list__remove {
	background: none;
	border: 0;
	color: var(--pwdw-muted);
	cursor: pointer;
	font-size: 1.4rem;
	min-height: 44px;
	min-width: 36px;
}

.pwdw-list__remove:hover {
	color: var(--pwdw-sale);
}

.pwdw-list__empty {
	color: var(--pwdw-muted);
	padding: 1.25rem;
}

.pwdw-list__footer {
	border-top: 1px solid var(--pwdw-border);
	display: flex;
	flex-direction: column;
	gap: 0.6rem;
	padding: 1rem 1.25rem calc(1rem + env(safe-area-inset-bottom, 0px));
}

.pwdw-list__footer[hidden] {
	display: none;
}

.pwdw-list__total {
	display: flex;
	font-size: 1.15em;
	justify-content: space-between;
	margin: 0;
}

.pwdw-list__send {
	width: 100%;
}

.pwdw-list__clear {
	background: none;
	border: 0;
	color: var(--pwdw-muted);
	cursor: pointer;
	font: inherit;
	font-size: 0.9em;
	text-decoration: underline;
}

.pwdw-toast {
	background: #1d2327;
	border-radius: 999px;
	bottom: 90px;
	color: #fff;
	left: 50%;
	opacity: 0;
	padding: 0.6em 1.2em;
	pointer-events: none;
	position: fixed;
	transform: translate(-50%, 10px);
	transition: opacity 0.2s ease, transform 0.2s ease;
	z-index: 100000;
}

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

@media (prefers-reduced-motion: reduce) {
	.pwdw-btn,
	.pwdw-card__media img,
	.pwdw-toast {
		transition: none;
	}
}

/* ---------- Plantilla de catálogo (temas clásicos) ---------- */

.pwdw-archive {
	margin: 0 auto;
	max-width: 1200px;
	padding: 2rem 1rem;
}

.pwdw-archive__header {
	margin-bottom: 1.5rem;
}

.pwdw-archive__title {
	margin: 0 0 0.5rem;
}
