/* ============================================================================
   Layout Shell
   Navigation, loading, page hero, footer, and shared layout pieces
   ============================================================================ */

/* ============================================================================
   LOADING SCREEN
   ============================================================================ */

.loading-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--gradient-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  opacity: 1;
  visibility: visible;
  transition: all 0.3s ease;
}

.loading-screen.hidden {
  opacity: 0;
  visibility: hidden;
}

.loading-content {
  text-align: center;
  color: var(--white);
}

.loading-logo {
  width: 80px;
  height: 80px;
  margin: 0 auto 20px;
  border-radius: 50%;
  animation: pulse 1s infinite;
}

.loading-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-top: 3px solid var(--white);
  border-radius: 50%;
  margin: 0 auto;
  animation: spin 0.6s linear infinite;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.05); opacity: 0.8; }
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* ============================================================================
   NAVIGATION
   ============================================================================ */

:root {
  --seasonal-banner-height: 0px;
}

.navbar {
  position: fixed;
  top: var(--seasonal-banner-height, 0px);
  left: 0;
  width: 100%;
  background: rgba(13, 27, 42, 0.95);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(230, 235, 238, 0.1);
  z-index: 1000;
  padding: 0;
  min-height: var(--nav-height);
  transition: var(--transition-normal), top 0.3s ease;
}

/* Seasonal banner styling */
.seasonal-banner + .navbar,
.seasonal-banner ~ .navbar {
  top: var(--seasonal-banner-height, 0px);
}

.nav-container {
  opacity: 0;
  transform: translateY(-20px);
  animation: navSlideIn 0.2s ease forwards;
  /* animation-delay: 1.5s; */
}

@keyframes navSlideIn {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.nav-container {
  max-width: var(--content-wide);
  margin: 0 auto;
  padding-inline: clamp(16px, 4vw, 48px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--nav-height);
  gap: clamp(0.5rem, 2vw, 2rem);
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: clamp(1.25rem, 1.2vw + 1rem, 1.75rem);
  color: var(--white);
  flex-shrink: 0;
}

.nav-logo img {
  width: 40px;
  height: 40px;
  border-radius: 8px;
}

.nav-menu {
  display: flex;
  align-items: center;
  gap: clamp(1rem, 2.5vw, 2rem);
  margin: 0 clamp(1.5rem, 4vw, 3rem);
}

.nav-link {
  color: var(--primary-light);
  font-weight: 500;
  position: relative;
  transition: var(--transition-normal);
  white-space: nowrap;
}

.nav-link:hover,
.nav-link.active {
  color: var(--accent-green);
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: -8px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--accent-green);
  transition: var(--transition-normal);
}

.nav-link:hover::after,
.nav-link.active::after {
  width: 100%;
}

.nav-cta {
  background: var(--gradient-secondary);
  color: var(--white);
  padding: 10px 24px;
  border-radius: var(--radius-lg);
  font-weight: 600;
  transition: var(--transition-normal);
  box-shadow: var(--shadow-md);
  white-space: nowrap;
}

.nav-cta:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 4px;
  cursor: pointer;
}

.nav-toggle span {
  width: 25px;
  height: 3px;
  background: var(--white);
  border-radius: 2px;
  transition: var(--transition-normal);
}

/* Right side navigation actions */
.nav-actions {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-shrink: 0;
}

/* Language Switcher */
.language-switcher {
  margin: 0;
}

.language-dropdown {
  position: relative;
}

.lang-btn {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: var(--white);
  padding: 8px 16px;
  border-radius: var(--radius-md);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 500;
  transition: var(--transition-normal);
  backdrop-filter: blur(10px);
}

.lang-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.3);
}

.lang-btn i:last-child {
  font-size: 12px;
  transition: var(--transition-normal);
}

.language-dropdown.active .lang-btn i:last-child {
  transform: rotate(180deg);
}

.lang-menu {
  position: absolute;
  top: 100%;
  right: 0;
  background: var(--white);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  padding: 8px 0;
  min-width: 160px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: var(--transition-normal);
  z-index: 1000;
  margin-top: 8px;
}

.lang-menu.active {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.lang-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  background: none;
  border: none;
  width: 100%;
  text-align: left;
  cursor: pointer;
  color: var(--gray-700);
  font-size: 14px;
  transition: var(--transition-fast);
}

.lang-option:hover {
  background: var(--gray-100);
}

.lang-option.active {
  background: var(--primary-light);
  color: var(--primary-dark);
  font-weight: 600;
}

.lang-option img {
  width: 20px;
  height: 14px;
  object-fit: cover;
  border-radius: 2px;
}

/* ============================================================================
   VIETNAMESE TYPOGRAPHY OPTIMIZATION
   ============================================================================ */

/* Vietnamese text specific styles */
p, span, div, li {
  /* Better spacing for Vietnamese diacritics */
  line-height: 1.7;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  /* Better line height for Vietnamese headings */
  line-height: 1.3;
  /* Prevent text breaking issues with Vietnamese */
  word-wrap: break-word;
  hyphens: none;
  /* Improve Vietnamese heading display */
  font-kerning: normal;
  font-variant-ligatures: common-ligatures;
  letter-spacing: -0.01em;
}

/* Improve Vietnamese text readability */
.hero-description,
.section-header p,
.service-card p,
.feature-item p,
.review-text,
.about-text p {
  /* Optimal line height for Vietnamese paragraphs */
  line-height: 1.8;
  /* Better word spacing */
  word-spacing: 0.1em;
}

/* Vietnamese text optimization class */
.vietnamese-text {
  font-family: var(--font-primary);
  line-height: 1.8;
  word-spacing: 0.1em;
  font-feature-settings: "liga", "kern";
  text-rendering: optimizeLegibility;
  font-variant-ligatures: common-ligatures;
  font-kerning: normal;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ============================================================================
   PAGE HERO STYLES (Products, Blog)
   ============================================================================ */

.page-hero {
  min-height: clamp(55vh, 65vh, 70vh);
  background: var(--gradient-primary);
  display: flex;
  align-items: center;
  position: relative;
  overflow: hidden;
  padding: clamp(100px, 12vh, 140px) 0 clamp(60px, 10vh, 100px);
}

.page-title {
  font-size: clamp(2.5rem, 5vw, 3.75rem);
  font-weight: 800;
  color: var(--white);
  margin-bottom: 24px;
  line-height: 1.2;
}

.page-description {
  font-size: clamp(1rem, 2vw, 1.25rem);
  color: rgba(255, 255, 255, 0.9);
  line-height: 1.7;
  max-width: 800px;
}

/* ============================================================================
   FOOTER
   ============================================================================ */

.footer {
  background: #0f1120;
  padding: 56px 0;
  color: var(--white);
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: clamp(1.5rem, 4vw, 2.5rem);
  align-items: flex-start;
}

.footer-brand {
  display: flex;
  flex-direction: column-reverse;
  gap: 12px;
  max-width: 320px;
}

.footer-logo {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.25rem;
}

.footer-logo img {
  width: 72px;
  height: 72px;
  border-radius: 10px;
}

.footer-description {
  color: rgba(255, 255, 255, 0.8);
  line-height: 1.6;
  margin: 0;
}

.footer-social {
  display: flex;
  gap: 10px;
}

.footer-social a {
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--white);
  transition: var(--transition-fast);
}

.footer-social a:hover {
  background: rgba(255, 255, 255, 0.16);
  transform: translateY(-2px);
}

.footer-column h4 {
  color: var(--white);
  font-size: 1.05rem;
  margin-bottom: 14px;
}

.footer-column ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 10px;
}

.footer-column a {
  color: rgba(255, 255, 255, 0.8);
  text-decoration: none;
  transition: var(--transition-fast);
}

.footer-column a:hover {
  color: var(--white);
}

.footer-contact li a {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.footer-contact i {
  width: 18px;
  text-align: center;
  color: rgba(255, 255, 255, 0.7);
}

.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 36px;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.75);
}

.footer-meta {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.footer-stats {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.85);
  font-size: 0.95rem;
}

.footer-stats i {
  color: #74c0fc;
}

.footer-legal {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.footer-legal a {
  color: rgba(255, 255, 255, 0.8);
  text-decoration: none;
}

.footer-legal a:hover {
  color: var(--white);
}

/* ============================================================================
   BACK TO TOP BUTTON
   ============================================================================ */

.back-to-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 50px;
  height: 50px;
  background: var(--gradient-secondary);
  border: none;
  border-radius: 50%;
  color: var(--white);
  font-size: 1.25rem;
  cursor: pointer;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px);
  transition: var(--transition-normal);
  z-index: 999;
}

.back-to-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.back-to-top:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-xl);
}

/* ============================================================================
   CONTACT FLOATING BUTTON
   ============================================================================ */

.floating-panels-container {
  position: fixed;
  right: var(--fab-right, 30px);
  bottom: var(--fab-bottom, 100px);
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: flex-end;
  gap: var(--fab-gap, 12px);
  z-index: 1002;
  pointer-events: none;
}

.floating-panels-container > * {
  pointer-events: auto;
}

.contact-fab {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: var(--fab-gap, 12px);
}

.contact-fab__toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border: none;
  border-radius: 50%;
  background: var(--gradient-primary);
  color: var(--white);
  font-weight: 600;
  cursor: pointer;
  box-shadow: var(--shadow-lg);
  transition: var(--transition-normal);
}

.contact-fab__toggle i {
  font-size: 1.25rem;
}

.contact-fab__toggle:hover,
.contact-fab.open .contact-fab__toggle {
  transform: translateY(-2px);
  box-shadow: var(--shadow-xl);
}

.contact-fab__actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: var(--transition-normal);
  pointer-events: none;
  width: 100%;
  max-width: min(320px, 86vw);
}

.contact-fab.open .contact-fab__actions {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: auto;
}

.contact-fab__action {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  background: rgba(8, 17, 40, 0.92);
  color: var(--white);
  padding: 6px 16px 6px 6px;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
  box-shadow: var(--shadow-lg);
  transition: var(--transition-fast);
  height: 52px;
  width: 100%;
  min-width: 180px;
  max-width: 320px;
  justify-content: flex-start;
}

.contact-fab__action:hover {
  transform: translateX(-4px);
  background: rgba(8, 17, 40, 1);
}

.contact-fab__icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--primary-navy);
  flex-shrink: 0;
}

.contact-fab__icon img {
  width: 20px;
  height: 20px;
}

.contact-fab__icon--zalo {
  background: #0068ff;
}

.contact-fab__icon--phone {
  background: #00c48c;
}

.contact-fab__icon--gmail {
  background: #ff5a5f;
}

.contact-fab__icon--facebook {
  background: #1877f2;
}

.contact-fab__label {
  padding: 0 10px;
  min-width: 70px;
  text-align: left;
}
