/*
Theme Name: Fantesla Native
Theme URI: https://fanteslaaccesorios.com
Author: Antigravity Architecture Lead
Description: Tema nativo optimizado para WPO (Core Web Vitals). Reemplaza a Divi.
Version: 1.4.0
Text Domain: fantesla-native
*/

:root {
    --primary-color: #e82127; /* Tesla Red Accent */
    --text-color: #333333;
    --bg-color: #ffffff;
    --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

body {
    font-family: var(--font-family);
    color: var(--text-color);
    background-color: var(--bg-color);
    line-height: 1.6;
    margin: 0;
    padding: 0;
}

.site-header {
    background-color: #111;
    color: #fff;
    padding: 1rem 0;
    text-align: center;
}

.site-header a {
    color: #fff;
    text-decoration: none;
    font-weight: bold;
    font-size: 1.5rem;
}

.site-main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 15px;
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    margin-bottom: 1rem;
    color: #000;
}

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

a:hover {
    text-decoration: underline;
}

.post-content {
    font-size: 1.1rem;
}

/* Amazon Affiliate Buttons Clone */
.amazon-button {
    display: inline-block;
    background-color: #f90;
    color: #fff !important;
    padding: 10px 20px;
    border-radius: 5px;
    text-decoration: none !important;
    font-weight: bold;
    margin-top: 10px;
}
.amazon-button:hover {
    background-color: #e08b00;
}


/* Estilos extraídos de Divi para Gutenberg */
.fantesla-card {
    border: 1px solid #e5e7eb;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    text-align: center;
    background: #fff;
}
.amazon-native-btn {
    margin-top: -20px;
    position: relative;
    z-index: 10;
    text-align: center;
}
.amazon-native-btn a {
    background-color: #fff !important;
    color: #0400F0 !important;
    padding: 10px 20px !important;
    border-radius: 5px !important;
    font-weight: 800 !important;
    box-shadow: 0 4px 15px rgba(0,0,0,0.15) !important;
    text-decoration: none !important;
}


/* Fix Responsive Gutenberg Columns (Safety Fallback) */
.fantesla-row {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    margin-bottom: 2rem;
    width: 100%;
}
.fantesla-col {
    flex-grow: 1;
    min-width: 0; /* Prevents text overflow breaking layout */
    word-break: break-word;
}
@media (max-width: 781px) {
    .fantesla-col {
        flex-basis: 100% !important;
    }
}


/* CUSTOM HEADER CSS */
.fantesla-custom-header {
    background-color: #d80000;
    width: 100%;
    padding: 0 20px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    position: relative;
    z-index: 1000;
}
.header-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 70px;
}
.header-logo-section {
    display: flex;
    align-items: center;
    gap: 20px;
}
.fta-logo {
    background-color: #a00000;
    padding: 15px 10px;
    text-decoration: none;
}
.fta-logo-text {
    color: #ffffff;
    font-weight: 800;
    font-size: 24px;
    font-family: Arial, sans-serif;
    letter-spacing: 1px;
}
.site-title-text {
    color: #ffffff;
    font-weight: 800;
    font-size: 18px;
    text-decoration: none;
    text-transform: uppercase;
    font-family: Arial, sans-serif;
    letter-spacing: 0.5px;
}
.header-nav-section nav ul.fantesla-nav-menu {
    list-style: none;
    display: flex;
    gap: 25px;
    margin: 0;
    padding: 0;
}
.header-nav-section nav ul.fantesla-nav-menu li a {
    color: #ffffff;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    font-family: Arial, sans-serif;
    display: flex;
    align-items: center;
}
.header-nav-section nav ul.fantesla-nav-menu li.menu-item-has-children > a::after,
.header-nav-section nav ul.fantesla-nav-menu li > a::after {
    content: " \25BE"; /* dropdown arrow */
    margin-left: 5px;
    font-size: 12px;
}
/* Responsive */
@media (max-width: 781px) {
    .header-container {
        flex-direction: column;
        padding: 15px 0;
        gap: 15px;
    }
    .header-nav-section nav ul.fantesla-nav-menu {
        flex-wrap: wrap;
        justify-content: center;
    }
}


/* CUSTOM FOOTER CSS */
.fantesla-custom-footer {
    background-color: #000000;
    width: 100%;
    padding: 60px 20px;
    margin-top: 40px;
}
.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: center;
    gap: 150px;
}
.footer-column {
    display: flex;
    flex-direction: column;
}
.footer-title {
    color: #ffffff;
    font-size: 16px;
    font-weight: 800;
    font-family: Arial, sans-serif;
    margin-bottom: 20px;
    letter-spacing: 1px;
}
.footer-menu {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.footer-menu li a {
    color: #ffffff;
    text-decoration: underline;
    font-size: 14px;
    font-family: Arial, sans-serif;
}
.footer-menu li a:hover {
    color: #cccccc;
}
/* Responsive Footer */
@media (max-width: 781px) {
    .footer-container {
        flex-direction: column;
        gap: 40px;
        align-items: flex-start;
        padding-left: 20px;
    }
}


/* DROPDOWN MENU CSS FIXES */
.header-nav-section nav ul.fantesla-nav-menu li {
    position: relative;
}
/* Hide all submenus by default */
.header-nav-section nav ul.fantesla-nav-menu ul.sub-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background-color: #d80000;
    min-width: 220px;
    z-index: 99999;
    padding: 10px 0;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    list-style: none;
    margin: 0;
}
/* Show submenu on hover */
.header-nav-section nav ul.fantesla-nav-menu li:hover > ul.sub-menu {
    display: block;
}
/* Submenu item styling */
.header-nav-section nav ul.fantesla-nav-menu ul.sub-menu li {
    width: 100%;
}
.header-nav-section nav ul.fantesla-nav-menu ul.sub-menu li a {
    padding: 10px 20px;
    display: block;
    font-size: 13px;
    font-weight: normal;
    white-space: normal;
    line-height: 1.4;
}
.header-nav-section nav ul.fantesla-nav-menu ul.sub-menu li a:hover {
    background-color: #a00000;
}
/* 3rd Level Menus (grand-children) */
.header-nav-section nav ul.fantesla-nav-menu ul.sub-menu ul.sub-menu {
    top: 0;
    left: 100%;
}



/* AMAZON CONVERSION BUTTONS */
.wp-block-button.amazon-native-btn {
    margin-top: 15px;
    margin-bottom: 15px;
}
.wp-block-button.amazon-native-btn .wp-block-button__link {
    background-color: #ff9900 !important; /* Amazon Orange */
    color: #111111 !important; /* Dark text for contrast */
    font-weight: bold;
    font-size: 16px;
    padding: 12px 24px;
    border-radius: 8px;
    border: 1px solid #e68a00;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}
.wp-block-button.amazon-native-btn .wp-block-button__link:hover {
    background-color: #e68a00 !important;
    box-shadow: 0 6px 12px rgba(0,0,0,0.15);
    transform: translateY(-2px);
}
/* Amazon Icon via Pseudo-element */
.wp-block-button.amazon-native-btn .wp-block-button__link::before {
    content: "";
    display: block;
    width: 20px;
    height: 20px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 448 512'%3E%3Cpath fill='#111' d='M257.2 162.7c-48.7 1.8-169.5 15.5-169.5 117.5 0 109.5 138.3 114 183.5 43.2 4.5 4.5 10.4 9.5 19 9.5 19 0 24.4-18.1 30.8-41.2l20.4-78.5c11.3-43 20.4-98.7-27.2-127-31.3-18.6-80.1-25.8-125.7-18.1-58.5 9.5-103.9 44-106.2 46.2l19 25.8c2.3-1.8 38-29.4 92-36.2 31.7-4.1 63.9-.4 83.4 11.8 23.1 14.5 19 46.6 15 72-13.6-6.4-53.1-17.6-114-17.6zm-17.2 121c-29.9-10.4-44.4-23.5-44.4-48 0-33 30.8-54.8 83-58.5-7.2 57.5-31.3 64.3-38.6 64.3zm208-162.7v-25.8h-48.5l-49 184.2-22.2-12.7c-50.7 75.6-107.8 86.1-137.7 86.1-59.8 0-111-37.1-111-105.1 0-71.1 52.1-113.7 131-124.6l54.8-7.7c-5.4-31.7-25.8-49.8-63.4-43-34 5.9-63.4 28.5-65.7 30.4L113.6 54.8c2.7-2.3 40.3-33 93.8-41.2 54.4-8.6 96.1.9 123.7 27.6 28.1 26.7 29.4 69.3 29.4 100.1l-18.1 71.6 30.8 17.6zm-162.7 86.5c-4.1-8.1-14.5-59.4-14.5-59.4l4.5 30.4-43 65.2z'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}



/* TABLE OF CONTENTS CSS */
.fantesla-toc {
    background-color: #f8f9fa;
    border-left: 4px solid #d80000;
    padding: 20px;
    margin: 30px 0;
    border-radius: 0 8px 8px 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    max-width: 100%;
}
.fantesla-toc-title {
    font-weight: 800;
    font-size: 18px;
    margin-bottom: 15px;
    color: #111;
    text-transform: uppercase;
}
.fantesla-toc-list {
    list-style: none;
    padding-left: 0;
    margin: 0;
}
.fantesla-toc-list ul {
    list-style: none;
    padding-left: 20px;
    margin-top: 5px;
    margin-bottom: 5px;
}
.fantesla-toc-list li {
    margin-bottom: 8px;
}
.fantesla-toc-list a {
    color: #333;
    text-decoration: none;
    font-size: 15px;
    transition: color 0.2s ease;
}
.fantesla-toc-list a:hover {
    color: #d80000;
    text-decoration: underline;
}
h2[id], h3[id] {
    scroll-margin-top: 80px; /* Offset for fixed headers if any */
}



/* ACCORDIONS CSS */
details.fantesla-accordion {
    background: #fff;
    border: 1px solid #eee;
    border-radius: 8px;
    margin: 20px 0;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    overflow: hidden;
}
details.fantesla-accordion summary {
    background: #f8f9fa;
    padding: 15px 20px;
    cursor: pointer;
    list-style: none; /* Hide default arrow */
    position: relative;
    border-bottom: 1px solid transparent;
    transition: background 0.2s ease;
}
details.fantesla-accordion summary::-webkit-details-marker {
    display: none;
}
details.fantesla-accordion summary:hover {
    background: #f1f1f1;
}
details.fantesla-accordion[open] summary {
    border-bottom: 1px solid #eee;
    background: #fff;
}
details.fantesla-accordion summary::after {
    content: "+";
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 24px;
    font-weight: bold;
    color: #d80000;
}
details.fantesla-accordion[open] summary::after {
    content: "-";
}
details.fantesla-accordion .accordion-title h2,
details.fantesla-accordion .accordion-title h3 {
    margin: 0 !important;
    padding: 0 !important;
    font-size: 20px !important;
    display: inline-block;
}
details.fantesla-accordion .fantesla-accordion-content {
    padding: 20px;
}


