:root {
            --vino: #611232;
            --blanco: #ffffff;
            --gris-fondo: #f4f4f4;
            --vino-oscuro: #4d0e28;
            --dorado: #b38e5d; /* Color institucional de apoyo */
        }

        body { margin: 0; padding: 0; font-family: sans-serif; background-color: var(--gris-fondo); }

        /* --- 1. CABECERA --- */
        .institutional-bar { background: var(--blanco); padding: 1.5em 0; border-bottom: 1px solid #ddd; width: 100% !important; }
        .header-container { width: 100%; max-width: 100% !important; padding: 0 5%; display: flex; align-items: center; justify-content: space-between; box-sizing: border-box; }
        .logo-section { display: flex; align-items: center; gap: 20px; }
        .logo-section img { height: 100px !important; width: auto !important; }
        .text-section h1 { margin: 0; font-size: 1.8em; color: var(--vino); line-height: 1.1; }
        .text-section span { font-size: 1.1em; color: #666; font-style: italic; }
        .search-box { display: flex; }
        .search-box input { padding: 0.7em; border: 1px solid #ccc; border-radius: 4px 0 0 4px; width: 220px; }
        .search-box button { background: var(--vino); color: #fff; border: none; padding: 0 1.2em; border-radius: 0 4px 4px 0; cursor: pointer; }

        /* --- 2. NAVEGACIÓN --- */
        header { 
            background: var(--vino); 
            position: sticky; 
            top: 0; 
            z-index: 1000; 
            box-shadow: 0 4px 12px rgba(0,0,0,0.15); 
            border-bottom: 3px solid var(--dorado); 
        }

        #menu-btn { 
            display: none; 
            background: var(--vino-oscuro); 
            color: white; 
            border: 1px solid var(--dorado); 
            padding: 10px 20px; 
            margin: 10px; 
            border-radius: 5px;
            font-weight: bold;
        }

        nav ul { 
            list-style: none; 
            margin: 0; 
            padding: 0; 
            display: flex; 
            justify-content: center; 
        }

        nav li { position: relative; }

        nav a { 
            color: white; 
            text-decoration: none; 
            padding: 0 25px; 
            line-height: 65px; 
            display: block; 
            font-weight: 600; 
            text-transform: uppercase;
            font-size: 0.85rem;
            letter-spacing: 0.5px;
            transition: all 0.3s ease; 
        }

        nav li:hover > a { 
            background: var(--vino-oscuro); 
            color: var(--dorado);
        }

        /* --- SUBMENÚS "CRISTAL GUINDA" --- */
        nav ul ul { 
            display: none; 
            position: absolute; 
            top: 100%; 
            left: 0; 
            background: rgba(97, 18, 50, 0.98); 
            backdrop-filter: blur(10px);
            min-width: 240px; 
            flex-direction: column; 
            box-shadow: 0 10px 30px rgba(0,0,0,0.3); 
            border-radius: 0 0 12px 12px;
            border-top: 3px solid var(--dorado);
            padding: 10px 0;
            overflow: hidden;
            animation: menuSlide 0.3s ease-out;
        }

        nav ul ul.show-submenu { display: flex; }

        @keyframes menuSlide {
            from { opacity: 0; transform: translateY(10px); }
            to { opacity: 1; transform: translateY(0); }
        }

        nav ul ul li { width: 100%; }

        nav ul ul a { 
            line-height: 40px; 
            padding: 5px 20px; 
            color: rgba(255,255,255,0.9) !important; 
            text-transform: none; 
            font-size: 0.95rem;
            font-weight: 500;
            border-bottom: 1px solid rgba(255,255,255,0.05);
            display: flex;
            align-items: center;
            gap: 10px;
        }

        nav ul ul a:hover { 
            background: rgba(179, 142, 93, 0.2) !important; 
            color: var(--dorado) !important;
            padding-left: 30px; 
        }

        nav ul ul a i {
            color: var(--dorado);
            font-size: 1.1rem;
        }

        .bi-chevron-down {
            font-size: 0.7rem;
            margin-left: 5px;
            transition: transform 0.3s;
        }
        nav li.active-submenu > a .bi-chevron-down {
            transform: rotate(180deg);
        }

        /* --- 3. NUEVAS SECCIONES --- */
        .container-box { max-width: 1200px; margin: 40px auto; padding: 0 20px; }
        h2.section-title { color: var(--vino); text-align: center; margin-bottom: 30px; font-size: 2em; position: relative; }
        h2.section-title::after { content: ''; display: block; width: 60px; height: 3px; background: var(--dorado); margin: 10px auto 0; }

        .carousel-hero {
            background: linear-gradient(rgba(97, 18, 50, 0.8), rgba(97, 18, 50, 0.8)), url('https://images.unsplash.com/photo-1517737286950-705b7fbabf94?q=80&w=1200') center/cover;
            height: 400px;
            display: flex;
            align-items: center;
            justify-content: center;
            text-align: center;
            color: white;
            box-shadow: 0 4px 15px rgba(0,0,0,0.1);
        }
        .carousel-hero h2 { font-size: 2.5em; margin: 0 0 15px 0; text-shadow: 2px 2px 4px rgba(0,0,0,0.5); }
        .btn-dorado { background: var(--dorado); color: white; padding: 10px 25px; text-decoration: none; border-radius: 5px; font-weight: bold; transition: 0.3s; display: inline-block;}
        .btn-dorado:hover { background: #967448; transform: translateY(-2px); }

        .news-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 30px; }
        .news-card { background: white; border-radius: 8px; overflow: hidden; box-shadow: 0 4px 10px rgba(0,0,0,0.05); transition: 0.3s; }
        .news-card:hover { transform: translateY(-5px); box-shadow: 0 8px 15px rgba(0,0,0,0.1); }
        .news-img { height: 180px; background: #ddd; display: flex; align-items: center; justify-content: center; color: #888; }
        .news-content { padding: 20px; }
        .news-content h3 { margin: 0 0 10px; color: var(--vino); font-size: 1.2em; }
        .news-content p { color: #666; font-size: 0.9em; line-height: 1.5; }

        .tramites-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 20px; }
        .tramite-card { background: white; padding: 30px 20px; text-align: center; border-radius: 8px; box-shadow: 0 4px 10px rgba(0,0,0,0.05); text-decoration: none; color: #333; transition: 0.3s; border-bottom: 3px solid transparent; }
        .tramite-card:hover { transform: translateY(-5px); border-bottom: 3px solid var(--vino); }
        .tramite-card i { font-size: 2.5em; color: var(--dorado); margin-bottom: 15px; display: block; }
        .tramite-card h4 { margin: 0; font-size: 1.1em; }

        /* --- 4. BOTÓN FLOTANTE DE CONTACTO --- */
        .btn-flotante {
            position: fixed;
            bottom: 30px;
            right: 30px;
            background: #25D366; 
            color: white;
            width: 60px;
            height: 60px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 30px;
            box-shadow: 0 4px 15px rgba(0,0,0,0.2);
            z-index: 9999;
            text-decoration: none;
            transition: transform 0.3s ease;
        }
        .btn-flotante:hover { transform: scale(1.1) rotate(10deg); color: white; }

        /* --- 5. FOOTER --- */
        .footer-principal { background: var(--vino); color: var(--blanco); padding: 60px 0 20px 0; border-top: 5px solid var(--vino-oscuro); margin-top: 60px; }
        .footer-container { max-width: 1200px; margin: 0 auto; display: grid; grid-template-columns: repeat(3, 1fr); gap: 40px; padding: 0 20px; }
        .footer-col h3 { font-size: 1.2em; margin-bottom: 20px; border-bottom: 1px solid rgba(255,255,255,0.2); padding-bottom: 10px; }
        .footer-col ul { list-style: none; padding: 0; }
        .footer-col li { margin-bottom: 10px; }
        .footer-col a { color: rgba(255,255,255,0.8); text-decoration: none; }
        .fb-btn { background: #1877F2; color: white !important; padding: 10px 20px; border-radius: 5px; display: inline-flex; align-items: center; gap: 10px; font-weight: bold; }

        /* --- RESPONSIVE CORREGIDO --- */
        @media (max-width: 850px) {
            .header-container { flex-direction: column; gap: 15px; padding: 15px; }
            .logo-section { flex-direction: column; text-align: center; }
            .search-box input { width: 100%; }

            #menu-btn { 
                display: block; 
                width: calc(100% - 20px); 
                margin: 10px auto; 
            }

            nav ul { 
                display: none; 
                flex-direction: column; 
                background: var(--vino-oscuro); 
                width: 100%;
            }

            nav ul.active { display: flex; }

            nav li { width: 100%; border-bottom: 1px solid rgba(255,255,255,0.05); }

            nav a { 
                line-height: 50px; 
                padding: 0 20px; 
                display: flex; 
                justify-content: space-between; 
                align-items: center; 
            }

            nav ul ul { 
                display: none; 
                position: static; 
                width: 100%; 
                background: rgba(0,0,0,0.2) !important; 
                box-shadow: none; 
                border-top: none; 
                border-radius: 0;
                padding: 0;
                animation: none;
            }

            nav ul ul.show-submenu {
                display: flex;
            }

            nav ul ul a { 
                color: white !important; 
                padding-left: 40px !important; 
                background: transparent !important;
                border-bottom: 1px solid rgba(255,255,255,0.05);
            }

                /* LA SOLUCIÓN DEL FOOTER */
                    .footer-container { 
                        display: grid !important;
                        grid-template-columns: 1fr !important; /* ESTA ES LA MAGIA: Fuerza 1 sola columna */
                        text-align: center !important; 
                        gap: 40px !important;
                    }

                    .footer-col ul {
                    padding-left: 0;
                    list-style: none; /* Quitamos las viñetas para poder centrar bien los enlaces */
                                    }

            .fb-btn {
                justify-content: center; /* Centra el contenido del botón de Facebook */
            }
        }

        /* --- AJUSTES PARA CONTRARRESTAR BOOTSTRAP --- */
        html {
            font-size: 18px; 
        }
        
        .text-section h1 { 
            font-size: 2.2rem; 
        }
        
        .text-section span { 
            font-size: 1.2rem; 
        }
        
        nav a { 
            font-size: 1.1rem; 
        }
        
        h2.section-title {
            font-size: 2.2rem; 
        }