/*
 * LAGALA Design · estilos del sitio (basados en el prototipo aprobado V2.2).
 *
 * Orden: variables → base → botones → formularios → cabecera → portada → tarjetas de producto
 * → secciones divididas → pie → ventana de consulta → páginas → ficha de producto
 * → avisos → carrito y checkout → mi cuenta → teléfono/tableta (media queries al final).
 * Para cambiar colores o tipografías, editar las variables de :root.
 */

:root {
	/* Paleta del prototipo */
	--blanco: #ffffff;
	--marfil: #f5f3ef;
	--arena: #d5cbbe;
	--topo: #8c8072;
	--carbon: #262626;
	--texto: #665e54;
	--suave: #82776b;
	--linea: #e8e4de;
	--serif: "Cormorant Garamond", Georgia, serif;
	--sans: Manrope, Arial, sans-serif;
	--gutter: 6%;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 100px; -webkit-text-size-adjust: 100%; }
body { margin: 0; color: var(--carbon); background: var(--blanco); font: 14px/1.6 var(--sans); }
img { max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--topo); outline-offset: 3px; }
[hidden] { display: none !important; }

h1, h2, h3 { font-family: var(--serif); font-weight: 400; margin: 0 0 16px; line-height: 1.05; }
h1 { font-size: clamp(48px, 7vw, 96px); }
h2 { font-size: clamp(38px, 5vw, 64px); }
h3 { font-size: 32px; }
p { line-height: 1.8; color: var(--texto); margin: 0 0 1em; }
small, .eyebrow { font-size: 11px; letter-spacing: 2px; text-transform: uppercase; color: var(--suave); }
.eyebrow { display: block; margin-bottom: 6px; }

.screen-reader-text, .hp { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(1px, 1px, 1px, 1px); white-space: nowrap; }
.skip-link { position: absolute; left: -9999px; top: 8px; z-index: 100; background: var(--carbon); color: #fff; padding: 10px 16px; }
.skip-link:focus { left: 8px; }

/* Botones: rectos, como en el prototipo */
button, .btn, .button, input[type="submit"],
.single_add_to_cart_button, .woocommerce-Button {
	font: 600 11px var(--sans); letter-spacing: 1.3px; text-transform: uppercase;
	border: 1px solid var(--carbon); background: transparent; color: var(--carbon);
	padding: 15px 22px; cursor: pointer; display: inline-block; border-radius: 0;
	text-decoration: none; line-height: 1.2; text-align: center;
	transition: background .15s, color .15s;
}
button:hover, .btn:hover, .button:hover, input[type="submit"]:hover,
.single_add_to_cart_button:hover, .woocommerce-Button:hover { background: var(--carbon); color: #fff; text-decoration: none; }
.btn.active, button.active { background: var(--carbon); color: #fff; }
.textlink { border: 0; padding: 8px 0; font: inherit; font-size: 14px; text-transform: none; letter-spacing: 0; background: none; color: inherit; cursor: pointer; }
.textlink:hover { background: none; color: inherit; text-decoration: underline; }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; }

/* Formularios */
input[type="text"], input[type="email"], input[type="tel"], input[type="search"], input[type="number"], input[type="password"], select, textarea {
	width: 100%; padding: 12px; border: 1px solid #c9c2b8; background: #fff; font: inherit; color: var(--carbon); border-radius: 0;
}
textarea { resize: vertical; }
label { display: block; font-weight: 600; margin: 14px 0 6px; }
label.check { font-weight: 400; display: flex; gap: 10px; align-items: flex-start; color: var(--texto); }
label.check input { margin-top: 4px; }
.lead-form button { margin-top: 18px; }
.form-ok { background: var(--marfil); padding: 14px 16px; color: var(--carbon); }
.form-error { border: 1px solid #b4533a; padding: 12px 14px; color: #8a3a26; }

/* Cabecera */
.site-header {
	position: sticky; top: 0; z-index: 20; background: #fff; border-bottom: 1px solid #eee;
	display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 18px 5%;
}
.admin-bar .site-header { top: 32px; }
.brand { display: block; line-height: 0; }
.brand .logo { width: 145px; height: auto; }
.main-nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 28px; flex-wrap: wrap; }
.main-nav a { font-size: 14px; }
.header-actions { display: flex; gap: 10px; }

/* Portada */
.hero { height: min(76vh, 800px); overflow: hidden; background: var(--marfil); }
.hero-img, .hero img { width: 100%; height: 100%; object-fit: cover; object-position: center 56%; display: block; }
.intro { text-align: center; padding: 80px 20px; }
.wrap { padding: 55px var(--gutter); }
.heading { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; }

/* Tres tarjetas de colección: Lineales, Modulares y Otras piezas. */
.category-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-top: 22px; }
.category-card { display: block; color: var(--carbon); text-decoration: none; text-align: center; } /* Nombre de la categoría centrado (los nombres de cada sofá siguen alineados a la izquierda). */
.category-card:hover { text-decoration: none; }
/* Tarjetas «Sofás lineales / modulares»: foto cuadrada 1:1 de borde a borde, igual que los productos (sin bandas laterales). */
.category-card img, .category-card .img-placeholder { display: block; width: 100%; height: auto; aspect-ratio: 1 / 1; object-fit: contain; background: transparent; border: 0; }
.category-card .img-placeholder { background: var(--marfil); }
.category-card strong { display: block; font-size: 22px; font-weight: 500; margin: 14px 0 4px; }
.category-card span { color: #756c62; }
.category-card:hover span { text-decoration: underline; }
.category-card[aria-expanded="true"] img { outline: 2px solid var(--topo); outline-offset: 3px; }

.catalog-panel { margin-top: 35px; padding-top: 25px; border-top: 1px solid var(--arena); }
.catalog-panel input[type="search"] { margin-top: 6px; }
.filters { display: flex; gap: 10px; margin: 20px 0 30px; flex-wrap: wrap; }
.featured { margin-top: 65px; }
.featured .heading { margin-bottom: 24px; }

/* Cuadrícula y tarjetas de producto */
.grid, ul.products { display: grid; grid-template-columns: repeat(3, 1fr); gap: 36px 24px; list-style: none; margin: 0; padding: 0; }
ul.products li { margin: 0; padding: 0; }
.tile { display: block; color: inherit; text-decoration: none; }
.tile:hover { text-decoration: none; }
.tile:hover h3 { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 4px; }
.tile img { display: block; width: 100%; height: auto; aspect-ratio: 1 / 1; object-fit: contain; background: transparent; padding: 0; margin: 0; border: 0; }
/* Segunda foto al pasar el mouse (solo en dispositivos con mouse; en celulares no se usa). */
.tile-media { display: block; position: relative; background: #fff; }
.tile-media .tile-alt { position: absolute; inset: 0; height: 100%; opacity: 0; transition: opacity .35s ease; }
@media (hover: hover) { .tile:hover .tile-alt, .tile:focus-visible .tile-alt { opacity: 1; } }
@media (hover: none) { .tile-media .tile-alt { display: none; } }
.tile h3 { margin: 12px 0 4px; }
.tile-price { font-size: 13px; color: var(--carbon); }
.woocommerce-Price-currencySymbol { margin-right: 1px; }

/* Secciones divididas */
.split { display: grid; grid-template-columns: 1fr 1fr; background: var(--marfil); align-items: center; }
/* Fotos de las secciones divididas: cuadradas (1:1), enteras, como las fotos originales. */
.split img { width: 100%; height: auto; aspect-ratio: 1 / 1; display: block; object-fit: cover; }
.copy-legal a { color: var(--marfil); text-decoration: underline; text-underline-offset: 3px; }
.copy { padding: 10%; }
.compra details { border-top: 1px solid #ddd; padding: 15px 0; }
.compra details:last-of-type { border-bottom: 1px solid #ddd; }
details > summary { cursor: pointer; font-weight: 500; }
details[open] > summary { margin-bottom: 10px; }

/* Pie oscuro */
.dark { background: var(--carbon); color: var(--marfil); padding: 65px var(--gutter); }
.dark p { color: var(--arena); }
.dark .btn { border-color: var(--arena); color: var(--marfil); }
.dark .btn:hover { background: var(--marfil); color: var(--carbon); }
.dark hr { border: 0; border-top: 1px solid #555; margin: 40px 0; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 24px; }
.footer-grid ul { list-style: none; margin: 0; padding: 0; line-height: 2; }
.footer-brand { font-family: var(--serif); font-size: 32px; color: var(--marfil) !important; line-height: 1.1; margin-bottom: 10px; }
.social a { margin-right: 16px; color: var(--marfil); }
.copy-legal { margin-top: 30px; font-size: 12px; }

/* Ventana de consulta */
dialog { border: 0; width: min(640px, 94vw); max-height: 90vh; padding: 28px; overflow: auto; }
dialog::backdrop { background: rgba(0, 0, 0, .6); }
dialog .close { float: right; }
dialog h2 { clear: both; font-size: 44px; }

/* Páginas */
.page--text .page-content { max-width: 760px; }
.page--text .page-content h2 { font-size: 36px; margin-top: 40px; }
.page-head h1 { font-size: clamp(42px, 6vw, 72px); }
.archive-head { margin-bottom: 30px; }
.archive-head h1 { font-size: clamp(42px, 6vw, 72px); }
.archive-desc p { max-width: 640px; }
.woocommerce-product-search { display: flex; gap: 8px; max-width: 520px; }
.woocommerce-product-search button { flex: none; }
.woocommerce-pagination ul { list-style: none; display: flex; gap: 8px; padding: 0; margin: 40px 0 0; }
.woocommerce-pagination a, .woocommerce-pagination span { display: inline-block; padding: 8px 14px; border: 1px solid var(--linea); }
.woocommerce-pagination .current { background: var(--carbon); color: #fff; }

/* Ficha de producto */
.single-product div.product { display: grid; grid-template-columns: 1.2fr 1fr; gap: 28px 48px; align-items: start; }
.single-product div.product > .product-description,
.single-product div.product > .related-models { grid-column: 1 / -1; }
.product-gallery__main img { width: 100%; height: auto; aspect-ratio: 1 / 1; object-fit: contain; display: block; }
.thumbs { display: flex; gap: 8px; overflow-x: auto; margin-top: 10px; padding-bottom: 4px; }
.thumbs button { padding: 0; flex: 0 0 78px; border: 1px solid #ddd; background: #fff; line-height: 0; }
.thumbs button:hover { background: #fff; }
.thumbs button[aria-pressed="true"] { border-color: var(--carbon); }
.thumbs img { width: 78px; height: 78px; object-fit: cover; }
/* Columna de precio y tapizado: se desplaza con la página (no queda fija para no taparse con lo de abajo). */
.summary { position: static; }
/* El precio de la variante se muestra arriba (main.js lo actualiza); se oculta el duplicado de WooCommerce. */
.summary .woocommerce-variation-price { display: none; }
.summary .product_title { font-size: clamp(40px, 4.5vw, 60px); }
.summary .price { font-family: var(--serif); font-size: 32px; margin: 0 0 18px; color: var(--carbon); }
.summary .price del { opacity: .5; }
.product-crumbs a { text-decoration: none; }
.product-crumbs a:hover { text-decoration: underline; }
table.variations { width: 100%; border-collapse: collapse; margin-bottom: 10px; }
table.variations th, table.variations td { display: block; padding: 0; text-align: left; }
table.variations th label { margin: 16px 0 6px; }
table.variations select { margin-bottom: 4px; }
.reset_variations { display: inline-block; font-size: 12px; margin-top: 6px; color: var(--suave); }
.single_variation_wrap .woocommerce-variation-price .price { font-size: 28px; margin: 16px 0 6px; }
.woocommerce-variation-availability { font-size: 13px; }
.swatches { display: flex; flex-wrap: wrap; gap: 10px; margin: 10px 0 4px; }
.swatches button { width: 36px; height: 36px; padding: 0; border: 2px solid #fff; outline: 1px solid #aaa; }
.swatches button:hover { border-color: #fff; }
.swatches button[aria-pressed="true"] { outline: 2px solid var(--carbon); }
.swatch-label { font-size: 12px; color: var(--suave); }
form.cart { margin: 18px 0 8px; }
form.cart .quantity { display: inline-block; vertical-align: top; margin-right: 8px; }
form.cart .quantity input { width: 72px; text-align: center; padding: 14px 8px; }
.woocommerce-variation-add-to-cart { display: flex; gap: 8px; align-items: stretch; margin-top: 16px; }
.single_add_to_cart_button { background: var(--carbon); color: #fff; flex: 1; padding: 16px 22px; }
.single_add_to_cart_button:hover { background: #000; }
.single_add_to_cart_button.disabled, .single_add_to_cart_button:disabled { opacity: .45; cursor: not-allowed; }
/* Botón de WhatsApp en la ficha: ancho completo, debajo de «Agregar al carrito». */
.btn-whatsapp { display: block; width: 100%; margin: 0 0 18px; }
.product-extra details { border-top: 1px solid #ddd; padding: 15px 0; }
.product-extra details:last-child { border-bottom: 1px solid #ddd; }
.product-description { max-width: 760px; padding-top: 30px; }
.product-description p { font-size: 15px; }
.related-models { margin-top: 30px; }
.related-models h2 { font-size: clamp(32px, 4vw, 48px); }

/* Avisos de WooCommerce */
.woocommerce-notices-wrapper:empty { display: none; }
.woocommerce-message, .woocommerce-info, .woocommerce-error { list-style: none; background: var(--marfil); border-left: 3px solid var(--topo); padding: 14px 18px; margin: 0 0 24px; }
.woocommerce-error { border-left-color: #b4533a; }
.woocommerce-message .button, .woocommerce-info .button { float: right; padding: 8px 14px; margin-left: 12px; }

/* Carrito y checkout (bloques de WooCommerce) */
.page--shop .page-head h1 { font-size: clamp(40px, 5vw, 64px); }
.wp-block-woocommerce-cart, .wp-block-woocommerce-checkout { font-family: var(--sans); }
.wc-block-components-button:not(.is-link) { border-radius: 0 !important; background: var(--carbon) !important; color: #fff !important; text-transform: uppercase; letter-spacing: 1.3px; font: 600 12px var(--sans) !important; min-height: 50px; }
.wc-block-components-button:not(.is-link):hover { background: #000 !important; }
.wc-block-components-text-input input, .wc-block-components-combobox input, .wc-blocks-components-select select, .wc-block-components-textarea { border-radius: 0 !important; }
.wc-block-components-product-name { font-family: var(--serif); font-size: 22px !important; color: var(--carbon) !important; }
.wc-block-components-totals-footer-item .wc-block-components-totals-item__value { font-family: var(--serif); font-size: 26px; }
.wc-block-components-title.wc-block-components-title { font-family: var(--serif); font-weight: 400; font-size: 28px; }

/* Página «Pedido recibido» y detalle de pedidos (también en Mi cuenta) */
.woocommerce-order h2, .woocommerce-order-details__title, .woocommerce-column__title, .woocommerce-customer-details h2 { font-size: clamp(28px, 3vw, 36px); margin: 40px 0 14px; }
.woocommerce-thankyou-order-received { font-size: 16px; color: var(--carbon); }
.woocommerce-order-overview { list-style: none; display: flex; flex-wrap: wrap; gap: 16px 40px; margin: 20px 0 10px; padding: 20px 24px; background: var(--marfil); }
.woocommerce-order-overview li { font-size: 11px; letter-spacing: 1.5px; text-transform: uppercase; color: var(--suave); }
.woocommerce-order-overview li strong { display: block; margin-top: 4px; font-size: 16px; letter-spacing: 0; text-transform: none; color: var(--carbon); }
table.shop_table { width: 100%; max-width: 760px; border-collapse: collapse; }
table.shop_table th, table.shop_table td { text-align: left; padding: 12px 8px 12px 0; border-bottom: 1px solid var(--linea); vertical-align: top; }
table.shop_table tfoot tr:last-child th, table.shop_table tfoot tr:last-child td { font-family: var(--serif); font-size: 22px; }
.woocommerce-customer-details address { font-style: normal; line-height: 1.8; color: var(--texto); }
.woocommerce-bacs-bank-details ul { list-style: none; padding: 16px 20px; background: var(--marfil); }

/* Mi cuenta (formularios clásicos) */
.woocommerce-account .woocommerce { display: grid; grid-template-columns: 220px 1fr; gap: 40px; }
.woocommerce-MyAccount-navigation ul { list-style: none; padding: 0; margin: 0; }
.woocommerce-MyAccount-navigation li { border-bottom: 1px solid var(--linea); }
.woocommerce-MyAccount-navigation a { display: block; padding: 10px 0; }
.woocommerce-MyAccount-navigation .is-active a { font-weight: 600; }
.woocommerce-account:not(.logged-in) .woocommerce { display: block; max-width: 520px; }

/* Teléfono y tableta */
@media (max-width: 900px) {
	.single-product div.product { grid-template-columns: 1fr; }
	.summary { position: static; }
	.woocommerce-account .woocommerce { grid-template-columns: 1fr; }
}
@media (max-width: 782px) {
	.admin-bar .site-header { top: 46px; }
}
@media (max-width: 700px) {
	.site-header { flex-wrap: wrap; padding: 12px 5%; gap: 10px; }
	.brand .logo { width: 110px; }
	.main-nav { order: 3; width: 100%; }
	.main-nav ul { gap: 14px; }
	.main-nav a { font-size: 12px; }
	.header-actions .btn { padding: 11px 14px; }
	.hero { height: 55vh; }
	.grid, ul.products { grid-template-columns: repeat(2, 1fr); gap: 20px 12px; }
	.split, .footer-grid { grid-template-columns: 1fr; }
	/* En celular el texto va siempre antes que la foto, así se alterna texto, foto, texto, foto. */
	.split .copy { order: -1; }
	.intro { padding: 55px 20px; }
	.wrap { padding: 35px 5%; }
	.heading { align-items: flex-start; flex-direction: column; }
	.tile h3 { font-size: 22px; }
	.category-grid { gap: 12px; }
	.category-card strong { font-size: 16px; }
	.category-card span { font-size: 12px; }
	.featured { margin-top: 40px; }
	.copy { padding: 40px 6%; }
	.dark { padding: 50px 5%; }
}
@media (prefers-reduced-motion: reduce) {
	html { scroll-behavior: auto; }
}
