/*
Theme Name: Trepal - Grupo Empresarial
Description: Tema optimizado para Trepal - Mobile-first, Core Web Vitals optimizado, accesible AA
Version: 1.0.0
Author: Trepal Team
Text Domain: trepal-theme
*/

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

body {
    font-family: 'Inter', sans-serif;
    font-display: swap;
    line-height: 1.6;
    color: #333;
    background-color: #fff;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Variables CSS */
:root {
    --primary-color: #9a958e;
    --secondary-color: #d4af37;
    --accent-color: #8b4513;
    --dark-color: #2c2c2c;
    --light-color: #f8f9fa;
    --border-color: #e5e7eb;
    --text-color: #374151;
    --text-light: #6b7280;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
}

/* Accesibilidad */
.skip-link {
    position: absolute;
    left: -9999px;
    z-index: 999999;
    padding: 8px 16px;
    background: var(--dark-color);
    color: white;
    text-decoration: none;
}

.skip-link:focus {
    left: 6px;
    top: 7px;
}

.screen-reader-text {
    clip: rect(1px, 1px, 1px, 1px);
    position: absolute !important;
    height: 1px;
    width: 1px;
    overflow: hidden;
}

.screen-reader-text:focus {
    background-color: #f1f1f1;
    border-radius: 3px;
    box-shadow: 0 0 2px 2px rgba(0, 0, 0, 0.6);
    clip: auto !important;
    color: #21759b;
    display: block;
    font-size: 14px;
    font-weight: bold;
    height: auto;
    left: 5px;
    line-height: normal;
    padding: 15px 23px 14px;
    text-decoration: none;
    top: 5px;
    width: auto;
    z-index: 100000;
}

/* Focus visible para navegación por teclado */
*:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Reducir movimiento para usuarios sensibles */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* Tipografía */
h1, h2, h3, h4, h5, h6 {
    font-weight: 300;
    line-height: 1.2;
    margin-bottom: 1rem;
    color: var(--dark-color);
}

/* Mobile-first typography */
h1 { font-size: 2.5rem; }
h2 { font-size: 3.75rem;}
h3 { font-size: 3rem; }
h4 { font-size: 1.5rem; }
h5 { font-size: 1.25rem; }
h6 { font-size: 1rem; }


h1, h2{
    font-family: "Playfair Display", serif;
}
.container.img-bg-queso {
    background-position: right;
    background-repeat: no-repeat;
    background-image: url('https://trepal.es/wp-content/uploads/2025/10/BQIN2.png');
    background-size: auto;
}
.bg-crema{
    background-color: #FFF9EB;
}

@media (min-width: 768px) {
    h1 { font-size: 4rem; }
    h2 { font-size: 3rem; }
    h3 { font-size: 2.5rem; }
    h4 { font-size: 2rem; }
}


p {
    margin-bottom: 1rem;
    color: var(--text-color);
}

/* Layout */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

.container-fluid {
    width: 100%;
    padding: 0 1rem;
}

/* Mejoras de rendimiento */
img {
    height: auto;
    max-width: 100%;
}

img[loading="lazy"] {
    opacity: 0;
    transition: opacity 0.3s;
}

img[loading="lazy"].loaded {
    opacity: 1;
}

/* Header */
.site-header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.site-header.scrolled {
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.site-header.header-hidden {
    transform: translateY(-100%);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
}

.site-logo img {
    height: 50px;
    width: auto;
}

/* Navegación */
.main-navigation ul {
    display: none;
    list-style: none;
    margin: 0;
    padding: 0;
}

@media (min-width: 768px) {
    .main-navigation ul {
        display: flex;
        gap: 2rem;
    }
}

.main-navigation ul.active {
    display: block;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    box-shadow: var(--shadow);
    padding: 1rem;
}

@media (min-width: 768px) {
    .main-navigation ul.active {
        display: flex;
        position: static;
        box-shadow: none;
        padding: 0;
    }
}

.main-navigation li {
    margin-bottom: 1rem;
}

@media (min-width: 768px) {
    .main-navigation li {
        margin-bottom: 0;
    }
}

.main-navigation a {
    text-decoration: none;
    color: var(--text-color);
    font-weight: 300;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    transition: var(--transition);
    position: relative;
}

.main-navigation a:hover {
    color: var(--primary-color);
}

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

.main-navigation a:hover::after {
    width: 100%;
}

/* Menu toggle button */
.menu-toggle {
    display: block;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    position: relative;
    width: 30px;
    height: 30px;
}

@media (min-width: 768px) {
    .menu-toggle {
        display: none;
    }
}

.menu-toggle .hamburger {
    display: block;
    width: 25px;
    height: 3px;
    background: var(--dark-color);
    margin: 5px 0;
    transition: var(--transition);
}

.menu-toggle.active .hamburger:nth-child(1) {
    transform: rotate(-45deg) translate(-5px, 6px);
}

.menu-toggle.active .hamburger:nth-child(2) {
    opacity: 0;
}

.menu-toggle.active .hamburger:nth-child(3) {
    transform: rotate(45deg) translate(-5px, -6px);
}

/* Hero Section */
.hero-section {
    min-height: 60vh;
    display: flex;
    align-items: center;
    position: relative;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--dark-color) 100%);
    color: white;
    overflow: hidden;
}

@media (min-width: 768px) {
    .hero-section {
        min-height: 100vh;
    }
}

.hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
}

.hero-title {
    font-size: 3rem;
    font-weight: 100;
    margin-bottom: 1.5rem;
    opacity: 0;
    animation: fadeInUp 1s ease forwards;
}

@media (min-width: 768px) {
    .hero-title {
        font-size: 6rem;
    }
}

.hero-subtitle {
    font-size: 1.25rem;
    margin-bottom: 2rem;
    opacity: 0;
    animation: fadeInUp 1s ease 0.3s forwards;
}

@media (min-width: 768px) {
    .hero-subtitle {
        font-size: 1.5rem;
    }
}

.hero-description {
    font-size: 1rem;
    margin-bottom: 3rem;
    opacity: 0;
    animation: fadeInUp 1s ease 0.6s forwards;
}

@media (min-width: 768px) {
    .hero-description {
        font-size: 1.1rem;
    }
}


/* Botones */
.btn {
    display: inline-block;
    padding: 1rem 2rem;
    border: none;
    border-radius: 0;
    text-decoration: none;
    font-weight: 300;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    min-height: 44px;
    min-width: 44px;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: #8a857e;
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-secondary {
    background: transparent;
    color: white;
    border: 2px solid white;
}

.btn-secondary:hover {
    background: white;
    color: var(--primary-color);
}

/* Secciones */
.section {
    padding: 5rem 0;
}

.section-title {
    text-align: center;
    margin-bottom: 3rem;
    position: relative;
    font-weight: 100;
    font-size: 3rem;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 3px;
    background: var(--primary-color);
}

/* Grid */
.grid {
    display: grid;
    gap: 1rem;
}

@media (min-width: 768px) {
    .grid {
        gap: 2rem;
    }
}

.grid-2 { grid-template-columns: 1fr; }
.grid-3 { grid-template-columns: 1fr; }
.grid-4 { grid-template-columns: 1fr; }

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

/* Cards */
.card {
    background: white;
    border-radius: 0;
    padding: 2rem;
    box-shadow: var(--shadow);
    transition: var(--transition);
    border: 1px solid var(--border-color);
}

@media (hover: hover) {
    .card:hover {
        transform: translateY(-5px);
        box-shadow: var(--shadow-lg);
    }
}

.card:hover {
    transform: none;
}

.card-icon {
    width: 60px;
    height: 60px;
    background: var(--primary-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
    color: white;
    font-size: 1.5rem;
}

.card-title {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--dark-color);
    font-weight: 300;
}

.card-description {
    color: var(--text-light);
    line-height: 1.6;
    font-weight: 300;
}

/* Brand Cards */
.brand-card {
    background: white;
    border: 1px solid var(--primary-color);
    transition: var(--transition);
    cursor: pointer;
    opacity: 0.7;
}

.brand-card:hover {
    opacity: 1;
    background: #fafafa;
}

.brand-image {
    height: 200px;
    background: linear-gradient(to bottom right, #f8f9fa, #e9ecef);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.brand-content {
    padding: 2rem;
}

.brand-title {
    font-size: 1.5rem;
    font-weight: 300;
    color: var(--dark-color);
    margin-bottom: 0.5rem;
}

.brand-category {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.brand-description {
    color: var(--text-color);
    font-weight: 300;
    line-height: 1.6;
    font-size: 0.9rem;
}

.brand-footer {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.brand-link {
    display: flex;
    align-items: center;
    color: var(--text-light);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    transition: var(--transition);
}

.brand-card:hover .brand-link {
    color: var(--text-color);
}

/* Footer */
.site-footer {
    background: var(--dark-color);
    color: white;
    padding: 3rem 0 1rem;
}

.footer-content {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    margin-bottom: 2rem;
}

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

@media (min-width: 1024px) {
    .footer-content {
        grid-template-columns: repeat(4, 1fr);
    }
}

.footer-section h4 {
    margin-bottom: 1rem;
    color: var(--secondary-color);
    font-weight: 300;
}

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

.footer-section ul li {
    margin-bottom: 0.5rem;
}

.footer-section a {
    color: #d1d5db;
    text-decoration: none;
    transition: var(--transition);
    font-weight: 300;
}

.footer-section a:hover {
    color: var(--secondary-color);
}

.footer-bottom {
    border-top: 1px solid #374151;
    padding-top: 1rem;
    text-align: center;
    color: #9ca3af;
}

/* Animaciones */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Formularios accesibles */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 300;
    color: var(--dark-color);
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid var(--border-color);
    border-radius: 0;
    font-size: 1rem;
    transition: var(--transition);
    min-height: 44px;
    font-family: inherit;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(154, 149, 142, 0.1);
}

.form-group input.error,
.form-group textarea.error,
.form-group select.error {
    border-color: #dc2626;
}

.form-row {
    display: grid;
    gap: 1rem;
}

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

/* Alertas y mensajes */
.alert {
    padding: 1rem;
    border-radius: 0;
    margin-bottom: 1rem;
    border-left: 4px solid;
}

.alert-success {
    background-color: #f0fdf4;
    border-color: #22c55e;
    color: #166534;
}

.alert-error {
    background-color: #fef2f2;
    border-color: #ef4444;
    color: #991b1b;
}

.alert-info {
    background-color: #eff6ff;
    border-color: #3b82f6;
    color: #1e40af;
}

/* Responsive breakpoints adicionales */
@media (max-width: 480px) {
    .container {
        padding: 0 0.75rem;
    }
    
    .hero-title {
        font-size: 2rem;
    }
    
    .hero-subtitle {
        font-size: 1.125rem;
    }
    
    .btn {
        padding: 0.75rem 1.5rem;
        font-size: 0.9rem;
    }
    
    .section {
        padding: 3rem 0;
    }
    .container.img-bg-queso {
        background-image: none;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    :root {
        --primary-color: #000080;
        --text-color: #000000;
        --border-color: #000000;
    }
    
    .btn {
        border: 2px solid;
    }
    
    .card {
        border: 2px solid var(--border-color);
    }
}

/* Utilidades */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }

.visually-hidden {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

/* Print styles */
@media print {
    .site-header,
    .site-footer,
    .btn,
    .menu-toggle {
        display: none !important;
    }
    
    body {
        font-size: 12pt;
        line-height: 1.4;
    }
    
    h1, h2, h3, h4, h5, h6 {
        page-break-after: avoid;
    }
    
    img {
        max-width: 100% !important;
    }
}