/* ==========================================================================
   PORTAFOLIO & REPERTORIO DE WEBS - AITOR DORRONSORO
   Estética inspirada en Carla Díaz Web & Arquitectura sólida de Amurrio Club
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. VARIABLES & DESIGN SYSTEM
   -------------------------------------------------------------------------- */
:root {
    --primary-color: #1e3a8a;       /* Azul marino sofisticado */
    --primary-dark: #1e293b;        /* Slate oscuro */
    --accent-color: #3b82f6;        /* Azul vibrante */
    --accent-gold: #d97706;         /* Toque de elegancia dorado */
    --bg-light: #f8fafc;           /* Fondo suave ultra limpio */
    --bg-card: #ffffff;            /* Tarjetas blanco puro */
    --text-primary: #0f172a;       /* Texto principal casi negro */
    --text-muted: #64748b;         /* Texto secundario gris */
    --border-color: #e2e8f0;       /* Bordes muy finos */
    --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    --shadow-md: 0 10px 25px -5px rgba(15, 23, 42, 0.08), 0 8px 10px -6px rgba(15, 23, 42, 0.04);
    --shadow-lg: 0 20px 35px -10px rgba(15, 23, 42, 0.12), 0 10px 15px -5px rgba(15, 23, 42, 0.06);
    --radius-sm: 8px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --font-heading: 'Playfair Display', Georgia, serif;
    --font-body: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
}

/* Dark Mode support baseline if needed */
body.dark-theme {
    --bg-light: #0f172a;
    --bg-card: #1e293b;
    --text-primary: #f8fafc;
    --text-muted: #94a3b8;
    --border-color: #334155;
}

/* --------------------------------------------------------------------------
   2. RESET & BASE STYLES
   -------------------------------------------------------------------------- */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
}

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

body {
    font-family: var(--font-body);
    background-color: var(--bg-light);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

a {
    color: inherit;
    text-decoration: none;
    transition: var(--transition);
}

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

.container {
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 1.5rem;
    box-sizing: border-box;
}

.section-padding {
    padding: 5rem 0;
}

/* --------------------------------------------------------------------------
   3. HEADER & NAVEGACIÓN
   -------------------------------------------------------------------------- */
.main-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(226, 232, 240, 0.8);
    transition: var(--transition);
}

.header-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 80px;
    max-width: 1400px;
}

.logo {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0.8rem;
    flex-shrink: 0;
}

.logo-img {
    width: 38px;
    height: 38px;
    max-width: 38px;
    max-height: 38px;
    object-fit: contain;
    display: block;
    flex-shrink: 0;
}

.logo-text-box {
    display: flex;
    flex-direction: column;
}

.logo-serif {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 1.15rem;
    font-weight: 800;
    color: #0f172a;
    letter-spacing: 0.5px;
}

.logo-subtitle {
    font-size: 0.65rem;
    font-weight: 600;
    color: var(--accent-color);
    text-transform: uppercase;
    letter-spacing: 1px;
    white-space: nowrap;
}

.nav-menu ul {
    display: flex;
    align-items: center;
    gap: 1.1rem;
    list-style: none;
    flex-wrap: nowrap;
}

.nav-link {
    font-size: 0.88rem;
    font-weight: 700;
    color: #334155;
    position: relative;
    padding: 0.5rem 0.2rem;
    white-space: nowrap;
    transition: color 0.2s ease;
}

.nav-link:hover, .nav-link.active {
    color: #0f172a;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0%;
    height: 2.5px;
    background: #b45309;
    transition: width 0.25s ease;
    border-radius: 2px;
}

.nav-link:hover::after, .nav-link.active::after {
    width: 100%;
}

.btn-contact-nav {
    background: #0f172a;
    color: #ffffff !important;
    padding: 0.55rem 1.2rem;
    border-radius: 8px;
    font-weight: 700;
    font-size: 0.85rem;
    white-space: nowrap;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.2);
    transition: all 0.2s ease;
}

.btn-contact-nav:hover {
    background: #1e293b;
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(15, 23, 42, 0.3);
}

.btn-admin-nav {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    background: #ffffff;
    border: 1.5px solid #d97706;
    padding: 0.48rem 1.1rem;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 700;
    color: #b45309;
    transition: all 0.2s ease;
}

.btn-admin-nav:hover {
    background: #fffbeeb3;
    color: #92400e;
}

.btn-install-pwa {
    background: #10b981;
    color: #fff;
    border: none;
    padding: 0.45rem 0.9rem;
    border-radius: 30px;
    font-weight: 700;
    font-size: 0.8rem;
    cursor: pointer;
    display: inline-flex !important;
    align-items: center;
    gap: 0.4rem;
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.3);
    transition: var(--transition);
}

.btn-install-pwa:hover {
    background: #059669;
    transform: translateY(-2px);
}

.btn-install-pwa-mobile {
    background: #10b981;
    color: #fff;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(16, 185, 129, 0.3);
}

/* Control Móvil */
.mobile-header-right {
    display: none;
    align-items: center;
    gap: 0.6rem;
}

/* --------------------------------------------------------------------------
   SELECCIÓN DE IDIOMAS (DROPDOWN CON BANDERAS Y CÓDIGOS)
   -------------------------------------------------------------------------- */
.lang-dropdown-wrapper {
    position: relative;
    display: inline-block;
}

.lang-dropdown-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: rgba(241, 245, 249, 0.9);
    border: 1px solid var(--border-color);
    padding: 0.4rem 0.75rem;
    border-radius: 20px;
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--primary-dark);
    cursor: pointer;
    transition: var(--transition);
    user-select: none;
}

.lang-dropdown-btn:hover {
    background: #e2e8f0;
    border-color: var(--accent-color);
}

.lang-flag {
    font-size: 1rem;
    line-height: 1;
    display: inline-block;
}

/* Bandera de Euskadi (Ikurriña) artesanal SVG */
.lang-flag-ikurriña {
    width: 18px;
    height: 12px;
    display: inline-block;
    border-radius: 2px;
    box-shadow: 0 0 1px rgba(0,0,0,0.3);
    background-color: #d52b1e;
    background-image: 
        linear-gradient(to bottom right, transparent calc(50% - 1.5px), #009b48 calc(50% - 1.5px), #009b48 calc(50% + 1.5px), transparent calc(50% + 1.5px)),
        linear-gradient(to bottom left, transparent calc(50% - 1.5px), #009b48 calc(50% - 1.5px), #009b48 calc(50% + 1.5px), transparent calc(50% + 1.5px)),
        linear-gradient(to right, transparent calc(50% - 1.5px), #ffffff calc(50% - 1.5px), #ffffff calc(50% + 1.5px), transparent calc(50% + 1.5px)),
        linear-gradient(to bottom, transparent calc(50% - 1.5px), #ffffff calc(50% - 1.5px), #ffffff calc(50% + 1.5px), transparent calc(50% + 1.5px));
    flex-shrink: 0;
}

.lang-code {
    font-size: 0.8rem;
    letter-spacing: 0.5px;
    color: var(--primary-dark);
}

.lang-arrow {
    font-size: 0.65rem;
    color: var(--text-muted);
    transition: transform 0.2s ease;
}

.lang-dropdown-wrapper.active .lang-arrow {
    transform: rotate(180deg);
}

.lang-dropdown-menu {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    width: 160px;
    background: #ffffff !important;
    border-radius: 14px;
    border: 1px solid var(--border-color);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15) !important;
    padding: 0.4rem;
    display: none !important;
    flex-direction: column;
    gap: 2px;
    z-index: 99999 !important;
    max-height: 320px;
    overflow-y: auto;
}

.lang-dropdown-wrapper.active .lang-dropdown-menu {
    display: flex !important;
    animation: fadeInDown 0.2s ease forwards;
}

@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

.lang-option {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.45rem 0.65rem;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.15s ease;
    font-size: 0.85rem;
    color: var(--text-primary);
}

.lang-option:hover {
    background: #f1f5f9;
}

.lang-option.active {
    background: #e0f2fe;
    color: var(--primary-color);
    font-weight: 700;
}

.lang-code-bold {
    font-weight: 700;
    font-size: 0.8rem;
    min-width: 32px;
    color: var(--primary-dark);
}

.lang-name {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.mobile-admin-btn {
    font-size: 1.1rem;
    color: var(--primary-dark);
}

.mobile-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.4rem;
    color: var(--text-primary);
    cursor: pointer;
}

/* --------------------------------------------------------------------------
   4. HERO SECTION
   -------------------------------------------------------------------------- */
.hero-section {
    padding-top: 140px;
    padding-bottom: 80px;
    position: relative;
    background: radial-gradient(circle at 80% 20%, rgba(59, 130, 246, 0.08) 0%, transparent 50%),
                radial-gradient(circle at 20% 80%, rgba(30, 58, 138, 0.05) 0%, transparent 50%);
}

.hero-content {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
}

.hero-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 1.2rem;
    border-radius: 30px;
    background: rgba(59, 130, 246, 0.1);
    color: var(--primary-color);
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 1.5rem;
}

.hero-title {
    font-family: var(--font-heading);
    font-size: 3.2rem;
    font-weight: 800;
    line-height: 1.15;
    color: var(--primary-dark);
    margin-bottom: 1.5rem;
}

.hero-title span {
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-description {
    font-size: 1.15rem;
    color: var(--text-muted);
    margin-bottom: 2.5rem;
    line-height: 1.7;
}

.hero-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.2rem;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    padding: 0.9rem 2rem;
    border-radius: 30px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: var(--transition);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    color: #fff;
    box-shadow: 0 8px 25px rgba(59, 130, 246, 0.35);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 30px rgba(59, 130, 246, 0.45);
}

.btn-secondary {
    background: #fff;
    color: var(--primary-dark);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
}

.btn-secondary:hover {
    background: #f8fafc;
    border-color: var(--accent-color);
    color: var(--primary-color);
}

/* --------------------------------------------------------------------------
   5. SECCIONES Y REPERTORIO DE WEBS (3 POR FILA)
   -------------------------------------------------------------------------- */
.category-block {
    margin-bottom: 4rem;
}

.category-header {
    margin-bottom: 2.5rem;
}

.category-tag {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--accent-color);
}

.category-title {
    font-family: var(--font-heading);
    font-size: 2.2rem;
    color: var(--primary-dark);
    margin-top: 0.3rem;
}

.title-underline {
    width: 60px;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
    border-radius: 2px;
    margin-top: 0.8rem;
}

/* Grilla de 3 webs horizontales por fila en escritorio */
.webs-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
}

.web-card {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-md);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: var(--transition);
    position: relative;
}

.web-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
    border-color: rgba(59, 130, 246, 0.4);
}

/* Contenedor de Vista Previa / Mockup */
.web-preview-container {
    position: relative;
    width: 100%;
    height: 220px;
    background: #1e293b;
    overflow: hidden;
}

.web-preview-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top center;
    transition: transform 0.6s ease;
}

.web-card:hover .web-preview-img {
    transform: scale(1.05);
}

.web-preview-overlay {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.7);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    opacity: 0;
    transition: var(--transition);
    backdrop-filter: blur(4px);
}

.web-card:hover .web-preview-overlay {
    opacity: 1;
}

.btn-preview-visit {
    padding: 0.6rem 1.4rem;
    border-radius: 30px;
    background: var(--accent-color);
    color: #fff;
    font-size: 0.85rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-preview-visit:hover {
    background: var(--primary-color);
}

/* Cuerpo con Información y Resumen */
.web-card-body {
    padding: 1.8rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.web-badge {
    align-self: flex-start;
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    background: #e0f2fe;
    color: #0369a1;
    margin-bottom: 0.8rem;
}

.web-title {
    font-family: var(--font-heading);
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--primary-dark);
    margin-bottom: 0.6rem;
}

.web-url-link {
    font-size: 0.85rem;
    color: var(--accent-color);
    font-weight: 600;
    margin-bottom: 1rem;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

.web-summary {
    font-size: 0.95rem;
    color: var(--text-muted);
    margin-bottom: 1.4rem;
    line-height: 1.6;
    flex-grow: 1;
}

.web-features-list {
    list-style: none;
    margin-bottom: 1.5rem;
    border-top: 1px dashed var(--border-color);
    padding-top: 1rem;
}

.web-features-list li {
    font-size: 0.85rem;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.web-features-list li i {
    color: #10b981;
    font-size: 0.8rem;
}

.web-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: auto;
}

.btn-open-full {
    width: 100%;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
    background: #f1f5f9;
    color: var(--primary-dark);
    font-weight: 600;
    font-size: 0.9rem;
    text-align: center;
    border: 1px solid var(--border-color);
}

.btn-open-full:hover {
    background: var(--primary-color);
    color: #fff;
    border-color: var(--primary-color);
}

/* --------------------------------------------------------------------------
   6. SECCIÓN DE CONTACTO & SOLICITUD DE PRESUPUESTOS
   -------------------------------------------------------------------------- */
.contact-section {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    color: #fff;
    border-radius: var(--radius-lg);
    padding: 4rem 3rem;
    margin: 4rem 0;
}

.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: center;
}

.contact-info-title {
    font-family: var(--font-heading);
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.contact-info-desc {
    color: #94a3b8;
    font-size: 1.05rem;
    margin-bottom: 2rem;
}

.contact-form {
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.form-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: #cbd5e1;
}

.form-input {
    padding: 0.9rem 1.2rem;
    border-radius: var(--radius-sm);
    border: 1px solid #334155;
    background: #1e293b;
    color: #fff;
    font-family: var(--font-body);
    font-size: 0.95rem;
    outline: none;
    transition: var(--transition);
}

.form-input:focus {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

textarea.form-input {
    resize: vertical;
    min-height: 120px;
}

.btn-form-submit {
    background: linear-gradient(135deg, var(--accent-color), #2563eb);
    color: #fff;
    padding: 1rem;
    border: none;
    border-radius: var(--radius-sm);
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    transition: var(--transition);
}

.btn-form-submit:hover {
    opacity: 0.95;
    transform: translateY(-2px);
}

/* --------------------------------------------------------------------------
   7. BOTONES FLOTANTES FIJOS (WHATSAPP, GMAIL & ASISTENTE IA)
   -------------------------------------------------------------------------- */
.floating-container {
    position: fixed;
    bottom: 25px;
    right: 25px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    z-index: 9999;
}

.floating-btn {
    width: 58px;
    height: 58px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.5rem;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
    transition: var(--transition);
    position: relative;
    cursor: pointer;
    border: none;
}

.floating-btn:hover {
    transform: scale(1.12);
}

.floating-btn-whatsapp {
    background: #25d366;
}

.floating-btn-gmail {
    background: #ea4335;
}

.floating-btn-ai {
    background: linear-gradient(135deg, #10b981, #059669);
    animation: pulse-ai 2.5s infinite;
}

@keyframes pulse-ai {
    0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.6); }
    70% { box-shadow: 0 0 0 15px rgba(16, 185, 129, 0); }
    100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.floating-tooltip {
    position: absolute;
    right: 70px;
    background: rgba(15, 23, 42, 0.9);
    color: #fff;
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: var(--transition);
}

.floating-btn:hover .floating-tooltip {
    opacity: 1;
}

/* --------------------------------------------------------------------------
   8. MODAL DE ASISTENTE VIRTUAL IA DE PRESUPUESTOS
   -------------------------------------------------------------------------- */
.ai-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.ai-modal-card {
    width: 100%;
    max-width: 480px;
    height: 600px;
    background: #fff;
    border-radius: var(--radius-lg);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.ai-modal-header {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary-color));
    color: #fff;
    padding: 1.2rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.ai-avatar-box {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.ai-modal-info h4 {
    font-size: 1rem;
    font-weight: 700;
}

.ai-modal-info span {
    font-size: 0.75rem;
    color: #a7f3d0;
}

.ai-modal-close {
    background: none;
    border: none;
    color: #fff;
    font-size: 1.5rem;
    cursor: pointer;
}

.ai-modal-body {
    flex-grow: 1;
    padding: 1.2rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    background: #f8fafc;
}

.chat-bubble {
    max-width: 80%;
    padding: 0.8rem 1.1rem;
    border-radius: 16px;
    font-size: 0.9rem;
    line-height: 1.5;
}

.chat-bubble.bot {
    align-self: flex-start;
    background: #fff;
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-bottom-left-radius: 4px;
    box-shadow: var(--shadow-sm);
}

.chat-bubble.user {
    align-self: flex-end;
    background: var(--primary-color);
    color: #fff;
    border-bottom-right-radius: 4px;
}

.ai-chips-container {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 0.8rem 1.2rem;
    background: #fff;
    border-top: 1px solid var(--border-color);
}

.ai-chip {
    background: #f1f5f9;
    border: 1px solid var(--border-color);
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    transition: var(--transition);
}

.ai-chip:hover {
    background: var(--primary-color);
    color: #fff;
    border-color: var(--primary-color);
}

.ai-modal-footer {
    padding: 1rem 1.2rem;
    background: #fff;
    display: flex;
    gap: 0.6rem;
    border-top: 1px solid var(--border-color);
}

.ai-input {
    flex-grow: 1;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 25px;
    outline: none;
    font-size: 0.9rem;
}

.ai-send-btn {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: var(--primary-color);
    color: #fff;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* --------------------------------------------------------------------------
   9. RESPONSIVE DESIGN (MÓVIL & TABLET)
   -------------------------------------------------------------------------- */
@media (max-width: 1024px) {
    .webs-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    body {
        overflow-x: hidden !important;
    }

    .container {
        padding: 0 1rem !important; /* Margen cómodo y contenido */
        width: 100% !important;
        max-width: 100vw !important;
        box-sizing: border-box !important;
    }

    .header-container {
        padding: 0 0.8rem !important;
        height: 65px !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }

    .logo {
        max-width: 70% !important;
        overflow: hidden !important;
    }

    .logo-img {
        width: 28px !important;
        height: 28px !important;
        max-width: 28px !important;
        max-height: 28px !important;
        flex-shrink: 0 !important;
        object-fit: contain !important;
        display: block !important;
    }

    .logo-serif {
        font-size: 0.9rem !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
    }

    .logo-subtitle {
        font-size: 0.5rem !important;
        display: none !important; /* Ocultar subtítulo en pantallas muy pequeñas para evitar acumulación */
    }

    .nav-menu {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background: #ffffff;
        padding: 1rem 1.2rem;
        box-shadow: 0 15px 35px rgba(0,0,0,0.12);
        border-bottom: 2px solid var(--border-color);
        z-index: 999;
    }

    .nav-menu.active-mobile {
        display: block !important;
    }

    .nav-menu ul {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 0.6rem !important;
    }

    .nav-link {
        font-size: 0.9rem !important;
        padding: 0.5rem 0 !important;
        display: block !important;
        border-bottom: 1px solid #f1f5f9;
        text-align: left;
    }

    .mobile-header-right {
        display: flex;
        align-items: center;
        gap: 0.5rem;
    }

    .mobile-toggle {
        display: block !important;
    }

    .hero-section {
        padding: 5rem 1rem 2rem 1rem !important;
    }

    .hero-title {
        font-size: 1.4rem !important;
        line-height: 1.3 !important;
    }

    .hero-description {
        font-size: 0.85rem !important;
    }

    .category-block {
        margin-bottom: 2rem !important;
    }

    .category-title {
        font-size: 1.5rem !important;
    }

    .webs-grid {
        display: flex !important;
        flex-direction: column !important;
        gap: 1.2rem !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }

    .web-card {
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
        margin: 0 !important;
    }

    .web-preview-container {
        height: 180px !important;
        width: 100% !important;
        max-width: 100% !important;
        position: relative !important;
        overflow: hidden !important;
        background: #1e293b !important;
    }

    .web-preview-img {
        width: 100% !important;
        max-width: 100% !important;
        height: 180px !important;
        object-fit: cover !important;
        object-position: top center !important;
        display: block !important;
    }

    .web-card-body {
        padding: 1rem !important;
        box-sizing: border-box !important;
    }

    .web-title {
        font-size: 1.1rem !important;
    }

    .web-summary {
        font-size: 0.82rem !important;
    }

    .web-features-list li {
        font-size: 0.78rem !important;
    }

    .contact-section {
        padding: 1.5rem 1rem !important;
        overflow: hidden;
    }

    .contact-info-title {
        font-size: 1.4rem !important;
        word-break: break-word;
    }

    .contact-grid {
        grid-template-columns: 1fr !important;
        gap: 1.2rem !important;
    }

    .form-group input, .form-group textarea {
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
    }

    .floating-container {
        bottom: 12px;
        right: 12px;
    }

    .floating-btn {
        width: 44px;
        height: 44px;
        font-size: 1.1rem;
    }
}
