/* ==========================================================================
   ESTILOS UNIFICADOS PARA LAS GUÍAS DEL HACER
   (Horno a leña, Torno, Herramientas y Documentación Técnica)
   ========================================================================== */

:root {
    --bg-color-guia: #fdfaf7;
    --table-bg: #f9f9f9;
}

body.guia-page {
    background:
        radial-gradient(circle at top, rgba(210, 180, 140, 0.42), transparent 34%),
        linear-gradient(180deg, #f7f1e8 0%, #eadcc8 48%, #f3ede2 100%);
    color: var(--color-text);
    line-height: 1.8;
}

/* Encabezados y Top Links */
.top-links {
    padding: 15px 5%;
    background-color: var(--color-dark);
    display: flex;
    gap: 20px;
    position: sticky;
    top: 0;
    z-index: 100;
}

.top-link {
    color: var(--color-light);
    text-decoration: none;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: color 0.3s;
}

.top-link:hover {
    color: var(--color-secondary);
}

.guia-header {
    text-align: center;
    padding: 60px 20px;
    background: linear-gradient(rgba(139, 90, 43, 0.8), rgba(62, 39, 35, 0.9)), url('imagenes/generales/fondo_3.webp') center/cover;
    color: white;
    margin-bottom: 40px;
}

.guia-header h1 {
    font-size: 2.8rem;
    margin-bottom: 15px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
    font-family: 'Stardos Stencil', system-ui;
}

.guia-header p {
    font-size: 1.3rem;
    opacity: 0.95;
    font-family: 'PT Serif', serif;
}

/* Navegación / Índice */
nav, .toc {
    background-color: white;
    margin: 20px auto 40px auto;
    padding: 30px 40px;
    max-width: 800px;
    border-radius: 12px;
    box-shadow: 0 6px 20px rgba(0,0,0,0.06);
    border-top: 4px solid var(--color-primary);
}

nav h2, .toc h2 {
    color: var(--color-dark);
    margin-top: 0;
    border-bottom: 2px solid var(--color-secondary);
    padding-bottom: 10px;
    font-size: 1.8rem;
}

nav ul, .toc ul {
    list-style: none;
    padding: 0;
    margin-top: 20px;
}

nav ul li, .toc ul li {
    margin-bottom: 12px;
}

nav ul li a, .toc ul li a {
    color: var(--color-primary);
    text-decoration: none;
    font-weight: 600;
    font-size: 1.1rem;
    transition: color 0.2s, padding-left 0.2s;
}

nav ul li a:hover, .toc ul li a:hover {
    color: var(--color-accent);
    padding-left: 5px;
}

/* Secciones y Contenido */
.phase-card, section.guia-section {
    max-width: 800px;
    margin: 40px auto;
    padding: 40px;
    background-color: white;
    border-radius: 12px;
    box-shadow: 0 6px 20px rgba(0,0,0,0.05);
}

.phase-card {
    border-left: 5px solid var(--color-primary);
}

.phase-card h2, section.guia-section h2 {
    color: var(--color-dark);
    font-size: 2.2rem;
    border-bottom: 2px solid var(--color-secondary);
    padding-bottom: 10px;
    margin-top: 0;
    margin-bottom: 20px;
}

.phase-card h3, section.guia-section h3 {
    color: var(--color-accent);
    font-size: 1.5rem;
    margin-top: 35px;
    margin-bottom: 15px;
}

.phase-card p, .phase-card ul, .phase-card ol,
section.guia-section p, section.guia-section ul, section.guia-section ol {
    font-size: 1.1rem;
    margin-bottom: 20px;
    color: #444;
}

.phase-card ul, .phase-card ol,
section.guia-section ul, section.guia-section ol {
    padding-left: 25px;
}

.phase-card ul, section.guia-section ul {
    list-style-type: disc;
}

.phase-card ol, section.guia-section ol {
    list-style-type: decimal;
}

.phase-card li, section.guia-section li {
    margin-bottom: 12px;
}

.phase-card li strong, section.guia-section li strong {
    color: var(--color-primary);
}

/* Alertas y Filosofía */
.warning, .alert, .philosophy {
    padding: 22px 24px;
    margin: 30px 0;
    border-radius: 12px;
    font-size: 1.05rem;
    line-height: 1.7;
    position: relative;
    overflow: hidden;
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.06);
}

.warning {
    background: linear-gradient(90deg, #fff9db 0%, #fffdf2 100%);
    border-left: 6px solid #f0b429;
    color: #7a5a00;
}

.alert {
    background: linear-gradient(90deg, #fff1f1 0%, #fff9f9 100%);
    border-left: 6px solid #d9534f;
    color: #7a1f1f;
}

.philosophy {
    max-width: 800px;
    margin: 40px auto;
    background: linear-gradient(90deg, #f8efe0 0%, #fffaf3 100%);
    border-left: 6px solid var(--color-primary);
    color: var(--color-dark);
    box-shadow: 0 10px 24px rgba(0,0,0,0.08);
}

.warning::before,
.alert::before,
.philosophy::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, rgba(255,255,255,0.2), rgba(255,255,255,0.6));
}

.philosophy p {
    font-style: italic;
    margin-top: 15px;
}

/* Tablas */
.table-specs {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    margin-bottom: 30px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.03);
}

.table-specs th, .table-specs td {
    border: 1px solid #ddd;
    padding: 15px;
    text-align: left;
}

.table-specs th {
    background-color: var(--color-primary);
    color: white;
    font-weight: 600;
}

.table-specs tr:nth-child(even) {
    background-color: var(--table-bg);
}

pre, .concept-map pre, .graphic {
    background-color: var(--table-bg);
    padding: 20px;
    border-radius: 8px;
    overflow-x: auto;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.95rem;
    border: 1px solid #ddd;
    margin-bottom: 20px;
    line-height: 1.5;
}

.portada {
    max-width: 800px;
    margin: 0 auto;
}

/* Carrusel de Imágenes */
.slider-container {
    max-width: 800px;
    position: relative;
    margin: 50px auto;
    box-shadow: 0 10px 40px rgba(0,0,0,0.15);
    border-radius: 12px;
    overflow: hidden;
    background-color: #111;
}

.horno-slide {
    display: none;
}

.horno-slide img {
    width: 100%;
    height: auto;
    display: block;
}

.prev, .next {
    cursor: pointer;
    position: absolute;
    top: 50%;
    width: auto;
    padding: 20px;
    margin-top: -30px;
    color: white;
    font-weight: bold;
    font-size: 22px;
    transition: 0.3s ease;
    border-radius: 0 4px 4px 0;
    user-select: none;
    background-color: rgba(0,0,0,0.4);
    text-decoration: none;
}

.next {
    right: 0;
    border-radius: 4px 0 0 4px;
}

.prev:hover, .next:hover {
    background-color: rgba(0,0,0,0.8);
}

.dots-container {
    text-align: center;
    padding: 20px;
    background-color: #1a1a1a;
}

.dot {
    cursor: pointer;
    height: 14px;
    width: 14px;
    margin: 0 6px;
    background-color: #777;
    border-radius: 50%;
    display: inline-block;
    transition: background-color 0.4s ease;
}

.active-dot, .dot:hover {
    background-color: var(--color-secondary);
}

.fade {
    animation-name: fade;
    animation-duration: 1.5s;
}

@keyframes fade {
    from {opacity: .4} 
    to {opacity: 1}
}

/* Botón de descarga */
.pdf-download-btn {
    display: table;
    margin: 40px auto;
    padding: 18px 35px;
    background-color: var(--color-primary);
    color: white;
    text-decoration: none;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 50px;
    transition: all 0.3s ease;
    text-align: center;
    box-shadow: 0 6px 15px rgba(139, 90, 43, 0.3);
}

.pdf-download-btn:hover {
    background-color: var(--color-accent);
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(165, 42, 42, 0.4);
}

@media (max-width: 768px) {
    .top-links {
        padding: 12px 15px;
        gap: 10px;
        flex-wrap: wrap;
        justify-content: center;
    }

    .top-link {
        font-size: 0.94rem;
    }

    .guia-header {
        padding: 48px 16px;
        margin-bottom: 24px;
    }

    .guia-header h1 {
        font-size: 2rem;
        line-height: 1.15;
    }

    .guia-header p {
        font-size: 1rem;
    }

    nav,
    .toc,
    .phase-card,
    section.guia-section,
    .philosophy {
        max-width: calc(100% - 16px);
        margin: 24px auto;
        padding: 24px 16px;
        box-sizing: border-box;
    }

    nav ul,
    .toc ul {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
        gap: 8px;
    }

    nav ul li,
    .toc ul li {
        margin-bottom: 0;
    }

    nav ul li a,
    .toc ul li a {
        display: block;
        width: 100%;
        padding: 10px 12px;
        border-radius: 8px;
        background: #f9f5ee;
        box-sizing: border-box;
    }

    nav h2,
    .toc h2,
    .phase-card h2,
    section.guia-section h2 {
        font-size: 1.7rem;
    }

    .phase-card h3,
    section.guia-section h3 {
        font-size: 1.3rem;
    }

    .phase-card p,
    .phase-card ul,
    .phase-card ol,
    section.guia-section p,
    section.guia-section ul,
    section.guia-section ol {
        font-size: 1rem;
    }

    .warning,
    .alert,
    .philosophy {
        width: 100%;
        box-sizing: border-box;
        margin: 18px 0;
        padding: 18px 16px;
        line-height: 1.6;
    }

    .table-specs {
        display: block;
        width: 100%;
        overflow-x: auto;
        white-space: nowrap;
    }

    .table-specs th,
    .table-specs td {
        padding: 10px;
        font-size: 0.9rem;
    }

    .slider-container {
        width: calc(100% - 16px);
        margin: 30px auto;
    }

    .prev,
    .next {
        padding: 14px;
        font-size: 18px;
    }

    .pdf-download-btn {
        width: calc(100% - 32px);
        max-width: 320px;
        padding: 15px 18px;
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .top-links {
        justify-content: center;
    }

    .guia-header h1 {
        font-size: 1.75rem;
    }

    nav,
    .toc,
    .phase-card,
    section.guia-section {
        padding: 20px 14px;
    }
}

/* ==========================================================================
   ESTILOS DE HERRAMIENTAS Y SIDEBAR
   ========================================================================== */
.tools-wrapper {
    display: flex;
    max-width: 1200px;
    margin: 0 auto 60px auto;
    gap: 30px;
    padding: 0 20px;
    align-items: flex-start;
}

.sidebar {
    width: 280px;
    background-color: white;
    border-radius: 12px;
    padding: 30px 20px;
    box-shadow: 0 6px 20px rgba(0,0,0,0.06);
    position: sticky;
    top: 80px;
}

.search-box {
    width: 100%;
    padding: 12px 15px;
    margin-bottom: 20px;
    border: 1px solid #ddd;
    border-radius: 8px;
    outline: none;
    font-family: inherit;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.search-box:focus {
    border-color: var(--color-primary);
}

.category-btn {
    width: 100%;
    text-align: left;
    padding: 12px 15px;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    color: var(--color-dark);
    margin-bottom: 5px;
    transition: all 0.2s;
    font-weight: 600;
}

.category-btn:hover {
    background-color: rgba(165, 42, 42, 0.05);
}

.category-btn.active {
    background-color: var(--color-primary);
    color: white;
}

.main-content {
    flex: 1;
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 25px;
}

.card {
    background-color: white;
    border: 1px solid #eee;
    border-radius: 12px;
    padding: 20px;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 6px 20px rgba(0,0,0,0.04);
    display: flex;
    flex-direction: column;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(62, 39, 35, 0.1);
    border-color: rgba(62, 39, 35, 0.2);
}

.card img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 15px;
    background-color: #f9f9f9;
}

.card h3 {
    color: var(--color-dark);
    margin-bottom: 10px;
    font-size: 1.25rem;
    font-weight: 600;
    margin-top: 0;
}

.card .tag {
    display: inline-block;
    background-color: rgba(139, 90, 43, 0.1);
    color: var(--color-primary);
    font-size: 0.8rem;
    padding: 5px 12px;
    border-radius: 20px;
    margin-bottom: 12px;
    align-self: flex-start;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.card p {
    color: #555;
    font-size: 0.95rem;
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 0;
}

/* Modal de Herramientas */
.modal {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background-color: rgba(62, 39, 35, 0.8);
    backdrop-filter: blur(5px);
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
    z-index: 2000;
}

.modal.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-content {
    background-color: white;
    width: 90%;
    max-width: 600px;
    padding: 40px;
    border-radius: 16px;
    position: relative;
    transform: scale(0.95);
    transition: transform 0.3s ease;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 50px rgba(0,0,0,0.2);
}

.modal.active .modal-content {
    transform: scale(1);
}

.close-btn {
    position: absolute;
    top: 15px; right: 20px;
    background: none; border: none;
    font-size: 2rem; cursor: pointer; color: #999;
    z-index: 10;
    transition: color 0.2s;
}

.close-btn:hover {
    color: var(--color-accent);
}

.modal img {
    width: 100%;
    height: 300px;
    object-fit: cover;
    border-radius: 12px;
    margin-bottom: 25px;
    background-color: #f0f0f0;
}

.modal h2 {
    color: var(--color-dark);
    margin-top: 0;
    margin-bottom: 20px;
    border-bottom: 2px solid var(--color-secondary);
    padding-bottom: 15px;
    font-size: 1.8rem;
    font-weight: 600;
}

.modal h4 {
    margin-top: 20px;
    color: var(--color-primary);
    font-size: 1.1rem;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.modal p {
    margin-top: 0;
    line-height: 1.7;
    color: #444;
    font-size: 1.05rem;
}

@media (max-width: 768px) {
    .tools-wrapper {
        flex-direction: column;
        padding: 0 15px;
    }
    .sidebar {
        width: 100%;
        position: static;
        margin-bottom: 30px;
        padding: 20px;
    }
    #categoryFilters {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
    }
    .category-btn {
        width: auto;
        flex: 1 1 calc(50% - 8px);
        margin-bottom: 0;
        text-align: center;
        padding: 10px;
        font-size: 0.9rem;
    }
    .grid {
        grid-template-columns: 1fr;
    }
}

/* ==========================================================================
   ESTILOS DE LABORATORIO DE ESMALTADOS
   ========================================================================== */
.chart-container {
    position: relative;
    width: 100%;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
    height: 40vh;
    max-height: 450px;
}

@media (min-width: 768px) {
    .chart-container { height: 50vh; }
}

.fade-in { animation: fadeIn 0.4s ease-in-out; }

@keyframes fadeIn { 
    from { opacity: 0; transform: translateY(10px); } 
    to { opacity: 1; transform: translateY(0); } 
}

/* Botones y Acordeones del Laboratorio */
#btn-mono, #btn-raku { border-radius: 999px !important; border-color: transparent !important; }
#btn-mono.bg-stone-800, #btn-raku.bg-stone-800 { background-color: var(--color-dark) !important; color: white !important; }
#btn-mono.bg-stone-200, #btn-raku.bg-stone-200 { background-color: var(--color-secondary) !important; color: var(--color-dark) !important; }

button[onclick^="toggleAccordion"] { background-color: var(--color-dark) !important; color: white !important; border-radius: 8px; transition: var(--transition); }
button[onclick^="toggleAccordion"]:hover { background-color: var(--color-accent) !important; transform: translateY(-2px); }
button[onclick^="toggleAccordion"] span { color: white !important; }