/**
 * Single Product Page Styles - Un Detalle Theme
 * Diseño basado en mockup 100% sin Elementor
 * 
 * @package UnDetalle
 * @since 1.0.0
 */

/* =============================================================================
   COLORS (Style Guide)
   ============================================================================= */
   :root {
	--undetalle-primary: #EC5970;
	--undetalle-primary-hover: #e94562;
	--undetalle-primary-dark: #d63851;
	--undetalle-text: #242424;
	--undetalle-text-light: #666;
	--undetalle-text-muted: #999;
	--undetalle-border: #e0e0e0;
	--undetalle-bg-light: #f9f9f9;
	--undetalle-white: #ffffff;
	--e-primary: #C681B1;
}

.woocommerce div.product{
gap: 20px !important;	
}

.delivery-option label{
height: 122.8px;	
}

.single-product-main{
padding-left: 0px;
padding-right: 0px;	
}

.product-layout-wrapper{
padding-left: 0px;
padding-right: 0px;	
}

.woocommerce div.product .summary{
padding: 0px;	
}

.woocommerce div.product .summary .woocommerce-product-details__short-description{
margin-bottom: 10px;	
}

h1{
margin-bottom: 1px !important;	
}	

.woocommerce div.product form.cart .quantity{
margin-right: 0px;
}

/* =============================================================================
   PRODUCT LAYOUT - 2 COLUMNAS (MÁXIMA ESPECIFICIDAD)
   ============================================================================= */
body.single-product div.product,
body.woocommerce div.product,
.woocommerce div.product,
div.product,
.product {
	max-width: 1400px !important;
	margin: 0 auto !important;
	padding: 20px 0px !important;
}

/* Breadcrumb */
.product-breadcrumb {
	margin-bottom: 4px;
	font-size: 0.9rem;
	color: var(--undetalle-text-muted);
}

.product-breadcrumb a {
	color: var(--undetalle-text-light);
	text-decoration: none;
	transition: color 0.3s ease;
}

.product-breadcrumb a:hover {
	color: var(--undetalle-primary);
}

/* CRÍTICO: Flexbox de 2 columnas 50/50 */
body.single-product div.product .product-layout-wrapper,
body.woocommerce div.product .product-layout-wrapper,
.woocommerce div.product .product-layout-wrapper,
div.product .product-layout-wrapper,
.product-layout-wrapper {
	display: flex !important;
	gap: 20px !important;
	align-items: flex-start !important;
	width: 100% !important;
	box-sizing: border-box !important;
	position: relative; /* Importante para limitar sticky */
}

.product-images-column{
	flex: 1;
	min-width: 0; /* Previene overflow */
	max-width: 40%;
}

.product-summary-column {
	max-width: 60%;
}

/* =============================================================================
   MOBILE OVERRIDE - CRÍTICO: Debe estar ANTES del sticky
   ============================================================================= */
@media (max-width: 768px) {
	/* Forzar 1 columna inmediatamente */
	body.single-product div.product .product-layout-wrapper,
	body.woocommerce div.product .product-layout-wrapper,
	.woocommerce div.product .product-layout-wrapper,
	div.product .product-layout-wrapper,
	.product-layout-wrapper {
		flex-direction: column !important;
		gap: 15px !important;
	}
	
	.product-images-column,
	.product-summary-column {
		max-width: 100% !important;
		width: 100% !important;
		flex: 1 1 100%;
	}
}

/* Ya no es necesario padding-bottom, se soluciona con max-height de imagen */

/* =============================================================================
   COLUMNA IZQUIERDA - IMÁGENES (STICKY)
   ============================================================================= */
.product-images-column {
    align-self: flex-start;
    z-index: 1;
}

/* Sticky en pantallas grandes, se detiene al 90% del wrapper */
@media (min-width: 1025px) {
    .product-images-column {
        position: sticky;
        top: 120px;
        max-height: calc(100vh - 140px);
        overflow: visible;
        /* Se detiene al 90% gracias al padding-bottom del wrapper */
    }
}

/* Imagen principal */
.woocommerce-product-gallery {
	margin: 0;
}

.woocommerce-product-gallery__wrapper {
	margin: 0;
}

.woocommerce-product-gallery__image {
	margin-bottom: 20px;
	border-radius: 30px;
	overflow: hidden;
}

.woocommerce-product-gallery__image img {
	width: 100%;
	height: auto;
	max-height: 43vw; /* Proporcional al ancho del viewport */
	object-fit: cover;
	display: block;
	border-radius: 16px;
}

/* En pantallas muy grandes, limitar para que no sea demasiado alta */
@media (min-width: 2000px) {
	.woocommerce-product-gallery__image img {
		max-height: 800px; /* Límite máximo en pantallas 4K */
	}
}

/* En mobile, aumentar proporción para mejor visualización */
@media (max-width: 768px) {
	.woocommerce-product-gallery__image img {
		max-height: 70vw; /* Más grande proporcionalmente en mobile */
	}
}

.woocommerce-product-gallery__trigger { display: none !important; }

/* Fondo de página */
body.single-product { background: #F9F9F9; }

/* Forzar visibilidad si algún script oculta la galería */
.woocommerce-product-gallery {
	opacity: 1 !important;
	visibility: visible !important;
}

/* Thumbnails - Flexbox 4 columnas */
.flex-control-thumbs {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
	margin-top: 15px;
	list-style: none;
	padding: 0;
}

.flex-control-thumbs .thumbnail-item,
.flex-control-thumbs li {
	flex: 0 1 calc(25% - 9px); /* 4 columnas con gap */
	margin: 0;
	cursor: pointer;
	border-radius: 10px;
	overflow: hidden;
	position: relative;
	aspect-ratio: 4 / 6;
}

.flex-control-thumbs img,
.thumbnail-image {
	width: 100%;
	height: 100%;
	object-fit: cover;
	border-radius: 10px;
	cursor: pointer;
	opacity: 0.6;
	transition: all 0.3s ease;
	border: 3px solid transparent;
	display: block;
}

.flex-control-thumbs img:hover,
.flex-control-thumbs img.flex-active,
.thumbnail-image:hover,
.thumbnail-image.flex-active {
	opacity: 1;
	border-color: var(--undetalle-primary);
	transform: scale(1.05);
}

/* =============================================================================
   COLUMNA DERECHA - INFORMACIÓN DEL PRODUCTO
   ============================================================================= */
.product-summary-column {
	padding: 0;
}

.summary.entry-summary {
	margin: 0;
}

/* Título del producto */
.woocommerce div.product .product_title,
.product_title {
	font-size: 2.2rem;
	font-weight: 700;
	margin-bottom: 15px;
	color: var(--undetalle-text);
	line-height: 1.3;
}

/* SKU */
.product-sku {
	font-size: 0.9rem;
	color: var(--undetalle-text-muted);
	margin-bottom: 10px;
	display: block;
}

.product-sku .sku-label {
	font-weight: 600;
	color: var(--undetalle-text-light);
}

/* Precio - Todo en una sola línea */
.price-wrapper {
	display: flex;
	align-items: center;
	gap: 15px;
	margin-bottom: 10px;
	flex-wrap: wrap;
}

.price-regular {
	color: var(--undetalle-text-muted);
	font-size: 1.8rem;
	font-weight: 600;
	text-decoration: line-through;
}

.price-sale,
.price-current {
	font-size: 1.8rem;
	font-weight: 700;
	color: var(--undetalle-primary);
}

.woocommerce div.product p.price,
.woocommerce div.product span.price,
p.price,
span.price {
	font-size: 2.5rem;
	font-weight: 700;
	color: var(--undetalle-primary);
	margin: 0;
	display: inline-block;
}

.price del {
	color: var(--undetalle-text-muted);
	margin-right: 12px;
	text-decoration: line-through;
}

.price ins {
	text-decoration: none;
}

/* Badge de descuento */
.discount-badge {
	display: inline-block;
	background: linear-gradient(135deg, #EC5970 0%, #e94562 100%);
	color: white;
	padding: 8px 16px;
	border-radius: 50px;
	font-size: 0.9rem;
	font-weight: 700;
}

/* Descripción corta con padding superior */
.woocommerce-product-details__short-description {
	margin-bottom: 10px;
	padding-top: 10px;
	line-height: 1.7;
	color: var(--undetalle-text-light);
	font-size: 1rem;
}

/* =============================================================================
   CAMPOS PERSONALIZADOS DE PRODUCTO
   ============================================================================= */
.product-field {
	margin-bottom: 25px;
	padding: 12px 16px 12px 16px;
	background: var(--undetalle-bg-light);
	border-radius: 14px;
	border: 2px solid #f0f0f0;
	transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.product-field:hover {
	border-color: rgba(236, 89, 112, 0.3);
	transform: translateY(-2px);
}

.product-field label {
	display: block;
	font-weight: 600;
	color: var(--undetalle-text);
	font-size: 1.05rem;
	margin-bottom:6px;
}

.photo-upload-field label{
		margin-bottom:14px;
}

/* Iconografía por sección */
.photo-upload-field > label::before { content: "📷 "; }
.complements-field > label::before { content: "🎁 "; }
.delivery-field > label:first-of-type::before { content: "📅 "; }
.delivery-field > label:nth-of-type(2)::before { content: "🕒 "; }

/* =============================================================================
   SUBIDA DE FOTO - FLEXBOX (IZQUIERDA: UPLOAD/PREVIEW, DERECHA: INFO)
   ============================================================================= */
.photo-upload-wrapper {
	display: flex;
	gap: 20px;
	align-items: flex-start;
}

.photo-upload-left {
	flex: 0 0 auto;
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.product-photo-upload {
	width: 120px;
	height: 120px;
	padding: 15px;
	border: 2px dashed var(--undetalle-primary);
	border-radius: 12px;
	background: white;
	cursor: pointer;
	text-align: center;
	transition: all 0.3s ease;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 8px;
}

.product-photo-upload:hover {
	background: #fff5f7;
	border-color: var(--undetalle-primary-hover);
	transform: translateY(-2px);
}

.product-photo-upload svg{
width: 100% !important;	
}

.product-photo-upload svg {
	width: 40px;
	height: 40px;
	stroke: var(--undetalle-primary);
}

.product-photo-upload .upload-label-text {
	font-weight: 600;
	color: var(--undetalle-primary);
	font-size: 0.9rem;
}

.photo-preview-thumbnail {
	width: 120px;
	height: 120px;
	border-radius: 12px;
	overflow: hidden;
	position: relative;
}

.photo-preview-thumbnail img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.remove-photo-btn {
	position: absolute;
	top: 5px;
	right: 5px;
	width: 28px;
	height: 28px;
	background: rgba(255, 255, 255, 0.95);
	border: none;
	border-radius: 50%;
	color: var(--undetalle-primary);
	font-size: 1.5rem;
	line-height: 1;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: all 0.3s ease;
	font-weight: 700;
}

.remove-photo-btn:hover {
	background: var(--undetalle-primary);
	color: white;
	transform: rotate(90deg);
}

.photo-upload-right {
	flex: 1;
	display: flex;
	align-items: center;
	min-height: 120px;
}

.upload-file-info {
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.upload-file-info .file-name {
	font-size: 1rem;
	color: var(--undetalle-text);
	font-weight: 600;
	word-break: break-word;
}

.upload-file-info .file-size {
	font-size: 0.85rem;
	color: var(--undetalle-text-muted);
}

/* =============================================================================
   COMPLEMENTOS (HORIZONTAL SCROLL)
   ============================================================================= */
.complements-section {
	margin-bottom: 30px;
}

.complements-horizontal-scroll {
	display: flex;
	gap: 16px;
	overflow-x: auto;
	scrollbar-width: thin;
	padding-top: 12px;
	scrollbar-color: var(--undetalle-primary) #f0f0f0;
}

.complements-horizontal-scroll::-webkit-scrollbar {
	height: 8px;
}

.complements-horizontal-scroll::-webkit-scrollbar-track {
	background: #f0f0f0;
	border-radius: 4px;
}

.complements-horizontal-scroll::-webkit-scrollbar-thumb {
	background: var(--undetalle-primary);
	border-radius: 4px;
}

.complement-item-horizontal {
	min-width: 150px;
	max-width: 150px;
	position: relative;
	flex-shrink: 0;
}

.complement-item-horizontal input[type="checkbox"] {
	position: absolute;
	opacity: 0;
	pointer-events: none;
}

.complement-item-horizontal label {
	display: flex;
	flex-direction: column;
	border: 2px solid var(--undetalle-border);
	border-radius: 14px;
	text-align: center;
	transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
	cursor: pointer;
	background: white;
	position: relative;
	overflow: visible;
}

.complement-item-horizontal label:hover {
	border-color: var(--undetalle-primary);
	transform: translateY(-4px);
}

.complement-item-horizontal input[type="checkbox"]:checked + label {
	border-color: var(--undetalle-primary);
	background: linear-gradient(135deg, rgba(236, 89, 112, 0.12) 0%, rgba(233, 69, 98, 0.06) 100%);
}

.complement-item-horizontal input[type="checkbox"]:checked + label::after {
	content: "✓";
	position: absolute;
	top: -8px;
	right: -8px;
	width: 28px;
	height: 28px;
	background: linear-gradient(135deg, #EC5970 0%, #e94562 100%);
	color: white;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 0.9rem;
	font-weight: 700;
	z-index: 10;
}

.complement-item-horizontal.out-of-stock {
	opacity: 0.4;
	pointer-events: none;
	filter: grayscale(1);
	position: relative;
}

.complement-item-horizontal.out-of-stock::after {
	content: "Agotado";
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%) rotate(-15deg);
	background: rgba(255, 0, 0, 0.9);
	color: white;
	padding: 5px 12px;
	border-radius: 20px;
	font-size: 0.75rem;
	font-weight: 700;
	z-index: 10;
}

.complement-image-wrapper {
	width: 100%;
	aspect-ratio: 1 / 1;
	display: flex;
	align-items: center;
	justify-content: center;
	margin-bottom: 12px;
	overflow: hidden;
	border-radius: 0;
}

.complement-item-horizontal .complement-image {
	width: 100%;
	height: 100%;
	object-fit: cover;
	border-radius: 0;
}

.complement-info {
	display: flex;
	flex-direction: column;
	gap: 0px;
}

.complement-item-horizontal .complement-name {
	font-size: 0.95rem;
	font-weight: 600;
	color: var(--undetalle-text);
}

.complement-item-horizontal .complement-price {
	font-size: 0.9rem;
	color: var(--undetalle-primary);
	font-weight: 700;
	display: block;
}

.complement-item-horizontal .complement-stock {
	font-size: 0.75rem;
	color: var(--undetalle-text-muted);
}

/* Legacy grid styles - CONVERTIDO A FLEXBOX */
.complements-grid {
	display: flex;
	flex-wrap: wrap;
	gap: 16px;
}

.complement-item {
	flex: 0 1 calc(25% - 12px); /* 4 columnas */
	min-width: 130px;
	border: 2px solid var(--undetalle-border);
	border-radius: 14px;
	padding: 14px;
	text-align: center;
	transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
	cursor: pointer;
	background: white;
	position: relative;
	overflow: hidden;
}

.complement-item::before {
	content: "";
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: linear-gradient(135deg, rgba(236, 89, 112, 0.05) 0%, rgba(233, 69, 98, 0.02) 100%);
	opacity: 0;
	transition: opacity 0.3s ease;
	z-index: 0;
}

.complement-item:hover::before {
	opacity: 1;
}

.complement-item:hover {
	border-color: var(--undetalle-primary);
	transform: translateY(-4px) scale(1.02);
}

.complement-item.selected {
	border-color: var(--undetalle-primary);
	background: linear-gradient(135deg, rgba(236, 89, 112, 0.12) 0%, rgba(233, 69, 98, 0.06) 100%);
}

.complement-item.selected::after {
	content: "✓";
	position: absolute;
	top: 8px;
	right: 8px;
	width: 24px;
	height: 24px;
	background: linear-gradient(135deg, #EC5970 0%, #e94562 100%);
	color: white;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 0.9rem;
	font-weight: 700;
}

.complement-item.out-of-stock {
	opacity: 0.4;
	pointer-events: none;
	filter: grayscale(1);
	position: relative;
}

.complement-item.out-of-stock::after {
	content: "Agotado";
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%) rotate(-15deg);
	background: rgba(255, 0, 0, 0.9);
	color: white;
	padding: 5px 12px;
	border-radius: 20px;
	font-size: 0.75rem;
	font-weight: 700;
	z-index: 10;
}

.complement-item label {
	cursor: pointer;
	margin: 0;
	display: block;
	position: relative;
	z-index: 1;
}

.complement-item input[type="checkbox"] {
	display: none;
}

.complement-image {
	width: 100%;
	aspect-ratio: 1 / 1;
	object-fit: cover;
	border-radius: 0;
	margin-bottom: 0px;
}

.complement-name {
	font-size: 0.95rem;
	font-weight: 600;
	margin-bottom: 6px;
	color: var(--undetalle-text);
}

.complement-price {
	font-size: 0.9rem;
	color: var(--undetalle-primary);
	font-weight: 700;
	display: block;
}

.complement-stock {
	font-size: 0.75rem;
	color: var(--undetalle-text-muted);
}

.complement-stock.low-stock {
	color: #ff6b6b;
	font-weight: 600;
	animation: pulse 1.5s infinite;
}

@keyframes pulse {
	0%, 100% { opacity: 1; }
	50% { opacity: 0.6; }
}

/* =============================================================================
   FECHA Y HORA DE ENTREGA
   ============================================================================= */
.delivery-section {
	margin-bottom: 30px;
}

.delivery-options {
	display: flex;
	gap: 14px;
	margin-bottom: 8px;
}

.delivery-option {
	flex: 1;
	position: relative;
}

.delivery-option input[type="radio"] {
	display: none;
}

.delivery-option label {
	display: block;
	padding: 20px 22px;
	border: 3px solid var(--undetalle-border);
	border-radius: 14px;
	text-align: center;
	cursor: pointer;
	transition: all 0.3s ease;
	background: white;
	font-weight: 700;
	font-size: 1.05rem;
	color: var(--undetalle-text);
	position: relative;
	min-height: 85px;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
}

.delivery-option label small {
	display: block;
	margin-top: 6px;
	font-weight: 700;
	font-size: 0.9rem;
	opacity: 0.8;
}

.delivery-option label:hover {
	border-color: var(--e-primary);
	transform: translateY(-3px);
}

.delivery-option input[type="radio"]:checked + label {
	border-color: var(--e-primary);
	background: var(--e-primary);
	color: white;
	transform: translateY(-2px);
}

.delivery-option input[type="radio"]:checked + label small {
	color: rgba(255, 255, 255, 0.95);
	opacity: 1;
}

.delivery-option input[type="radio"]:checked + label::before {
	content: "✓";
	position: absolute;
	top: -10px;
	right: -10px;
	width: 30px;
	height: 30px;
	background: white;
	color: var(--undetalle-primary);
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 1rem;
	font-weight: 700;
	z-index: 10;
}

/* Input de otra fecha estilizado - SIEMPRE VISIBLE Y MEJORADO */
.delivery-option input[type="date"] {
    width: 100%;
    margin-top: 8px;
    padding: 4px 10px;
    border: 3px solid #e0e0e0;
    border-radius: 12px;
    background: white;
    font-weight: 600;
	color: var(--undetalle-text);
	transition: all 0.3s ease;
	font-size: 0.95rem;
	cursor: pointer;
}

.delivery-option input[type="date"]:hover {
	border-color: var(--undetalle-primary);
}

.delivery-option input[type="date"]:focus {
	outline: none;
	border-color: var(--undetalle-primary);
}

.delivery-option input[type="radio"]:checked + label input[type="date"] {
	border-color: rgba(255, 255, 255, 0.6);
	background: rgba(255, 255, 255, 0.25);
	color: white;
	font-weight: 700;
}

.delivery-option input[type="date"]::-webkit-calendar-picker-indicator {
	cursor: pointer;
	width: 24px;
	height: 24px;
	opacity: 0.7;
	transition: all 0.3s ease;
}

.delivery-option input[type="date"]::-webkit-calendar-picker-indicator:hover {
	opacity: 1;
	transform: scale(1.1);
}

.delivery-option input[type="radio"]:checked + label input[type="date"]::-webkit-calendar-picker-indicator {
	filter: brightness(0) invert(1);
	opacity: 1;
}

/* Rangos horarios - FLEXBOX */
.time-ranges {
	display: flex;
	gap: 14px;
	margin-top: 12px;
	flex-wrap: wrap;
}

.time-range {
	flex: 1;
	min-width: 150px;
	padding: 8px 12px;
	border: 3px solid var(--undetalle-border);
	border-radius: 12px;
	text-align: center;
	cursor: pointer;
	transition: all 0.3s ease;
	background: white;
	font-size: 1rem;
	font-weight: 600;
	color: var(--undetalle-text);
}

.time-range:hover:not(.disabled) {
	border-color: var(--e-primary);
	background: rgba(236, 89, 112, 0.05);
	transform: translateY(-2px);
}

.time-range.selected {
	border-color: var(--e-primary);
	background: var(--e-primary);
	color: white;
	font-weight: 700;
	transform: translateY(-1px);
}

/* IMPORTANTE: Mantener el estilo rosado al hacer hover sobre un elemento seleccionado */
.time-range.selected:hover {
	border-color: var(--e-primary);
	background: var(--e-primary);
	color: white;
	transform: translateY(-1px);
}

.time-range.disabled {
	opacity: 0.3;
	cursor: not-allowed;
	pointer-events: none;
	background: #f5f5f5;
	color: #999;
}

/* Opciones deshabilitadas */
.delivery-option input[type="radio"]:disabled + label,
label.disabled-option {
	opacity: 0.4;
	cursor: not-allowed;
	pointer-events: none;
	background: #f5f5f5 !important;
	color: #999 !important;
	border-color: #ddd !important;
}

.delivery-option input[type="radio"]:disabled + label small,
label.disabled-option small {
	color: #aaa !important;
}

/* =============================================================================
   MENSAJE PARA TARJETA
   ============================================================================= */
.card-message-field label::before {
	content: "💌 ";
}

.card-message-field textarea {
	width: 100%;
	min-height: 110px;
	height: 110px;
	border: 2px solid #f0f0f0;
	border-radius: 10px;
	resize: vertical;
	font-size: 1rem;
	line-height: 1.6;
	transition: all 0.3s ease;
	background: white;
	color: var(--undetalle-text);
}

.card-message-field textarea:focus {
	outline: none;
	border-color: var(--undetalle-primary);
}

.card-message-field textarea::placeholder {
	color: var(--undetalle-text-muted);
	font-style: italic;
}

/* Contador de caracteres */
.card-message-counter {
	text-align: right;
	font-size: 0.85rem;
	color: var(--undetalle-text-muted);
	margin-top: 6px;
	font-weight: 600;
}

.card-message-counter.limit-reached {
	color: var(--undetalle-primary);
}

/* =============================================================================
   TEXTO PERSONALIZADO
   ============================================================================= */
.custom-text-field {
	background: linear-gradient(135deg, rgba(236, 89, 112, 0.08) 0%, rgba(233, 69, 98, 0.04) 100%);
	border-color: rgba(236, 89, 112, 0.2);
}

.custom-text-field label::before {
	content: "✏️ ";
}

.custom-text-field input[type="text"] {
	width: 100%;
	padding: 12px 16px;
	border: 2px solid #f0f0f0;
	border-radius: 10px;
	font-size: 1rem;
	transition: all 0.3s ease;
	background: white;
	color: var(--undetalle-text);
}

.custom-text-field input[type="text"]:focus {
	outline: none;
	border-color: var(--undetalle-primary);
}

.custom-text-field input[type="text"]::placeholder {
	color: var(--undetalle-text-muted);
	font-style: italic;
}

.custom-text-info {
	font-size: 0.85rem;
	color: var(--undetalle-text-muted);
	margin-top: 6px;
	font-weight: 600;
}


/* =============================================================================
   CANTIDAD
   ============================================================================= */
.quantity-field {
	display: flex;
	align-items: center;
	gap: 18px;
	background: white;
	padding: 4px 12px;
	border-radius: 12px;
	border: 2px solid var(--undetalle-border);
	margin-bottom: 12px;
}

.quantity-field label {
	margin-bottom: 0;
	flex-shrink: 0;
	font-size: 1.05rem;
	font-weight: 600;
}

.quantity-controls {
	display: flex;
	align-items: center;
	gap: 12px;
	border-radius: 10px;
	padding: 8px 12px;
}

.qty-button {
	width: 40px;
	height: 40px;
	border: 2px solid var(--undetalle-primary);
	background: white;
	color: var(--undetalle-primary);
	border-radius: 8px;
	font-size: 1.5rem;
	font-weight: 700;
	cursor: pointer;
	transition: all 0.3s ease;
	display: flex;
	align-items: center;
	justify-content: center;
	line-height: 1;
	padding: 0;
}

.qty-button:hover {
	background: var(--undetalle-primary);
	color: white;
	transform: scale(1.1);
}

.qty-button:active {
	transform: scale(0.95);
}

.quantity-field .quantity {
	display: contents;
}

.quantity-field input[type="number"] {
	width: 80px;
	padding: 10px;
	border: 2px solid var(--undetalle-border);
	border-radius: 8px;
	text-align: center;
	font-size: 1.2rem;
	font-weight: 700;
	color: var(--undetalle-text);
	background: white;
}

.quantity-field input[type="number"]:focus {
	outline: none;
	border-color: var(--undetalle-primary);
}

/* =============================================================================
   BOTONES DE ACCIÓN
   ============================================================================= */
.product-buttons {
	display: flex;
	gap: 16px;
	margin-top: 12px;
}

/* Precio final */
.final-price {
    margin: 12px 0 6px;
    font-size: 1.3rem;
    color: #242424;
	font-weight: 600;
}
.final-price .amount { 
	color: var(--undetalle-primary); 
	font-weight: 800; 
	margin-left: 8px; 
	font-size: 1.5rem;
}

.product-buttons .button {
	flex: 1;
	padding: 20px 35px;
	border: none;
	border-radius: 50px;
	font-size: 1.1rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.8px;
	cursor: pointer;
	transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
	text-align: center;
	text-decoration: none;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	position: relative;
	overflow: hidden;
}

.product-buttons .button::before {
	content: "";
	position: absolute;
	top: 50%;
	left: 50%;
	width: 0;
	height: 0;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.3);
	transform: translate(-50%, -50%);
	transition: width 0.6s, height 0.6s;
}

.product-buttons .button:hover::before {
	width: 300px;
	height: 300px;
}

/* Compartir con íconos SVG */
.product-share {
    margin-top: 18px;
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--undetalle-text);
}

.product-share strong {
	font-weight: 600;
	margin-right: 5px;
}

.product-share .share-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #e0e0e0;
    color: #666;
    transition: all 0.3s ease;
	text-decoration: none;
}

.product-share .share-btn:hover {
    background: #EC5970;
    color: white;
    transform: translateY(-3px);
}

.product-share .share-btn svg {
	width: 18px;
	height: 18px;
	fill: currentColor;
}

/* Botón "Seguir Comprando" - Secundario */
.button.continue-shopping {
	background: white;
	color: var(--undetalle-primary);
	border: 2px solid var(--undetalle-primary);
	position: relative;
	z-index: 1;
	flex: 0.8;
}

.button.continue-shopping:hover {
	background: rgba(236, 89, 112, 0.1);
	color: var(--undetalle-primary);
	transform: translateY(-2px);
}

/* Botón "IR A PAGAR" - PRIMARIO (MÁS GRANDE Y DESTACADO) */
.button.go-to-checkout {
	background: linear-gradient(135deg, #EC5970 0%, #e94562 100%);
	color: white;
	position: relative;
	z-index: 1;
	flex: 1.3;
	font-size: 1.2rem;
	padding: 22px 40px;
}

.button.go-to-checkout:hover {
	background: linear-gradient(135deg, #e94562 0%, #d63851 100%);
	transform: translateY(-4px);
}

.button.go-to-checkout:active {
	transform: translateY(-2px);
}

/* =============================================================================
   DESCRIPCIÓN DEL PRODUCTO (TÍTULO CENTRADO + 2 COLUMNAS)
   ============================================================================= */
.product-description-section {
	margin-top: 40px;
	clear: both !important;
	width: 100%;
	position: relative;
	z-index: 2;
	display: block;
	/* margin-top se calcula dinámicamente con JavaScript en pantallas grandes */
}

.description-header {
	text-align: center;
	margin-bottom: 10px;
}

.description-header h2 {
	font-size: 2.2rem;
	color: var(--undetalle-text);
	font-weight: 700;
	position: relative;
	display: inline-block;
	padding-bottom: 15px;
}

.description-header h2::after {
	content: "";
	position: absolute;
	bottom: 0;
	left: 50%;
	transform: translateX(-50%);
	width: 80px;
	height: 5px;
	background: linear-gradient(90deg, #EC5970 0%, #e94562 100%);
	border-radius: 3px;
}

.product-description-wrapper {
	padding: 55px 40px;
	background: linear-gradient(135deg, #f9f9f9 0%, #f5f5f5 100%);
	border-radius: 18px;
	display: flex;
	gap: 50px;
}

.description-left,
.description-right {
	flex: 1;
	line-height: 1.9;
	color: var(--undetalle-text-light);
	font-size: 1.05rem;
}

.description-left p,
.description-right p {
	margin-bottom: 18px;
}

.description-left ul,
.description-right ul {
	padding-left: 25px;
	margin-bottom: 18px;
}

.description-left li,
.description-right li {
	margin-bottom: 10px;
	list-style-type: disc;
	margin-left: 20px;
}

/* =============================================================================
   PRODUCTOS RELACIONADOS
   ============================================================================= */
.related-products-section {
	margin-top: 30px;
	padding-top: 30px;
	border-top: 3px solid #f0f0f0;
}

.related-products-section h2 {
	text-align: center;
	font-size: 2.2rem;
	margin-bottom: 50px;
	color: var(--undetalle-text);
	font-weight: 700;
	position: relative;
	padding-bottom: 20px;
}

.related-products-section h2::after {
	content: "";
	position: absolute;
	bottom: 0;
	left: 50%;
	transform: translateX(-50%);
	width: 80px;
	height: 5px;
	background: linear-gradient(90deg, #EC5970 0%, #e94562 100%);
	border-radius: 3px;
}

.related-products-grid {
	display: flex;
	gap: 35px;
	flex-wrap: wrap;
}

.related-product-item {
	flex: 0 1 calc(25% - 27px); /* 4 columnas */
	min-width: 200px;
	text-align: center;
	transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
	border-radius: 16px;
	background: white;
	border: 2px solid transparent;
}

.related-product-item:hover {
	transform: translateY(-8px);
	border-color: rgba(236, 89, 112, 0.2);
}

.related-product-item a {
	text-decoration: none;
	color: inherit;
}

.related-product-thumb {
	display: block;
	position: relative;
	width: 100%;
	aspect-ratio: 4 / 6;
	border-radius: 14px;
	overflow: hidden;
	margin-bottom: 18px;
}

.related-product-thumb .product-media-stack,
.related-product-thumb .related-product-media {
	position: relative;
	display: block;
	width: 100%;
	height: 100%;
	border-radius: inherit;
	overflow: hidden;
}

.related-product-thumb .product-media {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: opacity 0.45s ease, transform 0.45s ease;
}

.related-product-thumb .product-media--secondary {
	opacity: 0;
	transform: scale(1.05);
}

.related-product-item .price{
	text-align: left !important;
	display: flex !important;
	font-size: 19px !important;
	color: #242424 !important;
}

.related-product-item:hover .related-product-thumb .product-media--primary {
	transform: scale(1.05);
}

.related-product-item:hover .related-product-thumb .product-media-stack.has-secondary .product-media--primary,
.related-product-item:hover .related-product-thumb .related-product-media.has-secondary .product-media--primary {
	opacity: 0;
	transform: scale(0.96);
}

.related-product-item:hover .related-product-thumb .product-media-stack.has-secondary .product-media--secondary,
.related-product-item:hover .related-product-thumb .related-product-media.has-secondary .product-media--secondary {
	opacity: 1;
	transform: scale(1.02);
}

.related-product-item h3 {
	font-size: 1.1rem;
	margin-bottom: 12px;
	color: var(--undetalle-text);
	font-weight: 600;
	line-height: 1.4;
	text-align: left;
}

.related-product-item .price {
	font-size: 1.3rem;
	color: var(--undetalle-primary);
	font-weight: 700;
	margin: 0;
}

/* =============================
   SHARE
   ============================= */
.product-share {
	margin-top: 18px;
	display: flex;
	align-items: center;
	gap: 10px;
}

.product-share .share-label {
	font-weight: 600;
	color: #666;
}

.product-share .share-icon {
	width: 36px;
	height: 36px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	background: #f3f3f3;
	color: #EC5970;
	border-radius: 50%;
	text-decoration: none;
	transition: transform 0.2s ease, background 0.2s ease;
}

/* Compatibilidad con markup .share-btn ya presente */
.product-share .share-btn {
	width: 36px;
	height: 36px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	background: #f3f3f3;
	color: #EC5970;
	border-radius: 50%;
	text-decoration: none;
	font-weight: 700;
}

.product-share .share-icon:hover {
	transform: translateY(-2px);
	background: #ffe6eb;
}

/* =============================
   RIGHT DESCRIPTION: How it arrives
   ============================= */
.right-description-image {
	width: 100%;
	height: auto;
	border-radius: 16px;
	display: block;
	margin-bottom: 16px;
}

.how-it-arrives {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 10px;
}

.how-it-arrives .arrive-step {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 8px;
	padding: 12px;
	background: #fff;
	border: 1px solid #eee;
	border-radius: 12px;
	color: #EC5970;
}

.how-it-arrives .arrive-step span {
	color: #666;
	font-weight: 600;
	font-size: 12px;
}

/* =============================================================================
   SOLUCIÓN: Espacio dinámico calculado por JavaScript
   ============================================================================= */
/* El margin-top se calcula dinámicamente en main.js */

/* =============================================================================
   RESPONSIVE - TABLET
   ============================================================================= */
@media (max-width: 1024px) {
	.product-layout-wrapper {
		flex-direction: column !important;
		gap: 35px !important;
	}

	.product-images-column,
	.product-summary-column {
		max-width: 100% !important;
		width: 100% !important;
	}

	.product-images-column {
		position: relative !important;
		top: 0 !important;
		max-height: none !important;
	}

	.product-description-section {
		margin-top: 50px;
	}

	.product-description-wrapper {
		flex-direction: column;
		padding: 40px 30px;
		gap: 35px;
	}

	.related-products-grid {
		gap: 20px;
	}

	.related-product-item {
		flex: 0 1 calc(50% - 10px); /* 2 columnas en tablet */
		min-width: 0;
	}

	.complements-grid {
		grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
	}

	.delivery-options {
		gap: 12px;
		flex-wrap: wrap;
	}

	.time-ranges {
		flex-wrap: wrap;
	}

	.time-range {
		flex: 1 1 calc(50% - 7px);
		min-width: 140px;
	}

	.type-product{
		display: block !important;;
	}
}

/* =============================================================================
   RESPONSIVE - MOBILE
   ============================================================================= */
@media (max-width: 768px) {
	/* CRÍTICO: Selector universal para prevenir overflow */
	* {
		max-width: 100vw;
		box-sizing: border-box;
	}
	
	/* Prevenir overflow horizontal */
	html, body {
		overflow-x: hidden !important;
		max-width: 100vw;
		width: 100%;
	}
	
	body.single-product {
		overflow-x: hidden !important;
	}
	
	/* Sobrescribir max-width con IGUAL especificidad */
	body.single-product div.product,
	body.woocommerce div.product,
	.woocommerce div.product,
	div.product,
	.product {
		max-width: 100% !important;
		padding: 2px !important;
		width: 100%;
	}
	
	/* FORZAR 1 columna en mobile */
	.product-layout-wrapper {
		flex-direction: column !important;
		padding-left: 1px !important;
		padding-right: 1px !important;
		gap: 15px !important;
		max-width: 100% !important;
	}
	
	/* Columnas 100% width en mobile */
	.product-images-column,
	.product-summary-column {
		max-width: 100% !important;
		width: 100% !important;
		flex: 1 1 100%;
	}
	
	/* Breadcrumb más pequeño */
	.product-breadcrumb {
		font-size: 0.8rem;
		margin-bottom: 10px;
	}
	
	/* Galería 100% responsive */
	.woocommerce-product-gallery {
		width: 100% !important;
		max-width: 100% !important;
	}
	
	.woocommerce-product-gallery__wrapper {
		width: 100% !important;
		max-width: 100% !important;
	}
	
	/* Imagen principal responsive */
	.woocommerce-product-gallery__image {
		margin-bottom: 15px;
		border-radius: 20px;
		width: 100% !important;
		max-width: 100% !important;
	}
	
	.woocommerce-product-gallery__image img {
		max-width: 100% !important;
		width: 100% !important;
		height: auto !important;
		max-height: 490px !important;
		border-radius: 12px;
		object-fit: cover;
	}
	
	/* Miniaturas - 4 columnas compactas */
	.flex-control-thumbs {
		gap: 5px;
		margin-top: 10px;
		width: 100%;
	}
	
	.flex-control-thumbs .thumbnail-item,
	.flex-control-thumbs li {
		flex: 0 1 calc(25% - 4px); /* 4 columnas compactas */
		max-width: calc(25% - 4px);
	}
	
	.flex-control-thumbs img {
		border: 2px solid transparent;
	}
	
	/* Títulos y textos */
	.product_title {
		font-size: 1.4rem;
		margin-bottom: 8px;
		line-height: 1.2;
	}
	
	.product-sku {
		font-size: 0.75rem;
		margin-bottom: 8px;
	}

	/* Precios más compactos */
	.price-wrapper {
		gap: 10px;
		margin-bottom: 8px;
	}

	.price {
		font-size: 22px !important;;
	}
	
	.discount-badge {
		font-size: 0.75rem;
		padding: 6px 12px;
	}
	
	/* Descripción corta */
	.woocommerce-product-details__short-description {
		font-size: 0.9rem;
		padding-top: 5px;
		margin-bottom: 15px;
	}

	.product-buttons {
		flex-direction: column;
		gap: 12px;
	}

	.product-buttons .button {
		padding: 16px 25px;
		font-size: 1rem;
		flex: 1 !important;
	}

	.delivery-options {
		flex-direction: column;
		gap: 10px;
	}

	.delivery-option {
		flex: 1 1 100%;
	}

	.delivery-option label {
		padding: 14px 16px;
		font-size: 0.95rem;
	}

	.time-ranges {
		flex-direction: column;
		gap: 10px;
	}

	.time-range {
		padding: 12px 16px;
		font-size: 0.9rem;
		flex: 1 1 100%;
	}

	/* Complementos - mejor visualización en mobile */
	.complements-horizontal-scroll {
		gap: 10px;
		padding-bottom: 10px;
	}
	
	.complement-item-horizontal {
		min-width: 130px;
		max-width: 130px;
	}
	
	.complement-item-horizontal label {
		padding: 10px;
	}
	
	.complement-image-wrapper {
		aspect-ratio: 1 / 1;
		margin-bottom: 8px;
	}
	
	.complement-item-horizontal .complement-image {
		height: 100%;
	}
	
	.complement-item-horizontal .complement-name {
		font-size: 0.8rem;
		min-height: 32px;
	}
	
	.complement-item-horizontal .complement-price {
		font-size: 0.75rem;
	}
	
	.complement-item-horizontal .complement-stock {
		font-size: 0.7rem;
	}
	
	/* Grid fallback para complementos */
	.complements-grid {
		grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
		gap: 10px;
	}

	.complement-item {
		padding: 10px;
	}

	.complement-image {
		aspect-ratio: 1 / 1;
	}

	.complement-name {
		font-size: 0.8rem;
	}

	.complement-price {
		font-size: 0.75rem;
	}

	.product-description-section {
		margin-top: 40px;
	}

	.product-description-wrapper {
		padding: 30px 20px;
	}

	.product-description-wrapper h2 {
		font-size: 1.5rem;
	}

	.description-left,
	.description-right {
		font-size: 0.95rem;
	}

	.related-products-grid {
		flex-direction: row;
		flex-wrap: wrap;
		gap: 15px;
	}

	.related-product-item {
		flex: 0 1 calc(50% - 8px); /* 2 columnas en móvil */
		min-width: 0;
		max-width: calc(50% - 8px);
	}

	.related-product-item a{
		display: block;
		width: 100%;
	}

	.related-products-section h2 {
		font-size: 1.8rem;
		margin-bottom: 30px;
	}

	/* Campos de producto más compactos */
	.product-field {
		padding: 15px;
		margin-bottom: 15px;
		border-radius: 12px;
	}
	
	.product-field label {
		font-size: 0.95rem;
		margin-bottom: 8px;
	}
	
	/* Subida de foto responsive */
	.photo-upload-wrapper {
		flex-direction: column;
		gap: 15px;
	}
	
	.product-photo-upload {
		width: 100%;
		height: 100px;
	}
	
	.photo-preview-thumbnail {
		width: 100px;
		height: 100px;
	}
	
	/* Cantidad más compacta */
	.quantity-field {
		padding: 15px;
	}
	
	.quantity-field label {
		font-size: 0.95rem;
	}
	
	.quantity-controls {
		justify-content: center;
	}
	
	.qty-button {
		width: 36px;
		height: 36px;
		font-size: 1.3rem;
	}
	
	.quantity-field input[type="number"] {
		width: 70px;
		font-size: 1.1rem;
	}
	
	/* Botones de acción */
	.product-buttons .button {
		padding: 14px 20px;
		font-size: 0.95rem;
		border-radius: 40px;
	}
	
	/* Precio final */
	.final-price {
		font-size: 1.1rem;
		margin: 10px 0 8px;
	}
	
	.final-price .amount {
		font-size: 1.3rem;
	}
	
	/* Compartir */
	.product-share {
		margin-top: 15px;
		gap: 8px;
	}
	
	.product-share .share-btn {
		width: 34px;
		height: 34px;
	}
}

/* =============================================================================
   ANIMATIONS
   ============================================================================= */
@keyframes fadeInUp {
	from {
		opacity: 0;
		transform: translateY(30px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

.product-layout-wrapper {
	animation: fadeInUp 0.6s ease-out;
}

.product-field {
	animation: fadeInUp 0.6s ease-out;
	animation-fill-mode: both;
}

.product-field:nth-child(1) { animation-delay: 0.1s; }
.product-field:nth-child(2) { animation-delay: 0.2s; }
.product-field:nth-child(3) { animation-delay: 0.3s; }
.product-field:nth-child(4) { animation-delay: 0.4s; }
.product-field:nth-child(5) { animation-delay: 0.5s; }
