/* ==========================================================================
   BRICOCALCULA - Premium Design System (CSS Vanilla)
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&display=swap');

:root {
    /* Color Palette */
    --primary: #FF6B35;          /* Industrial Orange (Call to Action) */
    --primary-hover: #E85A27;
    --secondary: #0F172A;        /* Deep Industrial Blue-Grey (Slate 900) */
    --secondary-light: #1E293B;  /* Slate 800 */
    --accent: #2563EB;           /* Vivid Blue */
    --background: #F8FAFC;       /* Light Slate Background (Slate 50) */
    --surface: #FFFFFF;          /* Card Background */
    --text: #0F172A;             /* Dark Text */
    --text-muted: #64748B;       /* Muted Slate Text */
    --border: #E2E8F0;           /* Subtle Border */
    --success: #10B981;          /* Success Green */
    
    /* Layout and Spacing */
    --font-sans: 'Outfit', sans-serif;
    --radius-sm: 8px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --shadow: 0 4px 20px -2px rgba(15, 23, 42, 0.06), 0 2px 8px -1px rgba(15, 23, 42, 0.04);
    --shadow-lg: 0 20px 25px -5px rgba(15, 23, 42, 0.1), 0 10px 10px -5px rgba(15, 23, 42, 0.04);
}

/* Base Styles */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: var(--font-sans);
    background-color: var(--background);
    color: var(--text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

a {
    color: inherit;
    text-decoration: none;
    transition: var(--transition);
}

/* Layout Utilities */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

/* Header & Navigation */
header {
    background-color: var(--secondary);
    color: white;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 80px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 24px;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.logo span {
    color: var(--primary);
}

.logo svg {
    fill: var(--primary);
}

nav ul {
    display: flex;
    gap: 32px;
    list-style: none;
}

nav a {
    font-weight: 500;
    font-size: 16px;
    opacity: 0.85;
    position: relative;
    padding: 8px 0;
}

nav a:hover, nav a.active {
    opacity: 1;
    color: var(--primary);
}

nav a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--primary);
    transition: var(--transition);
}

nav a:hover::after, nav a.active::after {
    width: 100%;
}

/* Hero Section */
.hero {
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.85) 0%, rgba(30, 41, 59, 0.9) 100%), url('images/hero-diy.png') no-repeat center/cover;
    color: white;
    padding: 90px 0;
    text-align: center;
    position: relative;
    overflow: hidden;
    border-bottom: 3px solid var(--primary);
}

.hero::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,107,53,0.05) 0%, transparent 60%);
    pointer-events: none;
}

.hero h1 {
    font-size: 48px;
    font-weight: 700;
    letter-spacing: -1px;
    margin-bottom: 16px;
    line-height: 1.2;
}

.hero h1 span {
    color: var(--primary);
}

.hero p {
    font-size: 20px;
    opacity: 0.8;
    max-width: 600px;
    margin: 0 auto;
}

/* Main Section Grid */
.main-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 40px;
    margin: 60px 0;
}

@media (min-width: 992px) {
    .main-layout {
        grid-template-columns: 2fr 1fr;
    }
}

/* Calculator Component */
.calc-card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border);
    overflow: hidden;
}

/* Pestañas (Tabs) */
.calc-tabs {
    display: flex;
    background-color: #F1F5F9;
    border-bottom: 1px solid var(--border);
}

.tab-btn {
    flex: 1;
    background: none;
    border: none;
    padding: 18px 12px;
    font-family: var(--font-sans);
    font-size: 16px;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.tab-btn:hover {
    color: var(--text);
    background-color: rgba(0,0,0,0.02);
}

.tab-btn.active {
    color: var(--primary);
    background-color: var(--surface);
    border-bottom: 3px solid var(--primary);
}

/* Form Styles */
.calc-body {
    padding: 32px;
}

.calc-section {
    display: none;
}

.calc-section.active {
    display: block;
    animation: fadeIn 0.4s ease;
}

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

.form-group {
    margin-bottom: 24px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
}

@media (min-width: 576px) {
    .form-row {
        grid-template-columns: 1fr 1fr;
    }
}

label {
    display: block;
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 8px;
    color: var(--secondary-light);
}

input[type="number"], select {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: var(--font-sans);
    font-size: 16px;
    color: var(--text);
    background-color: #FFFFFF;
    transition: var(--transition);
    outline: none;
}

input[type="number"]:focus, select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(255, 107, 53, 0.1);
}

/* Checkbox & Switches */
.checkbox-group {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    user-select: none;
    font-weight: 500;
}

.checkbox-group input {
    width: 20px;
    height: 20px;
    accent-color: var(--primary);
}

/* Button Premium */
.btn {
    width: 100%;
    background-color: var(--primary);
    color: white;
    border: none;
    padding: 16px 24px;
    font-family: var(--font-sans);
    font-size: 18px;
    font-weight: 700;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 4px 12px rgba(255, 107, 53, 0.2);
}

.btn:hover {
    background-color: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 107, 53, 0.3);
}

.btn:active {
    transform: translateY(0);
}

/* Calculator Results Panel */
.results-panel {
    margin-top: 32px;
    padding: 24px;
    background-color: #F8FAFC;
    border: 1px dashed var(--border);
    border-radius: var(--radius-md);
    display: none;
}

.results-panel.active {
    display: block;
    animation: slideDown 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes slideDown {
    from { opacity: 0; max-height: 0; }
    to { opacity: 1; max-height: 500px; }
}

.results-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--secondary);
}

.results-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}

@media (min-width: 576px) {
    .results-grid {
        grid-template-columns: 1fr 1fr;
    }
}

.result-item {
    background: var(--surface);
    padding: 16px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
}

.result-label {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 0.5px;
}

.result-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--primary);
    margin-top: 4px;
}

.result-value span {
    font-size: 16px;
    font-weight: 500;
    color: var(--text);
    margin-left: 4px;
}

/* Content & Sidebar */
.content-area {
    display: flex;
    flex-direction: column;
    gap: 40px;
}

.sidebar {
    display: flex;
    flex-direction: column;
    gap: 32px;
}

.sidebar-widget {
    background: var(--surface);
    padding: 28px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
}

.widget-title {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 20px;
    position: relative;
    padding-bottom: 8px;
}

.widget-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 40px;
    height: 3px;
    background-color: var(--primary);
}

/* EEAT Author Box Widget */
.author-widget {
    text-align: center;
}

.author-avatar {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    background-color: var(--border);
    margin: 0 auto 16px;
    overflow: hidden;
    border: 3px solid var(--primary);
}

.author-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.author-name {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 4px;
}

.author-title {
    font-size: 14px;
    color: var(--primary);
    font-weight: 600;
    margin-bottom: 12px;
}

.author-bio {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 16px;
}

/* Callout Box inside content */
.callout-box {
    background: linear-gradient(135deg, #FFF7ED 0%, #FFEDD5 100%);
    border-left: 5px solid var(--primary);
    padding: 24px;
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    margin: 32px 0;
}

.callout-box h4 {
    font-size: 18px;
    font-weight: 700;
    color: #C2410C;
    margin-bottom: 8px;
}

/* Cards de Artículos */
.post-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
}

@media (min-width: 768px) {
    .post-grid {
        grid-template-columns: 1fr 1fr;
    }
}

.post-card {
    background: var(--surface);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
}

.post-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.post-card-content {
    padding: 24px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.post-card-tag {
    font-size: 12px;
    font-weight: 700;
    color: var(--primary);
    text-transform: uppercase;
    margin-bottom: 8px;
}

.post-card-title {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 12px;
    line-height: 1.3;
}

.post-card-excerpt {
    font-size: 15px;
    color: var(--text-muted);
    margin-bottom: 16px;
    flex-grow: 1;
}

.post-card-link {
    font-weight: 600;
    font-size: 14px;
    color: var(--accent);
    display: flex;
    align-items: center;
    gap: 4px;
}

.post-card-link:hover {
    color: var(--primary);
}

/* Legal Pages Template Styling */
.legal-content {
    background: var(--surface);
    padding: 40px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    margin: 40px 0;
}

.legal-content h2 {
    margin: 28px 0 16px;
    font-size: 24px;
    font-weight: 700;
}

.legal-content h3 {
    margin: 20px 0 12px;
    font-size: 18px;
    font-weight: 600;
}

.legal-content p {
    margin-bottom: 16px;
    color: var(--secondary-light);
}

.legal-content ul {
    margin: 0 0 20px 24px;
}

/* Contact Page Form */
.contact-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.contact-form textarea {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: var(--font-sans);
    font-size: 16px;
    min-height: 150px;
    outline: none;
    transition: var(--transition);
}

.contact-form textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(255, 107, 53, 0.1);
}

/* Footer */
footer {
    background-color: var(--secondary);
    color: white;
    padding: 60px 0 30px;
    margin-top: 80px;
    border-top: 4px solid var(--primary);
}

.footer-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 40px;
    margin-bottom: 40px;
}

@media (min-width: 768px) {
    .footer-grid {
        grid-template-columns: 2fr 1fr 1fr;
    }
}

.footer-col h4 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 20px;
    color: var(--primary);
}

.footer-col p {
    font-size: 15px;
    opacity: 0.8;
}

.footer-col ul {
    list-style: none;
}

.footer-col ul li {
    margin-bottom: 12px;
}

.footer-col ul a {
    font-size: 15px;
    opacity: 0.8;
}

.footer-col ul a:hover {
    opacity: 1;
    color: var(--primary);
    padding-left: 4px;
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 30px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    align-items: center;
    font-size: 14px;
    color: var(--text-muted);
}

@media (min-width: 768px) {
    .footer-bottom {
        flex-direction: row;
        justify-content: space-between;
    }
}

.footer-bottom-links {
    display: flex;
    gap: 20px;
}

.footer-bottom-links a:hover {
    color: white;
}

/* Custom Image Styling for Blog and Detail Pages */
.post-card-img-container {
    width: 100%;
    height: 200px;
    overflow: hidden;
    position: relative;
    border-bottom: 1px solid var(--border);
}

.post-card-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

.post-card:hover .post-card-img {
    transform: scale(1.05);
}

.blog-detail-img {
    width: 100%;
    max-height: 400px;
    object-fit: cover;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow);
    margin: 16px 0 32px 0;
    border: 1px solid var(--border);
}

