:root,
[data-theme="light"],
body[data-theme="light"] {
  color-scheme: light;
  --page-bg: #f8fafc;
  --surface: #ffffff;
  --surface-2: #f1f5f9;
  --header-bg: linear-gradient(135deg, #ffffff 0%, #edf4fa 100%);
  --primary-color: #0284c7;
  --accent-color: #0284c7;
  --border-color: rgba(0, 0, 0, 0.1);
  --text-color: #334155;
  --text-strong: #0f172a;
  --text-light: #64748b;
  --hover-bg: rgba(2, 132, 199, 0.09);
  --active-bg: rgba(2, 132, 199, 0.18);
  --on-accent: #ffffff;
  --paper: #f8fafc;
  --line: #e2e8f0;
  --ink: #0f172a;
  --muted: #64748b;
  --accent: #0284c7;
  --accent-soft: #e0f2fe;
  --gold: #b45309;
  --part-bg: #f8fafc;
  --families-bg: #eef4f8;
  --greek: "Gentium Plus", Georgia, "Times New Roman", serif;
}

[data-theme="sepia"],
body[data-theme="sepia"] {
  color-scheme: light;
  --page-bg: #e4d8bf;
  --surface: #fdf9ed;
  --surface-2: #f5eddc;
  --header-bg: linear-gradient(135deg, #fdf9ed 0%, #efe4cd 100%);
  --primary-color: #9e3b1e;
  --accent-color: #9e3b1e;
  --border-color: rgba(140, 80, 20, 0.2);
  --text-color: #2b1b0e;
  --text-strong: #2b1b0e;
  --text-light: #6e5843;
  --hover-bg: rgba(140, 80, 20, 0.1);
  --active-bg: rgba(140, 80, 20, 0.2);
  --on-accent: #ffffff;
  --paper: #e4d8bf;
  --line: #d5bf93;
  --ink: #2b1b0e;
  --muted: #6e5843;
  --accent: #9e3b1e;
  --accent-soft: #f4e3cd;
  --gold: #9e3b1e;
  --part-bg: #f5eddc;
  --families-bg: #eeddc4;
  --greek: "Gentium Plus", Georgia, "Times New Roman", serif;
}

[data-theme="dark"],
body[data-theme="dark"] {
  color-scheme: dark;
  --page-bg: #0f172a;
  --surface: #1e293b;
  --surface-2: rgba(255, 255, 255, 0.06);
  --header-bg: linear-gradient(135deg, #16213c 0%, #0f172a 100%);
  --primary-color: #38bdf8;
  --accent-color: #7dd3fc;
  --border-color: rgba(255, 255, 255, 0.14);
  --text-color: #e2e8f0;
  --text-strong: #ffffff;
  --text-light: #94a3b8;
  --hover-bg: rgba(125, 211, 252, 0.15);
  --active-bg: rgba(125, 211, 252, 0.25);
  --on-accent: #0f172a;
  --paper: #0f172a;
  --line: #334155;
  --ink: #e2e8f0;
  --muted: #94a3b8;
  --accent: #38bdf8;
  --accent-soft: rgba(56, 189, 248, 0.18);
  --gold: #fbbf24;
  --part-bg: rgba(255, 255, 255, 0.04);
  --families-bg: #162436;
  --greek: "Gentium Plus", Georgia, "Times New Roman", serif;
}

[data-theme="ocean"],
body[data-theme="ocean"] {
  color-scheme: dark;
  --page-bg: #012b3d;
  --surface: #06262d;
  --surface-2: rgba(45, 212, 191, 0.08);
  --header-bg: linear-gradient(135deg, #083f4d 0%, #012b3d 100%);
  --primary-color: #2dd4bf;
  --accent-color: #5eead4;
  --border-color: rgba(45, 212, 191, 0.22);
  --text-color: #f0fdfa;
  --text-strong: #ffffff;
  --text-light: #99f6e4;
  --hover-bg: rgba(45, 212, 191, 0.15);
  --active-bg: rgba(45, 212, 191, 0.25);
  --on-accent: #042f2e;
  --paper: #012b3d;
  --line: #0d4653;
  --ink: #f0fdfa;
  --muted: #99f6e4;
  --accent: #2dd4bf;
  --accent-soft: rgba(45, 212, 191, 0.18);
  --gold: #fcd34d;
  --part-bg: rgba(45, 212, 191, 0.06);
  --families-bg: #0a3a47;
  --greek: "Gentium Plus", Georgia, "Times New Roman", serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  line-height: 1.55;
  transition: background 0.2s ease, color 0.2s ease;
}

/* Container */
.container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* Header Styles */
header {
  background: var(--header-bg);
  color: var(--text-color);
  padding: 0.6rem 0 0.8rem;
  border-bottom: 1px solid var(--border-color);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

/* Brand Header */
.brand-header {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  margin: 0.35rem 0 0.5rem;
}

.brand-logo {
  flex: 0 0 auto;
  display: block;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  overflow: hidden;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.22), 0 0 0 3px var(--hover-bg);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.brand-logo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.brand-logo:hover {
  transform: translateY(-1px) scale(1.05);
  box-shadow: 0 7px 18px rgba(0, 0, 0, 0.3), 0 0 0 3px var(--active-bg);
}

.brand-titles {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-width: 0;
}

.brand-titles h4 {
  margin: 0;
  text-align: left;
  line-height: 1.15;
  font-size: 1.45rem;
  font-weight: 700;
  color: var(--primary-color);
}

.brand-subtitle {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--text-light);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

@media (max-width: 560px) {
  .brand-subtitle { display: none; }
  .brand-logo { width: 42px; height: 42px; }
  .brand-titles h4 { font-size: 1.25rem; }
}

/* Theme Switch */
.theme-switch {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
  padding: 0.3rem 0 0.5rem;
}

.theme-switch button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 20px;
  border: 1px solid var(--border-color);
  background: var(--surface);
  color: var(--text-color);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.theme-switch button:hover {
  border-color: var(--primary-color);
  color: var(--primary-color);
  background: var(--surface-2);
}

.theme-switch button.active {
  background: var(--primary-color);
  border-color: var(--primary-color);
  color: var(--on-accent);
}

.theme-switch .swatch {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  border: 1px solid rgba(0, 0, 0, 0.2);
}

.swatch-light { background: #ffffff; }
.swatch-sepia { background: #e4d8bf; }
.swatch-dark { background: #0f172a; }
.swatch-ocean { background: #2dd4bf; }

@media (max-width: 900px) {
  .theme-switch {
    flex-wrap: wrap;
    justify-content: center;
    padding-top: 0.3rem;
  }
}

/* Navigation Bar */
.navbar {
  border-radius: 12px;
  background: var(--surface-2) !important;
  border: 1px solid var(--border-color);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
  padding: 0.45rem 1rem;
  margin: 0.2rem 0;
}

.navbar-brand h6 {
  color: var(--text-strong) !important;
  font-weight: 700;
  margin: 0;
  padding: 0.4rem 0;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
}

.nav-link {
  color: var(--text-color) !important;
  font-weight: 500;
  padding: 0.45rem 0.85rem !important;
  margin: 0 0.15rem;
  border-radius: 6px;
  transition: all 0.2s ease;
  text-decoration: none;
  font-size: 0.92rem;
}

.nav-link:hover {
  color: var(--text-strong) !important;
  background-color: var(--hover-bg);
  transform: translateY(-1px);
}

.nav-link.active {
  background-color: var(--active-bg);
  color: var(--primary-color) !important;
  font-weight: 700;
}

.navbar-toggler {
  border-color: var(--border-color) !important;
  background: var(--surface);
  padding: 0.35rem 0.65rem;
  border-radius: 8px;
}

.navbar-toggler:focus {
  box-shadow: 0 0 0 3px var(--active-bg) !important;
  outline: none;
}

.navbar-toggler-icon {
  width: 1.4em;
  height: 1.4em;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='%23334155' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2.2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

[data-theme="dark"] .navbar-toggler-icon,
[data-theme="ocean"] .navbar-toggler-icon {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='%23e2e8f0' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2.2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

@media (max-width: 991px) {
  .navbar-nav {
    padding-top: 0.5rem;
    gap: 0.2rem;
  }
}

/* Main Content */
main {
  max-width: 1120px;
  margin: auto;
  padding: 2.5rem 1.25rem 4rem;
}

.hero {
  text-align: center;
  max-width: 760px;
  margin: 0 auto 2rem;
}

.eyebrow {
  margin: 0 0 .35rem;
  color: var(--accent);
  font-size: .78rem;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.hero h1 {
  margin: .1rem 0 .45rem;
  font-size: clamp(2rem, 5vw, 3.2rem);
  line-height: 1.1;
  color: var(--text-strong);
  letter-spacing: -0.02em;
}

.hero > p:not(.eyebrow):not(.hint) {
  color: var(--muted);
  font-size: 1.08rem;
}

.search-section {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin: 1.25rem auto 1.5rem;
  padding: 1.25rem 1.75rem;
  max-width: 680px;
  background-color: var(--surface);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.05);
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.search-section:focus-within {
  border-color: var(--primary-color);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
}

.search-box-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.85rem;
  flex-wrap: wrap;
}

.search-section label {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-strong);
  letter-spacing: -0.01em;
  white-space: nowrap;
  margin: 0;
}

.search-section input {
  padding: 0.45rem 0.85rem;
  border: 2px solid var(--primary-color);
  border-radius: 10px;
  width: 220px;
  max-width: 260px;
  text-align: center;
  font-family: var(--greek);
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1.3;
  background-color: var(--surface-2);
  color: var(--text-strong);
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.06);
  transition: all 0.2s ease;
}

.search-section input::placeholder {
  color: var(--text-light);
  opacity: 0.7;
  font-family: var(--greek);
  font-size: 1rem;
}

.search-section input:focus {
  outline: none;
  border-color: var(--accent-color);
  background-color: var(--surface);
  box-shadow: 0 0 0 3px var(--active-bg);
}

.search-section button.btn-analyze {
  padding: 0.55rem 1.35rem;
  background-color: var(--primary-color);
  color: var(--on-accent);
  border: none;
  border-radius: 10px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
  transition: all 0.2s ease;
  white-space: nowrap;
}

.search-section button.btn-analyze:hover {
  background-color: var(--accent-color);
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.18);
}

.search-section button.btn-analyze:active {
  transform: translateY(0);
}

.search-section .hint {
  margin: 0.1rem 0 0 0;
  text-align: center;
  font-size: 0.88rem;
  color: var(--text-light);
}

@media (max-width: 600px) {
  .search-section {
    padding: 1rem;
  }
  .search-box-row {
    flex-direction: column;
    gap: 0.6rem;
    align-items: stretch;
  }
  .search-section input {
    width: 100%;
    max-width: 100%;
  }
  .search-section button.btn-analyze {
    width: 100%;
  }
}

.text-button {
  padding: 0;
  background: none;
  border: 0;
  color: var(--accent);
  font-family: var(--greek);
  font-size: 1.1rem;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.text-button:hover {
  opacity: 0.8;
}

.hint {
  color: var(--muted);
  font-size: .88rem;
}

.notice {
  max-width: 760px;
  margin: 1.25rem auto;
  padding: .85rem 1.2rem;
  border-left: 4px solid var(--gold);
  background: var(--surface);
  border-radius: 0 10px 10px 0;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
  color: var(--ink);
}

.verb-card,
.analysis-card,
.principal-parts,
.attested-map {
  margin: 1.25rem 0;
  padding: 1.4rem;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--surface);
  box-shadow: 0 5px 16px rgba(0, 0, 0, 0.05);
}

.verb-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.lemma {
  margin: 0;
  font: 2.35rem/1.15 var(--greek);
  color: var(--text-strong);
}

.strong {
  display: inline-block;
  border-radius: 999px;
  background: var(--accent-soft);
  padding: .25rem .75rem;
  color: var(--accent);
  font-size: .82rem;
  font-weight: 800;
  text-decoration: none;
  border: 1px solid var(--border-color);
  transition: all 0.2s ease;
}

.strong:hover {
  transform: scale(1.04);
}

.meaning {
  margin: .35rem 0;
  color: var(--muted);
  font-size: 1.05rem;
}

.analysis-card h3,
.principal-parts h3,
.attested-map h3 {
  margin: 0 0 .75rem;
  font-size: 1.15rem;
  color: var(--text-strong);
}

.greek-form {
  font: 2rem var(--greek);
  color: var(--text-strong);
}

.morph {
  display: inline-block;
  margin: .35rem 0;
  padding: .2rem .55rem;
  border-radius: 6px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--accent);
  font: 700 .76rem ui-monospace, monospace;
}

.explanation {
  color: var(--muted);
  font-size: 0.92rem;
}

.refs {
  margin: .7rem 0 0;
  color: var(--muted);
  font-size: .88rem;
}

.parts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(155px, 1fr));
  gap: .75rem;
}

.part {
  min-height: 85px;
  padding: .75rem .9rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--part-bg);
  transition: transform 0.15s ease, border-color 0.15s ease;
}

.part:hover {
  border-color: var(--accent);
}

.part b {
  display: block;
  color: var(--muted);
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.part span {
  display: block;
  margin-top: .3rem;
  font: 1.45rem var(--greek);
  color: var(--text-strong);
}

.part em {
  display: block;
  font-size: .74rem;
  color: var(--muted);
  font-style: normal;
  font-family: ui-monospace, monospace;
}

.forms-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .92rem;
}

.forms-table th,
.forms-table td {
  padding: .6rem;
  border-bottom: 1px solid var(--line);
  text-align: left;
}

.forms-table th {
  color: var(--muted);
  font-size: .75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.forms-table .form-cell {
  font: 1.3rem var(--greek);
  color: var(--text-strong);
}

.open-verb {
  border: 1px solid var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
  padding: 0.4rem 0.9rem;
  border-radius: 8px;
  font-weight: 700;
  font-size: 0.86rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.open-verb:hover {
  background: var(--accent);
  color: var(--on-accent);
}

.families {
  margin-top: 3rem;
  padding: 1.6rem;
  border-radius: 16px;
  background: var(--families-bg);
  border: 1px solid var(--line);
}

.families h2 {
  margin: .1rem 0;
  color: var(--text-strong);
}

.families > div > p:not(.eyebrow) {
  color: var(--muted);
}

.family-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: .85rem;
  margin-top: 1rem;
}

.family-grid article {
  padding: 1.1rem;
  border-radius: 10px;
  background: var(--surface);
  border: 1px solid var(--line);
}

.family-grid b {
  display: block;
  color: var(--text-strong);
}

.family-grid span {
  display: block;
  margin: .4rem 0;
  font: 1.35rem var(--greek);
  color: var(--accent);
}

.family-grid p {
  margin: 0;
  color: var(--muted);
  font-size: .86rem;
}

/* Site Footer */
.site-footer {
  padding: 2.2rem 1.25rem 2.8rem;
  background: var(--header-bg);
  color: var(--text-color);
  text-align: center;
  border-top: 1px solid var(--border-color);
  font-size: 0.88rem;
}

.footer-note {
  max-width: 800px;
  margin: 0 auto 1.2rem;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.5;
}

.footer-copyright {
  font-weight: 700;
  color: var(--text-strong);
  margin: 0 0 0.35rem;
}

.footer-license {
  max-width: 800px;
  margin: 0 auto;
  font-size: 0.78rem;
  color: var(--text-light);
  line-height: 1.45;
}

.footer-license a {
  color: var(--primary-color);
  text-decoration: underline;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

/* Embedded mode: for Davar and Lexicon modal inclusion */
body.is-embedded header,
body.is-embedded .site-header,
body.is-embedded .families,
body.is-embedded footer,
body.is-embedded .site-footer {
  display: none !important;
}

body.is-embedded {
  background-color: var(--surface) !important;
  padding: 0 !important;
}

body.is-embedded main {
  max-width: 100% !important;
  padding: 0.6rem 1rem 1.5rem !important;
}

body.is-embedded .hero {
  margin: 0 auto 0.5rem !important;
  max-width: 100% !important;
}

body.is-embedded .hero .eyebrow,
body.is-embedded .hero h1,
body.is-embedded .hero > p:not(.hint) {
  display: none !important;
}

body.is-embedded .search-section {
  margin: 0.25rem auto 0.75rem !important;
  padding: 0.6rem 1rem !important;
  max-width: 600px !important;
  border-radius: 10px !important;
}

body.is-embedded .verb-card,
body.is-embedded .principal-parts,
body.is-embedded .attested-map {
  margin: 0.75rem 0 !important;
}

@media (max-width: 768px) {
  main {
    padding: 1.4rem .85rem 2.5rem;
  }
  .search-box {
    flex-direction: column;
  }
  .search-box button {
    width: 100%;
  }
  .family-grid {
    grid-template-columns: 1fr 1fr;
  }
  .verb-card,
  .analysis-card,
  .principal-parts,
  .attested-map {
    padding: 1rem;
  }
  .forms-table {
    font-size: .8rem;
  }
  .forms-table th:nth-child(3),
  .forms-table td:nth-child(3) {
    display: none;
  }
}

@media (max-width: 480px) {
  .family-grid {
    grid-template-columns: 1fr;
  }
  .lemma {
    font-size: 2rem;
  }
}

/* Dropdown navigation styles (Option A) */
.nav-item.dropdown {
    position: relative;
}
.dropdown-menu {
    background-color: var(--surface);
    border: 1px solid var(--border);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
    border-radius: 10px;
    padding: 6px 0;
    min-width: 200px;
}
.dropdown-item {
    color: var(--text-color);
    font-size: 0.92rem;
    font-weight: 500;
    padding: 7px 16px;
    display: block;
    text-decoration: none;
    transition: background 0.15s ease, color 0.15s ease;
}
.dropdown-item:hover, .dropdown-item:focus {
    background-color: var(--hover-bg);
    color: var(--primary);
}


/* Barra de navegación unificada (Autónoma, no depende de Bootstrap externo) */
.navbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    border-radius: 12px;
    background: var(--surface-2) !important;
    border: 1px solid var(--border, var(--border-color, rgba(0,0,0,0.1)));
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    padding: 0.5rem 1rem;
    margin: 0.2rem 0 1rem 0;
    position: relative;
    box-sizing: border-box;
}

.navbar .container-fluid {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 0;
    margin: 0;
}

.navbar-brand {
    text-decoration: none !important;
    display: inline-flex;
    align-items: center;
    margin-right: 1rem;
}

.navbar-brand h6 {
    color: var(--text-strong) !important;
    font-weight: 700;
    margin: 0;
    padding: 0.35rem 0;
    font-size: 1.05rem;
    text-decoration: none !important;
}

.navbar-collapse {
    display: flex;
    flex-basis: auto;
    flex-grow: 1;
    align-items: center;
}

.navbar-nav {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    list-style: none !important;
    margin: 0;
    padding: 0;
    gap: 4px;
    align-items: center;
}

.nav-item {
    list-style: none !important;
    margin: 0;
    padding: 0;
    position: relative;
}

.nav-link {
    display: inline-flex;
    align-items: center;
    color: var(--text, var(--text-color, #333)) !important;
    font-weight: 500;
    padding: 0.45rem 0.85rem !important;
    margin: 0;
    border-radius: 8px;
    text-decoration: none !important;
    transition: all 0.2s ease;
    font-size: 0.92rem;
    border: 1px solid transparent;
}

.nav-link:hover {
    color: var(--text-strong) !important;
    background-color: var(--hover-bg);
    text-decoration: none !important;
    transform: translateY(-1px);
}

.nav-link.active {
    background-color: var(--active-bg);
    color: var(--text-strong) !important;
    font-weight: 700;
    border-color: var(--border, var(--border-color, rgba(0,0,0,0.1)));
    text-decoration: none !important;
}

.dropdown {
    position: relative;
}

.dropdown-toggle::after {
    display: inline-block;
    margin-left: 0.35em;
    vertical-align: 0.15em;
    content: "";
    border-top: 0.35em solid;
    border-right: 0.3em solid transparent;
    border-bottom: 0;
    border-left: 0.3em solid transparent;
}

.dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 1050;
    min-width: 13rem;
    padding: 0.4rem 0;
    margin: 0.25rem 0 0;
    font-size: 0.9rem;
    color: var(--text, var(--text-color, #333));
    text-align: left;
    list-style: none !important;
    background-color: var(--surface);
    border: 1px solid var(--border, var(--border-color, rgba(0,0,0,0.1)));
    border-radius: 10px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

.dropdown:hover .dropdown-menu,
.dropdown.show .dropdown-menu,
.dropdown-menu.show {
    display: block;
}

.dropdown-item {
    display: block;
    width: 100%;
    padding: 0.5rem 1.15rem;
    clear: both;
    font-weight: 500;
    color: var(--text, var(--text-color, #333)) !important;
    text-align: inherit;
    text-decoration: none !important;
    white-space: nowrap;
    background-color: transparent;
    border: 0;
    transition: background 0.15s ease, color 0.15s ease;
}

.dropdown-item:hover,
.dropdown-item:focus {
    color: var(--text-strong) !important;
    background-color: var(--hover-bg);
    text-decoration: none !important;
}

.navbar-toggler {
    display: none;
    padding: 0.35rem 0.65rem;
    font-size: 1.1rem;
    line-height: 1;
    background-color: transparent;
    border: 1px solid var(--border, var(--border-color, rgba(0,0,0,0.1)));
    border-radius: 8px;
    cursor: pointer;
}

.navbar-toggler-icon {
    display: inline-block;
    width: 1.5em;
    height: 1.5em;
    vertical-align: middle;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba(120, 100, 80, 0.85)' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: center;
    background-size: 100%;
    filter: var(--toggler-filter);
}

@media (max-width: 991px) {
    .navbar-toggler {
        display: block;
    }
    .navbar-collapse {
        flex-basis: 100%;
        display: none;
        padding-top: 0.75rem;
    }
    .navbar-collapse.show {
        display: block;
    }
    .navbar-nav {
        flex-direction: column;
        align-items: stretch;
    }
    .nav-link {
        padding: 0.6rem 1rem !important;
    }
    .dropdown-menu {
        position: static;
        box-shadow: none;
        border: 1px solid var(--border, var(--border-color, rgba(0,0,0,0.1)));
        margin: 0.25rem 0.5rem;
    }
}

/* Fallbacks para iconos si FontAwesome es bloqueado por CSP */
.fa-search:empty::before,
.fas.fa-search:empty::before {
    content: "🔍";
    font-style: normal;
}

.fa-times:empty::before,
.fas.fa-times:empty::before {
    content: "✕";
    font-style: normal;
}
