/*
Theme Name:   Agrosophia Child
Theme URI:    https://agrosophia.com
Description:  Kadence Child Theme - Agrosophia Design System
Author:       Agrosophia
Author URI:   https://agrosophia.com
Template:     kadence
Version:      1.1.0
License:      GNU General Public License v2 or later
License URI:  https://www.gnu.org/licenses/gpl-2.0.html
Text Domain:  agrosophia-child
*/



/* ══════════════════════════════════════════════════════════
   AGROSOPHIA — Design System v2.0
   NOTA: el padre se carga en functions.php (wp_enqueue_style)
   NO usar @import aquí (WordPress lo rechaza en child themes)
══════════════════════════════════════════════════════════ */

/* ── VARIABLES GLOBALES ──────────────────────────────────── */
:root {
    /* Paleta de marca */
    --navy: #0D2B45;
    --navy-mid: #184E77;
    --teal: #168AAD;
    --teal-light: #52B69A;
    --earth: #7A5C2E;
    --earth-light: #A67C52;
    --white: #FFFFFF;
    --off-white: #F7F6F2;
    --dark: #07141F;
    --gray-text: #6B7280;
    --gray-border: #E5E7EB;

    /* Tipografía */
    --font-ui: 'Inter', -apple-system, sans-serif;
    --font-edit: 'Lora', Georgia, serif;

    /* Espaciados */
    --section-pad: 96px 0;

    /* Sombras */
    --shadow-sm: 0 2px 8px rgba(13, 43, 69, 0.08);
    --shadow-md: 0 8px 32px rgba(13, 43, 69, 0.12);
    --shadow-lg: 0 16px 64px rgba(13, 43, 69, 0.18);
}

/* ── TIPOGRAFÍA GLOBAL ───────────────────────────────────── */
body {
    font-family: var(--font-ui);
    color: var(--dark);
    background: var(--white);
    -webkit-font-smoothing: antialiased;
    line-height: 1.7;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-edit);
    font-weight: 600;
    line-height: 1.25;
    color: var(--navy);
}

/* ══════════════════════════════════════════════════════════
   HEADER — Fondo blanco, logo color, navegación oscura
══════════════════════════════════════════════════════════ */

/* Fondo del header: BLANCO */
#masthead,
.site-header-wrap,
.site-main-header-wrap,
.site-main-header-wrap .site-header-row-container-inner,
.site-header-row-container-inner {
    background: #ffffff !important;
    border-bottom: 1px solid rgba(13, 43, 69, 0.08) !important;
}

/* Header sticky: añadir sombra al hacer scroll */
#masthead.item-is-fixed,
.kadence-sticky-header.item-is-fixed {
    box-shadow: 0 4px 24px rgba(13, 43, 69, 0.10) !important;
}

/* Navegación principal — texto oscuro sobre fondo blanco */
.main-navigation .primary-menu-container>ul>li.menu-item>a,
.header-navigation .header-menu-container>ul>li>a,
.wp-block-kadence-navigation a {
    color: var(--navy) !important;
    font-size: 0.95rem !important;
    font-family: var(--font-ui) !important;
    font-weight: 500 !important;
    letter-spacing: 0.3px !important;
    transition: color 0.2s ease !important;
}

.main-navigation .primary-menu-container>ul>li.menu-item>a:hover,
.header-navigation .header-menu-container>ul>li>a:hover,
.wp-block-kadence-navigation a:hover {
    color: var(--teal) !important;
}

/* Logo: tamaño correcto, sin filtros */
.site-branding img,
.custom-logo,
.site-branding a.brand img {
    height: 52px !important;
    width: auto !important;
    max-width: 220px !important;
}

/* ── BOTONES GLOBALES ────────────────────────────────────── */
.wp-block-button__link,
.kb-btn {
    font-family: var(--font-ui) !important;
    font-weight: 600 !important;
    letter-spacing: 0.3px !important;
    border-radius: 50px !important;
    transition: all 0.2s ease !important;
}

/* Botón primario */
.wp-block-button.is-style-fill .wp-block-button__link,
.kb-btn-primary {
    background: var(--navy-mid) !important;
    color: var(--white) !important;
    padding: 14px 28px !important;
}

.wp-block-button.is-style-fill .wp-block-button__link:hover {
    background: var(--navy) !important;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* Botón outline */
.wp-block-button.is-style-outline .wp-block-button__link {
    border: 2px solid var(--teal) !important;
    color: var(--teal) !important;
    background: transparent !important;
    padding: 13px 28px !important;
}

.wp-block-button.is-style-outline .wp-block-button__link:hover {
    background: var(--teal) !important;
    color: var(--white) !important;
}

/* ── CONTENEDORES ─────────────────────────────────────────── */
.kb-section-pad {
    padding: var(--section-pad);
}

.kb-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 40px;
}

/* ── SECCIÓN HERO ────────────────────────────────────────── */
.kb-hero-row {
    min-height: 90vh;
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
}

.kb-hero-overlay {
    background: linear-gradient(135deg,
            rgba(13, 43, 69, 0.92) 0%,
            rgba(24, 78, 119, 0.75) 60%,
            rgba(22, 138, 173, 0.3) 100%);
}

/* ── BADGE ────────────────────────────────────────────────── */
.kb-badge {
    display: inline-flex;
    align-items: center;
    padding: 6px 14px;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    font-family: var(--font-ui);
    margin-bottom: 16px;
}

.kb-badge-teal {
    background: rgba(22, 138, 173, 0.1);
    color: var(--teal);
}

.kb-badge-earth {
    background: rgba(122, 92, 46, 0.1);
    color: var(--earth);
}

.kb-badge-navy {
    background: rgba(13, 43, 69, 0.1);
    color: var(--navy);
}

/* ── CARDS DE PROYECTO ───────────────────────────────────── */
.kb-project-card {
    background: var(--white);
    border-radius: 16px;
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    transition: all 0.3s ease;
    border: 1px solid var(--gray-border);
}

.kb-project-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-lg);
    border-color: rgba(22, 138, 173, 0.2);
}

.kb-project-card-header {
    background: linear-gradient(135deg, var(--navy) 0%, var(--navy-mid) 100%);
    padding: 24px;
    color: var(--white);
}

/* ── SECCIÓN FINCA PALOS VERDES ──────────────────────────── */
.finca-photo-block img {
    width: 100%;
    height: 420px;
    object-fit: cover;
    border-radius: 20px;
    box-shadow: var(--shadow-lg);
}

.finca-caption-text {
    font-size: 0.75rem;
    color: var(--gray-text);
    text-align: center;
    margin-top: 10px;
    font-style: italic;
}

/* ── FORMULARIO ───────────────────────────────────────────── */
.kb-field input,
.kb-field select,
.kb-field textarea,
input[type="text"],
input[type="email"],
input[type="number"],
select,
textarea {
    font-family: var(--font-ui) !important;
    border: 1.5px solid var(--gray-border) !important;
    border-radius: 10px !important;
    padding: 14px 16px !important;
    font-size: 1rem !important;
    width: 100% !important;
    min-height: 44px !important;
    /* Mobile: mínimo táctil 44px */
    transition: border-color 0.2s !important;
}

input[type="tel"],
input[type="number"] {
    -moz-appearance: textfield !important;
    inputmode: numeric !important;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--teal) !important;
    outline: none !important;
    box-shadow: 0 0 0 3px rgba(22, 138, 173, 0.1) !important;
}

/* ── FOOTER ───────────────────────────────────────────────── */
.site-footer {
    background: var(--dark) !important;
    position: relative;
    overflow: hidden;
}

/* Imagen DEM de fondo visible */
.footer-dem-bg {
    position: absolute;
    inset: 0;
    background-image: url('../agrosophia-child/assets/dem-background.webp');
    background-size: cover;
    background-position: center;
    opacity: 0.65;
}

/* ── SOPHIA IA — WIDGET FLOTANTE ──────────────────────────── */
#sophia-widget {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9999;
    font-family: var(--font-ui);
}

#sophia-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--navy);
    color: var(--white);
    border: none;
    border-radius: 50px;
    padding: 12px 20px;
    cursor: pointer;
    box-shadow: var(--shadow-md);
    transition: all 0.25s ease;
}

#sophia-toggle:hover {
    background: var(--navy-mid);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.sophia-panel {
    width: 370px;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    display: flex;
    flex-direction: column;
    background: var(--white);
    position: fixed;
    bottom: 88px;
    right: 24px;
    z-index: 9998;
    max-height: 580px;
    border: 1px solid var(--gray-border);
}

.sophia-header {
    background: var(--navy);
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--white);
}

.sophia-header strong {
    font-size: 0.95rem;
}

.sophia-header span {
    font-size: 0.75rem;
    opacity: 0.7;
}

.sophia-header-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.sophia-avatar-wrap {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
}

.sophia-avatar-img {
    width: 32px;
    height: 32px;
    object-fit: contain;
    mix-blend-mode: multiply;
}

.sophia-close {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    font-size: 1.1rem;
    padding: 4px;
    transition: color 0.2s;
}

.sophia-close:hover {
    color: var(--white);
}

.sophia-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    background: #f8fafc;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 320px;
}

.sophia-bubble {
    background: var(--white);
    border: 1px solid var(--gray-border);
    border-radius: 14px 14px 14px 4px;
    padding: 13px 15px;
    font-size: 0.875rem;
    color: var(--dark);
    line-height: 1.6;
    max-width: 92%;
    align-self: flex-start;
}

.user-bubble {
    background: var(--navy-mid);
    color: white;
    border-radius: 14px 14px 4px 14px;
    padding: 12px 15px;
    font-size: 0.875rem;
    line-height: 1.6;
    max-width: 88%;
    align-self: flex-end;
}

.sophia-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    padding: 10px 14px 6px;
    background: #f8fafc;
    border-top: 1px solid var(--gray-border);
}

.sophia-chip {
    padding: 6px 12px;
    border-radius: 50px;
    border: 1.5px solid rgba(22, 138, 173, 0.25);
    background: rgba(22, 138, 173, 0.05);
    color: var(--teal);
    font-size: 0.75rem;
    font-weight: 600;
    font-family: var(--font-ui);
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.sophia-chip:hover {
    background: rgba(22, 138, 173, 0.14);
    border-color: var(--teal);
}

.sophia-input-row {
    display: flex;
    gap: 8px;
    padding: 12px 14px;
    border-top: 1px solid var(--gray-border);
    background: var(--white);
}

.sophia-input-row input {
    flex: 1;
    border: 1.5px solid var(--gray-border) !important;
    border-radius: 50px !important;
    padding: 9px 14px !important;
    font-size: 0.875rem !important;
    min-height: 38px !important;
}

.sophia-input-row button {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--navy-mid);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background 0.2s;
}

.typing-indicator {
    display: flex;
    gap: 5px;
    align-items: center;
    padding: 4px 0;
}

.typing-indicator span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--gray-text);
    animation: blink 1.2s infinite;
}

.typing-indicator span:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-indicator span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes blink {

    0%,
    100% {
        opacity: 0.3;
        transform: scale(0.8);
    }

    50% {
        opacity: 1;
        transform: scale(1.1);
    }
}

/* ── MOBILE FIRST (máximo 768px) ──────────────────────────── */
@media (max-width: 768px) {
    :root {
        --section-pad: 64px 0;
    }

    .sophia-panel {
        width: calc(100vw - 32px);
        right: 16px;
        bottom: 80px;
    }

    #sophia-toggle {
        padding: 10px 16px;
        font-size: 0.875rem;
    }

    /* Botones mínimo 44x44px en mobile */
    .wp-block-button__link,
    .kb-btn {
        min-height: 44px !important;
        display: inline-flex !important;
        align-items: center !important;
    }
}