/**
 * BASE CSS - Template Villa del Totoral
 * Archivo: /templates/villatotoral/assets/css/base.css
 * 
 * Estilos base fundamentales portados del sitio legacy.
 * Incluye: formato básico, estructura, títulos, enlaces, navbar.
 * 
 * Fuentes legacy:
 * - formato-basico.css (completo)
 * - titulos.css (completo)
 * - enlaces.css (completo)
 * - estructura.css (parcial - estilos base)
 */

/* ========================================
   FORMATO BÁSICO
   Portado de: estilos/generales/formato-basico.css
   ======================================== */

html {
    font-size: 62.5%; /* 1rem = 10px */
    box-sizing: border-box;
    scroll-snap-type: y mandatory;
    scroll-behavior: smooth;
}

*, *:before, *:after {
    box-sizing: inherit;
}

body, table, td, textarea, input, select {
    font-size: 1.5rem;
    font-family: var(--fuente);
    color: var(--negro);
}

body {
    margin: 0 auto;
    background-color: var(--blanco);
    min-height: 100dvh;
}

html, body {
    overflow-x: clip;
}

/* Utilidades de texto */
.texto_subrayado {
    text-decoration: underline;
}

.texto_resaltado {
    font-weight: 700;
}

.align_right {
    text-align: right;
}

.align_center {
    text-align: center;
}

.align_left {
    text-align: left;
}

.align_justify {
    text-align: justify;
}

.float_left {
    float: left;
}

.float_right {
    float: right;
}

span.align_justify, 
span.align_right, 
span.align_center {
    display: block;
}

.clear_both {
    clear: both;
}

.display_block {
    display: block;
}

.margen_none {
    margin: 0rem;
}

/* Formularios */
form {
    padding: 0rem;
    margin: 0rem;
}

/* Párrafos */
p {
    padding: 0rem;
    margin: 0rem;
    color: var(--parrafo);
    font-size: 1.9rem;
    font-style: normal;
    font-weight: 400;
    line-height: 135%;
}

.parrafo_modulo {
    color: var(--parrafo);
    font-size: 1.5rem;
    font-style: normal;
    font-weight: 400;
    line-height: 2.3rem;
}

@media (max-width:768px) {
    .parrafo_modulo {
        margin-bottom: 3rem;
    }
    
    .parrafo_modulo:last-child {
        margin-bottom: 0rem;
    }
}

.parrafo_modulo b {
    color: var(--parrafo);
    font-size: 1.6rem;
    font-style: normal;
    font-weight: 600;
    line-height: 2.2rem;
}

/* Imágenes */
img {
    border-radius: 0.5rem;
}

/* ========================================
   TÍTULOS
   Portado de: estilos/generales/titulos.css
   ======================================== */

h1 {
    color: var(--negro);
    font-family: var(--fuente);
    font-size: 3.2rem;
    font-style: normal;
    font-weight: 700;
    line-height: normal;
}

h1:after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 50%;
    border-bottom: solid var(--primario) 0.5rem;
}

h2 {
    color: var(--negro);
    font-size: 3.2rem;
    font-style: normal;
    font-weight: 700;
    line-height: normal;
}

h3 {
    color: var(--negro);
    font-size: 2rem;
    font-style: normal;
    font-weight: 500;
    line-height: 135%;
}

h5 {
    font-size: 1.8rem;
}

/* ========================================
   ENLACES
   Portado de: estilos/generales/enlaces.css
   ======================================== */

a:link, 
a:visited {
    text-decoration: none;
}

a:hover {
    text-decoration: none;
}

a.acciones:link, 
a.acciones:visited {
    display: block;
    background-position: left;
    background-repeat: no-repeat;
    white-space: nowrap;
    padding: 0.2rem 0 0.3rem 0.2rem;
    margin: 0 0 0.3rem 0;
    color: var(--primario);
}

/* ========================================
   ESTRUCTURA - Elementos Base
   Portado de: estilos/generales/estructura.css
   ======================================== */

/* Tell the browser to render HTML 5 elements as block */
header,
footer,
aside,
nav,
article {
    display: block;
}

header {
    width: 100%;
    z-index: 1000;
}

@media (min-width: 992px) {
    header {
        position: sticky;
        top: 0;
        z-index: 500;
    }
}

/* Divider decorativo */
.divider {
    border-bottom: var(--primario) solid 0.5rem;
    margin: 1.2rem 0 3rem 0;
    width: 8%;
}

#encabezado {
    z-index: 100;
}

/* Contenedor de error */
.contenedor_error {
    margin: 5rem 0 0 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
}

.contenedor_error img {
    max-width: 70%;
    margin-bottom: 2.5rem;
}

.contenedor_error p.titulo {
    text-align: center;
    font-size: 2.8rem;
    margin-bottom: 1rem;
    font-weight: 700;
    color: var(--primario);
}

.contenedor_error p.texto {
    text-align: center;
    margin-bottom: 2rem;
}

@media (max-width: 576px) {
    .contenedor_error p.titulo {
        font-size: 2.2rem;
    }
    
    .contenedor_error p.texto {
        font-size: 1.8rem;
    }
}

/* ========================================
   NAVBAR Y MENÚ
   Portado de: estilos/generales/estructura.css
   ======================================== */

/* Animación fadeIn para dropdowns */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.dropdown-menu.show {
    -webkit-animation: fadeIn 0.3s alternate;
    animation: fadeIn 0.3s alternate;
}

/* Mega dropdown */
.nav-item.dropdown.dropdown-mega {
    position: static;
}

.nav-item.dropdown.dropdown-mega .dropdown-menu {
    width: 90%;
    top: auto;
}

/* Hamburger Menu */
.navbar-toggler {
    border: none;
    padding: 0;
    outline: none;
}

.navbar-toggler:focus {
    box-shadow: none;
}

.navbar-toggler .hamburger-toggle {
    position: relative;
    display: inline-block;
    width: 5rem;
    height: 5rem;
    z-index: 11;
    float: right;
}

.navbar-toggler .hamburger-toggle .hamburger {
    position: absolute;
    transform: translate(-50%, -50%) rotate(0deg);
    left: 50%;
    top: 50%;
    width: 50%;
    height: 50%;
    pointer-events: none;
}

.navbar-toggler .hamburger-toggle .hamburger span {
    width: 100%;
    height: 0.4rem;
    position: absolute;
    background: var(--blanco);
    border-radius: 0.2rem;
    z-index: 1;
    transition: transform 0.2s cubic-bezier(0.77, 0.2, 0.05, 1),
        background 0.2s cubic-bezier(0.77, 0.2, 0.05, 1), 
        all 0.2s ease-in-out;
    left: 0rem;
}

.navbar-toggler .hamburger-toggle .hamburger span:first-child {
    top: 10%;
    transform-origin: 50% 50%;
    transform: translate(0% -50%) !important;
}

.navbar-toggler .hamburger-toggle .hamburger span:nth-child(2) {
    top: 50%;
    transform: translate(0, -50%);
}

.navbar-toggler .hamburger-toggle .hamburger span:last-child {
    left: 0rem;
    top: auto;
    bottom: 10%;
    transform-origin: 50% 50%;
}

.navbar-toggler .hamburger-toggle .hamburger.active span {
    position: absolute;
    margin: 0;
}

.navbar-toggler .hamburger-toggle .hamburger.active span:first-child {
    top: 45%;
    transform: rotate(45deg);
}

.navbar-toggler .hamburger-toggle .hamburger.active span:nth-child(2) {
    left: 50%;
    width: 0rem;
}

.navbar-toggler .hamburger-toggle .hamburger.active span:last-child {
    top: 45%;
    transform: rotate(-45deg);
}

/* List groups */
.list-group .list-group-item {
    display: flex;
    align-items: center;
    justify-content: flex-start;
}

.list-group .list-group-item-2 {
    gap: 0.5rem;
}

.list-group-item {
    display: flex;
    gap: 1rem;
    padding-left: 0;
    margin-bottom: 0;
    border-radius: 0.25rem;
    align-items: center;
}

.list-group-item .icono {
    display: flex;
    align-items: center;
    width: 5rem;
    justify-content: center;
}

.list-group-item .icono i {
    font-size: 3rem;
}

/* Icons */
.icons {
    display: inline-flex;
    margin-left: auto;
}

.icons a {
    transition: all 0.2s ease-in-out;
    padding: 0.2rem 0.4rem;
    color: #ccc !important;
    text-decoration: none;
}

.icons a:hover {
    color: white;
    text-shadow: 0 0 3rem white;
}

/* Navbar base */
.navbar {
    transition: padding 0.5s ease-in-out;
}

.navbar-expand-lg .navbar-collapse {
    justify-content: center;
    font-size: 2rem;
    transition: font-size 0.5s ease-in-out;
}

@media (max-width: 1400px) {
    .navbar-expand-lg .navbar-collapse {
        font-size: 1.8rem;
    }
}

@media (max-width: 1300px) {
    .navbar-expand-lg .navbar-collapse {
        font-size: 1.8rem;
    }
}

.navbar-light .navbar-nav .nav-link.active,
.navbar-light .navbar-nav .show > .nav-link {
    color: var(--negro);
}

.navbar-light .navbar-nav .nav-link {
    color: var(--negro);
    font-size: 1.6rem;
    text-transform: none;
}

/* ========================================
   COMPATIBILIDAD Y OVERRIDES
   ======================================== */

/* Asegurar que variables legacy funcionen */
body {
    font-family: var(--fuente);
}

/* Fix para imágenes responsive */
img {
    max-width: 100%;
    height: auto;
}

/* Fix para contenedores Bootstrap */
.container {
    width: 100%;
    padding-right: 15px;
    padding-left: 15px;
    margin-right: auto;
    margin-left: auto;
}

@media (min-width: 576px) {
    .container {
        max-width: 540px;
    }
}

@media (min-width: 768px) {
    .container {
        max-width: 720px;
    }
}

@media (min-width: 992px) {
    .container {
        max-width: 960px;
    }
}

@media (min-width: 1200px) {
    .container {
        max-width: 1140px;
    }
}

@media (min-width: 1400px) {
    .container {
        max-width: 1320px;
    }
}
