/*
Theme Name: DSI Tienda
Theme URI: https://desarrollodesistemasinformaticos.com
Description: Identidad visual de Desarrollo de Sistemas Informáticos. Tema hijo de Twenty Twenty-Five con la paleta de marca, logotipo y pie de página comercial.
Author: Desarrollo de Sistemas Informáticos
Template: twentytwentyfive
Version: 1.1.0
Requires at least: 6.7
Tested up to: 7.1
Requires PHP: 8.0
License: GPL-2.0-or-later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: dsi-tienda
*/

/* ------------------------------------------------------------------ */
/* Variables de marca                                                  */
/* ------------------------------------------------------------------ */
:root {
	--dsi-fondo: #0b1437;
	--dsi-fondo-2: #131d4d;
	--dsi-azul: #2563eb;
	--dsi-cian: #22d3ee;
	--dsi-violeta: #7c3aed;
	--dsi-claro: #f5f8ff;
	--dsi-borde: rgba(148, 163, 184, 0.28);
	--dsi-degradado: linear-gradient(135deg, #0b1437 0%, #2563eb 55%, #22d3ee 100%);
}

/* ------------------------------------------------------------------ */
/* Encabezado                                                          */
/* ------------------------------------------------------------------ */
.wp-block-site-logo img {
	border-radius: 10px;
}

.wp-block-site-title a {
	text-decoration: none;
	font-weight: 700;
	letter-spacing: -0.015em;
}

/* Barra superior de acento: la firma visual de la marca */
body::before {
	content: "";
	display: block;
	height: 4px;
	width: 100%;
	background: var(--dsi-degradado);
}

/* ------------------------------------------------------------------ */
/* Botones                                                             */
/* ------------------------------------------------------------------ */
.wp-element-button,
.wp-block-button__link,
.woocommerce a.button,
.woocommerce button.button,
.woocommerce input.button,
.woocommerce #respond input#submit {
	border-radius: 8px;
	font-weight: 600;
	letter-spacing: 0.01em;
	transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
}

.wp-element-button:hover,
.wp-block-button__link:hover,
.woocommerce a.button:hover,
.woocommerce button.button:hover,
.woocommerce input.button:hover {
	transform: translateY(-1px);
	box-shadow: 0 6px 18px rgba(37, 99, 235, 0.25);
}

.woocommerce a.button.alt,
.woocommerce button.button.alt,
.woocommerce #respond input#submit.alt,
.woocommerce .single_add_to_cart_button {
	background: var(--dsi-azul);
	color: #fff;
}

.woocommerce a.button.alt:hover,
.woocommerce button.button.alt:hover,
.woocommerce .single_add_to_cart_button:hover {
	background: #1d4ed8;
	color: #fff;
}

/* ------------------------------------------------------------------ */
/* Catálogo                                                            */
/* ------------------------------------------------------------------ */
.woocommerce ul.products li.product,
.wc-block-product-template .wc-block-product {
	border: 1px solid var(--dsi-borde);
	border-radius: 14px;
	padding: 1rem;
	background: #fff;
	transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.woocommerce ul.products li.product:hover,
.wc-block-product-template .wc-block-product:hover {
	border-color: var(--dsi-azul);
	box-shadow: 0 10px 28px rgba(11, 20, 55, 0.1);
	transform: translateY(-2px);
}

.woocommerce ul.products li.product img,
.wc-block-product-template .wc-block-product img {
	border-radius: 10px;
}

.woocommerce .price,
.wc-block-components-product-price {
	color: var(--dsi-fondo);
	font-weight: 700;
}

.woocommerce span.onsale,
.wc-block-components-product-sale-badge {
	background: var(--dsi-cian);
	color: var(--dsi-fondo);
	font-weight: 700;
	border-radius: 999px;
}

/* Insignia de confianza bajo el precio en la ficha de producto */
.woocommerce div.product .woocommerce-product-details__short-description {
	border-left: 3px solid var(--dsi-cian);
	padding-left: 1rem;
}

/* ------------------------------------------------------------------ */
/* Carrito y checkout                                                  */
/* ------------------------------------------------------------------ */
.woocommerce-checkout h3,
.wc-block-components-title {
	color: var(--dsi-fondo);
}

.woocommerce table.shop_table,
.wc-block-components-sidebar {
	border-radius: 12px;
	border-color: var(--dsi-borde);
}

.woocommerce-info,
.woocommerce-message,
.wc-block-components-notice-banner {
	border-top-color: var(--dsi-azul);
	border-radius: 10px;
}

/* Que la casilla de aceptación de términos no pase desapercibida */
.woocommerce-terms-and-conditions-wrapper,
.wc-block-checkout__terms {
	background: var(--dsi-claro);
	border: 1px solid var(--dsi-borde);
	border-radius: 10px;
	padding: 1rem;
	margin-top: 1rem;
}

.woocommerce-terms-and-conditions-wrapper a,
.wc-block-checkout__terms a {
	color: var(--dsi-azul);
	font-weight: 600;
}

/* ------------------------------------------------------------------ */
/* Pie de página                                                       */
/* ------------------------------------------------------------------ */
.dsi-pie {
	background: var(--dsi-fondo);
	color: var(--dsi-claro);
}

.dsi-pie a {
	color: var(--dsi-claro);
	text-decoration: none;
	opacity: 0.85;
}

.dsi-pie a:hover {
	opacity: 1;
	text-decoration: underline;
	color: var(--dsi-cian);
}

.dsi-pie .wp-block-heading {
	color: #fff;
	font-size: 0.95rem;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	opacity: 0.7;
}

.dsi-pie .wp-block-navigation {
	gap: 0.55rem;
}

.dsi-pie .wp-block-social-links .wp-social-link {
	background: rgba(255, 255, 255, 0.1);
}

.dsi-pie .wp-block-social-links .wp-social-link:hover {
	background: var(--dsi-cian);
}

.dsi-sello-pago {
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	font-size: 0.85rem;
	padding: 0.45rem 0.8rem;
	border: 1px solid var(--dsi-borde);
	border-radius: 999px;
	opacity: 0.9;
}

/* ------------------------------------------------------------------ */
/* Texto solo para lectores de pantalla                                */
/* ------------------------------------------------------------------ */
.screen-reader-text {
	position: absolute !important;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

/* ------------------------------------------------------------------ */
/* Carrusel de portada                                                 */
/* ------------------------------------------------------------------ */
.dsi-slider {
	position: relative;
	width: 100%;
	background: var(--dsi-fondo);
	overflow: hidden;
}

.dsi-slider__pista {
	display: flex;
	overflow-x: auto;
	scroll-snap-type: x mandatory;
	scroll-behavior: smooth;
	scrollbar-width: none;
	-ms-overflow-style: none;
}

.dsi-slider__pista::-webkit-scrollbar {
	display: none;
}

.dsi-slide {
	position: relative;
	flex: 0 0 100%;
	scroll-snap-align: center;
	min-height: clamp(380px, 46vw, 560px);
	display: flex;
	align-items: center;
}

.dsi-slide__imagen {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: 72% center;
}

/* Velo que garantiza el contraste del texto sobre la ilustración */
.dsi-slide::after {
	content: "";
	position: absolute;
	inset: 0;
	background: linear-gradient(
		100deg,
		rgba(7, 14, 38, 0.95) 0%,
		rgba(7, 14, 38, 0.86) 34%,
		rgba(11, 20, 55, 0.45) 60%,
		rgba(11, 20, 55, 0.12) 100%
	);
}

.dsi-slide__contenido {
	position: relative;
	z-index: 2;
	width: 100%;
	max-width: 1200px;
	margin: 0 auto;
	padding: 3rem 1.5rem;
	color: var(--dsi-claro);
}

.dsi-slide__texto {
	max-width: 33rem;
}

.dsi-slide__etiqueta {
	display: inline-block;
	font-size: 0.78rem;
	font-weight: 700;
	letter-spacing: 0.16em;
	text-transform: uppercase;
	color: var(--dsi-cian);
	margin-bottom: 0.9rem;
}

.dsi-slide__titulo {
	color: #fff;
	font-size: clamp(1.7rem, 3.6vw, 2.9rem);
	line-height: 1.12;
	letter-spacing: -0.02em;
	margin: 0 0 0.9rem;
}

.dsi-slide__bajada {
	font-size: clamp(0.98rem, 1.3vw, 1.1rem);
	line-height: 1.6;
	opacity: 0.92;
	margin: 0 0 1.6rem;
}

.dsi-slide__acciones {
	display: flex;
	flex-wrap: wrap;
	gap: 0.75rem;
}

.dsi-slide__boton {
	display: inline-flex;
	align-items: center;
	padding: 0.72rem 1.4rem;
	border-radius: 8px;
	font-weight: 600;
	font-size: 0.96rem;
	text-decoration: none;
	transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.dsi-slide__boton--principal {
	background: var(--dsi-cian);
	color: var(--dsi-fondo);
}

.dsi-slide__boton--principal:hover {
	background: #67e8f9;
	color: var(--dsi-fondo);
	transform: translateY(-1px);
	box-shadow: 0 8px 22px rgba(34, 211, 238, 0.32);
}

.dsi-slide__boton--secundario {
	border: 1.5px solid rgba(245, 248, 255, 0.55);
	color: #fff;
}

.dsi-slide__boton--secundario:hover {
	border-color: var(--dsi-cian);
	color: var(--dsi-cian);
	transform: translateY(-1px);
}

/* --- Controles --- */
.dsi-slider__flecha {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	z-index: 3;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 46px;
	height: 46px;
	border: 0;
	border-radius: 50%;
	background: rgba(11, 20, 55, 0.6);
	color: #fff;
	cursor: pointer;
	transition: background 0.15s ease, transform 0.15s ease;
}

.dsi-slider__flecha:hover {
	background: var(--dsi-azul);
	transform: translateY(-50%) scale(1.06);
}

.dsi-slider__flecha--previa {
	left: 14px;
}

.dsi-slider__flecha--siguiente {
	right: 14px;
}

.dsi-slider__barra {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 16px;
	z-index: 3;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 0.6rem;
}

.dsi-slider__punto {
	width: 10px;
	height: 10px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: rgba(245, 248, 255, 0.38);
	cursor: pointer;
	transition: background 0.15s ease, width 0.2s ease;
}

.dsi-slider__punto[aria-current="true"] {
	width: 30px;
	border-radius: 5px;
	background: var(--dsi-cian);
}

.dsi-slider__pausa {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 26px;
	height: 26px;
	margin-left: 0.4rem;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: rgba(245, 248, 255, 0.18);
	color: #fff;
	cursor: pointer;
}

.dsi-slider__pausa:hover {
	background: var(--dsi-azul);
}

@media (max-width: 782px) {
	.dsi-slide__imagen {
		object-position: 64% center;
	}

	.dsi-slide::after {
		background: linear-gradient(
			180deg,
			rgba(7, 14, 38, 0.86) 0%,
			rgba(7, 14, 38, 0.8) 55%,
			rgba(11, 20, 55, 0.7) 100%
		);
	}

	.dsi-slide__texto {
		max-width: none;
	}

	.dsi-slider__flecha {
		display: none;
	}
}

@media (prefers-reduced-motion: reduce) {
	.dsi-slider__pista {
		scroll-behavior: auto;
	}
}

/* ------------------------------------------------------------------ */
/* Botón flotante de WhatsApp                                          */
/* ------------------------------------------------------------------ */
.dsi-whatsapp {
	position: fixed;
	right: 20px;
	bottom: 20px;
	z-index: 9999;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 58px;
	height: 58px;
	border-radius: 50%;
	background: #25d366;
	color: #fff;
	box-shadow: 0 6px 20px rgba(11, 20, 55, 0.28);
	transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.dsi-whatsapp:hover,
.dsi-whatsapp:focus-visible {
	color: #fff;
	transform: translateY(-3px) scale(1.04);
	box-shadow: 0 10px 26px rgba(37, 211, 102, 0.45);
}

/* Latido discreto, solo una vez al cargar, para que se note sin molestar */
@media (prefers-reduced-motion: no-preference) {
	.dsi-whatsapp::after {
		content: "";
		position: absolute;
		inset: 0;
		border-radius: 50%;
		border: 2px solid #25d366;
		animation: dsi-pulso 2.4s ease-out 3;
	}
}

@keyframes dsi-pulso {
	0% {
		transform: scale(1);
		opacity: 0.7;
	}
	70% {
		transform: scale(1.5);
		opacity: 0;
	}
	100% {
		transform: scale(1.5);
		opacity: 0;
	}
}

/* En móvil se hace un poco más chico y sube, para no tapar el botón de compra */
@media (max-width: 600px) {
	.dsi-whatsapp {
		width: 52px;
		height: 52px;
		right: 14px;
		bottom: 14px;
	}
}

/* En el checkout se aparta: ahí estorba más de lo que ayuda */
.woocommerce-checkout .dsi-whatsapp {
	opacity: 0.55;
}

.woocommerce-checkout .dsi-whatsapp:hover {
	opacity: 1;
}

/* ------------------------------------------------------------------ */
/* Accesibilidad y foco visible                                        */
/* ------------------------------------------------------------------ */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
.wp-element-button:focus-visible {
	outline: 2px solid var(--dsi-cian);
	outline-offset: 2px;
}

/* ------------------------------------------------------------------ */
/* Móvil                                                               */
/* ------------------------------------------------------------------ */
@media (max-width: 600px) {
	.woocommerce ul.products li.product,
	.wc-block-product-template .wc-block-product {
		padding: 0.75rem;
	}

	.dsi-pie {
		text-align: left;
	}
}
