/*
Theme Name: Luna Roja
Description: Tema minimalista para la tienda Luna Roja. Requiere el plugin Luna Roja Core.
Author: Luna Roja
Version: 1.1.0
Requires at least: 6.0
Requires PHP: 7.4
Text Domain: lunaroja
*/

:root {
	/* --red, --deep, --paper (y --ink si se define) llegan desde Personalizar vía el tema.
	   Todo lo demás se deriva de esos colores. */
	--ink: color-mix(in srgb, var(--deep) 30%, black);
	--surface: color-mix(in srgb, var(--paper) 35%, white);
	--line: color-mix(in srgb, var(--ink) 22%, var(--paper));
	--mist: color-mix(in srgb, var(--paper) 86%, var(--deep));
	--muted: color-mix(in srgb, var(--ink) 70%, var(--paper));
	--alert: var(--deep);
	--font-body: "Helvetica Neue", Helvetica, Arial, "Segoe UI", sans-serif;
	--font-display: "Bebas Neue", "Oswald", "Roboto Condensed", "Franklin Gothic Medium Cond", "Arial Narrow", Impact, sans-serif;
	--w: 1280px;
	--gap: clamp(16px, 2.2vw, 32px);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
	margin: 0;
	background: var(--paper);
	color: var(--ink);
	font: 400 1rem/1.6 var(--font-body);
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
h1, h2, h3 { font-family: var(--font-display); font-weight: 700; font-synthesis: none; text-transform: uppercase; line-height: 1; letter-spacing: 0.01em; }
:focus-visible { outline: 2px solid var(--red); outline-offset: 3px; }
.hero :focus-visible, .carousel :focus-visible, .drop-feature :focus-visible, .site-footer :focus-visible { outline-color: var(--paper); }

.wrap { width: min(100% - 2 * var(--gap), var(--w)); margin-inline: auto; }
.screen-reader-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -9999px; background: var(--surface); color: var(--ink); padding: 8px 12px; z-index: 10; }
.skip:focus { left: 8px; top: 8px; }

/* Cabecera */
.site-header { background: var(--paper); color: var(--ink); border-bottom: 1px solid var(--line); }
.bar { display: flex; align-items: center; justify-content: space-between; min-height: 72px; gap: 24px; }
.brand { display: inline-block; text-decoration: none; line-height: 0; white-space: nowrap; }
.brand img { max-height: 56px; width: auto; }
.primary-nav ul { display: flex; gap: 28px; list-style: none; margin: 0; padding: 0; }
.primary-nav a { font-family: var(--font-display); font-size: 1.25rem; letter-spacing: 0.06em; text-transform: uppercase; text-decoration: none; padding: 6px 0; }
.primary-nav a:hover, .primary-nav .current-menu-item > a { color: var(--red); text-decoration: underline; text-underline-offset: 6px; }
.nav-toggle { display: none; background: none; border: 1px solid var(--ink); color: var(--ink); padding: 8px 14px; font: inherit; cursor: pointer; }

/* Hero */
.hero { position: relative; background: var(--deep); color: var(--paper); overflow: hidden; }
.hero.has-img { background-size: cover; background-position: center; }
.hero.has-img::before { content: ""; position: absolute; inset: 0; background: color-mix(in srgb, var(--deep) 62%, transparent); }
.hero-in { position: relative; display: grid; grid-template-columns: 1.3fr 0.7fr; align-items: center; gap: var(--gap); min-height: min(76vh, 700px); padding-block: 64px; }
.hero h1 { margin: 0; font-size: clamp(3.5rem, 11vw, 9.5rem); line-height: 0.9; letter-spacing: 0.01em; }
.hero p { max-width: 36ch; margin: 24px 0 32px; font-size: 1.125rem; color: var(--paper); }
.hero-mark { width: min(32vw, 380px); justify-self: end; }

.btn { display: inline-block; padding: 12px 28px; background: var(--red); color: var(--surface); border: 1px solid var(--red); text-decoration: none; font-family: var(--font-display); font-size: 1.25rem; letter-spacing: 0.08em; text-transform: uppercase; cursor: pointer; }
.btn:hover { background: var(--deep); border-color: var(--deep); }
.btn-light { background: var(--paper); color: var(--deep); border-color: var(--paper); }
.btn-light:hover { background: var(--surface); border-color: var(--surface); color: var(--deep); }

/* Carrusel del inicio */
.carousel { position: relative; height: min(76vh, 700px); min-height: 420px; background: var(--deep); color: var(--paper); overflow: hidden; }
.carousel-track { position: absolute; inset: 0; }
.slide { position: absolute; inset: 0; visibility: hidden; opacity: 0; }
.slide.is-active { visibility: visible; opacity: 1; }
.slide-media { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.slide.has-copy::after { content: ""; position: absolute; inset: 0; background: color-mix(in srgb, var(--deep) 58%, transparent); }
.slide-in { position: relative; z-index: 1; height: 100%; display: flex; align-items: center; }
.slide-copy { max-width: 40rem; }
.slide-title { margin: 0; font-family: var(--font-display); font-weight: 700; font-synthesis: none; text-transform: uppercase; font-size: clamp(3.25rem, 9vw, 8rem); line-height: 0.9; letter-spacing: 0.01em; }
.slide-text { margin: 20px 0 28px; max-width: 36ch; font-size: 1.125rem; color: var(--paper); }
.slide-copy .btn { margin-top: 8px; }
.carousel-ui { position: absolute; left: 0; right: 0; bottom: 20px; z-index: 2; display: flex; align-items: center; flex-wrap: wrap; gap: 12px; }
.carousel-dots { display: flex; gap: 10px; margin-inline: auto; }
.carousel-dot { position: relative; width: 12px; height: 12px; padding: 0; border: 1px solid var(--paper); background: transparent; border-radius: 0; cursor: pointer; }
.carousel-dot::before { content: ""; position: absolute; inset: -10px; }
.carousel-dot[aria-current="true"] { background: var(--paper); }
.carousel-btn { padding: 8px 14px; border: 1px solid color-mix(in srgb, var(--paper) 60%, transparent); background: transparent; color: var(--paper); font: inherit; font-size: 0.875rem; cursor: pointer; }
.carousel-btn:hover { background: var(--paper); color: var(--deep); }

/* Secciones */
.section { padding-block: clamp(56px, 8vw, 112px); }
.section + .section { padding-top: 0; }
.section-head { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; margin-bottom: 32px; }
.section-head h2, .page-head h1 { margin: 0; font-size: clamp(2.25rem, 4.6vw, 4rem); }
.more { font-weight: 700; color: var(--deep); text-underline-offset: 5px; }
.page-head { padding-block: clamp(40px, 6vw, 80px) 32px; }
.page-head p { max-width: 60ch; color: var(--muted); margin: 12px 0 0; }
.empty { color: var(--muted); }

/* Colecciones */
.tiles { display: grid; grid-template-columns: repeat(12, 1fr); gap: var(--gap); }
.tile { grid-column: span 12; text-decoration: none; display: block; }
.tile-img { height: clamp(320px, 46vw, 620px); background: var(--mist); overflow: hidden; display: grid; place-items: center; }
.tile-img img.wp-post-image { width: 100%; height: 100%; object-fit: cover; }
.ph img { width: 96px; opacity: 0.9; }
.tile-meta { padding-top: 14px; }
.tile-meta h3 { margin: 0; font-size: clamp(1.75rem, 3vw, 2.5rem); }
.tile-meta p { margin: 4px 0 0; color: var(--muted); }
.tile:hover h3 { text-decoration: underline; text-underline-offset: 6px; }
@media (min-width: 800px) {
	.tile:nth-child(4n+1), .tile:nth-child(4n+4) { grid-column: span 7; }
	.tile:nth-child(4n+2), .tile:nth-child(4n+3) { grid-column: span 5; }
	.tiles.single .tile { grid-column: span 12; }
}

/* Prendas */
.products { display: grid; grid-template-columns: repeat(4, 1fr); gap: calc(var(--gap) * 1.5) var(--gap); }
.card-img { display: block; aspect-ratio: 4 / 5; background: var(--mist); overflow: hidden; }
.card-img img { width: 100%; height: 100%; object-fit: cover; }
.card-img.ph { display: grid; place-items: center; }
.card-body { padding-top: 12px; }
.card-body h3 { margin: 0; font-size: 1.375rem; letter-spacing: 0.02em; }
.card-body h3 a { text-decoration: none; }
.card-body h3 a:hover { text-decoration: underline; }
.card-col { margin: 2px 0 0; color: var(--muted); font-size: 0.875rem; }
.price-line { margin: 6px 0 0; }
.price { font-weight: 700; }
.price-line del { color: var(--muted); margin-left: 6px; }
.lr-soldout { margin: 12px 0 0; font-weight: 700; color: var(--muted); }

[hidden] { display: none !important; }

/* Bloque de pedido */
.lr-order { margin-top: 12px; }
.lr-sizes, .lr-colors { border: 0; padding: 0; margin: 0 0 12px; display: flex; flex-wrap: wrap; gap: 6px; min-width: 0; }
.lr-legend { width: 100%; padding: 0; margin-bottom: 2px; font-size: 0.875rem; font-weight: 700; }
.lr-order-card .lr-legend { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.lr-sizes label, .lr-colors label { position: relative; }
.lr-sizes input, .lr-colors input { position: absolute; opacity: 0; pointer-events: none; }
.lr-sizes span, .lr-colors span { display: inline-flex; min-width: 40px; height: 40px; padding: 0 12px; align-items: center; justify-content: center; border: 1px solid var(--line); background: var(--surface); font-size: 0.875rem; font-weight: 600; cursor: pointer; }
.lr-sizes input:checked + span, .lr-colors input:checked + span { background: var(--deep); border-color: var(--deep); color: var(--surface); }
.lr-sizes input:focus-visible + span, .lr-colors input:focus-visible + span { outline: 2px solid var(--red); outline-offset: 2px; }
.needs-choice .lr-sizes span, .needs-choice .lr-colors span { border-color: var(--alert); }
.lr-variants { border: 0; padding: 0; margin: 0 0 12px; display: flex; flex-wrap: wrap; gap: 6px; min-width: 0; }
.lr-variants label { position: relative; }
.lr-variants input { position: absolute; opacity: 0; pointer-events: none; }
.lr-variants span { display: inline-flex; min-height: 40px; padding: 6px 14px; align-items: center; justify-content: center; border: 1px solid var(--line); background: var(--surface); font-size: 0.875rem; font-weight: 600; cursor: pointer; }
.lr-variants input:checked + span { background: var(--deep); border-color: var(--deep); color: var(--surface); }
.lr-variants input:focus-visible + span { outline: 2px solid var(--red); outline-offset: 2px; }
.lr-select { display: block; margin-bottom: 12px; }
.lr-select select { width: 100%; padding: 10px; border: 1px solid var(--line); background: var(--surface); font: inherit; font-size: 0.875rem; font-weight: 600; border-radius: 0; }
/* Galería de la prenda: imagen principal con miniaturas al lado */
.lr-media { display: grid; grid-template-columns: 88px minmax(0, 1fr); grid-template-areas: "thumbs stage"; gap: 12px; align-items: start; }
.lr-media-single { grid-template-columns: minmax(0, 1fr); grid-template-areas: "stage"; }
.lr-stage { grid-area: stage; aspect-ratio: 4 / 5; min-width: 0; background: var(--mist); display: grid; place-items: center; }
.lr-stage-img { width: 100%; height: 100%; object-fit: contain; }
.lr-thumbs { grid-area: thumbs; list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.lr-thumb { display: block; width: 100%; aspect-ratio: 4 / 5; padding: 0; border: 1px solid var(--line); background: var(--mist); cursor: pointer; }
.lr-thumb img { width: 100%; height: 100%; object-fit: cover; }
.lr-thumb[aria-pressed="true"] { border-color: var(--deep); outline: 1px solid var(--deep); }
.lr-thumb:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; }
.lr-wa, .lr-notify { display: block; text-align: center; padding: 12px; border: 1px solid var(--red); color: var(--deep); text-decoration: none; font-family: var(--font-display); font-size: 1.25rem; letter-spacing: 0.08em; text-transform: uppercase; background: transparent; }
.lr-wa:hover, .lr-notify:hover { background: var(--red); color: var(--surface); }
.lr-hint { margin: 8px 0 0; font-size: 0.875rem; font-weight: 700; color: var(--alert); }
.lr-hint:empty { display: none; }

/* Drops */
.drop-label { margin: 6px 0 0; font-size: 0.875rem; font-weight: 700; color: var(--deep); }
.lr-drop-note { margin: 0 0 4px; font-weight: 600; }
.lr-countdown { display: block; margin: 0 0 10px; color: var(--muted); font-variant-numeric: tabular-nums; }
.lr-countdown:empty { display: none; }
.drop-group { margin-bottom: clamp(40px, 6vw, 80px); }
.drop-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 24px; margin-bottom: 24px; }
.drop-head h2 { margin: 0; font-size: clamp(2rem, 4vw, 3rem); }
.drop-head h2 a { text-decoration: none; }
.drop-head h2 a:hover { text-decoration: underline; text-underline-offset: 6px; }
.drop-meta { margin: 0; color: var(--muted); }
.drop-meta .lr-countdown { display: inline; margin: 0 0 0 8px; }
.drop-feature { display: grid; grid-template-columns: 1fr 1fr; background: var(--deep); color: var(--paper); text-decoration: none; }
.drop-feature.no-img { grid-template-columns: 1fr; }
.drop-feature-img { display: block; min-height: 320px; background: color-mix(in srgb, var(--deep) 70%, black); overflow: hidden; }
.drop-feature-img img { width: 100%; height: 100%; object-fit: cover; }
.drop-feature-body { display: flex; flex-direction: column; align-items: flex-start; justify-content: center; gap: 10px; padding: clamp(24px, 4vw, 56px); }
.drop-kicker { font-weight: 700; color: var(--paper); }
.drop-feature-title { font-family: var(--font-display); font-weight: 700; font-synthesis: none; text-transform: uppercase; font-size: clamp(2.75rem, 7vw, 5.5rem); line-height: 0.95; letter-spacing: 0.01em; }
.drop-feature-meta { color: var(--paper); }
.drop-feature .lr-countdown { color: var(--paper); margin: 0; }
.drop-page-meta { margin: 8px 0 0; color: var(--muted); }

/* Contenido */
.entry-content > *:not(.lr-contact) { max-width: 72ch; }
.entry-content h2 { margin: 2em 0 0.5em; font-size: 2rem; }
.entry-content ul, .entry-content ol { padding-left: 1.25em; }
.entry-content li { margin: 0.4em 0; }
.entry-content { padding-bottom: clamp(56px, 8vw, 112px); }
.lr-missing { background: color-mix(in srgb, var(--red) 22%, var(--paper)); color: var(--ink); padding: 0 4px; }

/* Colección y prenda individuales */
.coll-banner { width: 100%; height: clamp(240px, 42vw, 560px); object-fit: cover; }
.coll-text { padding-block: 32px; }
.coll-text h1 { margin: 0; font-size: clamp(2.75rem, 6vw, 5.5rem); }
.coll-text .tag { color: var(--muted); margin: 8px 0 0; }
.filters-wrap { margin-bottom: 32px; }
.filters { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 12px; }
.filters-label { min-width: 84px; font-weight: 700; }
.filters a { padding: 8px 16px; border: 1px solid var(--line); background: var(--surface); text-decoration: none; }
.filters a[aria-current="true"] { background: var(--deep); border-color: var(--deep); color: var(--surface); }
.product { display: grid; grid-template-columns: 1.2fr 0.8fr; gap: clamp(24px, 4vw, 64px); padding-block: 40px clamp(56px, 8vw, 112px); }
.product-media { display: grid; gap: 12px; align-content: start; }
.product-media img { width: 100%; }
.product-info { position: sticky; top: 24px; align-self: start; }
.product-info h1 { margin: 0; font-size: clamp(2.5rem, 4.4vw, 3.75rem); }
.product-info .crumb { margin: 0 0 8px; color: var(--muted); }
.product-info .crumb a { text-underline-offset: 4px; }
.product-info .price-line { font-size: 1.25rem; margin-block: 12px 20px; }
.product-info dl { margin: 24px 0 0; }
.product-info dt { font-weight: 700; }
.product-info dd { margin: 0 0 12px; }
.product-info .entry-content { padding: 24px 0 0; }
.pagination { margin-top: 48px; }
.pagination .nav-links { display: flex; gap: 8px; flex-wrap: wrap; }
.pagination a, .pagination span { padding: 8px 14px; border: 1px solid var(--line); background: var(--surface); text-decoration: none; }
.pagination .current { background: var(--deep); color: var(--surface); border-color: var(--deep); }

/* Contacto */
.lr-contact { display: grid; grid-template-columns: 1fr 1.2fr; gap: clamp(32px, 5vw, 72px); }
.lr-contact h2 { margin-top: 0; }
.lr-contact dt { font-weight: 700; margin-top: 12px; }
.lr-contact dd { margin: 0; }
.lr-field label { display: block; font-weight: 600; margin-bottom: 6px; }
.lr-field input, .lr-field textarea { width: 100%; padding: 12px; border: 1px solid var(--ink); background: var(--surface); font: inherit; border-radius: 0; }
.lr-hp { position: absolute; left: -9999px; }
.lr-notice { padding: 12px 16px; border: 1px solid var(--ink); background: var(--surface); }
.lr-notice-error { border-color: var(--alert); color: var(--alert); }

/* Pie */
.site-footer { background: var(--deep); color: color-mix(in srgb, var(--paper) 90%, var(--deep)); padding-block: 64px 28px; }
.foot-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1.2fr; gap: var(--gap); }
.foot-h { margin: 0 0 14px; font-size: 1.5rem; color: var(--paper); letter-spacing: 0.04em; }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin: 6px 0; }
.site-footer a { text-decoration: none; }
.site-footer a:hover { text-decoration: underline; text-underline-offset: 4px; }
.site-footer .brand img { max-height: 72px; }
.foot-brand p { max-width: 30ch; margin: 14px 0; }
.foot-base { border-top: 1px solid color-mix(in srgb, var(--paper) 28%, var(--deep)); margin-top: 48px; padding-top: 20px; font-size: 0.875rem; color: color-mix(in srgb, var(--paper) 78%, var(--deep)); }

@media (prefers-reduced-motion: no-preference) {
	.slide { transition: opacity 0.5s, visibility 0.5s; }
	.btn, .lr-wa, .lr-notify, .lr-sizes span, .lr-colors span, .lr-variants span { transition: background-color 0.15s, color 0.15s, border-color 0.15s; }
}

@media (max-width: 960px) {
	.products { grid-template-columns: repeat(2, 1fr); }
	.foot-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 720px) {
	.nav-toggle { display: inline-block; }
	.primary-nav { display: none; position: absolute; left: 0; right: 0; top: 72px; background: var(--paper); border-bottom: 1px solid var(--line); padding: 8px var(--gap) 24px; z-index: 5; }
	.primary-nav.is-open { display: block; }
	.primary-nav ul { flex-direction: column; gap: 4px; }
	.site-header { position: relative; }
	.hero-in { grid-template-columns: 1fr; min-height: 0; }
	.carousel { height: auto; min-height: 480px; }
	.lr-media { grid-template-columns: minmax(0, 1fr); grid-template-areas: "stage" "thumbs"; }
	.lr-thumbs { flex-direction: row; overflow-x: auto; }
	.lr-thumbs li { flex: 0 0 72px; }
	.hero-mark { width: 120px; justify-self: start; order: -1; }
	.product, .lr-contact, .drop-feature { grid-template-columns: 1fr; }
	.product-info { position: static; }
	.foot-grid { grid-template-columns: 1fr; }
}
