/*
 Theme Name: Astra Child - EasyPrestamos
 Template: astra
 Description: Custom child theme for EasyPrestamos.com - Spanish loan comparison website
 Version: 1.0
*/

/* ===== CSS VARIABLES ===== */
:root {
    --ep-teal: #2a9d8f;
    --ep-teal-dark: #238b7e;
    --ep-teal-light: #e8f5f3;
    --ep-green: #27ae60;
    --ep-green-dark: #219a52;
    --ep-orange: #e67e22;
    --ep-orange-light: #f39c12;
    --ep-blue: #2c3e50;
    --ep-blue-light: #34495e;
    --ep-gray: #7f8c8d;
    --ep-gray-light: #f8f9fa;
    --ep-gray-border: #e9ecef;
    --ep-white: #ffffff;
    --ep-text: #2c3e50;
    --ep-text-light: #636e72;
    --ep-danger: #e74c3c;
    --ep-radius: 8px;
    --ep-radius-lg: 12px;
    --ep-shadow: 0 2px 8px rgba(0,0,0,0.08);
    --ep-shadow-lg: 0 4px 20px rgba(0,0,0,0.12);
    --ep-transition: all 0.3s ease;
}

/* ===== GLOBAL STYLES ===== */
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: var(--ep-text);
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
    color: var(--ep-blue);
    font-weight: 700;
    line-height: 1.3;
}

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

a:hover {
    color: var(--ep-teal-dark);
}

img {
    display: block !important;
    max-width: 100% !important;
    padding: 0 !important;
    height: auto;
}

/* ===== HEADER ===== */
.ast-primary-header-bar {
    border-bottom: 2px solid var(--ep-teal);
}

.site-header .custom-logo-link img {
    max-height: 45px;
    width: auto;
}

.ast-header-menu-root-list > .menu-item > a {
    font-weight: 600;
    font-size: 15px;
    color: var(--ep-blue) !important;
    padding: 8px 16px !important;
    transition: var(--ep-transition);
}

.ast-header-menu-root-list > .menu-item > a:hover,
.ast-header-menu-root-list > .menu-item.current-menu-item > a {
    color: var(--ep-teal) !important;
}

/* Dropdown menu */
.ast-header-menu-root-list .sub-menu {
    background: var(--ep-white);
    border: 1px solid var(--ep-gray-border);
    border-radius: var(--ep-radius);
    box-shadow: var(--ep-shadow-lg);
    min-width: 220px;
}

.ast-header-menu-root-list .sub-menu li a {
    padding: 10px 20px !important;
    font-size: 14px;
    color: var(--ep-text) !important;
}

.ast-header-menu-root-list .sub-menu li a:hover {
    background: var(--ep-teal-light);
    color: var(--ep-teal) !important;
}

/* ===== HERO SECTION ===== */
.ep-hero {
    background: linear-gradient(135deg, var(--ep-teal) 0%, var(--ep-teal-dark) 100%);
    color: var(--ep-white);
    padding: 60px 20px;
    text-align: center;
}

.ep-hero h1 {
    color: var(--ep-white);
    font-size: 2.4em;
    margin-bottom: 12px;
    font-weight: 800;
}

.ep-hero p {
    font-size: 1.2em;
    opacity: 0.92;
    max-width: 600px;
    margin: 0 auto 30px;
}

.ep-hero-badges {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 30px;
}

.ep-hero-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1em;
    font-weight: 600;
}

.ep-hero-badge::before {
    content: "\2714";
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    background: rgba(255,255,255,0.2);
    border-radius: 50%;
    font-size: 14px;
}

/* ===== LOAN AMOUNT SELECTOR ===== */
.ep-amount-selector {
    background: var(--ep-white);
    border-radius: var(--ep-radius-lg);
    padding: 35px 30px;
    max-width: 550px;
    margin: 0 auto;
    box-shadow: var(--ep-shadow-lg);
}

.ep-amount-selector h3 {
    text-align: center;
    margin-bottom: 20px;
    font-size: 1.3em;
    color: var(--ep-blue);
}

.ep-amount-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 20px;
}

.ep-amount-btn {
    display: block;
    padding: 14px 10px;
    border: 2px solid var(--ep-gray-border);
    border-radius: var(--ep-radius);
    text-align: center;
    font-weight: 600;
    font-size: 1em;
    color: var(--ep-teal);
    background: var(--ep-white);
    cursor: pointer;
    transition: var(--ep-transition);
    text-decoration: none;
}

.ep-amount-btn:hover {
    border-color: var(--ep-teal);
    background: var(--ep-teal-light);
    color: var(--ep-teal-dark);
    transform: translateY(-2px);
}

.ep-cta-main {
    display: block;
    width: 100%;
    padding: 16px;
    background: var(--ep-orange);
    color: var(--ep-white) !important;
    text-align: center;
    border-radius: var(--ep-radius);
    font-weight: 700;
    font-size: 1.1em;
    border: none;
    cursor: pointer;
    transition: var(--ep-transition);
    text-decoration: none;
}

.ep-cta-main:hover {
    background: var(--ep-orange-light);
    color: var(--ep-white) !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(230, 126, 34, 0.4);
}

/* ===== HOW IT WORKS SECTION ===== */
.ep-how-it-works {
    padding: 60px 20px;
    background: var(--ep-gray-light);
}

.ep-section-title {
    text-align: center;
    font-size: 2em;
    margin-bottom: 40px;
    color: var(--ep-blue);
}

.ep-steps {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    max-width: 900px;
    margin: 0 auto;
}

.ep-step {
    text-align: center;
    padding: 30px 20px;
    background: var(--ep-white);
    border-radius: var(--ep-radius-lg);
    box-shadow: var(--ep-shadow);
}

.ep-step-icon {
    width: 70px;
    height: 70px;
    background: var(--ep-teal-light);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 18px;
    font-size: 30px;
}

.ep-step h3 {
    font-size: 1.15em;
    margin-bottom: 10px;
}

.ep-step p {
    color: var(--ep-text-light);
    font-size: 0.95em;
}

/* ===== TRUST SIGNALS ===== */
.ep-trust {
    padding: 50px 20px;
    text-align: center;
}

.ep-trust-items {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 25px;
    max-width: 800px;
    margin: 0 auto;
}

.ep-trust-item {
    padding: 20px;
}

.ep-trust-icon {
    font-size: 40px;
    margin-bottom: 12px;
}

.ep-trust-item h4 {
    font-size: 1.1em;
    margin-bottom: 6px;
}

.ep-trust-item p {
    color: var(--ep-text-light);
    font-size: 0.9em;
}

/* ===== LENDER COMPARISON TABLE ===== */
.ep-comparator-section {
    padding: 60px 20px;
    max-width: 900px;
    margin: 0 auto;
}

.ep-lender-card {
    display: grid;
    grid-template-columns: 160px 1fr auto;
    align-items: center;
    gap: 20px;
    padding: 22px 25px;
    margin-bottom: 15px;
    background: var(--ep-white);
    border: 1px solid var(--ep-gray-border);
    border-radius: var(--ep-radius-lg);
    box-shadow: var(--ep-shadow);
    transition: var(--ep-transition);
}

.ep-lender-card:hover {
    box-shadow: var(--ep-shadow-lg);
    transform: translateY(-2px);
}

.ep-lender-logo {
    text-align: center;
}

.ep-lender-logo img {
    max-width: 140px;
    max-height: 50px;
    object-fit: contain;
}

.ep-lender-info {
    font-size: 0.92em;
}

.ep-lender-info strong {
    display: block;
    font-size: 1.05em;
    margin-bottom: 4px;
    color: var(--ep-blue);
}

.ep-lender-details {
    color: var(--ep-text-light);
    line-height: 1.6;
}

.ep-lender-features {
    list-style: none;
    margin: 8px 0 0;
}

.ep-lender-features li {
    padding: 2px 0;
    font-size: 0.88em;
    color: var(--ep-text-light);
}

.ep-lender-features li::before {
    content: "\2714 ";
    color: var(--ep-green);
    font-weight: bold;
}

.ep-lender-cta {
    text-align: center;
}

.ep-btn-solicitar {
    display: inline-block;
    padding: 12px 28px;
    background: var(--ep-green);
    color: var(--ep-white) !important;
    border-radius: var(--ep-radius);
    font-weight: 700;
    font-size: 0.95em;
    white-space: nowrap;
    transition: var(--ep-transition);
    text-decoration: none;
}

.ep-btn-solicitar:hover {
    background: var(--ep-green-dark);
    color: var(--ep-white) !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(39, 174, 96, 0.3);
}

.ep-btn-review {
    display: block;
    margin-top: 8px;
    font-size: 0.82em;
    color: var(--ep-teal);
}

/* ===== LATEST POSTS SECTION ===== */
.ep-latest-posts {
    padding: 60px 20px;
    background: var(--ep-gray-light);
}

.ep-posts-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 25px;
    max-width: 1000px;
    margin: 0 auto;
}

.ep-post-card {
    background: var(--ep-white);
    border-radius: var(--ep-radius-lg);
    overflow: hidden;
    box-shadow: var(--ep-shadow);
    transition: var(--ep-transition);
}

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

.ep-post-card-body {
    padding: 22px;
}

.ep-post-card h3 {
    font-size: 1.05em;
    margin-bottom: 10px;
    line-height: 1.4;
}

.ep-post-card h3 a {
    color: var(--ep-blue);
}

.ep-post-card h3 a:hover {
    color: var(--ep-teal);
}

.ep-post-card p {
    font-size: 0.9em;
    color: var(--ep-text-light);
    margin-bottom: 12px;
}

.ep-post-card .ep-read-more {
    font-size: 0.88em;
    font-weight: 600;
    color: var(--ep-teal);
}

/* ===== BLOG POST SINGLE ===== */
.single-post .entry-content {
    font-size: 18px;
    line-height: 1.8;
    max-width: 760px;
    margin: 0 auto;
}

.single-post .entry-content h2 {
    font-size: 1.6em;
    margin: 40px 0 16px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--ep-teal-light);
}

.single-post .entry-content h3 {
    font-size: 1.3em;
    margin: 30px 0 12px;
}

.single-post .entry-content p {
    margin-bottom: 18px;
}

.single-post .entry-content ul,
.single-post .entry-content ol {
    margin: 0 0 20px 20px;
}

.single-post .entry-content li {
    margin-bottom: 6px;
}

.single-post .entry-content img {
    border-radius: var(--ep-radius);
    margin: 20px 0;
}

/* Table of Contents */
.ep-toc {
    background: var(--ep-gray-light);
    border: 1px solid var(--ep-gray-border);
    border-left: 4px solid var(--ep-teal);
    border-radius: var(--ep-radius);
    padding: 20px 25px;
    margin: 25px 0 35px;
}

.ep-toc h4 {
    font-size: 1em;
    margin-bottom: 12px;
    color: var(--ep-blue);
}

.ep-toc ul {
    list-style: none;
    margin: 0;
}

.ep-toc li {
    padding: 5px 0;
}

.ep-toc a {
    color: var(--ep-text-light);
    font-size: 0.92em;
}

.ep-toc a:hover {
    color: var(--ep-teal);
}

/* Affiliate CTA Box */
.ep-cta-box {
    background: linear-gradient(135deg, var(--ep-teal-light) 0%, #f0faf8 100%);
    border: 1px solid var(--ep-teal);
    border-radius: var(--ep-radius-lg);
    padding: 25px 30px;
    margin: 30px 0;
    text-align: center;
}

.ep-cta-box h4 {
    font-size: 1.15em;
    margin-bottom: 10px;
    color: var(--ep-teal-dark);
}

.ep-cta-box p {
    margin-bottom: 15px;
    color: var(--ep-text-light);
    font-size: 0.95em;
}

/* Author Box */
.ep-author-box {
    display: flex;
    gap: 20px;
    align-items: center;
    padding: 25px;
    background: var(--ep-gray-light);
    border-radius: var(--ep-radius-lg);
    margin: 40px 0;
}

.ep-author-avatar {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background: var(--ep-teal);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--ep-white);
    font-size: 28px;
    font-weight: 700;
    flex-shrink: 0;
}

.ep-author-info h4 {
    font-size: 1em;
    margin-bottom: 4px;
}

.ep-author-info p {
    font-size: 0.88em;
    color: var(--ep-text-light);
    margin: 0;
}

/* Related Posts */
.ep-related-posts {
    margin: 40px 0;
    padding: 30px 0;
    border-top: 2px solid var(--ep-gray-border);
}

.ep-related-posts h3 {
    margin-bottom: 20px;
}

/* Breadcrumbs */
.ep-breadcrumbs {
    font-size: 0.85em;
    color: var(--ep-gray);
    padding: 12px 0;
    margin-bottom: 10px;
}

.ep-breadcrumbs a {
    color: var(--ep-teal);
}

.ep-breadcrumbs span {
    margin: 0 6px;
    color: var(--ep-gray);
}

/* ===== COMPARATOR PAGE ===== */
.page-template-page-comparador .ep-lender-card {
    grid-template-columns: 150px 1fr 200px;
}

.ep-filter-bar {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.ep-filter-btn {
    padding: 8px 20px;
    border: 2px solid var(--ep-gray-border);
    border-radius: 50px;
    background: var(--ep-white);
    color: var(--ep-text);
    font-weight: 600;
    font-size: 0.9em;
    cursor: pointer;
    transition: var(--ep-transition);
}

.ep-filter-btn:hover,
.ep-filter-btn.active {
    border-color: var(--ep-teal);
    background: var(--ep-teal);
    color: var(--ep-white);
}

/* ===== LENDER REVIEW PAGE ===== */
.ep-review-header {
    display: flex;
    align-items: center;
    gap: 25px;
    padding: 30px;
    background: var(--ep-gray-light);
    border-radius: var(--ep-radius-lg);
    margin-bottom: 30px;
}

.ep-review-header img {
    max-width: 150px;
    max-height: 60px;
    object-fit: contain;
}

.ep-review-rating {
    display: flex;
    gap: 3px;
    color: var(--ep-orange);
    font-size: 1.2em;
    margin: 5px 0;
}

.ep-pros-cons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin: 25px 0;
}

.ep-pros, .ep-cons {
    padding: 20px;
    border-radius: var(--ep-radius);
}

.ep-pros {
    background: #f0faf4;
    border: 1px solid #c8e6d5;
}

.ep-cons {
    background: #fef5f3;
    border: 1px solid #f0cdc6;
}

.ep-pros h4 {
    color: var(--ep-green);
}

.ep-cons h4 {
    color: var(--ep-danger);
}

.ep-pros ul, .ep-cons ul {
    list-style: none;
    margin: 10px 0 0;
}

.ep-pros li::before {
    content: "\2714 ";
    color: var(--ep-green);
    font-weight: bold;
}

.ep-cons li::before {
    content: "\2718 ";
    color: var(--ep-danger);
    font-weight: bold;
}

/* ===== FOOTER ===== */
.site-footer {
    background: var(--ep-blue) !important;
    color: rgba(255,255,255,0.85);
}

.ep-footer {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 40px;
    max-width: 1100px;
    margin: 0 auto;
    padding: 50px 20px 30px;
}

.ep-footer h4 {
    color: var(--ep-white);
    font-size: 1em;
    margin-bottom: 15px;
}

.ep-footer a {
    color: rgba(255,255,255,0.7);
    display: block;
    padding: 4px 0;
    font-size: 0.9em;
}

.ep-footer a:hover {
    color: var(--ep-white);
}

.ep-footer-about p {
    font-size: 0.9em;
    line-height: 1.6;
    color: rgba(255,255,255,0.7);
}

.ep-footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.1);
    padding: 20px;
    text-align: center;
    font-size: 0.82em;
    color: rgba(255,255,255,0.5);
    max-width: 1100px;
    margin: 0 auto;
}

.ep-footer-disclosure {
    font-size: 0.78em;
    color: rgba(255,255,255,0.45);
    max-width: 700px;
    margin: 10px auto 0;
    line-height: 1.5;
}

/* ===== COOKIE BANNER ===== */
.ep-cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--ep-blue);
    color: var(--ep-white);
    padding: 18px 25px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    z-index: 9999;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.2);
    font-size: 0.88em;
}

.ep-cookie-banner.hidden {
    display: none;
}

.ep-cookie-accept {
    padding: 10px 24px;
    background: var(--ep-teal);
    color: var(--ep-white);
    border: none;
    border-radius: var(--ep-radius);
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .ep-hero h1 {
        font-size: 1.7em;
    }

    .ep-hero p {
        font-size: 1em;
    }

    .ep-hero-badges {
        flex-direction: column;
        align-items: center;
    }

    .ep-steps {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .ep-trust-items {
        grid-template-columns: 1fr;
    }

    .ep-lender-card {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .ep-lender-cta {
        margin-top: 10px;
    }

    .ep-posts-grid {
        grid-template-columns: 1fr;
    }

    .ep-footer {
        grid-template-columns: 1fr;
        gap: 25px;
    }

    .ep-pros-cons {
        grid-template-columns: 1fr;
    }

    .ep-review-header {
        flex-direction: column;
        text-align: center;
    }

    .ep-amount-buttons {
        grid-template-columns: 1fr;
    }

    .ep-cookie-banner {
        flex-direction: column;
        text-align: center;
    }

    .single-post .entry-content {
        font-size: 16px;
    }

    .page-template-page-comparador .ep-lender-card {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .ep-hero {
        padding: 40px 15px;
    }

    .ep-hero h1 {
        font-size: 1.5em;
    }

    .ep-amount-selector {
        padding: 25px 20px;
    }
}

/* ===== UTILITY CLASSES ===== */
.ep-container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px;
}

.ep-text-center {
    text-align: center;
}

.ep-mt-0 { margin-top: 0; }
.ep-mb-0 { margin-bottom: 0; }

/* ===== WORDPRESS BLOCK OVERRIDES ===== */
.wp-block-table table {
    border-collapse: collapse;
    width: 100%;
}

.wp-block-table td,
.wp-block-table th {
    border: 1px solid var(--ep-gray-border);
    padding: 12px 16px;
    text-align: left;
}

.wp-block-table th {
    background: var(--ep-teal);
    color: var(--ep-white);
    font-weight: 600;
}

.wp-block-table tr:nth-child(even) {
    background: var(--ep-gray-light);
}

/* Remove Astra defaults we don't want */
.ast-separate-container .ast-article-single {
    background: transparent;
}

.ast-separate-container .ast-article-post {
}

/* Fix Astra container for our custom pages */
/* Astra sets display:flex on .ast-container at desktop which breaks our multi-section layout */
.page-template-page-homepage .site-content > .ast-container,
.page-template-page-comparador .site-content > .ast-container {
    display: block !important;
    max-width: 100% !important;
    padding: 0 !important;
}
