/*
Theme Name: ClaudeLab Editorial
Theme URI: https://example.com/claudelab-theme
Author: ClaudeLab
Author URI: https://example.com
Description: Plataforma editorial para vender y gestionar cursos sobre Claude. Diseño tipo manual artesano con tipografía Fraunces serif, paleta papel/tinta/terracota e integración nativa con WooCommerce, Stripe y un sistema LMS ligero. La web se siente como una extensión natural de los manuales: misma identidad visual, misma calidad editorial.
Version: 1.2.4
Requires at least: 6.0
Tested up to: 6.5
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: claude-manuales
Tags: editorial, woocommerce, e-learning, courses, custom-colors, custom-menu, custom-logo, threaded-comments, translation-ready, full-width-template, theme-options
*/

/* =============================================================
   01 · Design tokens — paleta papel/tinta/terracota del manual
   ============================================================= */
:root {
    --ink: #1a1612;
    --ink-soft: rgba(26, 22, 18, 0.75);
    --ink-mute: rgba(26, 22, 18, 0.55);
    --ink-faint: rgba(26, 22, 18, 0.4);
    --paper: #f5f0e8;
    --paper-warm: #ede5d6;
    --paper-deep: #e6dec8;
    --accent: #cc5500;
    --accent-soft: #e8855a;
    --moss: #4a5d3a;
    --gold: #b8860b;
    --line: rgba(26, 22, 18, 0.12);
    --line-strong: rgba(26, 22, 18, 0.25);
    --shadow: 0 1px 0 rgba(26, 22, 18, 0.04), 0 4px 24px rgba(26, 22, 18, 0.06);
    --shadow-lift: 0 4px 0 var(--ink), 0 6px 30px rgba(26, 22, 18, 0.1);

    --font-serif: 'Fraunces', Georgia, serif;
    --font-sans: 'Inter Tight', -apple-system, system-ui, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;

    --max-content: 920px;
    --max-wide: 1280px;
    --sidebar-w: 280px;

    --radius: 4px;
    --radius-pill: 100px;
}

/* =============================================================
   02 · Reset y base
   ============================================================= */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    font-family: var(--font-sans);
    background: var(--paper);
    color: var(--ink);
    font-size: 16px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    background-image:
        radial-gradient(circle at 20% 10%, rgba(204, 85, 0, 0.04) 0%, transparent 40%),
        radial-gradient(circle at 80% 70%, rgba(74, 93, 58, 0.04) 0%, transparent 40%);
    background-attachment: fixed;
}
img, svg { max-width: 100%; height: auto; display: block; }
a { color: var(--ink); text-decoration: none; transition: color 0.15s; }
a:hover { color: var(--accent); }
button, input, textarea, select { font: inherit; color: inherit; }

/* Tipografía */
h1, h2, h3, h4 { font-family: var(--font-serif); font-weight: 900; letter-spacing: -0.02em; line-height: 1.1; margin: 0; }
h1 { font-size: clamp(40px, 6vw, 72px); letter-spacing: -0.035em; line-height: 0.98; }
h2 { font-size: 36px; }
h3 { font-size: 24px; font-weight: 700; }
h4 { font-size: 18px; font-weight: 700; }
p { margin: 0 0 16px; }
strong { font-weight: 600; }
em { font-style: italic; }
small { font-size: 13px; color: var(--ink-mute); }
hr { border: none; border-top: 1px solid var(--line); margin: 32px 0; }

/* Selección de texto */
::selection { background: var(--accent); color: var(--paper); }

/* =============================================================
   03 · Header del sitio
   ============================================================= */
.site-header {
    position: sticky;
    top: 0;
    background: rgba(245, 240, 232, 0.85);
    backdrop-filter: saturate(180%) blur(12px);
    -webkit-backdrop-filter: saturate(180%) blur(12px);
    border-bottom: 1px solid var(--line);
    z-index: 50;
}
.site-header__inner {
    max-width: var(--max-wide);
    margin: 0 auto;
    min-height: 74px;
    padding: 12px 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 32px;
}
.site-brand {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: var(--ink);
    flex-shrink: 0;
    height: 46px;
    max-width: 220px;
    overflow: hidden;
}
.site-brand__mark {
    width: 14px;
    height: 14px;
    background: var(--accent);
    border-radius: 50%;
    display: inline-block;
    transform: translateY(2px);
    box-shadow: 0 0 0 3px var(--paper), 0 0 0 4px var(--ink);
    flex-shrink: 0;
}
.site-brand__name {
    font-family: var(--font-serif);
    font-weight: 900;
    font-size: 20px;
    letter-spacing: -0.02em;
    line-height: 1;
}
.site-brand__sub {
    font-family: var(--font-mono);
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--accent);
    font-weight: 600;
    margin-left: 4px;
}
.site-brand__logo {
    height: 40px !important;
    width: auto !important;
    max-width: 210px !important;
    display: block;
    object-fit: contain;
}
/* Custom logo de WordPress (cuando se sube vía Customizer) */
.custom-logo-link,
.custom-logo-link img,
.site-brand .custom-logo {
    height: 40px !important;
    width: auto !important;
    max-width: 210px !important;
    display: block;
    object-fit: contain;
}
.custom-logo-link {
    display: flex;
    align-items: center;
    overflow: hidden;
}
.site-nav { display: flex; align-items: center; gap: 28px; }
.site-nav__menu { list-style: none; margin: 0; padding: 0; display: flex; gap: 28px; }
.site-nav__menu a {
    font-size: 14px;
    font-weight: 500;
    color: var(--ink-soft);
    position: relative;
}
.site-nav__menu a:hover { color: var(--accent); }
.site-nav__menu .current-menu-item > a,
.site-nav__menu .current_page_item > a { color: var(--ink); font-weight: 600; }

.site-nav__actions { display: flex; align-items: center; gap: 14px; }
.site-nav__icon-link {
    width: 36px;
    height: 36px;
    border: 1px solid var(--line);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    position: relative;
    color: var(--ink);
}
.site-nav__icon-link:hover { border-color: var(--ink); }
.site-nav__cart-count {
    position: absolute;
    top: -6px;
    right: -6px;
    background: var(--accent);
    color: white;
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 10px;
    min-width: 20px;
    text-align: center;
    line-height: 1.2;
}

/* Mobile menu toggle */
.mobile-toggle {
    display: none;
    background: transparent;
    border: 1px solid var(--line);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}
.mobile-toggle span { width: 18px; height: 2px; background: var(--ink); display: block; }

/* =============================================================
   04 · Buttons & forms
   ============================================================= */
.btn,
.button,
button.button,
input[type="submit"],
.woocommerce a.button,
.woocommerce button.button,
.woocommerce input.button,
.woocommerce #respond input#submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: var(--ink);
    color: var(--paper);
    border: none;
    padding: 12px 22px;
    font-family: var(--font-sans);
    font-size: 14px;
    font-weight: 600;
    letter-spacing: -0.005em;
    cursor: pointer;
    border-radius: var(--radius);
    text-decoration: none;
    transition: background 0.15s, transform 0.05s, box-shadow 0.15s;
    line-height: 1.2;
}
.btn:hover,
.button:hover,
button.button:hover,
input[type="submit"]:hover,
.woocommerce a.button:hover,
.woocommerce button.button:hover,
.woocommerce input.button:hover,
.woocommerce #respond input#submit:hover { background: var(--accent); color: white; }
.btn:active, .button:active { transform: translateY(1px); }

.btn--accent,
.btn--primary,
.woocommerce a.button.alt,
.woocommerce button.button.alt,
.woocommerce input.button.alt,
.woocommerce #respond input#submit.alt,
.woocommerce a.button.alt.disabled,
.woocommerce-checkout #payment .place-order .button {
    background: var(--accent);
    color: white;
}
.btn--accent:hover,
.btn--primary:hover,
.woocommerce a.button.alt:hover,
.woocommerce button.button.alt:hover,
.woocommerce input.button.alt:hover,
.woocommerce #respond input#submit.alt:hover { background: var(--ink); color: var(--paper); }

.btn--ghost {
    background: transparent;
    color: var(--ink);
    border: 1px solid var(--ink);
}
.btn--ghost:hover { background: var(--ink); color: var(--paper); }

.btn--lg { padding: 16px 28px; font-size: 15px; }
.btn--block { display: flex; width: 100%; }

/* Inputs */
input[type="text"], input[type="email"], input[type="password"], input[type="search"],
input[type="tel"], input[type="url"], input[type="number"], textarea, select,
.woocommerce form .form-row input.input-text,
.woocommerce form .form-row textarea,
.woocommerce form .form-row select {
    width: 100%;
    padding: 11px 14px;
    background: white;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius);
    font-size: 14.5px;
    color: var(--ink);
    font-family: var(--font-sans);
    transition: border-color 0.15s, box-shadow 0.15s;
}
input:focus, textarea:focus, select:focus,
.woocommerce form .form-row input.input-text:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px rgba(204, 85, 0, 0.15); }
label { display: block; margin-bottom: 6px; font-size: 13px; font-weight: 600; color: var(--ink); }
.search-form {
    display: flex;
    gap: 8px;
}
.search-form .search-field {
    flex: 1;
    min-width: 0;
}

/* =============================================================
   05 · Layout shells
   ============================================================= */
.shell { max-width: var(--max-content); margin: 0 auto; padding: 60px 32px 100px; }
.shell--wide { max-width: var(--max-wide); }

.shell-with-aside {
    display: grid;
    grid-template-columns: var(--sidebar-w) 1fr;
    max-width: var(--max-wide);
    margin: 0 auto;
}
.shell-with-aside > aside {
    position: sticky;
    top: 64px;
    height: calc(100vh - 64px);
    overflow-y: auto;
    padding: 40px 24px 40px 32px;
    border-right: 1px solid var(--line);
    background: rgba(245, 240, 232, 0.7);
    backdrop-filter: blur(8px);
}
.shell-with-aside > main { padding: 60px 80px 100px; max-width: 920px; }

/* =============================================================
   06 · Editorial primitives
   ============================================================= */
.eyebrow {
    display: inline-block;
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    background: var(--ink);
    color: var(--paper);
    padding: 6px 12px;
    margin-bottom: 24px;
    border-radius: 0;
}
.eyebrow--ghost { background: transparent; color: var(--ink-mute); padding: 0; }

.section-header {
    display: flex;
    align-items: baseline;
    gap: 16px;
    margin-bottom: 32px;
    padding-bottom: 16px;
    border-bottom: 2px solid var(--ink);
}
.section-num {
    font-family: var(--font-mono);
    font-size: 14px;
    color: var(--accent);
    font-weight: 700;
}
.section-header h2 { font-size: 36px; }

.lead {
    font-size: 18px;
    line-height: 1.55;
    color: var(--ink-soft);
    margin-bottom: 32px;
    max-width: 680px;
}

.marker-quote {
    font-family: var(--font-serif);
    font-style: italic;
    font-size: 22px;
    line-height: 1.4;
    color: var(--accent);
    border-left: 3px solid var(--accent);
    padding: 8px 0 8px 20px;
    margin: 32px 0;
    max-width: 600px;
}

.tip {
    background: var(--paper-warm);
    border-left: 3px solid var(--gold);
    padding: 16px 20px;
    margin: 20px 0;
    font-size: 14.5px;
    line-height: 1.55;
    border-radius: 0 var(--radius) var(--radius) 0;
}
.tip strong {
    display: inline-block;
    font-family: var(--font-mono);
    font-size: 10px;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--gold);
    margin-right: 8px;
    font-weight: 700;
}
.tip--warn { background: rgba(204, 85, 0, 0.06); border-left-color: var(--accent); }
.tip--warn strong { color: var(--accent); }
.tip--success { background: rgba(74, 93, 58, 0.08); border-left-color: var(--moss); }
.tip--success strong { color: var(--moss); }

/* Steps list — listado breve editorial */
ol.steps {
    list-style: none;
    counter-reset: step;
    margin: 24px 0;
    padding: 0;
}
ol.steps li {
    counter-increment: step;
    padding: 16px 0 16px 56px;
    position: relative;
    border-bottom: 1px dashed var(--line);
}
ol.steps li:last-child { border-bottom: none; }
ol.steps li::before {
    content: counter(step, decimal-leading-zero);
    position: absolute;
    left: 0;
    top: 16px;
    font-family: var(--font-mono);
    font-size: 11px;
    background: var(--ink);
    color: var(--paper);
    padding: 4px 8px;
    letter-spacing: 0.1em;
    font-weight: 700;
}
ol.steps li strong {
    display: block;
    font-family: var(--font-serif);
    font-size: 17px;
    font-weight: 700;
    margin-bottom: 4px;
    color: var(--ink);
}

.pill {
    display: inline-block;
    padding: 3px 10px;
    background: var(--ink);
    color: var(--paper);
    font-family: var(--font-mono);
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    border-radius: var(--radius-pill);
    font-weight: 500;
}
.pill--accent { background: var(--accent); }
.pill--moss { background: var(--moss); }
.pill--gold { background: var(--gold); }
.pill--ghost { background: transparent; color: var(--ink); border: 1px solid var(--line-strong); }

/* =============================================================
   07 · Product / course cards
   ============================================================= */
.products-grid,
.course-grid,
ul.products {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin: 24px 0;
    list-style: none;
    padding: 0;
}
.course-grid--catalog {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: stretch;
}
.faq-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    max-width: 820px;
}
.product-card,
ul.products li.product {
    background: white;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    position: relative;
    overflow: hidden;
    transition: transform 0.15s, box-shadow 0.15s;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    text-align: left !important;
}
.product-card::before,
ul.products li.product::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--accent);
    z-index: 1;
}
.product-card:hover,
ul.products li.product:hover { transform: translateY(-2px); box-shadow: 0 4px 30px rgba(26, 22, 18, 0.1); }
.product-card.is-moss::before, ul.products li.product:nth-child(3n+2)::before { background: var(--moss); }
.product-card.is-gold::before, ul.products li.product:nth-child(3n+3)::before { background: var(--gold); }

.product-card__media,
ul.products li.product .woocommerce-loop-product__link img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    background: var(--paper-deep);
    border-bottom: 1px solid var(--line);
    margin: 0;
}
.product-card__body,
ul.products li.product .woocommerce-loop-product__link {
    padding: 22px 24px;
    display: block;
    color: var(--ink);
    flex: 1;
}
.product-card__meta,
ul.products li.product .product-meta {
    font-family: var(--font-mono);
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--ink-mute);
    margin-bottom: 10px;
    font-weight: 600;
}
.product-card__title,
ul.products li.product .woocommerce-loop-product__title {
    font-family: var(--font-serif);
    font-weight: 700;
    font-size: 20px;
    letter-spacing: -0.015em;
    line-height: 1.2;
    margin: 0 0 8px;
    color: var(--ink);
    padding: 0 !important;
}
.product-card__excerpt,
ul.products li.product .woocommerce-loop-product__excerpt {
    font-size: 14px;
    color: var(--ink-soft);
    line-height: 1.5;
    margin: 0 0 16px;
}
.product-card__footer,
ul.products li.product .price-row {
    padding: 0 24px 22px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: auto;
}
.product-card__price,
ul.products li.product .price {
    font-family: var(--font-serif);
    font-weight: 700;
    font-size: 22px;
    color: var(--ink);
    letter-spacing: -0.01em;
    margin-right: auto;
}
.product-card__price del { color: var(--ink-faint); font-size: 16px; margin-right: 6px; }
.product-card__price ins { background: transparent; text-decoration: none; color: var(--accent); }

ul.products li.product .button { margin: 16px 24px 22px; }

/* =============================================================
   08 · Hero
   ============================================================= */
.hero {
    padding: 80px 32px 60px;
    max-width: var(--max-content);
    margin: 0 auto;
}
.hero__eyebrow { margin-bottom: 28px; }
.hero h1 em { font-style: italic; color: var(--accent); font-weight: 400; }
.hero__lead {
    font-size: 19px;
    line-height: 1.55;
    max-width: 600px;
    color: var(--ink-soft);
    margin: 24px 0 0;
}
.hero__actions { display: flex; gap: 12px; margin-top: 32px; flex-wrap: wrap; }
.hero__meta {
    display: flex;
    gap: 32px;
    margin-top: 40px;
    padding-top: 24px;
    border-top: 1px solid var(--line);
    font-size: 13px;
    color: var(--ink-mute);
    flex-wrap: wrap;
}
.hero__meta strong {
    color: var(--ink);
    display: block;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 4px;
    font-weight: 700;
    font-family: var(--font-sans);
}

/* =============================================================
   09 · Account / dashboard area
   ============================================================= */
.account-shell {
    display: grid;
    grid-template-columns: 260px 1fr;
    max-width: var(--max-wide);
    margin: 0 auto;
    gap: 0;
    min-height: calc(100vh - 130px);
}
.account-aside {
    border-right: 1px solid var(--line);
    padding: 40px 24px 40px 32px;
    background: rgba(245, 240, 232, 0.5);
}
.account-aside h4 {
    font-family: var(--font-mono);
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    color: var(--ink-faint);
    margin: 24px 0 10px;
    font-weight: 700;
}
.account-aside h4:first-child { margin-top: 0; }
.account-aside .user-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 12px;
    background: white;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    margin-bottom: 24px;
}
.account-aside .user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--ink);
    color: var(--paper);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-serif);
    font-weight: 700;
    font-size: 16px;
}
.account-aside .user-name { font-family: var(--font-serif); font-weight: 700; font-size: 15px; }
.account-aside .user-meta { font-size: 11px; color: var(--ink-mute); }

.account-aside ul {
    list-style: none;
    margin: 0;
    padding: 0;
}
.account-aside ul li a,
.woocommerce-MyAccount-navigation ul li a {
    display: block;
    padding: 9px 14px 9px 14px;
    color: var(--ink);
    text-decoration: none;
    font-size: 14px;
    border-left: 2px solid transparent;
    border-radius: 0;
    transition: all 0.15s;
    margin-left: -14px;
}
.account-aside ul li a:hover,
.woocommerce-MyAccount-navigation ul li a:hover {
    border-left-color: var(--accent);
    color: var(--accent);
    padding-left: 18px;
    background: transparent;
}
.account-aside ul li.is-active a,
.woocommerce-MyAccount-navigation ul li.is-active a,
.woocommerce-MyAccount-navigation ul li.woocommerce-MyAccount-navigation-link--dashboard.is-active a {
    border-left-color: var(--ink);
    font-weight: 600;
}
.woocommerce-MyAccount-navigation { padding: 0; }
.woocommerce-MyAccount-navigation ul { list-style: none; margin: 0; padding: 0; }

.account-main { padding: 50px 60px 80px; }

/* =============================================================
   10 · WooCommerce overrides
   ============================================================= */
.woocommerce-message,
.woocommerce-info,
.woocommerce-error,
.woocommerce-noreviews,
p.no-comments {
    background: var(--paper-warm);
    border-left: 3px solid var(--gold);
    padding: 14px 20px;
    border-top: none;
    border-right: none;
    border-bottom: none;
    color: var(--ink-soft);
    font-size: 14.5px;
    border-radius: 0 var(--radius) var(--radius) 0;
}
.woocommerce-message { border-left-color: var(--moss); background: rgba(74, 93, 58, 0.06); }
.woocommerce-error { border-left-color: var(--accent); background: rgba(204, 85, 0, 0.06); }
.woocommerce-message::before,
.woocommerce-info::before,
.woocommerce-error::before { display: none; }

/* My Account container */
.woocommerce-account .woocommerce {
    max-width: var(--max-wide);
    margin: 0 auto;
    padding: 0 32px;
}
body:not(.logged-in).woocommerce-account .woocommerce {
    display: block;
    max-width: none;
    padding: 0;
}
/* También para usuarios logueados: el contenedor debe ser un bloque normal
   a ancho completo, nunca una caja estrecha que comprima el contenido. */
.woocommerce-account .woocommerce {
    display: block;
    width: 100%;
}
.cm-account-layout {
    display: grid;
    grid-template-columns: minmax(240px, 280px) minmax(0, 1fr);
    gap: 0;
    width: 100%;
    min-height: calc(100vh - 130px);
}
/* Layout sin barra lateral de navegación: bloque simple a ancho completo */
.cm-account-layout--no-nav {
    display: block;
    grid-template-columns: none;
    width: 100%;
    max-width: var(--max-wide);
    margin: 0 auto;
    min-height: auto;
}
/* WooCommerce inserta un <div class="woocommerce"> entre .cm-account-layout
   y sus hijos (navegación + contenido). display:contents hace que ese div
   "desaparezca" del layout y deje pasar el grid de 2 columnas hasta la nav
   y el contenido. La anulación de max-width/margin/padding es imprescindible:
   sin ella esas propiedades chocan con display:contents y colapsan la columna
   del menú (avatar y email se apilan y el email se parte letra a letra). */
.cm-account-layout > .woocommerce,
.woocommerce-account .cm-account-layout .woocommerce {
    display: contents;
    max-width: none;
    margin: 0;
    padding: 0;
}
/* Garantía de ancho para la página de cuenta sin navegación.
   Sea cual sea el div .woocommerce intermedio que inserte WooCommerce,
   forzamos que toda la cadena ocupe el ancho disponible y que el contenido
   nunca se comprima a una columna estrecha (texto cae letra/palabra a línea). */
.woocommerce-account .woocommerce:has(.cm-account-layout--no-nav) {
    display: block;
    width: 100%;
    max-width: var(--max-wide);
    margin: 0 auto;
    padding: 0 32px;
    box-sizing: border-box;
}
.cm-account-layout--no-nav,
.cm-account-layout--no-nav > .woocommerce-MyAccount-content {
    display: block;
    width: 100%;
    min-width: 0;
}
.cm-account-layout--no-nav > .woocommerce-MyAccount-content {
    padding: 40px 0 80px;
}
.woocommerce-MyAccount-navigation {
    border-right: 1px solid var(--line);
    padding: 40px 24px 40px 32px;
    background: rgba(245, 240, 232, 0.5);
    min-height: 600px;
    min-width: 0;
    box-sizing: border-box;
}
.woocommerce-MyAccount-navigation .user-card,
.woocommerce-MyAccount-navigation .cm-account-user {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 12px;
    background: white;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    margin-bottom: 24px;
    width: 100%;
    box-sizing: border-box;
    align-self: start;
    height: auto;
}
.woocommerce-MyAccount-navigation .user-card > div:last-child,
.woocommerce-MyAccount-navigation .cm-account-user > div:last-child {
    min-width: 0;
    flex: 1 1 auto;
}
.woocommerce-MyAccount-navigation .user-avatar,
.woocommerce-MyAccount-navigation .cm-account-avatar {
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    border-radius: 50%;
    background: var(--ink);
    color: var(--paper);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-serif);
    font-weight: 800;
    font-size: 18px;
}
.woocommerce-MyAccount-navigation .user-name {
    font-family: var(--font-serif);
    font-weight: 800;
    font-size: 16px;
    line-height: 1.1;
}
.woocommerce-MyAccount-navigation .user-meta {
    color: var(--ink-mute);
    font-size: 12px;
    line-height: 1.3;
    margin-top: 4px;
    overflow-wrap: anywhere;
    word-break: normal;
    hyphens: none;
}
.woocommerce-MyAccount-navigation h4 {
    font-family: var(--font-mono);
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    color: var(--ink-faint);
    margin: 22px 0 10px;
}
.woocommerce-MyAccount-content {
    min-width: 0;
    width: 100%;
    padding: 50px 60px 80px;
}
.cm-account-layout--no-nav .woocommerce-MyAccount-content {
    padding: 50px 32px 80px;
}
.woocommerce-MyAccount-content h2,
.woocommerce-MyAccount-content h3 {
    font-family: var(--font-serif);
    margin-bottom: 16px;
}

.woocommerce-account .site-main > .shell {
    max-width: none;
    padding: 0;
}
.woocommerce-account .site-main > .shell > article > .hero {
    display: none;
}
.woocommerce-account .course-content {
    max-width: none;
}
.cm-auth-shell {
    max-width: 1040px;
    margin: 0 auto;
    padding: 72px 32px 96px;
}
.cm-auth-hero {
    max-width: 680px;
    margin: 0 auto 42px;
    text-align: center;
}
.cm-auth-hero h1 {
    font-size: clamp(44px, 5vw, 72px);
}
.cm-auth-hero .hero__lead {
    margin: 20px auto 0;
}
.cm-auth-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 24px;
    align-items: start;
}
.cm-auth-shell > .woocommerce-form-login {
    max-width: 480px;
    margin: 0 auto;
}
.cm-auth-shell .u-column1,
.cm-auth-shell .u-column2 {
    min-width: 0;
}
.cm-auth-shell .woocommerce-form-login,
.cm-auth-shell .woocommerce-form-register {
    min-height: 100%;
}
.cm-auth-shell .woocommerce-form-login h2,
.cm-auth-shell .woocommerce-form-register h2 {
    font-size: 30px;
    margin-bottom: 22px;
}
.cm-auth-shell .woocommerce form .form-row label {
    display: block;
}
.cm-auth-shell .woocommerce-Input {
    width: 100%;
}
.cm-auth-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 14px;
}
.cm-auth-secondary {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    padding-top: 12px;
    border-top: 1px solid var(--line);
    font-size: 14px;
}
.cm-account-hero {
    max-width: 780px;
    padding: 0 0 34px;
}
.cm-account-hero h1 {
    font-size: clamp(40px, 4vw, 58px);
    margin-top: 10px;
    overflow-wrap: anywhere;
}
.cm-account-hero h1 em {
    color: var(--accent);
    font-style: italic;
    font-weight: 500;
}
.cm-account-hero .hero__lead {
    max-width: 680px;
    margin-top: 18px;
}
.cm-account-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 18px;
    margin: 10px 0 28px;
}
.cm-account-stat {
    background: white;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 22px;
    min-width: 0;
    box-shadow: var(--shadow);
}
.cm-account-stat__label {
    font-family: var(--font-mono);
    font-size: 10px;
    line-height: 1.4;
    color: var(--ink-mute);
    letter-spacing: 0.14em;
    text-transform: uppercase;
    font-weight: 700;
}
.cm-account-stat__value {
    font-family: var(--font-serif);
    font-size: 44px;
    line-height: 1;
    font-weight: 900;
    margin: 16px 0 14px;
}
.cm-account-stat__value--text {
    font-size: 30px;
}
.cm-account-stat a {
    color: var(--accent);
    font-weight: 700;
    font-size: 14px;
}
.cm-account-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 24px;
}
.woocommerce-MyAccount-content table.shop_table,
.woocommerce-MyAccount-content .woocommerce-orders-table,
.woocommerce-MyAccount-content .woocommerce-table {
    margin-top: 18px;
}
.woocommerce-MyAccount-content form {
    max-width: 720px;
}
.woocommerce-MyAccount-content fieldset {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 18px;
    margin: 20px 0;
}
.woocommerce-MyAccount-content fieldset legend {
    font-family: var(--font-serif);
    font-weight: 800;
    padding: 0 8px;
}

/* Tablas WC */
.woocommerce table.shop_table,
.woocommerce-page table.shop_table {
    background: white;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    border-collapse: collapse;
    border-spacing: 0;
    overflow: hidden;
    width: 100%;
}
.woocommerce table.shop_table th {
    background: var(--ink);
    color: var(--paper);
    text-align: left;
    padding: 12px 16px;
    font-family: var(--font-mono);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 500;
    border: none;
}
.woocommerce table.shop_table td {
    padding: 14px 16px;
    border-top: 1px solid var(--line);
    font-size: 14px;
    color: var(--ink-soft);
}
.woocommerce table.shop_table td a { color: var(--ink); font-weight: 500; }
.woocommerce table.shop_table td a:hover { color: var(--accent); }

/* Single product */
.woocommerce div.product { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; max-width: var(--max-wide); margin: 60px auto; padding: 0 32px; }
.woocommerce div.product .product_title { font-family: var(--font-serif); font-size: 44px; line-height: 1.05; letter-spacing: -0.025em; margin: 12px 0 20px; }
.woocommerce div.product p.price,
.woocommerce div.product span.price {
    font-family: var(--font-serif);
    font-weight: 700;
    font-size: 32px;
    color: var(--ink);
    margin-bottom: 24px;
    letter-spacing: -0.01em;
}
.woocommerce div.product .woocommerce-product-details__short-description { font-size: 16px; color: var(--ink-soft); line-height: 1.6; margin-bottom: 24px; }
.woocommerce div.product .quantity { margin-right: 12px; }
.woocommerce .quantity .qty { width: 80px; text-align: center; }

/* Tabs */
.woocommerce div.product .woocommerce-tabs ul.tabs {
    border-bottom: 2px solid var(--ink);
    padding: 0;
    margin: 40px 0 24px;
    display: flex;
    gap: 4px;
}
.woocommerce div.product .woocommerce-tabs ul.tabs::before { display: none; }
.woocommerce div.product .woocommerce-tabs ul.tabs li {
    background: transparent;
    border: none;
    border-radius: 0;
    margin: 0;
    padding: 0;
}
.woocommerce div.product .woocommerce-tabs ul.tabs li::before,
.woocommerce div.product .woocommerce-tabs ul.tabs li::after { display: none; }
.woocommerce div.product .woocommerce-tabs ul.tabs li a {
    padding: 12px 18px;
    font-family: var(--font-mono);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--ink-mute);
    font-weight: 600;
    border: none;
    background: transparent;
    border-radius: 0;
    text-shadow: none;
}
.woocommerce div.product .woocommerce-tabs ul.tabs li.active a { color: var(--ink); border-bottom: 2px solid var(--accent); margin-bottom: -2px; }

/* Cart / checkout */
.woocommerce-cart-form,
.woocommerce-checkout { max-width: var(--max-wide); margin: 60px auto; padding: 0 32px; }
.woocommerce-cart .cart-collaterals,
.woocommerce-cart-form table.shop_table { margin-bottom: 32px; }
.cart_totals h2,
.woocommerce-checkout h3 { font-family: var(--font-serif); font-size: 24px; margin-bottom: 16px; }

/* Form rows */
.woocommerce form .form-row { margin: 0 0 16px; padding: 0; }
.woocommerce form .form-row label { font-size: 13px; font-weight: 600; margin-bottom: 6px; color: var(--ink); }
.woocommerce form .form-row .required { color: var(--accent); }

/* Login / Register */
.woocommerce-form-login,
.woocommerce-form-register {
    background: white;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 32px;
    box-shadow: var(--shadow);
}

/* =============================================================
   11 · Course page (LMS)
   ============================================================= */
.course-shell {
    display: grid;
    grid-template-columns: 280px 1fr;
    max-width: var(--max-wide);
    margin: 0 auto;
    min-height: calc(100vh - 130px);
}
.course-aside {
    border-right: 1px solid var(--line);
    padding: 40px 24px 40px 32px;
    background: rgba(245, 240, 232, 0.5);
    position: sticky;
    top: 64px;
    height: calc(100vh - 64px);
    overflow-y: auto;
}
.course-aside h4 {
    font-family: var(--font-mono);
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    color: var(--ink-faint);
    margin: 24px 0 10px;
    font-weight: 700;
}
.course-progress {
    background: white;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 14px;
    margin-bottom: 24px;
}
.course-progress-bar {
    height: 4px;
    background: var(--line);
    border-radius: 2px;
    overflow: hidden;
    margin: 8px 0;
}
.course-progress-fill { height: 100%; background: var(--accent); transition: width 0.3s; }
.course-progress-meta {
    display: flex;
    justify-content: space-between;
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--ink-mute);
}
.course-aside ul.lessons { list-style: none; margin: 0; padding: 0; }
.course-aside ul.lessons li {
    counter-increment: lesson;
    padding: 0;
    margin: 0;
}
.course-aside ul.lessons li a {
    display: block;
    padding: 10px 14px 10px 38px;
    position: relative;
    border-left: 2px solid transparent;
    margin-left: -14px;
    font-size: 13.5px;
    color: var(--ink-soft);
}
.course-aside ul.lessons li a::before {
    content: counter(lesson, decimal-leading-zero);
    position: absolute;
    left: 4px;
    top: 11px;
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--ink-faint);
    font-weight: 600;
}
.course-aside ul.lessons { counter-reset: lesson; }
.course-aside ul.lessons li.is-active a { border-left-color: var(--accent); color: var(--ink); font-weight: 600; }
.course-aside ul.lessons li.is-completed a::before { content: '✓'; color: var(--moss); }
.course-aside ul.lessons li a:hover { color: var(--accent); }

.course-main { padding: 60px 80px 100px; max-width: 920px; }
.course-content { font-size: 16.5px; line-height: 1.7; }
.course-content h2 { margin: 40px 0 16px; }
.course-content h3 { margin: 32px 0 12px; }
.course-content .products {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 18px;
    margin: 24px 0;
    padding: 0;
}
.course-content .products .product-card {
    display: block;
    min-width: 0;
    padding: 24px 24px 24px 32px;
}
.course-content .products .product-card::before {
    width: 5px;
}
.course-content .products .product-card.moss::before {
    background: var(--moss);
}
.course-content .products .product-card.gold::before {
    background: var(--gold);
}
.course-content .products .product-card.ink::before {
    background: var(--ink);
}
.course-content .products .product-card .product-meta {
    font-family: var(--font-mono);
    font-size: 10px;
    line-height: 1.35;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--ink-mute);
    margin: 0 0 10px;
    overflow-wrap: anywhere;
}
.course-content .products .product-card h4 {
    font-size: 21px;
    line-height: 1.15;
    margin: 0 0 8px;
    overflow-wrap: anywhere;
}
.course-content .products .product-card p {
    font-size: 14.5px;
    line-height: 1.5;
    color: var(--ink-soft);
    margin: 0;
    overflow-wrap: anywhere;
}

.lesson-nav {
    display: flex;
    justify-content: space-between;
    margin-top: 60px;
    padding-top: 32px;
    border-top: 1px solid var(--line);
    gap: 16px;
}
.lesson-nav a { flex: 1; max-width: 280px; }

.lesson-locked {
    background: white;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 40px 32px;
    text-align: center;
    box-shadow: var(--shadow);
}
.lesson-locked .lock-icon {
    width: 56px;
    height: 56px;
    border: 2px solid var(--ink);
    border-radius: 50%;
    margin: 0 auto 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

/* =============================================================
   12 · Footer
   ============================================================= */
.site-footer {
    background: #111111;
    color: var(--paper);
    padding: 60px 32px 32px;
    margin-top: 120px;
}
.site-footer__inner {
    max-width: var(--max-wide);
    margin: 0 auto;
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 48px;
}
.site-footer h5 {
    font-family: var(--font-mono);
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--accent-soft);
    margin: 0 0 14px;
    font-weight: 700;
}
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer ul li { padding: 4px 0; }
.site-footer a { color: rgba(245, 240, 232, 0.8); font-size: 14px; }
.site-footer a:hover { color: white; }
.site-footer__brand h3 { font-family: var(--font-serif); font-size: 24px; margin-bottom: 12px; color: var(--paper); }
.site-footer__brand p { color: rgba(245, 240, 232, 0.65); font-size: 14px; max-width: 320px; line-height: 1.6; }
.site-footer__legal {
    border-top: 1px solid rgba(245, 240, 232, 0.15);
    margin: 48px auto 0;
    padding-top: 24px;
    max-width: var(--max-wide);
    display: flex;
    justify-content: space-between;
    font-family: var(--font-mono);
    font-size: 11px;
    color: rgba(245, 240, 232, 0.5);
    letter-spacing: 0.04em;
    flex-wrap: wrap;
    gap: 12px;
}

/* =============================================================
   13 · Pagination
   ============================================================= */
.pagination, .woocommerce nav.woocommerce-pagination ul {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin: 40px 0;
    list-style: none;
    padding: 0;
    border: none;
}
.woocommerce nav.woocommerce-pagination ul li {
    border: none;
    margin: 0;
}
.woocommerce nav.woocommerce-pagination ul li a,
.woocommerce nav.woocommerce-pagination ul li span {
    background: white;
    border: 1px solid var(--line);
    color: var(--ink);
    padding: 8px 14px;
    border-radius: var(--radius);
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 600;
}
.woocommerce nav.woocommerce-pagination ul li span.current,
.woocommerce nav.woocommerce-pagination ul li a:hover { background: var(--ink); color: var(--paper); border-color: var(--ink); }

/* =============================================================
   14 · Misc utilities
   ============================================================= */
.text-center { text-align: center; }
.text-mute { color: var(--ink-mute); }
.mb-0 { margin-bottom: 0; }
.mb-2 { margin-bottom: 16px; }
.mb-4 { margin-bottom: 32px; }
.mt-4 { margin-top: 32px; }
.divider { border-top: 2px solid var(--ink); margin: 48px 0; }
.divider-soft { border-top: 1px solid var(--line); margin: 32px 0; }

/* Skip link a11y */
.skip-link {
    position: absolute;
    left: -9999px;
    top: auto;
    width: 1px;
    height: 1px;
    overflow: hidden;
}
.skip-link:focus {
    left: 16px;
    top: 16px;
    width: auto;
    height: auto;
    background: var(--ink);
    color: var(--paper);
    padding: 8px 14px;
    z-index: 100;
    border-radius: var(--radius);
}

/* Screen reader only */
.screen-reader-text {
    border: 0;
    clip: rect(1px, 1px, 1px, 1px);
    clip-path: inset(50%);
    height: 1px;
    margin: -1px;
    overflow: hidden;
    padding: 0;
    position: absolute;
    width: 1px;
    word-wrap: normal !important;
}

/* =============================================================
   15 · Responsive
   ============================================================= */
@media (max-width: 1024px) {
    .site-footer__inner { grid-template-columns: 1fr 1fr; gap: 32px; }
    .course-grid--catalog { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
    .site-header__inner { padding: 14px 20px; }
    .site-nav__menu { display: none; }
    .site-nav.is-open .site-nav__menu {
        display: flex;
        flex-direction: column;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--paper);
        border-bottom: 1px solid var(--line);
        padding: 16px 20px;
        gap: 0;
        box-shadow: var(--shadow);
    }
    .site-nav.is-open .site-nav__menu li { padding: 8px 0; border-bottom: 1px solid var(--line); }
    .site-nav.is-open .site-nav__menu li:last-child { border-bottom: none; }
    .mobile-toggle { display: inline-flex; }
    .shell-with-aside { grid-template-columns: 1fr; }
    .shell-with-aside > aside { position: static; height: auto; border-right: none; border-bottom: 1px solid var(--line); }
    .shell-with-aside > main { padding: 40px 24px 80px; }
    .account-shell, .course-shell, .cm-account-layout { grid-template-columns: 1fr; }
    .account-aside, .course-aside, .woocommerce-MyAccount-navigation { position: static; height: auto; border-right: none; border-bottom: 1px solid var(--line); min-height: 0; }
    .account-main, .course-main, .woocommerce-MyAccount-content { padding: 40px 24px 80px; }
    .woocommerce-account .woocommerce { padding: 0; }
    .woocommerce div.product { grid-template-columns: 1fr; gap: 24px; }
    .cm-auth-shell { padding: 52px 20px 72px; }
    .cm-auth-grid { grid-template-columns: 1fr; }
    .cm-account-stats { grid-template-columns: 1fr; }
    .cm-account-hero h1 { font-size: 40px; }
    .course-content .products { grid-template-columns: 1fr; }
    .course-content .products .product-card { padding: 22px 22px 22px 30px; }
    h1 { font-size: 40px; }
    .hero { padding: 60px 24px 40px; }
}
@media (max-width: 600px) {
    .site-footer__inner { grid-template-columns: 1fr; }
    .site-footer__legal { flex-direction: column; }
    .products-grid, .course-grid, .course-grid--catalog, .faq-grid, ul.products { grid-template-columns: 1fr; }
    .product-card__footer .btn { width: 100%; }
}

/* WordPress core */
.alignleft { float: left; margin-right: 24px; }
.alignright { float: right; margin-left: 24px; }
.aligncenter { display: block; margin-left: auto; margin-right: auto; }
.alignwide { max-width: 1100px; margin-left: auto; margin-right: auto; }
.alignfull { width: 100vw; margin-left: calc(50% - 50vw); }
.wp-caption { max-width: 100%; }
.wp-caption-text { font-size: 13px; color: var(--ink-mute); margin-top: 6px; }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 8px; }
