/* Shared header/footer chrome for inner pages.
   Class-scoped only — no global a/button resets (avoids breaking store/auth UI). */

:root {
  --tdo-rose: #db4458;
  --tdo-rose-hover: #c93347;
  --tdo-rose-soft: #fdebee;
  --tdo-ink: #222222;
  --tdo-line: #eeeeee;
  --tdo-footer-bg: #0f2824;
  --tdo-sans: "Plus Jakarta Sans", "Segoe UI", Arial, Helvetica, sans-serif;
  --tdo-script: "Dancing Script", "Caveat", cursive;
  --tdo-max-width: 1200px;
}

.aila-skip {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 1200;
  background: var(--tdo-ink);
  color: #fff;
  padding: 0.5rem 1rem;
  text-decoration: none;
}
.aila-skip:focus {
  left: 1rem;
  top: 1rem;
}

.aila-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 42px;
  padding: 0.65rem 1.4rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.92rem;
  border: 1px solid transparent;
  transition: all 0.25s ease;
  white-space: nowrap;
  text-decoration: none;
  box-sizing: border-box;
  font-family: var(--tdo-sans);
  line-height: 1.2;
  cursor: pointer;
}
.aila-btn--primary {
  background: var(--tdo-rose);
  color: #ffffff !important;
  box-shadow: 0 6px 18px rgba(219, 68, 88, 0.25);
}
.aila-btn--primary:hover {
  background: var(--tdo-rose-hover);
  color: #ffffff !important;
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(219, 68, 88, 0.35);
  text-decoration: none;
}
.aila-btn--outline,
.aila-btn--ghost {
  background: #ffffff;
  color: var(--tdo-ink) !important;
  border-color: #dddddd;
}
.aila-btn--outline:hover,
.aila-btn--ghost:hover {
  border-color: var(--tdo-rose);
  color: var(--tdo-rose) !important;
  text-decoration: none;
}

.aila-icon-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #555;
  transition: background 0.2s;
  background: none;
  border: 0;
  cursor: pointer;
  padding: 0;
}
.aila-icon-btn:hover {
  background: #f5f5f5;
  color: var(--tdo-rose);
}

/* Keep sticky header above page content, below Bootstrap modals (1050+) */
.aila-header {
  position: sticky;
  top: 0;
  z-index: 1040;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--tdo-line);
  font-family: var(--tdo-sans);
  isolation: isolate;
}
.aila-header__inner {
  max-width: var(--tdo-max-width);
  margin: 0 auto;
  padding: 0.75rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  position: relative;
  z-index: 1;
}

.aila-logo {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  text-decoration: none;
  color: inherit;
  flex-shrink: 0;
}
.aila-logo:hover { text-decoration: none; color: inherit; }
.aila-logo__mark {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--tdo-rose-soft);
  color: var(--tdo-rose);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.aila-logo__text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}
.aila-logo__text strong {
  font-family: var(--tdo-sans);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--tdo-ink);
}
.aila-logo__text small {
  font-size: 0.7rem;
  color: var(--tdo-rose);
  font-weight: 500;
}

.aila-nav {
  display: none;
  align-items: center;
  gap: 1.6rem;
}
.aila-nav a {
  font-size: 0.92rem;
  font-weight: 500;
  color: #444444;
  position: relative;
  padding: 0.3rem 0;
  text-decoration: none;
}
.aila-nav a:hover,
.aila-nav a.is-active {
  color: var(--tdo-rose);
  font-weight: 600;
  text-decoration: none;
}
.aila-drawer__sub {
  padding-left: 1.25rem !important;
  font-size: 0.92rem;
  opacity: 0.92;
}
.aila-nav a.is-active::after {
  content: "";
  position: absolute;
  bottom: -4px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--tdo-rose);
  border-radius: 2px;
  pointer-events: none;
}

.aila-header__actions {
  display: none;
  align-items: center;
  gap: 0.75rem;
}

.aila-burger {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 6px;
  background: none;
  border: 0;
  cursor: pointer;
  flex-shrink: 0;
}
.aila-burger span {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--tdo-ink);
  border-radius: 2px;
}

/* Drawer sits under header, above content; never cover Bootstrap modal */
.aila-drawer {
  position: fixed;
  top: 60px;
  left: 0;
  right: 0;
  background: #fff;
  padding: 1.25rem;
  box-shadow: 0 10px 20px rgba(0,0,0,0.1);
  display: flex;
  flex-direction: column;
  gap: 1rem;
  z-index: 1035;
  font-family: var(--tdo-sans);
}
.aila-drawer[hidden] {
  display: none !important;
}
.aila-drawer a {
  color: #333;
  text-decoration: none;
  font-weight: 500;
}
.aila-drawer a:hover {
  color: var(--tdo-rose);
}

@media (min-width: 992px) {
  .aila-nav,
  .aila-header__actions { display: flex; }
  .aila-burger,
  .aila-drawer,
  .aila-btn--header-mobile { display: none !important; }
}

/* Footer */
.tdo-footer {
  background: var(--tdo-footer-bg);
  color: rgba(255, 255, 255, 0.85);
  padding: 3rem 1.25rem 1.8rem;
  font-family: var(--tdo-sans);
  margin-top: 0;
  position: relative;
  z-index: 1;
}
.tdo-footer__inner {
  max-width: var(--tdo-max-width);
  margin: 0 auto;
}
.tdo-footer__top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  margin-bottom: 2rem;
}
.aila-logo--light .aila-logo__text strong { color: #ffffff; }
.aila-logo--light .aila-logo__text small { color: rgba(255, 255, 255, 0.6); }
.aila-logo--light .aila-logo__mark {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.tdo-footer__links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.88rem;
}
.tdo-footer__links a {
  color: rgba(255, 255, 255, 0.85);
  transition: color 0.2s;
  text-decoration: none;
}
.tdo-footer__links a:hover {
  color: var(--tdo-rose);
  text-decoration: none;
}
.tdo-footer__links span {
  color: rgba(255, 255, 255, 0.3);
}

.tdo-footer__social {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.tdo-footer .social-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.85);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-style: normal;
  font-size: 0.82rem;
  font-weight: 600;
  transition: background 0.2s, color 0.2s;
  text-decoration: none;
}
.tdo-footer a:hover .social-icon,
.tdo-footer .social-icon:hover {
  background: var(--tdo-rose);
  color: #ffffff;
}

.tdo-footer__divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.1);
  margin-bottom: 1.5rem;
}
.tdo-footer__bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  font-size: 0.82rem;
  color: rgba(255, 255, 255, 0.55);
}
.tdo-footer__bottom p { margin: 0; }
.tdo-footer__handwriting {
  font-family: var(--tdo-script);
  font-size: 1.15rem;
  color: rgba(255, 255, 255, 0.7);
}

/* Prevent old sticky nsb header from stacking if both somehow present */
body.nsb-store.has-aila-chrome .nsb-header {
  display: none !important;
}
/* Content should not sit under sticky chrome incorrectly */
body.nsb-store.has-aila-chrome main#main,
body.nsb-store.has-aila-chrome main#noi-dung {
  position: relative;
  z-index: 0;
}
/* Floating widgets stay usable but below modals */
body.nsb-store.has-aila-chrome .tp_top_icon {
  z-index: 1020;
}

/* Static CMS pages (Giới thiệu, chính sách, …) */
.tdo-static-page {
  padding: 0 0 3rem;
}
.tdo-static-page__hero {
  padding: 2.5rem 0 1.75rem;
  text-align: center;
  background: linear-gradient(180deg, rgba(255, 245, 248, 0.95) 0%, #fff 100%);
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}
/* nsb-bookstore sets body.nsb-store p { margin:0 } — flex centering avoids relying on p margin:auto */
body.nsb-store .tdo-static-page__hero .container {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}
.tdo-static-page__title {
  margin: 0 0 0.5rem;
  width: 100%;
  max-width: 52rem;
  font-family: var(--tdo-display, "Playfair Display", Georgia, serif);
  font-size: clamp(1.75rem, 4vw, 2.35rem);
  font-weight: 700;
  color: #1a1a2e;
}
body.nsb-store .tdo-static-page__hero .tdo-static-page__subtitle {
  width: 100%;
  max-width: 42rem;
  margin: 0;
  font-size: 1.05rem;
  color: #5c5c6f;
  line-height: 1.6;
  text-align: center;
}
.tdo-static-page__body-wrap {
  padding: 2rem 0 1rem;
}
.tdo-static-page__body {
  max-width: 52rem;
  margin: 0 auto;
  font-size: 1rem;
  line-height: 1.75;
  color: #3d3d4a;
}
.tdo-static-page__body.cms-content h2,
.tdo-static-page__body.cms-content h3 {
  margin-top: 1.75rem;
  margin-bottom: 0.75rem;
  color: #1a1a2e;
}
.tdo-static-page__body.cms-content p {
  margin-bottom: 1rem;
}
.tdo-static-page__empty {
  text-align: center;
  color: #8a8a9a;
  font-style: italic;
  padding: 2rem 1rem;
}
