/* ==========================================================================
   VARIABLES Y CONFIGURACIÓN GENERAL
   ========================================================================== */
:root {
    --accent-color: #C85A32;        /* Anaranjado Quemado / Terracota */
    --accent-hover: #AA4724;
    --primary-dark: #1A1816;        /* Marrón Oscuro / Carbón */
    --bg-beige: #F4EFEA;            /* Beige Cálido */
    --bg-white-off: #FAF8F5;        /* Blanco Roto */
    --text-main: #2D2A26;           /* Carbón Suave */
    --text-muted: #736C65;          /* Gris Tostado */
    --border-color: #E2DBD3;
    
    --font-main: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
    --transition-smooth: cubic-bezier(0.25, 0.8, 0.25, 1);
}

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

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

body {
    font-family: var(--font-main);
    color: var(--text-main);
    background-color: var(--bg-white-off);
    line-height: 1.6;
    overflow-x: hidden;
}

a {
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Helpers Layout */
.container {
    width: 90%;
    max-width: 1240px;
    margin: 0 auto;
}

.section {
    padding: 120px 0;
    position: relative;
}

.bg-beige { background-color: var(--bg-beige); }
.bg-dark { background-color: var(--primary-dark); }
.text-white { color: #FFFFFF !important; }
.text-center { text-align: center; }
.relative { position: relative; z-index: 2; }
.align-center { align-items: center; }

.grid {
    display: grid;
    gap: 40px;
}

.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

/* Tipografía de Sección */
.section-subtitle {
    text-transform: uppercase;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 2px;
    color: var(--accent-color);
    display: block;
    margin-bottom: 12px;
}

.accent-text { color: var(--accent-color) !important; }

.section-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary-dark);
    margin-bottom: 24px;
    line-height: 1.2;
}

.section-lead-white {
    color: rgba(255, 255, 255, 0.85);
    font-size: 1.05rem;
    max-width: 600px;
    margin: -10px auto 40px;
}

/* Botones Premium */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 16px 32px;
    font-weight: 600;
    font-size: 0.9rem;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s var(--transition-smooth);
}

.btn-primary {
    background-color: var(--accent-color);
    color: #FFFFFF;
    border: 1px solid var(--accent-color);
}

.btn-primary:hover {
    background-color: var(--accent-hover);
    border-color: var(--accent-hover);
    transform: translateY(-2px);
}

.btn-secondary {
    background-color: transparent;
    color: #FFFFFF;
    border: 1px solid rgba(255, 255, 255, 0.4);
}

.btn-secondary:hover {
    border-color: #FFFFFF;
    background-color: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
}

.btn-header {
    background-color: var(--accent-color);
    color: #fff;
    padding: 10px 20px;
    font-size: 0.85rem;
    border-radius: 4px;
}

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

.btn-card {
    display: block;
    width: 100%;
    text-align: center;
    padding: 12px;
    background-color: transparent;
    border: 1px solid var(--accent-color);
    color: var(--accent-color);
    font-weight: 600;
    border-radius: 4px;
    margin-top: 15px;
}

.btn-card:hover {
    background-color: var(--accent-color);
    color: #fff;
}

.btn-whatsapp-lg {
    background-color: var(--accent-color);
    color: #fff;
    padding: 20px 40px;
    font-size: 1.1rem;
    font-weight: 700;
    border-radius: 4px;
}

.btn-whatsapp-lg:hover {
    background-color: var(--accent-hover);
    transform: translateY(-3px);
}

/* ==========================================================================
   HEADER / NAVBAR
   ========================================================================== */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    padding: 24px 0;
    transition: all 0.4s ease;
}

.navbar.scrolled {
    background-color: rgba(26, 24, 22, 0.95);
    backdrop-filter: blur(10px);
    padding: 16px 0;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
}

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

.brand-logo {
    font-size: 1.15rem;
    font-weight: 700;
    color: #FFFFFF;
    letter-spacing: 1px;
}

.brand-logo span {
    color: var(--accent-color);
    font-weight: 400;
}

.nav-menu {
    display: flex;
    gap: 32px;
}

.nav-link {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9rem;
    font-weight: 500;
}

.nav-link:hover, .nav-link.active {
    color: var(--accent-color);
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    flex-direction: column;
    gap: 6px;
}

.menu-toggle span {
    width: 25px;
    height: 2px;
    background-color: #FFFFFF;
    transition: 0.3s;
}

/* ==========================================================================
   1. HERO (CON EFECTO HOVER MOVILE/PARALLAX SIN BORDES BLANCOS)
   ========================================================================== */
.hero {
    position: relative;
    height: 100vh;
    min-height: 650px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #FFFFFF;
    overflow: hidden; /* Garantiza que la imagen sobredimensionada no se salga */
}

.hero-bg-wrapper {
    position: absolute;
    inset: 0;
    overflow: hidden;
    z-index: -1;
}

.hero-bg {
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    /* Zoom inicial del 8% para evitar bordes al desplazar */
    transform: scale(1.08);
    transition: transform 0.15s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    will-change: transform;
}

.hero-content {
    max-width: 900px;
}

.hero h1 {
    font-size: 3.8rem;
    font-weight: 700;
    letter-spacing: 1px;
    line-height: 1.1;
    margin-bottom: 12px;
    color: #FFFFFF;
}

.hero-subtitle {
    font-size: 1.5rem;
    color: var(--accent-color);
    font-weight: 500;
    margin-bottom: 8px;
    letter-spacing: 1px;
}

.hero-description {
    font-size: 1.15rem;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 40px;
    font-weight: 300;
}

.hero-actions {
    display: flex;
    gap: 20px;
    justify-content: center;
}

.hero-indicators {
    position: absolute;
    bottom: 35px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 0.8rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.7);
}

.hero-indicators .dot {
    color: var(--accent-color);
}

/* ==========================================================================
   2. SOBRE EL RUBIO
   ========================================================================== */
.about-img {
    border-radius: 6px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.06);
}

.kpi-grid {
    display: flex;
    gap: 40px;
    margin-top: 40px;
    border-top: 1px solid var(--border-color);
    padding-top: 30px;
}

.kpi-number {
    display: block;
    font-size: 2.2rem;
    font-weight: 700;
    color: var(--accent-color);
}

.kpi-label {
    font-size: 0.85rem;
    color: var(--text-muted);
    text-transform: lowercase;
}

/* ==========================================================================
   3. NUESTROS PRODUCTOS
   ========================================================================== */
.category-card {
    background-color: var(--bg-white-off);
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.category-img-box {
    position: relative;
    height: 280px;
}

.category-img-box img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.badge-accent {
    position: absolute;
    top: 20px;
    right: 20px;
    background-color: var(--accent-color);
    color: #fff;
    padding: 4px 12px;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 4px;
    text-transform: uppercase;
}

.category-content {
    padding: 32px;
}

.category-content h3 {
    font-size: 1.4rem;
    color: var(--primary-dark);
    margin-bottom: 12px;
}

.category-content p {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 16px;
}

.editable-placeholder {
    font-size: 0.8rem;
    color: var(--text-muted);
    background-color: var(--bg-beige);
    padding: 12px;
    border-radius: 4px;
    border: 1px dashed var(--border-color);
}

/* ==========================================================================
   4. ESPECIALISTAS EN FORRAJERÍAS
   ========================================================================== */
.supply-flow {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-top: 30px;
    background-color: var(--bg-beige);
    padding: 24px;
    border-radius: 6px;
}

.flow-step-item {
    text-align: center;
    flex: 1;
}

.flow-icon {
    font-size: 1.8rem;
    margin-bottom: 6px;
}

.flow-step-item span {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--primary-dark);
}

.flow-connector {
    color: var(--accent-color);
    font-weight: 700;
}

.especialistas-img-box img {
    border-radius: 6px;
}

/* ==========================================================================
   5. DISTRIBUCIÓN
   ========================================================================== */
.distribucion-section {
    position: relative;
}

.distribucion-bg {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    z-index: 1;
}

.process-steps-grid {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-top: 60px;
}

.process-card {
    flex: 1;
    text-align: center;
    padding: 0 16px;
}

.step-num {
    display: inline-block;
    font-size: 2rem;
    font-weight: 700;
    color: var(--accent-color);
    margin-bottom: 12px;
}

.process-card h3 {
    font-size: 1.2rem;
    margin-bottom: 8px;
}

.process-card p {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.85);
}

.step-line {
    height: 1px;
    background-color: var(--accent-color);
    flex: 0.5;
    margin-top: 24px;
    opacity: 0.5;
}

/* ==========================================================================
   6. PRODUCTOS DESTACADOS
   ========================================================================== */
.product-card {
    background-color: var(--bg-white-off);
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.product-img-box {
    height: 220px;
}

.product-img-box img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-body {
    padding: 24px;
}

.product-body h3 {
    font-size: 1.15rem;
    margin-bottom: 8px;
    color: var(--primary-dark);
}

.product-desc {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.product-presentation {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--primary-dark);
}

/* ==========================================================================
   7. COBERTURA
   ========================================================================== */
.cobertura-details {
    margin-top: 24px;
}

.detail-item {
    margin-bottom: 16px;
}

.detail-item strong {
    color: var(--accent-color);
    font-size: 0.9rem;
}

.detail-item p {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.stylized-map {
    position: relative;
    height: 320px;
    background-color: var(--bg-beige);
    border-radius: 6px;
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.map-grid {
    position: absolute;
    inset: 0;
    background-image: radial-gradient(var(--border-color) 1px, transparent 1px);
    background-size: 20px 20px;
    opacity: 0.6;
}

.map-point {
    position: absolute;
    width: 12px;
    height: 12px;
    background-color: var(--accent-color);
    border-radius: 50%;
    box-shadow: 0 0 0 6px rgba(200, 90, 50, 0.2);
}

.point-1 { top: 30%; left: 40%; }
.point-2 { top: 55%; left: 60%; }
.point-3 { top: 70%; left: 35%; }

.map-label {
    position: relative;
    z-index: 2;
    background-color: var(--primary-dark);
    color: #FFFFFF;
    padding: 8px 16px;
    font-size: 0.8rem;
    border-radius: 4px;
    letter-spacing: 1px;
}

/* ==========================================================================
   8. FLOTA Y LOGÍSTICA
   ========================================================================== */
.flota-card {
    background-color: var(--bg-white-off);
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.flota-img-box {
    height: 240px;
}

.flota-img-box img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.flota-body {
    padding: 24px;
}

.flota-body h3 {
    margin-bottom: 8px;
    color: var(--primary-dark);
}

.flota-body p {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 16px;
}

.specs-editable p {
    font-size: 0.85rem;
    margin-bottom: 4px;
}

/* ==========================================================================
   9. GALERÍA MASONRY
   ========================================================================== */
.gallery-masonry {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.gallery-item {
    position: relative;
    height: 260px;
    border-radius: 6px;
    overflow: hidden;
    cursor: pointer;
}

.gallery-item.item-large { grid-column: span 2; }
.gallery-item.item-wide { grid-column: span 3; height: 320px; }

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.gallery-overlay {
    position: absolute;
    inset: 0;
    background-color: rgba(26, 24, 22, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #FFFFFF;
    opacity: 0;
    transition: opacity 0.3s ease;
    font-weight: 500;
}

.gallery-item:hover img { transform: scale(1.04); }
.gallery-item:hover .gallery-overlay { opacity: 1; }

.lightbox {
    display: none;
    position: fixed;
    z-index: 2000;
    inset: 0;
    background-color: rgba(0,0,0,0.9);
    justify-content: center;
    align-items: center;
}

.lightbox-content {
    max-width: 85%;
    max-height: 85%;
    border-radius: 4px;
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 30px;
    color: #FFFFFF;
    font-size: 40px;
    cursor: pointer;
}

/* ==========================================================================
   10. HISTORIA (TIMELINE)
   ========================================================================== */
.timeline {
    position: relative;
    max-width: 700px;
    margin: 40px auto 0;
}

.timeline::before {
    content: '';
    position: absolute;
    top: 0;
    left: 18px;
    width: 2px;
    height: 100%;
    background-color: var(--border-color);
}

.timeline-item {
    position: relative;
    padding-left: 50px;
    margin-bottom: 40px;
}

.timeline-dot {
    position: absolute;
    top: 4px;
    left: 11px;
    width: 16px;
    height: 16px;
    background-color: var(--accent-color);
    border-radius: 50%;
    border: 3px solid var(--bg-beige);
}

.timeline-stage {
    display: inline-block;
    font-weight: 700;
    color: var(--primary-dark);
    margin-bottom: 4px;
}

/* ==========================================================================
   11. POR QUÉ EL RUBIO
   ========================================================================== */
.feature-box {
    background-color: var(--bg-white-off);
    padding: 32px 24px;
    border-radius: 6px;
    border: 1px solid var(--border-color);
}

.feature-num {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent-color);
    margin-bottom: 12px;
}

.feature-box h3 {
    margin-bottom: 8px;
    font-size: 1.1rem;
}

.feature-box p {
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* ==========================================================================
   12. CONTACTO
   ========================================================================== */
.contacto-section { position: relative; }

.contacto-bg {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    z-index: 1;
}

.contacto-lead {
    max-width: 650px;
    margin: 0 auto 40px;
    font-size: 1.1rem;
}

/* ==========================================================================
   FOOTER
   ========================================================================== */
.site-footer {
    background-color: #121110;
    color: rgba(255, 255, 255, 0.7);
    padding: 80px 0 30px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.footer-brand {
    font-size: 1.1rem;
    font-weight: 700;
    color: #FFFFFF;
    margin-bottom: 16px;
}

.footer-brand span { color: var(--accent-color); font-weight: 400; }

.footer-col h4 {
    color: #FFFFFF;
    margin-bottom: 20px;
    font-size: 0.95rem;
}

.footer-links { list-style: none; }
.footer-links li { margin-bottom: 10px; }
.footer-links a:hover { color: var(--accent-color); }

.social-links a {
    display: inline-block;
    margin-right: 12px;
    color: var(--accent-color);
    font-weight: 600;
    font-size: 0.9rem;
}

.footer-bottom {
    margin-top: 60px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 0.85rem;
}

/* ==========================================================================
   ANIMACIONES REVEAL (SCROLL)
   ========================================================================== */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

/* ==========================================================================
   RESPONSIVE DESIGN
   ========================================================================== */
@media (max-width: 992px) {
    .grid-4, .grid-3 { grid-template-columns: repeat(2, 1fr); }
    .hero h1 { font-size: 2.8rem; }
    .process-steps-grid { flex-direction: column; gap: 30px; }
    .step-line { display: none; }
    .gallery-item.item-large, .gallery-item.item-wide { grid-column: span 1; }
    .supply-flow { flex-direction: column; gap: 12px; }
    .flow-connector { transform: rotate(90deg); }
}

@media (max-width: 768px) {
    .section { padding: 70px 0; }
    .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
    
    .menu-toggle { display: flex; }
    
    .nav-menu {
        position: fixed;
        top: 0;
        right: -100%;
        width: 80%;
        height: 100vh;
        background-color: var(--primary-dark);
        flex-direction: column;
        justify-content: center;
        align-items: center;
        transition: right 0.4s ease;
    }
    
    .nav-menu.active { right: 0; }
    
    .hero h1 { font-size: 2.2rem; }
    .hero-subtitle { font-size: 1.2rem; }
    .hero-actions { flex-direction: column; }
    .btn { width: 100%; }

    .kpi-grid { flex-direction: column; gap: 20px; }
    .gallery-masonry { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
    .hero h1 { font-size: 1.8rem; }
    .section-title { font-size: 1.8rem; }
}