/* ==========================================================================
   Mobio Technologies — Layout & Grid Architecture (Viewport-Fitted Sections)
   ========================================================================== */

/* Outer Shell: Disable page scroll from one section to the next */
html, body {
  height: 100vh;
  width: 100vw;
  overflow: hidden; /* Disables outer scrolling between sections */
  margin: 0;
  padding: 0;
  background-color: var(--bg-primary);
}

.site-wrapper {
  position: relative;
  width: 100%;
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* --------------------------------------------------------------------------
   1. Static Horizontal Navigation Bar (Top)
   -------------------------------------------------------------------------- */
.site-header {
  position: static; /* Static top navigation bar as requested */
  flex-shrink: 0;
  width: 100%;
  height: var(--header-height);
  background-color: #0a0a12;
  border-bottom: 1px solid var(--border-subtle);
  z-index: 100;
  overflow: hidden;
}

.header-inner {
  display: flex;
  align-items: stretch; /* Stretches children from top of navigation bar to bottom */
  justify-content: space-between;
  width: 100%;
  height: 100%;
  padding: 0;
  padding-left: 1.25rem;
  padding-right: 0; /* Flush right against the edge of the page */
  max-width: 100%;
}

@media (min-width: 768px) {
  .header-inner {
    padding-left: 1.75rem;
    padding-right: 0;
  }
}

/* Brand Logo (Supports replaceable .png, .svg, .webp) */
.brand-logo {
  display: inline-flex;
  align-items: center;
  height: 100%;
  text-decoration: none;
  cursor: pointer;
  user-select: none;
}

.brand-logo-img {
  height: 36px;
  width: auto;
  max-width: 180px;
  object-fit: contain;
  display: block;
}

/* Header Action Buttons (Start from top of nav bar to bottom; straight sides) */
.header-actions {
  display: flex;
  align-items: stretch; /* Full height from top to bottom */
  height: 100%;
  gap: 0;
  margin: 0;
  padding: 0;
}

.header-cta-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  height: 100%; /* From top of nav bar to bottom */
  padding: 0 1.35rem;
  border-radius: 0 !important; /* Straight sides, no circular corners */
  border: none;
  font-family: var(--font-heading);
  font-size: 0.88rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  text-decoration: none;
  transition: filter var(--transition-fast), background-color var(--transition-fast);
  white-space: nowrap;
  box-shadow: none;
}

.header-cta-btn:hover {
  filter: brightness(1.12);
}

.header-cta-btn.call-btn {
  background-color: var(--accent-purple);
  color: var(--accent-purple-text);
  border-left: 1px solid var(--border-subtle);
}

.header-cta-btn.whatsapp-btn {
  background-color: var(--accent-green);
  color: var(--accent-green-text);
  border-left: 1px solid rgba(0, 0, 0, 0.15);
}

.header-cta-btn svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

/* Hamburger Toggle (Full height top-to-bottom, extends to right end of page) */
.hamburger-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 100%; /* From top of nav bar to bottom */
  width: 62px; /* Extends to the right end of the page */
  min-width: 56px;
  border-radius: 0 !important; /* Straight sides, no circular corners */
  border: none;
  border-left: 1px solid var(--border-subtle);
  margin: 0; /* Flush to right edge */
  color: #ffffff;
  background-color: rgba(255, 255, 255, 0.06);
  transition: background-color var(--transition-fast), color var(--transition-fast);
  cursor: pointer;
}

.hamburger-toggle:hover {
  background-color: rgba(139, 92, 246, 0.25);
}

.hamburger-toggle.is-active {
  background-color: rgba(139, 92, 246, 0.4);
  color: var(--accent-yellow);
}

.hamburger-toggle svg {
  width: 22px;
  height: 22px;
}

@media (max-width: 640px) {
  .header-cta-btn {
    padding: 0 0.8rem;
    font-size: 0.8rem;
    gap: 0.35rem;
  }
  .hamburger-toggle {
    width: 48px;
    min-width: 48px;
  }
}

/* --------------------------------------------------------------------------
   2. Main Container (Fills viewport below static header)
   -------------------------------------------------------------------------- */
main {
  flex: 1;
  position: relative;
  width: 100%;
  height: calc(100vh - var(--header-height));
  max-height: calc(100vh - var(--header-height));
  overflow: hidden;
}

@media (min-width: 1024px) {
  main {
    padding-right: var(--sidebar-width);
  }
}

/* --------------------------------------------------------------------------
   3. Viewport-Fitted Hero Sections (Single-Screen Presentation Mode)
   -------------------------------------------------------------------------- */
.section-block {
  display: none;
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 1rem 1.5rem;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1), transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  -webkit-overflow-scrolling: touch;
}

@media (min-width: 768px) {
  .section-block {
    padding: 1.25rem 2rem;
  }
}

@media (min-width: 1200px) {
  .section-block {
    padding: 1.5rem 3rem;
  }
}

/* Custom subtle scrollbar if section contents exceed smaller screens */
.section-block::-webkit-scrollbar {
  width: 6px;
}
.section-block::-webkit-scrollbar-track {
  background: rgba(10, 10, 18, 0.6);
}
.section-block::-webkit-scrollbar-thumb {
  background: rgba(139, 92, 246, 0.35);
  border-radius: 3px;
}

.section-block.active-section {
  display: flex;
  flex-direction: column;
  justify-content: center;
  opacity: 1;
  transform: translateY(0);
  z-index: 10;
}

.section-block.bg-primary {
  background-color: var(--bg-primary);
}

.section-block.bg-panel {
  background-color: var(--bg-panel);
}

.section-container {
  max-width: var(--container-max);
  margin: 0 auto;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* --------------------------------------------------------------------------
   4. Hero Layout Structure & Mobile Responsive Sequence Ordering
   Required order on mobile:
   1. Super-header
   2. Header
   3. Sub-header
   4. Image
   5. Bullets
   6. CTA buttons (Call Now first, then WhatsApp Chat after)
   -------------------------------------------------------------------------- */
.section-hero-layout {
  width: 100%;
  display: flex;
  flex-direction: column;
}

/* Mobile Sequence Ordering (<1024px) */
@media (max-width: 1023px) {
  .section-hero-layout {
    gap: 0.65rem;
    padding: 0.5rem 0;
  }

  .hero-item-super-header { order: 1; margin-bottom: 0.15rem; }
  .hero-item-header       { order: 2; margin-bottom: 0.15rem; }
  .hero-item-sub-header   { order: 3; margin-bottom: 0.35rem; }
  .hero-item-image        { order: 4; margin-bottom: 0.65rem; }
  .hero-item-bullets      { order: 5; margin-bottom: 0.65rem; }
  .hero-item-ctas         { order: 6; margin-bottom: 0.65rem; }
  .hero-item-extra        { order: 7; }
  .hero-item-secondary    { order: 8; }
}

/* Desktop Two-Column Grid (>=1024px) */
@media (min-width: 1024px) {
  .section-hero-layout {
    display: grid;
    grid-template-columns: 1.15fr 0.95fr;
    grid-template-areas:
      "super   image"
      "head    image"
      "sub     image"
      "bullet  image"
      "ctas    extra"
      "bottom  bottom";
    column-gap: 2.75rem;
    row-gap: 0.35rem;
    align-items: center;
  }

  .section-hero-layout.image-left-desktop {
    grid-template-columns: 0.95fr 1.15fr;
    grid-template-areas:
      "image   super"
      "image   head"
      "image   sub"
      "image   bullet"
      "extra   ctas"
      "bottom  bottom";
  }

  .hero-item-super-header { grid-area: super; }
  .hero-item-header       { grid-area: head; }
  .hero-item-sub-header   { grid-area: sub; }
  .hero-item-image        { grid-area: image; }
  .hero-item-bullets      { grid-area: bullet; }
  .hero-item-ctas         { grid-area: ctas; margin: 0; }
  .hero-item-extra        { grid-area: extra; margin: 0; }
  .hero-item-secondary    { grid-area: bottom; }

  /* Web Development specific grid layout */
  #web-dev .section-hero-layout.image-left-desktop {
    grid-template-areas:
      "image   super"
      "image   head"
      "image   sub"
      "image   bullet"
      "image   ctas";
    row-gap: 0.35rem;
  }

  /* Client Reviews specific grid layout */
  #reviews .section-hero-layout {
    grid-template-areas:
      "super   image"
      "head    image"
      "sub     image"
      "bullet  image"
      "bottom  bottom";
    row-gap: 0.35rem;
    align-items: stretch;
  }
}

/* --------------------------------------------------------------------------
   5. Right-Side Vertical Navigation Bar (All Screen Sizes)
   Clicking the hamburger icon expands or retracts this navigation bar!
   -------------------------------------------------------------------------- */
.sidebar-nav {
  position: fixed;
  top: var(--header-height);
  right: 0;
  width: var(--sidebar-width);
  height: calc(100vh - var(--header-height));
  background-color: #0d0718;
  border-left: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  justify-content: space-evenly;
  align-items: center;
  padding: 8px 0;
  z-index: 150;
  transition: width var(--transition-normal), transform var(--transition-normal), box-shadow var(--transition-normal);
}

/* Expanded state (on any screen size when hamburger is clicked) */
.sidebar-nav.expanded {
  width: var(--sidebar-expanded-width);
  align-items: stretch;
  padding: 12px 10px;
  box-shadow: -8px 0 30px rgba(0, 0, 0, 0.7);
  background-color: #120921;
}

/* Mobile retract: off-canvas */
@media (max-width: 1023px) {
  .sidebar-nav {
    width: 270px;
    transform: translateX(100%);
    align-items: stretch;
    padding: 16px 12px;
    box-shadow: -10px 0 35px rgba(0, 0, 0, 0.8);
    background-color: #130a24;
  }

  .sidebar-nav.expanded {
    width: 270px;
    transform: translateX(0);
  }
}

/* Sidebar Nav Items */
.sidebar-nav-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.45rem 0.6rem;
  border-radius: 0 !important; /* Straight sides */
  color: #9d94b0;
  transition: color var(--transition-fast), background-color var(--transition-fast);
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
}

.sidebar-nav-item:hover {
  color: #ffffff;
  background-color: rgba(139, 92, 246, 0.16);
}

.sidebar-nav-item.active {
  color: #ffffff;
  background-color: rgba(139, 92, 246, 0.28);
}

.sidebar-nav-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 4px;
  bottom: 4px;
  width: 3px;
  background: linear-gradient(to bottom, #8b5cf6, #f5b83d);
}

.sidebar-icon-box {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.sidebar-nav-item svg {
  width: 20px;
  height: 20px;
}

/* Text label hidden in compact/retracted desktop mode, visible in expanded mode */
.sidebar-label {
  display: none;
  font-family: var(--font-heading);
  font-size: 0.85rem;
  font-weight: 600;
  color: #ffffff;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-nav.expanded .sidebar-label {
  display: inline-block;
}

@media (max-width: 1023px) {
  .sidebar-label {
    display: inline-block;
  }
}

/* Tooltips in retracted desktop mode */
.sidebar-tooltip {
  position: absolute;
  right: calc(100% + 10px);
  top: 50%;
  transform: translateY(-50%) translateX(6px);
  background-color: #1a122a;
  color: #ffffff;
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
  padding: 4px 9px;
  border-radius: 0;
  border: 1px solid var(--border-subtle);
  pointer-events: none;
  opacity: 0;
  transition: opacity var(--transition-fast), transform var(--transition-fast);
  box-shadow: 0 4px 16px rgba(0,0,0,0.5);
  z-index: 160;
}

.sidebar-nav:not(.expanded) .sidebar-nav-item:hover .sidebar-tooltip {
  opacity: 1;
  transform: translateY(-50%) translateX(0);
}

.sidebar-nav.expanded .sidebar-tooltip {
  display: none;
}

/* Backdrop when expanded on mobile or overlay */
.sidebar-backdrop {
  position: fixed;
  inset: 0;
  top: var(--header-height);
  background-color: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  z-index: 140;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-normal);
}

.sidebar-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}
