/* Sistema de Devoluciones - Frontend */

/* Icono para "Mis devoluciones" en menú woocommerce-MyAccount-navigation */
.woocommerce-MyAccount-navigation li.woocommerce-MyAccount-navigation-link--mis-devoluciones a::before,
.woocommerce-MyAccount-navigation li.sdw-menu-devoluciones a::before,
nav.woocommerce-MyAccount-navigation li.woocommerce-MyAccount-navigation-link--mis-devoluciones a::before,
nav.woocommerce-MyAccount-navigation li.sdw-menu-devoluciones a::before,
.woocommerce-account .woocommerce-MyAccount-navigation li.woocommerce-MyAccount-navigation-link--mis-devoluciones a::before,
.woocommerce-account .woocommerce-MyAccount-navigation li.sdw-menu-devoluciones a::before {
	content: "" !important;
	display: inline-block !important;
	width: 20px !important;
	height: 20px !important;
	min-width: 20px !important;
	margin-right: 10px !important;
	vertical-align: middle !important;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23666' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 10h10a8 8 0 0 1 8 8v2M3 10l6 6M3 10l6-6'/%3E%3C/svg%3E") !important;
	background-size: contain !important;
	background-repeat: no-repeat !important;
	background-position: center !important;
	opacity: 0.85;
}

.woocommerce-MyAccount-navigation li.woocommerce-MyAccount-navigation-link--mis-devoluciones a:hover::before,
.woocommerce-MyAccount-navigation li.sdw-menu-devoluciones a:hover::before {
	opacity: 1;
}

.sdw-boton-contenedor {
	margin: 15px 0;
}

.sdw-boton-producto {
	margin-top: 8px;
}

.sdw-boton-devolucion.sdw-boton-mini {
	font-size: 0.9em;
	padding: 4px 10px;
	text-align: center;
}

.sdw-boton-contenedor.sdw-deshabilitado button,
.sdw-boton-producto.sdw-deshabilitado button {
	opacity: 0.6;
	cursor: not-allowed;
}

.sdw-boton-pedido-completo {
	display: inline-block;
}

.sdw-boton-descripcion {
	margin: 8px 0 0;
	font-size: 0.9em;
	color: #666;
	line-height: 1.4;
}

/* Modal de cámara (ordenador y móvil) */
.sdw-camara-overlay {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background: rgba(0,0,0,0.8);
	z-index: 1000000;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 15px;
}

.sdw-camara-modal {
	background: #fff;
	border-radius: 8px;
	padding: 16px;
	max-width: 100%;
	width: 100%;
	max-width: 400px;
}

.sdw-camara-titulo {
	margin: 0 0 12px;
	font-size: 1.1em;
	font-weight: 600;
}

.sdw-camara-video-wrap {
	position: relative;
	width: 100%;
	aspect-ratio: 4/3;
	background: #000;
	border-radius: 6px;
	overflow: hidden;
	margin-bottom: 12px;
}

.sdw-camara-video-wrap video {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.sdw-camara-botones {
	display: flex;
	gap: 10px;
	justify-content: center;
}

.sdw-camara-botones .button {
	flex: 1;
}

.sdw-camara-capturar {
	background: #e67e22 !important;
	color: #fff !important;
	border-color: #d35400 !important;
}

.sdw-camara-capturar:hover {
	background: #d35400 !important;
	color: #fff !important;
}

/* Vale inline (No me gusta / Ya no lo necesito) - mensaje y botón en el mismo formulario */
.sdw-vale-inline {
	margin: 12px 0;
	padding: 16px 0;
	border-top: 1px solid #eee;
}

.sdw-vale-inline .sdw-vale-mensaje {
	margin: 0 0 16px;
	line-height: 1.6;
	color: #333;
	font-size: 1em;
}

.sdw-vale-inline .sdw-vale-btn-enviar {
	background: #e67e22 !important;
	color: #fff !important;
	border-color: #d35400 !important;
	padding: 10px 20px;
}

.sdw-vale-inline .sdw-vale-btn-enviar:hover {
	background: #d35400 !important;
	color: #fff !important;
}

/* Vista vale de devolución (legacy - ya no se usa, se mantiene por compatibilidad) */
.sdw-vale-vista {
	padding: 10px 0;
}

.sdw-vale-vista .sdw-vale-titulo {
	margin: 0 0 16px;
	font-size: 1.25em;
	font-weight: 600;
	color: #333;
	text-align: center;
}

.sdw-vale-vista .sdw-vale-mensaje {
	margin: 0 0 20px;
	line-height: 1.6;
	color: #333;
	font-size: 1em;
}

.sdw-vale-vista .sdw-vale-botones {
	margin-top: 16px;
	text-align: center;
}

.sdw-vale-vista .sdw-vale-btn-accion {
	background: #e67e22 !important;
	color: #fff !important;
	border-color: #d35400 !important;
	padding: 10px 20px;
}

.sdw-vale-vista .sdw-vale-btn-accion:hover {
	background: #d35400 !important;
	color: #fff !important;
}

.sdw-vale-vista .sdw-vale-resultado {
	margin-top: 16px;
	padding-top: 16px;
	border-top: 1px solid #eee;
}

.sdw-vale-vista .sdw-vale-exito {
	margin: 0 0 10px;
	color: #2e7d32;
}

.sdw-vale-vista .sdw-vale-codigo {
	margin: 0;
	display: flex;
	align-items: center;
	gap: 10px;
	flex-wrap: wrap;
}

.sdw-vale-vista .sdw-vale-codigo code,
.sdw-vale-vista .sdw-vale-codigo .sdw-vale-codigo-texto {
	background: #f5f5f5;
	padding: 8px 12px;
	border-radius: 4px;
	font-size: 1.1em;
	font-weight: 600;
}

.sdw-vale-vista .sdw-vale-copiar {
	font-size: 0.9em;
}

/* Lightbox / Modal */
.sdw-lightbox-overlay {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background: rgba(0,0,0,0.6);
	z-index: 999999;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
}

.sdw-lightbox-content {
	background: #fff;
	max-width: 500px;
	width: 100%;
	max-height: 90vh;
	overflow-y: auto;
	padding: 20px;
	border-radius: 4px;
	box-shadow: 0 4px 20px rgba(0,0,0,0.2);
}

.sdw-lightbox-content .sdw-titulo {
	margin: 0 0 12px;
	font-size: 1.1em;
	line-height: 50px !important;
	font-weight: 400 !important;
}

.sdw-lightbox-content .sdw-campo {
	margin-bottom: 10px;
}

.sdw-lightbox-content .sdw-campo:last-of-type {
	margin-bottom: 0;
}

.sdw-lightbox-content .sdw-campo > label:not(.sdw-btn-icono) {
	display: block;
	margin-bottom: 4px;
	font-weight: 600;
	font-size: 0.95em;
}

.sdw-lightbox-content select {
	width: 100%;
	padding: 8px 10px;
	border: 1px solid #ddd;
	border-radius: 3px;
	font-size: 1em;
}

.sdw-lightbox-content textarea {
	width: 100%;
	padding: 8px 10px;
	border: 1px solid #ddd;
	border-radius: 3px;
	line-height: 1.4;
	min-height: 80px;
}

/* Input file: cubre todo el label, transparente. El clic va directo al input (mejor para capture/cámara) */
.sdw-input-hidden {
	position: absolute !important;
	left: 0 !important;
	top: 0 !important;
	width: 100% !important;
	height: 100% !important;
	margin: 0 !important;
	padding: 0 !important;
	opacity: 0 !important;
	cursor: pointer !important;
	border: none !important;
}

.sdw-fotos-opciones {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
	margin-bottom: 16px;
}

.sdw-fotos-opciones .sdw-btn-icono {
	min-width: 120px;
}

.sdw-btn-icono {
	display: flex !important;
	flex-direction: column !important;
	align-items: center !important;
	justify-content: center !important;
	gap: 8px;
	flex: 1;
	min-height: 90px;
	padding: 12px 16px;
	background: #fff;
	border: 1px solid #e0e8f0;
	border-radius: 8px;
	cursor: pointer;
	transition: border-color 0.2s, box-shadow 0.2s;
	margin: 0;
	text-align: center !important;
	width: 100%;
	box-sizing: border-box;
	position: relative;
}

.sdw-btn-icono:disabled {
	opacity: 0.6;
	cursor: not-allowed;
}

#sdw-campo-fotos.sdw-fotos-max .sdw-btn-icono {
	opacity: 0.6;
	cursor: not-allowed;
	pointer-events: none;
}

.sdw-btn-icono:hover {
	border-color: #c5d4e8;
	box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.sdw-icono {
	display: flex !important;
	align-items: center !important;
	justify-content: center !important;
	width: 36px;
	height: 36px;
	flex-shrink: 0;
	margin: 0 auto;
}

.sdw-icono svg {
	width: 100%;
	height: 100%;
	display: block;
	vertical-align: middle;
}

/* Cámara: mismo aspecto que Elegir archivos (evitar estilos de button/theme) */
.sdw-btn-camara {
	background: #fff !important;
	border: 1px solid #e0e8f0 !important;
	outline: none !important;
}

.sdw-btn-camara:focus,
.sdw-btn-camara:active {
	background: #fff !important;
	border-color: #e0e8f0 !important;
	outline: none !important;
}

.sdw-btn-camara .sdw-icono,
.sdw-btn-camara .sdw-btn-texto {
	color: #5d6d7e;
}

.sdw-btn-camara:hover {
	border-color: #e67e22 !important;
	box-shadow: 0 2px 8px rgba(230, 126, 34, 0.2);
	background: #fff !important;
}

.sdw-btn-camara:hover .sdw-icono,
.sdw-btn-camara:hover .sdw-btn-texto {
	color: #e67e22;
}

/* Explorar archivos: mismo aspecto que Cámara */
.sdw-btn-archivos {
	background: #fff !important;
	border: 1px solid #e0e8f0 !important;
	outline: none !important;
}

.sdw-btn-archivos:focus,
.sdw-btn-archivos:active {
	background: #fff !important;
	border-color: #e0e8f0 !important;
	outline: none !important;
}

.sdw-btn-archivos .sdw-icono,
.sdw-btn-archivos .sdw-btn-texto {
	color: #5d6d7e;
}

.sdw-btn-archivos:hover {
	border-color: #e67e22 !important;
	box-shadow: 0 2px 8px rgba(230, 126, 34, 0.2);
	background: #fff !important;
}

.sdw-btn-archivos:hover .sdw-icono,
.sdw-btn-archivos:hover .sdw-btn-texto {
	color: #e67e22;
}

.sdw-btn-texto {
	font-size: 0.9em;
	font-weight: 500;
	text-align: center !important;
	display: block;
	width: 100%;
	margin: 0 auto;
}

.sdw-fotos-preview {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: 10px;
	margin-top: 0;
	margin-bottom: 16px;
}

.sdw-fotos-preview:empty {
	display: none;
}

.sdw-foto-item {
	position: relative;
	width: 100%;
	aspect-ratio: 1;
	max-width: 100px;
}

.sdw-foto-item img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	border-radius: 4px;
	border: 1px solid #ddd;
}

.sdw-foto-remove {
	position: absolute;
	top: -6px;
	right: -6px;
	width: 22px;
	height: 22px;
	padding: 0;
	line-height: 20px;
	font-size: 18px;
	border-radius: 50%;
	background: #dc3545;
	color: #fff;
	border: none;
	cursor: pointer;
}

.sdw-lightbox-content .description {
	font-size: 0.9em;
	color: #666;
	margin: 4px 0 0;
}

.sdw-lightbox-content #sdw-formulario {
	line-height: 1.4;
}

.sdw-lightbox-content .sdw-alerta {
	padding: 8px 10px;
	margin: 8px 0;
	border-radius: 3px;
}

.sdw-lightbox-content .sdw-alerta.sdw-error {
	background: #f8d7da;
	color: #721c24;
	border: 1px solid #f5c6cb;
}

.sdw-lightbox-content .sdw-alerta.sdw-success {
	background: #d4edda;
	color: #155724;
	border: 1px solid #c3e6cb;
}

.sdw-cerrar {
	float: right;
	cursor: pointer;
	font-size: 1.2em;
}

/* Sección PDF dentro de cada tarjeta de devolución */
.woocommerce-account .sdw-devolucion-pdf,
.sdw-devolucion-pdf {
	background: #f8f9fa !important;
	border-top: 1px solid #eee;
	border-bottom: 1px solid #eee;
	padding: 15px 0;
	margin: 15px 0;
}

.sdw-devolucion-pdf .sdw-exito-msg {
	font-weight: 600;
	font-size: 0.95em;
	margin: 0 0 12px;
	color: #333;
	line-height: 1.5;
}

.sdw-devolucion-pdf .sdw-btn-pdf {
	background: #e67e22 !important;
	color: #fff !important;
	border-color: #d35400 !important;
	padding: 8px 16px;
	font-size: 0.95em;
}

.sdw-devolucion-pdf .sdw-btn-pdf:hover {
	background: #d35400 !important;
	color: #fff !important;
	border-color: #d35400 !important;
}

/* Mensaje cuando la solicitud está Enviada */
.sdw-msg-enviada {
	margin: 12px 0 0;
	padding: 0;
	font-size: 0.95em;
	line-height: 1.5;
	color: #555;
}

/* Listado de devoluciones - Estilo similar a sección de seguimiento */
.woocommerce-account .sdw-devoluciones-section,
.sdw-devoluciones-section {
	margin-bottom: 30px;
}

.woocommerce-account .sdw-titulo-seccion,
.sdw-titulo-seccion {
	margin-bottom: 20px;
	font-size: 1.25em;
	border-bottom: 1px solid #e5e5e5;
	padding-bottom: 10px;
}

.woocommerce-account .sdw-sin-devoluciones,
.sdw-sin-devoluciones {
	padding: 25px;
	background: #f9f9f9;
	border-radius: 4px;
	border: 1px solid #e5e5e5;
}

.sdw-sin-devoluciones p {
	margin: 0 0 10px;
}

.sdw-sin-devoluciones p:last-child {
	margin-bottom: 0;
	color: #666;
	font-size: 0.95em;
}

.woocommerce-account .sdw-listado-devoluciones,
.sdw-listado-devoluciones {
	display: flex !important;
	flex-direction: column;
	gap: 15px;
}

.woocommerce-account .sdw-devolucion-card,
.sdw-devolucion-card {
	background: #fff !important;
	border: 1px solid #e5e5e5 !important;
	border-radius: 4px !important;
	padding: 20px !important;
	box-shadow: 0 1px 3px rgba(0,0,0,0.05) !important;
}

.woocommerce-account .sdw-devolucion-header,
.sdw-devolucion-header {
	display: flex !important;
	justify-content: space-between;
	align-items: center;
	flex-wrap: wrap;
	gap: 10px;
	margin-bottom: 15px;
	padding-bottom: 15px;
	border-bottom: 1px solid #eee;
}

.sdw-devolucion-id a {
	font-weight: 600;
	font-size: 1.1em;
}

.woocommerce-account .sdw-devolucion-estado,
.sdw-devolucion-estado {
	display: inline-block !important;
	padding: 4px 12px;
	border-radius: 20px;
	font-size: 0.85em;
	font-weight: 600;
}

.sdw-devolucion-estado.sdw-estado-nueva,
.sdw-devolucion-estado.sdw-estado-procesando {
	background: #e7f3ff !important;
	color: #0073aa !important;
}

.sdw-devolucion-estado.sdw-estado-aprobada {
	background: #d4edda !important;
	color: #155724 !important;
}

.sdw-devolucion-estado.sdw-estado-rechazada {
	background: #f8d7da !important;
	color: #721c24 !important;
}

.sdw-devolucion-estado.sdw-estado-vale-activo {
	background: #d4edda !important;
	color: #155724 !important;
}

.sdw-devolucion-estado.sdw-estado-vale-utilizado {
	background: #e2e3e5 !important;
	color: #383d41 !important;
}

.sdw-vale-codigo-area {
	margin-top: 15px;
	padding-top: 15px;
	border-top: 1px solid #eee;
}

.sdw-vale-codigo-area .sdw-vale-codigo-reveal {
	display: flex;
	align-items: center;
	gap: 10px;
	flex-wrap: wrap;
	margin-top: 10px;
}

.sdw-vale-codigo-area .sdw-vale-codigo-texto {
	background: #f5f5f5;
	padding: 8px 12px;
	border-radius: 4px;
	font-size: 1.05em;
	font-weight: 600;
}

.sdw-vale-card .sdw-devolucion-footer {
	display: none;
}

.woocommerce-account .sdw-devolucion-body,
.sdw-devolucion-body {
	display: grid !important;
	grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
	gap: 12px 20px;
	margin-bottom: 15px;
}

.sdw-devolucion-info {
	font-size: 0.95em;
}

.sdw-devolucion-label {
	display: block !important;
	color: #666;
	font-size: 0.9em;
	margin-bottom: 2px;
}

.woocommerce-account .sdw-devolucion-footer,
.sdw-devolucion-footer {
	padding-top: 15px;
	border-top: 1px solid #eee;
}

/* Ver devolución */
.sdw-info-devolucion {
	width: 100%;
	margin-bottom: 25px;
	border-collapse: collapse;
}

.sdw-info-devolucion td {
	padding: 10px 15px 10px 0;
	vertical-align: top;
}

.sdw-info-devolucion .sdw-minor {
	text-align: right;
	font-size: 0.9em;
}

.sdw-estado {
	display: inline-block;
	margin-bottom: 5px;
}

.sdw-fecha {
	font-size: 0.9em;
	color: #666;
}

.sdw-nuevo-mensaje {
	margin: 25px 0;
	padding: 20px;
	background: #f9f9f9;
	border-radius: 4px;
}

.sdw-titulo-block {
	font-weight: 400 !important;
	margin-bottom: 10px;
}

.sdw-nuevo-mensaje textarea {
	width: 100%;
	padding: 10px;
	border: 1px solid #ddd;
	border-radius: 3px;
	margin-bottom: 10px;
}

.sdw-acciones {
	margin-bottom: 10px;
}

.sdw-historial-mensajes {
	margin-top: 30px;
}

.sdw-separador {
	height: 1px;
	background: #ddd;
	margin: 20px 0;
}

.sdw-recargar {
	cursor: pointer;
	margin-left: 8px;
	opacity: 0.7;
}

.sdw-recargar:hover {
	opacity: 1;
}

.sdw-mensaje {
	padding: 12px 15px;
	margin-bottom: 10px;
	border-radius: 4px;
	border-left: 4px solid #ddd;
}

.sdw-mensaje.sdw-admin {
	background: #e7f3ff;
	border-left-color: #0073aa;
}

.sdw-mensaje.sdw-cliente {
	background: #f5f5f5;
	border-left-color: #999;
}

.sdw-mensaje .sdw-fecha {
	font-size: 0.85em;
	color: #666;
	margin-left: 8px;
}

.sdw-mensaje p {
	margin: 8px 0 0;
}

/* Vista éxito tras enviar solicitud */
.sdw-vista-exito {
	text-align: left;
	padding: 10px 0;
}

.sdw-vista-exito .sdw-exito-msg {
	font-weight: 600;
	font-size: 1em;
	margin: 0 0 20px;
	color: #333;
	line-height: 1.5;
}

.sdw-vista-exito .sdw-btn-pdf {
	display: inline-block;
	background: #e67e22;
	color: #fff;
	border-color: #d35400;
	padding: 10px 20px;
	font-size: 1em;
}

.sdw-vista-exito .sdw-btn-pdf:hover {
	background: #d35400;
	color: #fff;
	border-color: #d35400;
}

.sdw-vista-exito .sdw-exito-link {
	margin: 20px 0 0;
	font-size: 0.95em;
}

.sdw-vista-exito .sdw-exito-link a {
	color: #0073aa;
}
