:root {
      --primary:   #0B3D91;
      --accent:    #1A8FE3;
      --accent-lt: #E8F4FD;
      --text-dark: #1A1A2E;
      --text-mid:  #4A5568;
      --text-light:#718096;
      --white:     #FFFFFF;
      --bg:        #F7F9FC;
      --border:    #E2E8F0;
      --shadow-sm: 0 2px 8px rgba(11,61,145,0.08);
      --shadow-md: 0 4px 20px rgba(11,61,145,0.13);
      --radius:    6px;
      --font-head: 'Montserrat', sans-serif;
      --font-body: 'Lato', sans-serif;
    }

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

    body {
      margin: 0; padding: 0;
      font-family: var(--font-body);
      background: var(--bg);
    }
    header#header {
      width: 100%;
      background: var(--white);
      box-shadow: var(--shadow-md);
    }

    /* TOP BAR */
    .topbar {
      display: flex;
      align-items: center;
      justify-content: space-between;
      padding: 10px 24px 8px;
      border-bottom: 1px solid var(--border);
      background: var(--white);
    }
    .logo-area { display: flex; align-items: flex-end; }
    .logo-img-placeholder {
      display: flex; align-items: center; gap: 8px;
    }
    .logo-icon {
      width: 52px; height: 52px;
      background: linear-gradient(135deg, var(--primary), var(--accent));
      border-radius: 10px;
      display: flex; align-items: center; justify-content: center;
      color: white; font-family: var(--font-head); font-weight: 800; font-size: 1.4rem;
    }
    .logo-text-block { display: flex; flex-direction: column; }
    .logo-name {
      font-family: var(--font-head);
      font-weight: 800; font-size: 1.45rem;
      color: var(--primary); letter-spacing: -0.01em;
      line-height: 1.1;
    }
    .logo-name span { color: var(--accent); }
    .logo-tagline {
    /*  font-family: 'CooperBlack Italic'; */
      font-size: calc(1.3 * 100%);
      color: var(--text-mid);
      margin: 2px 0 0 0;
    }
    
    @font-face {
      font-family: 'CooperBlack Italic';
      src: url("fonts/CooperBlack Italic.ttf") format('truetype');
    }

    .topbar-utils {
      display: flex; flex-direction: column; align-items: flex-end; gap: 7px;
    }
    .lang-row {
      display: flex; align-items: center; gap: 6px;
      font-size: 0.82rem; color: var(--text-mid);
    }
    .lang-row label { margin: 0; font-weight: 600; }
    .lang-row select {
      border: 1px solid var(--border); border-radius: var(--radius);
      padding: 2px 8px; font-size: 0.82rem; color: var(--text-dark);
      background: var(--white);
    }
    .ref-row { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
    .ref-label {
      font-size: 0.72rem; font-weight: 700; color: var(--primary);
      text-transform: uppercase; letter-spacing: 0.05em;
    }
    .ref-search {
      display: flex; align-items: center; gap: 6px;
      background: var(--accent-lt); border: 1px solid var(--accent);
      border-radius: 20px; padding: 5px 12px 5px 10px;
    }
    .ref-search .lupa { font-size: 0.9rem; opacity: 0.7; }
    .ref-search input {
      border: none; background: transparent; font-size: 0.82rem;
      width: 110px; color: var(--text-dark); outline: none;
    }
    .ref-search input::placeholder { color: var(--text-light); }

    /* NAVBAR */
    nav.navbar {
      background: #1226AA;
/*      background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%); */
      padding: 0 24px; min-height: 46px;
    }
    .navbar-nav .nav-link {
      font-family: var(--font-head);
      font-size: 0.8rem; font-weight: 700;
      letter-spacing: 0.09em; text-transform: uppercase;
      color: rgba(255,255,255,.88) !important;
      padding: 12px 14px !important;
      position: relative;
      transition: color .2s;
    }
    .navbar-nav .nav-link::after {
      content: '';
      position: absolute; bottom: 6px; left: 14px; right: 14px;
      height: 2px; background: var(--white);
      transform: scaleX(0); transition: transform .25s ease;
      border-radius: 2px;
    }
    .navbar-nav .nav-link:hover { color: white !important; }
    .navbar-nav .nav-link:hover::after { transform: scaleX(1); }
    .dropdown-toggle::after { border-color: rgba(255,255,255,.8) transparent transparent; }

    /* COUNTRY SELECTOR */
    .country-section {
      display: flex;
      align-items: center;     /* centra verticalmente título y banderas */
      gap: 20px;               /* espacio entre título y fila de banderas */
      padding: 10px 0;         /* opcional: reduce espacio vertical */
      justify-content: center;
    }
/*
    .country-section .label {
      font-family: var(--font-head);
      font-weight: 700; font-size: 0.85rem;
      color: var(--text-mid); text-transform: uppercase;
      letter-spacing: 0.07em; text-align: center;
      margin-bottom: 16px;
    }
*/
    .label {
      font-size: 22px;
      font-weight: bold;
      white-space: nowrap;     /* evita que “Elija país” se corte en dos líneas */
    }

    .flags-row {
      display: flex;
      gap: 20px;
      flex-wrap: wrap;     
    }
    .flag-item {
      display: flex;
      flex-direction: column;
      align-items: center;
      cursor: pointer;
    }
    .flag-item:hover { transform: translateY(-3px); 
    }
    .flag-img {
      width: 72px; height: 48px; border-radius: 5px;
      box-shadow: 0 3px 10px rgba(0,0,0,0.15);
      object-fit: cover;
    }
    .flag-name {
      font-family: var(--font-head);
      font-size: 0.75rem; font-weight: 600;
      color: var(--text-mid); letter-spacing: 0.03em;
    }

    /* CONTENT AREA */
    .content-preview {
      padding: 40px 24px;
      text-align: center;
      color: var(--text-light);
      font-size: 0.9rem;
    }

    /* DROPDOWN MENU */
    .dropdown-menu {
      border: none; border-radius: var(--radius);
      box-shadow: var(--shadow-md); padding: 6px 0;
    }
    .dropdown-item {
      font-family: var(--font-head); font-size: 0.78rem;
      font-weight: 600; letter-spacing: 0.05em;
      color: var(--primary); padding: 8px 18px;
      transition: background .15s, color .15s;
    }
    .dropdown-item:hover { background: var(--accent-lt); color: var(--accent); }

    html[data-loading="true"] #contenido {
        visibility: hidden;
    }

    html[data-loading="true"] #loader {
        display: flex;
    }

    html[data-loading="false"] #loader {
        display: none;
    }

    html[data-loading="false"] #contenido {
        visibility: visible;
    }
    /* Estilos del loader */
    #loader {
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        display: flex;
        align-items: center;
        justify-content: center;
        background: rgba(255,255,255,0.85);
        z-index: 9999;
    }
    /* Spinner */
    .spinner {
        width: 50px;
        height: 50px;
        border: 6px solid #ccc;
        border-top-color: #007bff;
        border-radius: 50%;
        animation: spin 0.8s linear infinite;
    }

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

