/*
Theme Name: TorresTech Tienda
Theme URI: https://tienda.torrestech.cl
Description: Tema de la tienda de piezas para APR y SSR, con el estilo de torrestech.cl. Tema hijo de Twenty Twenty-Five.
Author: TorresTech
Template: twentytwentyfive
Version: 1.0.2
Requires at least: 6.7
Requires PHP: 8.1
License: GPLv2 or later
Text Domain: torrestech-tienda
*/

/* ---------- Encabezado ---------- */
.tt-header {
	position: sticky;
	top: 0;
	z-index: 50;
	background: var(--wp--preset--color--base);
	border-bottom: 1px solid var(--wp--preset--color--accent-5);
}
.admin-bar .tt-header { top: 32px; }
@media (max-width: 782px) { .admin-bar .tt-header { top: 46px; } }

.tt-bar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem 2rem;
	flex-wrap: wrap;
	max-width: 1240px;
	margin-inline: auto;
	padding: .75rem max(16px, env(safe-area-inset-right, 0px)) .75rem max(16px, env(safe-area-inset-left, 0px));
}
.tt-brand { display: inline-flex; align-items: center; text-decoration: none; }
.tt-brand img { display: block; height: 44px; width: auto; }
@media (min-width: 960px) { .tt-brand img { height: 52px; } }

.tt-nav { display: flex; align-items: center; gap: .25rem 1.5rem; flex-wrap: wrap; }
.tt-nav a {
	color: var(--wp--preset--color--accent-4);
	text-decoration: none;
	font-weight: 500;
	padding-block: .5rem;
	border-bottom: 2px solid transparent;
}
.tt-nav a:hover, .tt-nav a:focus-visible { color: var(--wp--preset--color--contrast); border-bottom-color: var(--wp--preset--color--accent-1); }
.tt-tools { display: flex; align-items: center; gap: 1rem; }

/* ---------- Pie ---------- */
.tt-footer {
	border-top: 1px solid var(--wp--preset--color--accent-5);
	background: var(--wp--preset--color--base);
	color: var(--wp--preset--color--accent-4);
	font-size: .875rem;
}
.tt-footer-inner {
	display: grid;
	gap: 2rem;
	max-width: 1240px;
	margin-inline: auto;
	padding: 3rem max(16px, env(safe-area-inset-right, 0px)) 2rem max(16px, env(safe-area-inset-left, 0px));
}
@media (min-width: 768px) { .tt-footer-inner { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1024px) { .tt-footer-inner { grid-template-columns: 2fr 1fr 1.3fr 1.5fr; } }
.tt-footer h2 { font-size: 1rem; margin: 0 0 .75rem; color: var(--wp--preset--color--contrast); }
.tt-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .5rem; }
.tt-footer a { color: inherit; text-decoration: none; }
.tt-footer a:hover { color: var(--wp--preset--color--contrast); }
.tt-footer-brands { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem 1.5rem; margin-bottom: 1rem; }
.tt-footer-brands img { display: block; height: 52px; width: auto; }
.tt-footer-bottom {
	max-width: 1240px;
	margin-inline: auto;
	padding: 1.25rem max(16px, env(safe-area-inset-right, 0px)) 2rem max(16px, env(safe-area-inset-left, 0px));
	border-top: 1px solid var(--wp--preset--color--accent-5);
}

/* ---------- Tienda ---------- */
/* Tarjetas de producto: borde fino, sin sombras ni esquinas redondeadas grandes */
.wc-block-product-template .wc-block-product,
ul.products li.product {
	background: var(--wp--preset--color--accent-3);
	border: 1px solid var(--wp--preset--color--accent-5);
	padding: 0 0 1rem;
}
.wc-block-product-template .wc-block-product > * { padding-inline: 1rem; }
.wc-block-product-template .wc-block-product .wc-block-components-product-image,
.wc-block-product-template .wc-block-product .wp-block-woocommerce-product-image { padding-inline: 0; }
.wc-block-components-product-image img { aspect-ratio: 1 / 1; object-fit: cover; }

/* Precio en blanco, sufijo "+ IVA" en gris */
.woocommerce-Price-amount, .wc-block-components-product-price { color: var(--wp--preset--color--contrast); font-weight: 700; }
.woocommerce-price-suffix { color: var(--wp--preset--color--accent-4); font-weight: 400; font-size: .85em; }

/* Campos de formulario sobre fondo oscuro */
.wc-block-components-text-input input,
.wc-block-components-select select,
.wc-blocks-components-select__select,
.wc-block-components-textarea,
input[type="text"], input[type="email"], input[type="tel"], input[type="search"], select, textarea {
	background-color: var(--wp--preset--color--base) !important;
	color: var(--wp--preset--color--contrast) !important;
	border-color: var(--wp--preset--color--accent-5) !important;
}
.wc-block-components-text-input label,
.wc-blocks-components-select__label { color: var(--wp--preset--color--accent-4) !important; }

/* Despacho: siempre se cotiza aparte. Oculta el monto ("GRATIS") del envío
   en el resumen del carro y del pago, y en la lista de opciones de envío. */
.wc-block-components-totals-shipping .wc-block-components-totals-item__value,
.wc-block-components-totals-shipping .wc-block-formatted-money-amount,
.wc-block-components-shipping-rates-control .wc-block-components-radio-control__secondary-label,
.wc-block-components-shipping-rates-control .wc-block-formatted-money-amount {
	display: none !important;
}

/* Avisos */
.wc-block-components-notice-banner { color: #101214; }

:focus-visible { outline: 2px solid var(--wp--preset--color--accent-1); outline-offset: 3px; }

@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after { transition: none !important; animation: none !important; }
}
