/* GENERAL */
html, body {
    max-width: 100%;
    overflow-x: hidden;
}
body {
    font-family: 'Lato', sans-serif;
    -webkit-font-smoothing: antialiased;
    scroll-behavior: smooth; /* Scroll suave nativo */
}
a {
    text-decoration: none;
}

/* TIPOGRAFÍA */
h1, h2, h3, h4, h5, h6 {
    font-family: 'Lato', sans-serif;
    font-weight: 700;
}

.letter-spacing-2 { letter-spacing: 2px; }
.letter-spacing-3 { letter-spacing: 3px; }

/* NAVBAR */
.navbar-brand img {
    max-height: 60px;
}

/* CAROUSEL / SLIDER */
.carousel-item img {
    object-fit: cover;
}

/* ESTILOS DE PROYECTOS (HOVER EFFECTS) */
.hover-opacity-100:hover {
    opacity: 1 !important;
}
.transition-all {
    transition: all 0.3s ease;
}

/* FORMULARIO DE CONTACTO - ICONOS */
.input-group-text {
    background-color: rgba(255,255,255,0.9);
    border: none;
}

/* MODIFICACIONES BOOTSTRAP */
section {
    scroll-margin-top: 80px;
}


/* CHAT */
n8n-chat {
	position: fixed !important;
	bottom: 20px !important;
	right: 20px !important;
	z-index: 99999 !important;
}

#chat-widget-container {
	position: fixed;
	bottom: 20px;
	right: 20px;
	z-index: 9999;
	display: flex;
	flex-direction: column;
	align-items: flex-end;
}

#chat-iframe-container {
	width: 380px;
	height: 600px;
	max-height: 80vh; /* Para pantallas pequeñas */
	max-width: 90vw;
	background: white;
	border-radius: 15px;
	box-shadow: 0 5px 25px rgba(0,0,0,0.2);
	overflow: hidden;
	margin-bottom: 15px;
	transition: all 0.3s ease;
	opacity: 0;
	transform: translateY(20px);
	visibility: hidden;
}

#chat-iframe-container.active {
	opacity: 1;
	transform: translateY(0);
	visibility: visible;
}

#chat-toggle-btn {
	width: 60px;
	height: 60px;
	border-radius: 50%;
	background-color: #0d6efd; /* Color primario bootstrap, cambiar si deseas */
	color: white;
	border: none;
	box-shadow: 0 4px 10px rgba(0,0,0,0.3);
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 28px;
	transition: transform 0.3s ease;
}

#chat-toggle-btn:hover {
	transform: scale(1.1);
}

#chat-toggle-btn i {
	transition: transform 0.3s ease;
}

/* COOKIES BANNER */
#cookie-banner {
    transition: transform 0.3s ease-in-out;
}

/* En móviles, asegurar que el botón sea fácil de tocar */
@media (max-width: 768px) {
    #cookie-banner .btn {
        width: 100%;
        margin-top: 10px;
    }
}

/* ESTILOS DEL AVISO DE COOKIES (Flotante Izquierda) */
.cookie-floating {
    position: fixed;
    bottom: 20px;       /* Separación del fondo */
    left: 20px;         /* Separación de la izquierda */
    width: 90%;         /* Ancho responsive */
    max-width: 420px;   /* Un poco más ancho para que entren los botones en la misma línea */
    border-radius: 12px;
    z-index: 10000;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s ease-in-out;
}

/* Estado Visible */
.cookie-floating:not(.d-none) {
    opacity: 1;
    visibility: visible;
    animation: slideUpLeft 0.5s ease-out forwards;
}

/* Animación de entrada (desde abajo) */
@keyframes slideUpLeft {
    from { transform: translateY(50px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* DARK MODE OVERRIDES */
[data-bs-theme="dark"] {
    --bs-body-bg: #121212;
    --bs-body-color: #f8f9fa;
    --bs-tertiary-bg: #1e1e1e;
}

[data-bs-theme="dark"] .bg-white {
    background-color: #1e1e1e !important;
}

[data-bs-theme="dark"] .bg-light {
    background-color: #2d2d2d !important;
}

[data-bs-theme="dark"] .navbar {
    background-color: #1e1e1e !important;
    border-bottom: 1px solid #333;
}

[data-bs-theme="dark"] .input-group-text {
    background-color: #2d2d2d;
    color: #fff;
    border: 1px solid #444;
}

[data-bs-theme="dark"] .form-control {
    background-color: #1e1e1e;
    color: #fff;
    border: 1px solid #444;
}

[data-bs-theme="dark"] #chat-iframe-container {
    background: #1e1e1e;
    box-shadow: 0 5px 25px rgba(0,0,0,0.5);
}

[data-bs-theme="dark"] .card {
    background-color: #1e1e1e;
    border-color: #333;
}

[data-bs-theme="dark"] .text-dark {
    color: #f8f9fa !important;
}

#theme-toggle {
    cursor: pointer;
    transition: transform 0.3s ease;
}

#theme-toggle:hover {
    transform: scale(1.1);
}

[data-bs-theme="dark"] #btn-submit {
    background-color: var(--bs-body-bg) !important;
    color: var(--bs-body-color) !important;
    border-color: #444 !important;
}

[data-bs-theme="dark"] #btn-submit:hover {
    background-color: #222 !important;
}


[data-bs-theme="dark"] img[src*="call.svg"] {
    filter: invert(1) brightness(100);
}

/* RESPONSIVE UTILS */
@media (min-width: 768px) {
    .w-md-50 { width: 50% !important; }
}

/* REPARACIONES Y PRODUCTOS */
.hover-scale {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.hover-scale:hover {
    transform: translateY(-5px);
    box-shadow: 0 0.5rem 1.5rem rgba(0, 0, 0, 0.1) !important;
}

/* AJUSTES RESPONSIVOS PARA MÓVILES (CHAT IA Y EVITAR DESPLAZAMIENTO HORIZONTAL) */
@media (max-width: 576px) {
    :root, [data-bs-theme="light"], [data-bs-theme="dark"] {
        --chat--window--width: calc(100vw - 24px);
        --chat--window--height: 70vh;
        --chat--window--bottom: 12px;
        --chat--window--right: 12px;
        --chat--toggle--size: 56px;
        --chat--spacing: 0.75rem;
    }
    
    n8n-chat {
        bottom: 12px !important;
        right: 12px !important;
    }

    .cookie-floating {
        left: 10px !important;
        right: 10px !important;
        bottom: 10px !important;
        width: auto !important;
        max-width: none !important;
    }
}
