/* =========================================================
   GLOBAL VARIABLES - SISTEMA DE DISEÑO UNIFICADO
   ========================================================= */
:root {
    /* Brand - verde principal (mismo que en style.css) */
    --color-accent: #16a34a;
    --color-accent-light: #22c55e;
    --color-accent-dark: #15803d;
    --color-accent-bg: #f0fdf4;
    --color-accent-soft: #dcfce7;

    /* Textos */
    --color-text: #334155;
    --color-text-strong: #0f172a;
    --color-muted: #64748b;
    --color-white: #ffffff;

    /* Fondos */
    --color-bg: #f8fafc;
    --color-card-bg: #ffffff;
    --color-section-alt: #f1f5f9;

    /* Borders */
    --color-border: #e2e8f0;
    --color-border-strong: #cbd5e1;

    /* Layout */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-hover: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);

    /* Radius */
    --radius-sm: 0.5rem;
    --radius-md: 0.75rem;
    --radius-lg: 1rem;
    --radius-xl: 1.5rem;
    --radius-full: 9999px;

    /* Article typography */
    --article-font-serif: 'Lora', Georgia, 'Times New Roman', serif;
    --article-font-sans: 'DM Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    --article-font-heading: 'Playfair Display', var(--article-font-serif);
    
    /* Article colors */
    --article-text: #475569;
    --article-text-strong: #1e293b;
    --article-muted: #94a3b8;
}

/* =========================================================
   RESET Y BASE
   ========================================================= */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--article-font-sans);
    background: var(--color-bg);
    color: var(--color-text);
    line-height: 1.6;
}

/* =========================================================
   ARTICLE WRAPPER
   ========================================================= */
.article-wrapper {
    max-width: 1100px;
    margin: 2rem auto;
    background: var(--color-card-bg);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    padding: clamp(1.5rem, 5vw, 3rem);
}

@media (max-width: 768px) {
    .article-wrapper {
        margin: 1rem;
        padding: 1.25rem;
        border-radius: var(--radius-lg);
    }
}

/* =========================================================
   INTRO - TÍTULO PRINCIPAL
   ========================================================= */
.article-intro {
    text-align: center;
    max-width: 42rem;
    margin: 0 auto 2.5rem;
}

.article-main-title {
    font-family: var(--article-font-heading);
    font-size: clamp(2rem, 5vw, 2.8rem);
    font-weight: 700;
    color: var(--color-text-strong);
    line-height: 1.2;
    margin-bottom: 1.25rem;
    letter-spacing: -0.02em;
}

.article-main-title span {
    background: linear-gradient(135deg, var(--color-accent) 0%, var(--color-accent-light) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.article-intro-text {
    font-size: clamp(1rem, 2vw, 1.125rem);
    color: var(--color-text);
    margin-bottom: 1rem;
    line-height: 1.7;
}

.article-intro-highlight {
    background: var(--color-accent-bg);
    border-radius: var(--radius-full);
    padding: 0.75rem 1.5rem;
    display: inline-block;
    font-weight: 600;
    color: var(--color-accent-dark);
    border: 1px solid var(--color-accent-soft);
    margin-top: 1rem;
}

/* =========================================================
   ARTICLE MENU - ÍNDICE MEJORADO
   ========================================================= */
.article-menu {
    background: var(--color-white);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: clamp(1.5rem, 3vw, 2rem);
    margin: 2rem 0 3rem;
    box-shadow: var(--shadow-md);
    position: relative;
    overflow: hidden;
}

.article-menu::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--color-accent-light), var(--color-accent-dark));
}

.article-menu-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--color-accent-soft);
}

.article-menu-header h2 {
    font-family: var(--article-font-heading);
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--color-text-strong);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.article-menu-header h2 i {
    color: var(--color-accent);
    font-size: 1.5rem;
}

.article-menu-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 0.5rem;
}

/* Enlace wrapper para que número y texto sean clickables */
.article-menu-link-wrapper {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 1rem;
    width: 100%;
    text-decoration: none;
    color: inherit;
    transition: all 0.2s ease;
    border-radius: var(--radius-md);
    background: var(--color-white);
    border: 1px solid transparent;
}

/* Hover en escritorio */
@media (min-width: 769px) {
    .article-menu-link-wrapper:hover {
        transform: translateY(-2px);
        border-color: var(--color-accent-soft);
        box-shadow: var(--shadow-sm);
        background: var(--color-white);
    }
    
    .article-menu-link-wrapper:hover .article-menu-number {
        background: var(--color-accent);
        color: white;
    }
}

/* Estado active en móvil */
@media (max-width: 768px) {
    .article-menu-link-wrapper:active {
        transform: scale(0.98);
        background: var(--color-accent-bg);
    }
    
    .article-menu-link-wrapper:active .article-menu-number {
        background: var(--color-accent);
        color: white;
    }
}

.article-menu-number {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-accent-bg);
    color: var(--color-accent-dark);
    font-weight: 700;
    font-size: 0.9rem;
    border-radius: var(--radius-full);
    transition: all 0.2s;
    flex-shrink: 0;
}

.article-menu-link {
    color: var(--color-text-strong);
    font-weight: 500;
    flex: 1;
}

/* =========================================================
   ARTICLE BODY Y SECCIONES
   ========================================================= */
.article-body {
    max-width: 48rem;
    margin: 0 auto;
}

.article-section {
    margin-bottom: 2.5rem;
    padding: 2rem;
    background: var(--color-white);
    border-radius: var(--radius-lg);
    border: 1px solid var(--color-border);
    transition: all 0.3s ease;
    scroll-margin-top: 2rem;
}

.article-section:hover {
    box-shadow: var(--shadow-hover);
    border-color: var(--color-accent-soft);
}

.article-section h2 {
    font-family: var(--article-font-heading);
    font-size: clamp(1.35rem, 3vw, 1.75rem);
    font-weight: 700;
    color: var(--color-text-strong);
    margin-bottom: 1.25rem;
    padding-bottom: 0.75rem;
    border-bottom: 3px solid var(--color-accent-soft);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.article-section h2 i {
    color: var(--color-accent);
    font-size: 1.5rem;
}

.article-section h3 {
    font-family: var(--article-font-sans);
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--color-text-strong);
    margin: 1.5rem 0 1rem;
    padding-left: 1rem;
    border-left: 4px solid var(--color-accent);
}

/* =========================================================
   IMÁGENES
   ========================================================= */
.article-image-container {
    margin: 1.5rem 0 1rem;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--color-border);
    transition: all 0.3s;
}

.article-image-container:hover {
    transform: scale(1.01);
    box-shadow: var(--shadow-lg);
}

.article-image {
    width: 100%;
    height: auto;
    display: block;
    aspect-ratio: 16/9;
    object-fit: cover;
}

.img-caption {
    padding: 0.75rem 1rem;
    background: var(--color-section-alt);
    font-size: 0.85rem;
    color: var(--color-muted);
    border-top: 1px solid var(--color-border);
    text-align: center;
}

/* =========================================================
   TABLAS
   ========================================================= */
.table-responsive {
    overflow-x: auto;
    margin: 1.5rem 0;
    border-radius: var(--radius-md);
    border: 1px solid var(--color-border);
    background: white;
}

.article-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
    min-width: 500px;
}

.article-table th {
    background: var(--color-accent-bg);
    color: var(--color-accent-dark);
    font-weight: 600;
    padding: 0.875rem 1rem;
    text-align: left;
    border-bottom: 2px solid var(--color-accent-soft);
}

.article-table td {
    padding: 0.875rem 1rem;
    border-bottom: 1px solid var(--color-border);
    color: var(--color-text);
}

.article-table tbody tr:hover td {
    background: var(--color-section-alt);
}

/* =========================================================
   NOTAS Y DESTACADOS
   ========================================================= */
.article-note {
    display: flex;
    gap: 1rem;
    padding: 1.5rem;
    margin: 1.5rem 0;
    background: var(--color-accent-bg);
    border-radius: var(--radius-lg);
    border-left: 4px solid var(--color-accent);
    box-shadow: var(--shadow-sm);
}

.article-note i {
    font-size: 1.8rem;
    color: var(--color-accent);
}

.article-note-content {
    flex: 1;
}

.article-note-content strong {
    color: var(--color-accent-dark);
    display: block;
    margin-bottom: 0.5rem;
    font-size: 1rem;
}

.calculo-ejemplo {
    background: var(--color-accent-bg);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    margin: 1.5rem 0;
    border: 1px solid var(--color-accent-soft);
}

.calculo-ejemplo pre {
    font-family: var(--article-font-sans);
    white-space: pre-wrap;
    color: var(--color-text-strong);
    font-size: 0.95rem;
    line-height: 1.6;
}

/* =========================================================
   LISTAS
   ========================================================= */
.styled-list {
    list-style: none;
    padding: 0;
}

.styled-list li {
    padding: 0.5rem 0 0.5rem 1.75rem;
    position: relative;
    border-bottom: 1px dashed var(--color-border);
}

.styled-list li:last-child {
    border-bottom: none;
}

.styled-list li::before {
    content: "→";
    position: absolute;
    left: 0;
    color: var(--color-accent);
    font-weight: 600;
}

.error-list {
    list-style: none;
    display: grid;
    gap: 0.75rem;
}

.error-list li {
    padding: 0.875rem 0.875rem 0.875rem 2.25rem;
    background: var(--color-white);
    border-radius: var(--radius-md);
    border: 1px solid var(--color-border);
    position: relative;
    transition: all 0.2s;
}

.error-list li:hover {
    border-color: var(--color-accent);
    transform: translateX(4px);
}

.error-list li::before {
    content: "⚠️";
    position: absolute;
    left: 0.75rem;
    top: 0.8rem;
    font-size: 1rem;
}

/* =========================================================
   FAQS
   ========================================================= */
.faq-grid {
    display: grid;
    gap: 1rem;
    margin-top: 1.5rem;
}

.faq-item {
    background: var(--color-white);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: 1rem 1.25rem;
    transition: all 0.2s;
}

.faq-item:hover {
    border-color: var(--color-accent);
    box-shadow: var(--shadow-sm);
}

.faq-item strong {
    color: var(--color-accent-dark);
    display: block;
    margin-bottom: 0.5rem;
    font-size: 1rem;
}

 /* =========================================================
   ARTICLE NOTE CTA - VERSIÓN MINIMALISTA
   ========================================================= */
.article-note-cta {
    display: flex;
    gap: 1.5rem;
    padding: 1.25rem 1.5rem;
    margin: 1.5rem 0;
    background: transparent;
    border-radius: var(--radius-lg);
    border: 1px solid var(--color-border);
    align-items: center;
    flex-wrap: wrap;
    transition: all 0.3s ease;
}

.article-note-cta:hover {
    border-color: var(--color-accent-soft);
    background: var(--color-white);
}

.article-note-cta i {
    font-size: 1.5rem;
    color: var(--color-muted);
    flex-shrink: 0;
    transition: color 0.3s ease;
}

.article-note-cta:hover i {
    color: var(--color-accent);
}

.article-note-cta-content {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
}

.article-note-cta-content strong {
    font-size: 1rem;
    color: var(--color-text-strong);
    display: block;
    margin-bottom: 0.25rem;
    font-weight: 600;
}

.article-note-cta-content p {
    margin: 0;
    color: var(--color-muted);
    font-size: 0.85rem;
}

/* Botón minimalista */
.article-note-cta .presupuesto-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    background: transparent;
    color: var(--color-accent);
    border: 1px solid var(--color-accent-soft);
    padding: 0.6rem 1.25rem;
    font-size: 0.85rem;
    font-weight: 500;
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    white-space: nowrap;
}

.article-note-cta .presupuesto-button:hover {
    background: var(--color-accent);
    color: white;
    border-color: var(--color-accent);
    transform: translateY(-1px);
}

.article-note-cta .presupuesto-button i {
    font-size: 0.8rem;
    margin: 0;
    color: inherit;
}

/* =========================================================
   PRESUPUESTO CARD - VERSIÓN MINIMALISTA
   ========================================================= */
.presupuesto-card-simple {
    background: var(--color-white);
    border-radius: var(--radius-lg);
    padding: 2rem;
    color: var(--color-text-strong);
    text-align: center;
    margin: 2.5rem auto 1rem;
    box-shadow: none;
    width: 100%;
    max-width: 800px;
    border: 1px solid var(--color-border);
    transition: all 0.3s ease;
}

.presupuesto-card-simple:hover {
    border-color: var(--color-accent-soft);
    box-shadow: var(--shadow-sm);
}

.presupuesto-card-simple .presupuesto-icon {
    font-size: 2rem;
    margin-bottom: 1rem;
    color: var(--color-muted);
}

.presupuesto-card-simple h3 {
    font-family: var(--article-font-heading);
    font-size: 1.4rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: var(--color-text-strong);
}

.presupuesto-text {
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
    color: var(--color-muted);
    max-width: 450px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.5;
}

/* Botón minimalista */
.presupuesto-button-simple {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    background: transparent;
    color: var(--color-accent);
    border: 1px solid var(--color-accent-soft);
    padding: 0.7rem 1.75rem;
    font-size: 0.9rem;
    font-weight: 500;
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}

.presupuesto-button-simple:hover {
    background: var(--color-accent);
    color: white;
    border-color: var(--color-accent);
    transform: translateY(-1px);
}

/* Features minimalistas */
.presupuesto-features-simple {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-top: 1.5rem;
    flex-wrap: wrap;
    font-size: 0.75rem;
}

.presupuesto-features-simple span {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--color-muted);
    background: transparent;
    padding: 0;
}

.presupuesto-features-simple i {
    color: var(--color-accent);
    font-size: 0.7rem;
    opacity: 0.8;
}

/* =========================================================
   RESPONSIVE - CORREGIDO
   ========================================================= */
@media (max-width: 768px) {
    .article-note-cta {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
        padding: 1.25rem;
    }
    
    .article-note-cta-content {
        flex-direction: column;
        text-align: center;
    }
    
    .article-note-cta .presupuesto-button {
        width: 100%;
        justify-content: center;
        white-space: normal;
    }
    
    /* CORREGIDO: margin auto en lugar de valores fijos */
    .presupuesto-card-simple {
        padding: 1.5rem;
        margin: 2rem auto;
        width: calc(100% - 2rem);
        max-width: 100%;
    }
    
    .presupuesto-card-simple h3 {
        font-size: 1.2rem;
    }
    
    .presupuesto-button-simple {
        width: 100%;
        padding: 0.65rem 1.5rem;
    }
    
    .presupuesto-features-simple {
        flex-direction: column;
        gap: 0.5rem;
        align-items: center;
    }
    
    /* Asegurar que los features también estén centrados */
    .presupuesto-features-simple span {
        justify-content: center;
        width: 100%;
    }
}

@media (max-width: 480px) {
    .presupuesto-card-simple {
        padding: 1.25rem;
        margin: 1.5rem auto;
        width: calc(100% - 1.5rem);
    }
    
    .presupuesto-card-simple h3 {
        font-size: 1.1rem;
    }
    
    .presupuesto-text {
        font-size: 0.85rem;
        margin-bottom: 1.25rem;
    }
    
    .presupuesto-button-simple {
        padding: 0.6rem 1rem;
        font-size: 0.85rem;
    }
    
    .presupuesto-features-simple span {
        font-size: 0.7rem;
    }
}
/* =========================================================
   BACK TO TOP
   ========================================================= */
.back-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 48px;
    height: 48px;
    background: var(--color-accent);
    color: white;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: var(--shadow-lg);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
    border: 2px solid white;
    z-index: 1000;
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    background: var(--color-accent-dark);
    transform: translateY(-4px);
}

/* =========================================================
   GUÍAS RÁPIDAS - TARJETAS
   ========================================================= */
.guia-card {
    background: var(--color-white);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    transition: all 0.2s ease;
    margin-bottom: 1.5rem;
}

.guia-card:hover {
    border-color: var(--color-accent-soft);
    box-shadow: var(--shadow-hover);
    transform: translateY(-2px);
}

.guia-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
    border-bottom: 2px solid var(--color-accent-soft);
    padding-bottom: 0.75rem;
}

.guia-header i {
    font-size: 1.6rem;
    color: var(--color-accent);
    background: var(--color-accent-bg);
    padding: 0.75rem;
    border-radius: var(--radius-md);
    width: 3.2rem;
    height: 3.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.guia-header h2 {
    font-family: var(--article-font-heading);
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--color-text-strong);
    margin: 0;
}

.guia-desc {
    font-size: 0.95rem;
    color: var(--color-text);
    margin-bottom: 1.25rem;
    line-height: 1.6;
}

.guia-desc strong {
    color: var(--color-accent-dark);
    font-weight: 600;
}

.guia-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 0.75rem;
}

.guia-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--color-accent-bg);
    color: var(--color-accent-dark);
    padding: 0.5rem 1rem;
    border-radius: var(--radius-full);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.85rem;
    transition: all 0.2s ease;
    border: 1px solid var(--color-accent-soft);
}

.guia-link:hover {
    background: var(--color-accent);
    color: white;
    border-color: var(--color-accent);
    transform: translateY(-2px);
}

.guia-link:hover i {
    color: white;
}

/* =========================================================
   RESPONSIVE
   ========================================================= */
@media (max-width: 768px) {
    .article-section {
        padding: 1.25rem;
    }
    
    .article-menu-grid {
        grid-template-columns: 1fr;
    }
    
    .guia-header {
        flex-direction: column;
        text-align: center;
        gap: 0.5rem;
    }
    
    .guia-link {
        width: 100%;
        justify-content: center;
    }
    
    .presupuesto-card-simple {
        padding: 1.5rem;
        margin: 2rem 1rem;
    }
    
    .presupuesto-card-simple h3 {
        font-size: 1.3rem;
    }
    
    .presupuesto-button-simple {
        width: 100%;
        padding: 0.7rem 1.25rem;
    }
    
    .presupuesto-features-simple {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .presupuesto-features-simple span {
        width: 100%;
        justify-content: center;
    }
    
    .article-note-cta {
        flex-direction: column;
        text-align: center;
    }
    
    .article-note-cta-content {
        flex-direction: column;
        text-align: center;
    }
    
    .article-note-cta .presupuesto-button {
        width: 100%;
        justify-content: center;
    }
    
    .back-to-top {
        width: 40px;
        height: 40px;
        bottom: 1rem;
        right: 1rem;
    }
}

@media (max-width: 480px) {
    .guia-card {
        padding: 1rem;
    }
    
    .guia-header h2 {
        font-size: 1.2rem;
    }
    
    .article-section h2 {
        font-size: 1.3rem;
    }
    
    .article-table th,
    .article-table td {
        padding: 0.6rem 0.75rem;
        font-size: 0.8rem;
    }
}

.info-minimal {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 2rem;
}

.info-minimal i {
    color: #94a3b8;
    font-size: 0.85rem;
    flex-shrink: 0;
}

.info-minimal p {
    margin: 0;
    font-size: 0.85rem;
    color: #64748b;
    line-height: 1.5;
}