/* ============================================
   FERRESERVICIOS INDUSTRIALES - ESTILOS MEJORADOS
   ============================================ */

/* ---------- IMPORTACIÓN DE FUENTES ---------- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap');

/* ---------- VARIABLES GLOBALES ---------- */
:root {
    --primary-color: #1a365d;
    --primary-dark: #0f2847;
    --primary-light: #2a4a7a;
    --secondary-color: #d69e2e;
    --secondary-dark: #b8860b;
    --accent-color: #e63946;
    --accent-hover: #c62836;
    --text-dark: #1a202c;
    --text-muted: #4a5568;
    --text-light: #f7fafc;
    --bg-body: #f0f4f8;
    --bg-card: #ffffff;
    --border-color: #e2e8f0;
    --border-radius: 12px;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 8px 25px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 20px 50px rgba(0, 0, 0, 0.12);
    --shadow-hover: 0 12px 35px rgba(26, 54, 93, 0.15);
    --transition: 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* ---------- RESET Y BASE ---------- */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--bg-body);
    color: var(--text-dark);
    line-height: 1.7;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

a {
    text-decoration: none;
    color: var(--primary-color);
    transition: color var(--transition);
}

a:hover {
    color: var(--secondary-color);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

/* ---------- CONTENEDOR ---------- */
.container {
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* ---------- HEADER ---------- */
header {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary-color));
    color: var(--text-light);
    padding: 0.6rem 0;
    border-bottom: 3px solid var(--secondary-color);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: var(--shadow-md);
}

.header-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    flex-wrap: nowrap;
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    flex-shrink: 0;
    text-decoration: none !important;
}

.logo-img {
    height: 50px;
    border-radius: 10px;
    border: 2px solid var(--secondary-color);
    padding: 2px;
    background: white;
    transition: transform var(--transition);
}

.logo-img:hover {
    transform: scale(1.04);
}

.logo-text-container {
    display: flex;
    flex-direction: column;
}

.logo-text {
    font-size: 1.15rem;
    font-weight: 800;
    line-height: 1.2;
    color: var(--text-light);
    letter-spacing: -0.02em;
}

.logo-text span {
    display: block;
    font-size: 0.7rem;
    font-weight: 400;
    opacity: 0.85;
}

.location {
    font-size: 0.7rem;
    opacity: 0.75;
    margin-top: -2px;
}

.nav-toggle {
    display: none;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: var(--text-light);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0.5rem 0.9rem;
    border-radius: 8px;
    transition: var(--transition);
}

.nav-toggle:hover {
    background: rgba(255, 255, 255, 0.2);
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.nav-links a {
    color: var(--text-light) !important;
    text-decoration: none !important;
    font-weight: 500;
    font-size: 0.85rem;
    padding: 0.5rem 0.9rem;
    border-radius: 8px;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.nav-links a:hover {
    background: rgba(255, 255, 255, 0.12);
    transform: translateY(-1px);
    color: var(--secondary-color) !important;
}

.nav-links a.active {
    background: var(--secondary-color);
    color: var(--primary-dark) !important;
    font-weight: 600;
}

@media (max-width: 1024px) {
    .nav-toggle {
        display: block;
    }
    .nav-links {
        flex-direction: column;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background: var(--primary-dark);
        padding: 1rem;
        border-top: 1px solid rgba(255, 255, 255, 0.08);
        transform: translateY(-150%);
        opacity: 0;
        pointer-events: none;
        transition: transform 0.3s ease, opacity 0.3s ease;
        z-index: 999;
        box-shadow: var(--shadow-lg);
    }
    .nav-links.active {
        transform: translateY(0);
        opacity: 1;
        pointer-events: auto;
    }
    .nav-links a {
        width: 100%;
        white-space: normal;
        padding: 0.6rem 1rem;
    }
}

@media (max-width: 600px) {
    .logo-text {
        font-size: 0.95rem;
    }
    .logo-img {
        height: 40px;
    }
}

/* ---------- TÍTULOS ---------- */
.section-title {
    text-align: center;
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--primary-color);
    margin-bottom: 3rem;
    position: relative;
    padding-bottom: 1rem;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 4px;
    background: linear-gradient(90deg, var(--secondary-color), var(--primary-color));
    border-radius: 2px;
}

.section-title span {
    color: var(--secondary-color);
}

.section-title-left {
    text-align: left;
}
.section-title-left::after {
    left: 0;
    transform: none;
}

/* ---------- TARJETAS ---------- */
.card {
    background: var(--bg-card);
    border-radius: var(--border-radius);
    padding: 2.5rem 2rem;
    text-align: center;
    box-shadow: var(--shadow-sm);
    transition: transform var(--transition), box-shadow var(--transition);
    border-top: 4px solid var(--primary-color);
}

.card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-hover);
    border-top-color: var(--secondary-color);
}

.card-icon {
    font-size: 2.8rem;
    margin-bottom: 1.2rem;
    color: var(--primary-color);
}

.card h3 {
    color: var(--primary-color);
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 0.8rem;
}

.card p {
    color: var(--text-muted);
    font-size: 0.95rem;
}

/* ---------- BOTONES ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.7rem 1.8rem;
    border-radius: 50px;
    font-weight: 600;
    font-size: 0.95rem;
    transition: var(--transition);
    cursor: pointer;
    border: 2px solid transparent;
    text-decoration: none !important;
}

.btn-primary {
    background: var(--primary-color);
    color: var(--text-light) !important;
    border-color: var(--primary-color);
}
.btn-primary:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(26, 54, 93, 0.3);
}

.btn-secondary {
    background: var(--secondary-color);
    color: var(--text-dark) !important;
    border-color: var(--secondary-color);
}
.btn-secondary:hover {
    background: var(--secondary-dark);
    border-color: var(--secondary-dark);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(214, 158, 46, 0.35);
}

.btn-outline {
    background: transparent;
    border-color: var(--text-light);
    color: var(--text-light) !important;
}
.btn-outline:hover {
    background: var(--text-light);
    color: var(--primary-color) !important;
}

.btn-danger {
    background: var(--accent-color);
    color: var(--text-light) !important;
    border-color: var(--accent-color);
}
.btn-danger:hover {
    background: var(--accent-hover);
    border-color: var(--accent-hover);
    transform: translateY(-2px);
}

.btn-sm {
    padding: 0.4rem 1.2rem;
    font-size: 0.8rem;
}
.btn-lg {
    padding: 0.9rem 2.5rem;
    font-size: 1.05rem;
}

/* ---------- PRODUCTOS ---------- */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1.5rem;
}

.product-card-container {
    position: relative;
}

.product-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: white;
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
    overflow: hidden;
    transition: transform var(--transition), box-shadow var(--transition);
    border-top: 4px solid var(--primary-color);
}

.product-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-hover);
}

.product-card a {
    text-decoration: none;
    color: inherit;
}

.product-img {
    height: 180px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8fafc;
    padding: 1rem;
    position: relative;
}

.product-img img {
    max-height: 100%;
    max-width: 100%;
    object-fit: contain;
}

.product-img .img-placeholder {
    font-size: 50px;
    color: #ddd;
    position: absolute;
}

.product-info {
    padding: 1rem 1.2rem;
    flex: 1;
}

.product-info h3 {
    font-size: 0.95rem;
    font-weight: 600;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-actions {
    padding: 0.8rem 1.2rem 1.2rem;
    border-top: 1px solid var(--border-color);
}

.category-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(26, 54, 93, 0.92);
    color: white;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.2rem 0.7rem;
    border-radius: 20px;
    z-index: 2;
    text-transform: uppercase;
}

.badge-oferta {
    position: absolute;
    top: 12px;
    left: 12px;
    background: var(--accent-color);
    color: white;
    padding: 0.2rem 0.9rem;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 700;
    z-index: 2;
    box-shadow: 0 2px 10px rgba(230, 57, 70, 0.35);
    animation: pulse-badge 2s infinite;
}

@keyframes pulse-badge {
    0%,
    100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

/* ---------- FOOTER ---------- */
footer {
    background: var(--primary-dark);
    color: var(--text-light);
    padding: 3.5rem 0 0;
    margin-top: auto;
    border-top: 4px solid var(--secondary-color);
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 2.5rem;
    padding-bottom: 2.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.footer-section h3 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 1.2rem;
    color: white;
    position: relative;
    padding-bottom: 0.6rem;
}

.footer-section h3::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 30px;
    height: 3px;
    background: var(--secondary-color);
    border-radius: 2px;
}

.footer-logo {
    font-size: 1.4rem;
    font-weight: 800;
    color: white;
    margin-bottom: 0.8rem;
}

.footer-section p {
    font-size: 0.9rem;
    opacity: 0.8;
    line-height: 1.7;
}

.social-links {
    display: flex;
    gap: 0.8rem;
    margin-top: 1rem;
}

.social-links a {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: white;
    transition: var(--transition);
    font-size: 1.1rem;
}

.social-links a:hover {
    background: var(--secondary-color);
    color: var(--primary-dark);
    transform: translateY(-3px);
}

.contact-info li {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    font-size: 0.9rem;
    opacity: 0.8;
    margin-bottom: 0.6rem;
}

.contact-info li i {
    margin-top: 0.2rem;
    color: var(--secondary-color);
    width: 18px;
}

.contact-info a {
    color: rgba(255, 255, 255, 0.8);
}
.contact-info a:hover {
    color: var(--secondary-color);
}

.copyright {
    text-align: center;
    padding: 1.5rem;
    font-size: 0.85rem;
    opacity: 0.7;
}

.designer-link {
    color: var(--secondary-color) !important;
    font-weight: 600;
    transition: var(--transition);
}
.designer-link:hover {
    color: white !important;
}

/* ---------- RESPONSIVE ---------- */
@media (max-width: 768px) {
    .section-title {
        font-size: 1.7rem;
    }
    .product-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 1rem;
    }
    .footer-content {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
}

@media (max-width: 480px) {
    .product-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.8rem;
    }
    .product-img {
        height: 130px;
    }
    .product-info h3 {
        font-size: 0.8rem;
    }
}

/* ---------- ANIMACIONES AOS ---------- */
[data-aos] {
    opacity: 0;
    transition-property: opacity, transform;
}
[data-aos].aos-animate {
    opacity: 1;
}
[data-aos="fade-up"] {
    transform: translateY(30px);
}
[data-aos="fade-up"].aos-animate {
    transform: translateY(0);
}
[data-aos="fade-right"] {
    transform: translateX(-30px);
}
[data-aos="fade-right"].aos-animate {
    transform: translateX(0);
}
[data-aos="zoom-in"] {
    transform: scale(0.9);
}
[data-aos="zoom-in"].aos-animate {
    transform: scale(1);
}
/* ============================================
   MEJORAS PROFESIONALES — INTERACCIÓN Y ANIMACIÓN
   ============================================ */

/* ---------- PRELOADER ---------- */
.page-loader {
    position: fixed;
    inset: 0;
    z-index: 99999;
    background: linear-gradient(135deg, var(--primary-dark), var(--primary-color));
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.6s ease, visibility 0.6s ease;
}

.page-loader-hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.page-loader-inner {
    text-align: center;
    color: #fff;
}

.page-loader-logo {
    width: 64px;
    height: 64px;
    margin: 0 auto 1rem;
    border: 4px solid rgba(255, 255, 255, 0.25);
    border-top-color: var(--secondary-color);
    border-radius: 50%;
    animation: loader-spin 0.9s linear infinite;
}

.page-loader-text {
    font-size: 0.8rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    opacity: 0.85;
}

@keyframes loader-spin {
    to { transform: rotate(360deg); }
}

/* ---------- HEADER: EFECTO AL HACER SCROLL ---------- */
header {
    transition: padding var(--transition), box-shadow var(--transition), background var(--transition);
}

header.is-scrolled {
    padding: 0.35rem 0;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.25);
}

/* ---------- REVELADO AL HACER SCROLL ---------- */
.reveal {
    opacity: 0;
    transform: translateY(28px);
    transition: opacity 0.7s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                transform 0.7s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    will-change: opacity, transform;
}

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

@media (prefers-reduced-motion: reduce) {
    .reveal {
        opacity: 1;
        transform: none;
        transition: none;
    }
}

/* ---------- IMÁGENES CON FUNDIDO ---------- */
.img-fade {
    opacity: 0;
    transform: scale(1.02);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.img-fade-in {
    opacity: 1;
    transform: scale(1);
}

/* ---------- BOTÓN VOLVER ARRIBA ---------- */
.back-to-top {
    position: fixed;
    right: 24px;
    bottom: 24px;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: var(--primary-color);
    color: #fff;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    cursor: pointer;
    box-shadow: var(--shadow-md);
    opacity: 0;
    visibility: hidden;
    transform: translateY(15px);
    transition: opacity 0.3s ease, transform 0.3s ease, background 0.3s ease, visibility 0.3s ease;
    z-index: 998;
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.back-to-top:hover {
    background: var(--secondary-color);
    color: var(--text-dark);
    transform: translateY(-4px);
}

/* Si hay botón flotante de WhatsApp, subir el back-to-top para no encimarlos */
.float-whatsapp ~ .back-to-top,
.back-to-top {
    bottom: 90px;
}

@media (max-width: 600px) {
    .back-to-top {
        right: 16px;
        width: 42px;
        height: 42px;
        bottom: 84px;
    }
}

/* ---------- BOTÓN FLOTANTE WHATSAPP CON PULSO ---------- */
.float-whatsapp {
    position: fixed;
    right: 24px;
    bottom: 24px;
    width: 58px;
    height: 58px;
    background: #25d366;
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.7rem;
    box-shadow: 0 8px 24px rgba(37, 211, 102, 0.45);
    z-index: 999;
    transition: transform var(--transition);
}

.float-whatsapp:hover {
    transform: scale(1.1);
    color: #fff;
}

.whatsapp-ring {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 2px solid #25d366;
    animation: whatsapp-pulse 2s ease-out infinite;
    pointer-events: none;
}

@keyframes whatsapp-pulse {
    0% { transform: scale(1); opacity: 0.7; }
    100% { transform: scale(1.9); opacity: 0; }
}

@media (max-width: 600px) {
    .float-whatsapp {
        right: 16px;
        bottom: 16px;
        width: 50px;
        height: 50px;
        font-size: 1.4rem;
    }
}

/* ---------- EFECTO RIPPLE EN BOTONES ---------- */
.btn, .btn-hero, .btn-hero-outline {
    position: relative;
    overflow: hidden;
}

.btn-ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    transform: scale(0);
    animation: ripple-anim 0.6s ease-out;
    pointer-events: none;
}

@keyframes ripple-anim {
    to {
        transform: scale(2.5);
        opacity: 0;
    }
}

/* ---------- TARJETAS DE PRODUCTO: BRILLO SUTIL AL PASAR EL MOUSE ---------- */
.product-img {
    overflow: hidden;
}

.product-img img {
    transition: transform 0.5s ease;
}

.product-card:hover .product-img img {
    transform: scale(1.08);
}

.product-card {
    position: relative;
}

/* ---------- NOTIFICACIONES TOAST ---------- */
.toast-container {
    position: fixed;
    top: 90px;
    right: 20px;
    z-index: 100000;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    max-width: 320px;
}

.app-toast {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    background: #fff;
    color: var(--text-dark);
    padding: 0.9rem 1.1rem;
    border-radius: 10px;
    box-shadow: var(--shadow-lg);
    border-left: 4px solid var(--primary-color);
    font-size: 0.9rem;
    font-weight: 500;
    opacity: 0;
    transform: translateX(30px);
    transition: opacity 0.35s ease, transform 0.35s ease;
}

.app-toast.show {
    opacity: 1;
    transform: translateX(0);
}

.app-toast-success { border-left-color: #22c55e; }
.app-toast-success i { color: #22c55e; }
.app-toast-error { border-left-color: var(--accent-color); }
.app-toast-error i { color: var(--accent-color); }
.app-toast-info { border-left-color: var(--secondary-color); }
.app-toast-info i { color: var(--secondary-color); }

@media (max-width: 600px) {
    .toast-container {
        left: 16px;
        right: 16px;
        max-width: none;
        top: 76px;
    }
}

/* ---------- BARRA DE DESPLAZAMIENTO PERSONALIZADA ---------- */
::-webkit-scrollbar {
    width: 10px;
}
::-webkit-scrollbar-track {
    background: var(--bg-body);
}
::-webkit-scrollbar-thumb {
    background: var(--primary-light);
    border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--secondary-color);
}
