.dp-product-grid-wrapper .dp-pg-grid {
	display: grid;
	list-style: none;
	margin: 0;
	padding: 0;
}

.dp-product-grid-wrapper .dp-pg-item {
	display: flex;
	box-sizing: border-box;
	height: 100%;
}

.dp-product-grid-wrapper.dp-pg--left .dp-pg-item {
	flex-direction: row;
	align-items: flex-start;
	text-align: left;
}

.dp-product-grid-wrapper.dp-pg--top .dp-pg-item {
	flex-direction: column;
	align-items: center;
	text-align: center;
}

.dp-product-grid-wrapper .dp-pg-image {
	display: block;
	flex-shrink: 0;
	position: relative;
}

.dp-product-grid-wrapper .dp-pg-badge {
	position: absolute;
	top: 8px;
	left: 8px;
	z-index: 2;
	padding: 3px 8px;
	font-weight: 700;
	line-height: 1.4;
	border-radius: 4px;
	background-color: #e02b2b;
	color: #ffffff;
	white-space: nowrap;
}

.dp-pg-badge-pos-top-right .dp-pg-badge {
	left: auto;
	right: 8px;
}

.dp-product-grid-wrapper .dp-pg-stock-notice {
	position: absolute;
	bottom: 8px;
	left: 8px;
	z-index: 2;
	padding: 2px 8px;
	font-weight: 600;
	border-radius: 4px;
	background-color: rgba(255, 255, 255, 0.92);
	color: #b54708;
	white-space: nowrap;
}

.dp-product-grid-wrapper .dp-pg-image img {
	display: block;
	width: 100%;
	height: 100%;
	box-sizing: border-box;
}

.dp-product-grid-wrapper .dp-pg-info {
	display: flex;
	flex-direction: column;
	flex: 1 1 auto;
	height: 100%;
	min-width: 0;
}

.dp-product-grid-wrapper.dp-pg--top .dp-pg-info {
	align-items: center;
}

.dp-product-grid-wrapper .dp-pg-title {
	text-decoration: none;
}

.dp-product-grid-wrapper .dp-pg-rating {
	line-height: 1;
}

.dp-product-grid-wrapper .dp-pg-price del {
	opacity: 0.6;
}

.dp-product-grid-wrapper .dp-pg-button {
	margin-top: auto;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px;
}

.dp-product-grid-wrapper .dp-pg-button a {
	display: inline-block;
	text-decoration: none;
	cursor: pointer;
	border: 1px solid transparent;
	transition: background-color 0.2s ease, color 0.2s ease;
}

/* El enlace "Ver carrito" que WooCommerce agrega automáticamente tras un
   añadir por AJAX hereda el mismo selector que el botón principal (ambos son
   <a> dentro de .dp-pg-button); lo reseteamos para que se vea como un enlace
   de texto secundario en vez de un segundo botón compitiendo visualmente. */
.dp-product-grid-wrapper .dp-pg-button a.added_to_cart {
	background-color: transparent !important;
	border-color: transparent !important;
	color: inherit !important;
	text-decoration: underline !important;
	padding: 0 !important;
	font-size: 0.9em;
	opacity: 0.85;
}

.dp-product-grid-wrapper.dp-pg--hide-view-cart .dp-pg-button a.added_to_cart {
	display: none !important;
}

.dp-product-grid-wrapper .dp-pg-empty {
	padding: 20px;
	text-align: center;
	opacity: 0.6;
}

.dp-product-grid-wrapper.is-loading .dp-pg-grid {
	opacity: 0.5;
	pointer-events: none;
	transition: opacity 0.15s ease;
}

.dp-product-grid-wrapper .dp-pg-pagination-wrap {
	width: 100%;
	margin-top: 30px;
}

.dp-product-grid-wrapper .dp-pg-pagination {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: center;
	gap: 6px;
	list-style: none;
	margin: 0;
	padding: 0;
}

.dp-product-grid-wrapper .dp-pg-page-btn {
	display: inline-block;
	cursor: pointer;
	font: inherit;
	line-height: 1.2;
	border: 1px solid #ddd;
	background-color: #ffffff;
	color: inherit;
	padding: 8px 14px;
	border-radius: 4px;
	transition: background-color 0.15s ease, color 0.15s ease;
}

.dp-product-grid-wrapper .dp-pg-page-btn:disabled {
	opacity: 0.35;
	cursor: not-allowed;
}

.dp-product-grid-wrapper .dp-pg-page-btn.is-active {
	background-color: #ED6C22;
	border-color: #ED6C22;
	color: #ffffff;
	font-weight: 700;
}

.dp-product-grid-wrapper .dp-pg-page-ellipsis {
	padding: 0 4px;
	opacity: 0.6;
}

.dp-product-grid-wrapper .dp-pg-empty-page {
	width: 100%;
	text-align: center;
	padding: 20px;
	opacity: 0.6;
	list-style: none;
}

.dp-product-grid-wrapper .dp-pg-view-more {
	width: 100%;
}

.dp-product-grid-wrapper .dp-pg-view-more-link {
	display: inline-block;
	text-decoration: none;
	cursor: pointer;
	border: 1px solid transparent;
	transition: background-color 0.2s ease, color 0.2s ease;
}

/* ==========================================================
   Modal "Elegir opciones" (productos variables)
   Vive fuera del widget (se agrega a <body>), por eso no usa el
   prefijo .dp-product-grid-wrapper.
   ========================================================== */

body.dp-pg-modal-open {
	overflow: hidden;
}

.dp-pg-modal-overlay {
	position: fixed;
	inset: 0;
	z-index: 100000;
	background: rgba(0, 0, 0, 0.55);
	display: none;
	align-items: center;
	justify-content: center;
	padding: 20px;
}

.dp-pg-modal-overlay.is-open {
	display: flex;
}

.dp-pg-modal {
	position: relative;
	background: #ffffff;
	border-radius: 8px;
	width: 100%;
	max-width: 480px;
	max-height: 90vh;
	overflow-y: auto;
	padding: 28px 24px 24px;
	box-sizing: border-box;
}

.dp-pg-modal-close {
	position: absolute;
	top: 10px;
	right: 12px;
	background: none;
	border: none;
	font-size: 26px;
	line-height: 1;
	cursor: pointer;
	color: #555;
	padding: 4px 8px;
}

.dp-pg-modal-loading,
.dp-pg-modal-error {
	text-align: center;
	padding: 30px 10px;
	opacity: 0.7;
}

.dp-pg-modal-header {
	display: flex;
	gap: 14px;
	align-items: flex-start;
	margin-bottom: 16px;
}

.dp-pg-modal-image {
	flex-shrink: 0;
	width: 80px;
}

.dp-pg-modal-image img {
	width: 100%;
	height: auto;
	display: block;
	border-radius: 6px;
	border: 1px solid #eee;
}

.dp-pg-modal-title {
	margin: 0 0 6px;
	font-size: 16px;
	line-height: 1.3;
}

.dp-pg-modal-price {
	font-weight: 700;
}

.dp-pg-modal-attributes {
	display: flex;
	flex-direction: column;
	gap: 12px;
	margin-bottom: 14px;
}

.dp-pg-modal-field label {
	display: block;
	font-size: 0.85em;
	font-weight: 600;
	margin-bottom: 4px;
}

.dp-pg-modal-field select {
	width: 100%;
	padding: 8px 10px;
	border: 1px solid #ccc;
	border-radius: 4px;
	font: inherit;
	box-sizing: border-box;
}

.dp-pg-modal-message {
	min-height: 1.2em;
	color: #b54708;
	font-size: 0.9em;
	margin-bottom: 8px;
}

.dp-pg-modal-actions {
	display: flex;
	align-items: center;
	gap: 10px;
	flex-wrap: wrap;
}

.dp-pg-modal-qty-label {
	font-size: 0.85em;
	font-weight: 600;
}

.dp-pg-modal-qty {
	width: 64px;
	padding: 8px;
	border: 1px solid #ccc;
	border-radius: 4px;
	font: inherit;
	box-sizing: border-box;
}

.dp-pg-modal-add {
	background-color: #ED6C22;
	border-color: #ED6C22;
	color: #ffffff;
	border: 1px solid transparent;
	padding: 10px 20px;
	border-radius: 4px;
	cursor: pointer;
	font: inherit;
}

.dp-pg-modal-add:disabled {
	opacity: 0.5;
	cursor: not-allowed;
}

.dp-pg-modal-view-product {
	display: inline-block;
	margin-top: 16px;
	font-size: 0.85em;
	text-decoration: underline;
}

.dp-pg-modal-success {
	display: flex;
	align-items: center;
	gap: 14px;
	flex-wrap: wrap;
	font-weight: 600;
	color: #1a7a3c;
}

.dp-pg-modal-success a {
	text-decoration: underline;
	color: inherit;
}
