/* ============================================================
   MOBILE UI OVERHAUL — "Out of the Box" Experience
   Dedicated mobile stylesheet for screens ≤ 768px
   ============================================================ */

/* ============================================================
   1. BOTTOM PILL NAVIGATION
   A floating glassmorphic pill at the bottom of the viewport
   ============================================================ */
@media (max-width: 768px) {

  /* Hide the top navbar on mobile — replaced by bottom pill */
  .navbar {
    display: none !important;
  }

  /* The bottom pill */
  .mobile-bottom-nav {
    display: flex !important;
    position: fixed;
    bottom: calc(12px + env(safe-area-inset-bottom, 0px));
    left: 50%;
    transform: translateX(-50%);
    z-index: 9998;
    background: var(--bg-app);
    border: 1px solid var(--border);
    border-radius: 50px;
    padding: 6px 10px;
    gap: 0;
    box-shadow: 0 8px 32px rgba(0,0,0,0.18), 0 2px 8px rgba(0,0,0,0.1);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    width: auto;
    max-width: 95vw;
    transition: transform 0.3s ease, opacity 0.3s ease;
  }

  [data-theme="dark"] .mobile-bottom-nav {
    background: rgba(20, 20, 20, 0.92);
    border-color: rgba(255,255,255,0.06);
  }

  /* Target BOTH links and the theme toggle button */
  .mobile-bottom-nav a,
  .mobile-bottom-nav button {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 6px 12px;
    border-radius: 40px;
    color: var(--text-tertiary);
    font-size: 0.55rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    text-decoration: none;
    transition: all 0.25s ease;
    gap: 3px;
    min-width: 50px;
    background: none;
    border: none;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
  }

  .mobile-bottom-nav a svg,
  .mobile-bottom-nav button svg {
    width: 18px;
    height: 18px;
    stroke-width: 1.8;
    flex-shrink: 0;
  }

  .mobile-bottom-nav a.active {
    background: var(--gold);
    color: var(--bg-app);
  }

  .mobile-bottom-nav a:active,
  .mobile-bottom-nav button:active {
    transform: scale(0.9);
  }

  /* Hide the old mobile menu entirely */
  .mobile-menu {
    display: none !important;
  }

  .nav-menu-toggle {
    display: none !important;
  }
}

/* Default: hide the bottom nav on desktop */
.mobile-bottom-nav {
  display: none;
}


/* ============================================================
   2. STICKY CTA BAR (appears after scrolling past hero)
   ============================================================ */
.mobile-sticky-cta {
  display: none;
}

@media (max-width: 768px) {
  .mobile-sticky-cta {
    display: block;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 9990;
    background: var(--bg-app);
    border-bottom: 1px solid var(--border);
    padding: calc(10px + env(safe-area-inset-top, 0px)) 16px 10px 16px;
    transform: translateY(-100%);
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
  }

  [data-theme="dark"] .mobile-sticky-cta {
    background: rgba(20, 20, 20, 0.95);
    border-color: rgba(255,255,255,0.06);
  }

  .mobile-sticky-cta.visible {
    transform: translateY(0);
  }

  .mobile-sticky-cta-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 100%;
  }

  .mobile-sticky-cta-inner .sticky-brand {
    display: flex;
    align-items: center;
    gap: 10px;
  }

  .mobile-sticky-cta-inner .sticky-brand img {
    height: 32px;
    width: auto;
    border-radius: 6px;
  }

  .mobile-sticky-cta-inner .sticky-brand span {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.01em;
  }

  .mobile-sticky-cta-inner .sticky-cta-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    background: var(--gold);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-radius: 50px;
    text-decoration: none;
    transition: transform 0.2s ease;
  }

  .mobile-sticky-cta-inner .sticky-cta-btn:active {
    transform: scale(0.95);
  }

  .mobile-sticky-cta-inner .sticky-cta-btn svg {
    width: 14px;
    height: 14px;
  }
}


/* ============================================================
   3. HORIZONTAL SNAP CAROUSELS — Services
   ============================================================ */
@media (max-width: 768px) {
  .services-scroll-wrapper {
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 1rem;
    margin: 0 -1rem;
    padding-left: 1rem;
    padding-right: 1rem;
    scrollbar-width: none;
  }

  .services-scroll-wrapper::-webkit-scrollbar {
    display: none;
  }

  .services-track {
    display: flex !important;
    flex-wrap: nowrap !important;
    gap: 16px;
    animation: none !important;
    width: max-content;
  }

  .service-card {
    scroll-snap-align: center;
    flex: 0 0 280px;
    width: 280px !important;
    min-width: 280px;
    border-radius: 20px;
  }

  /* Scroll indicator dots hint */
  .services-section .section-header::after {
    content: 'Swipe →';
    display: block;
    margin-top: 8px;
    font-size: 0.75rem;
    color: var(--text-tertiary);
    font-weight: 500;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    opacity: 0.6;
  }
}


/* ============================================================
   4. HERO SECTION — Optimized for mobile
   ============================================================ */
@media (max-width: 768px) {
  .hero-section {
    height: 300vh !important;
  }

  .hero-canvas-wrapper {
    height: 100vh !important;
    height: 100dvh !important;
    width: 100vw !important;
  }

  .hero-canvas-wrapper canvas {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    object-position: center 30% !important;
    transform: scale(1.15);
  }
}
  
  .hero-overlay {
    justify-content: center !important;
    padding-bottom: 0 !important;
  }
  
  .hero-content {
    text-align: center;
    padding: 2rem 1.5rem;
    border-radius: 20px;
  }
  
  .hero-cta-group {
    justify-content: center;
  }
  
  .nav-logo img {
    height: 85px !important; width: auto; object-fit: contain; /* Smaller logo on mobile */
  }
}


/* ============================================================
   5. TYPOGRAPHY — Aggressive mobile scaling
   ============================================================ */
@media (max-width: 768px) {
  h1 {
    font-size: clamp(2rem, 8vw, 3rem) !important;
    line-height: 1.1 !important;
  }

  h2 {
    font-size: clamp(1.6rem, 6vw, 2.2rem) !important;
    line-height: 1.15 !important;
  }

  h4 {
    font-size: clamp(1rem, 4vw, 1.3rem) !important;
  }

  .section-header p {
    font-size: 0.9rem !important;
    line-height: 1.6;
  }

  .section {
    padding: clamp(3rem, 8vw, 5rem) 0 !important;
  }

  .container {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
}


/* ============================================================
   6. TOUCH FEEDBACK — Native `:active` states
   ============================================================ */
@media (max-width: 768px) {
  .btn-primary:active,
  .btn-nav-cta:active,
  .sticky-cta-btn:active {
    transform: scale(0.95) !important;
    transition: transform 0.1s ease !important;
  }

  .service-card:active {
    transform: scale(0.97) !important;
    transition: transform 0.15s ease !important;
  }

  .project-card:active {
    transform: scale(0.97) !important;
    transition: transform 0.15s ease !important;
  }

  .footer-col h5:active {
    opacity: 0.7;
  }
}


/* ============================================================
   7. FOOTER ACCORDION on Mobile
   ============================================================ */
@media (max-width: 768px) {
  .footer-card {
    padding: 2rem 1.5rem 1.5rem !important;
    border-radius: 24px !important;
  }

  .footer-grid {
    grid-template-columns: 1fr !important;
    gap: 0 !important;
  }

  .footer-brand {
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border);
  }

  /* Accordion headers */
  .footer-col h5 {
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 0;
    margin-bottom: 0 !important;
    border-bottom: 1px solid var(--border);
    user-select: none;
    -webkit-user-select: none;
    transition: color 0.2s ease;
  }

  .footer-col h5::after {
    content: '+';
    font-size: 1.2rem;
    font-weight: 300;
    color: var(--text-tertiary);
    transition: transform 0.3s ease;
  }

  .footer-col h5.accordion-open::after {
    content: '−';
  }

  /* Accordion content — collapsed by default */
  .footer-col ul {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s ease, padding 0.35s ease;
    padding-top: 0;
    padding-bottom: 0;
  }

  .footer-col h5.accordion-open + ul {
    max-height: 300px;
    padding-top: 0.75rem;
    padding-bottom: 0.5rem;
  }

  /* Footer bottom */
  .footer-bottom {
    flex-direction: column !important;
    text-align: center !important;
    padding-top: 1.5rem !important;
    gap: 0.5rem !important;
  }

  .footer-bottom p {
    font-size: 0.8rem !important;
  }

  .footer-legal {
    display: flex;
    gap: 1rem;
    justify-content: center;
  }

  .footer-legal a {
    font-size: 0.8rem;
  }
}


/* ============================================================
   8. WHATSAPP BUTTON — Repositioned above bottom nav
   ============================================================ */
@media (max-width: 768px) {
  .whatsapp-float {
    bottom: 80px !important;
    right: 14px !important;
    width: 44px !important;
    height: 44px !important;
    box-shadow: 0 4px 20px rgba(37, 211, 102, 0.35) !important;
  }
  .whatsapp-float svg {
    width: 24px !important;
    height: 24px !important;
  }
}


/* ============================================================
   9. INTRO / ABOUT SECTION — Mobile layout
   ============================================================ */
@media (max-width: 768px) {
  .intro-grid {
    grid-template-columns: 1fr !important;
    gap: 2rem !important;
  }

  .intro-visual {
    max-height: 300px !important;
    border-radius: 20px;
  }

  .intro-stats {
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 0.5rem !important;
  }

  .stat-number {
    font-size: 1.4rem !important;
  }

  .stat-label {
    font-size: 0.7rem !important;
  }

  .floating-badge {
    width: 70px !important;
    height: 70px !important;
  }

  .badge-number {
    font-size: 1.2rem !important;
  }

  .badge-text {
    font-size: 0.5rem !important;
  }
}


/* ============================================================
   10. CTA SECTION — Mobile polish
   ============================================================ */
@media (max-width: 768px) {
  .cta-inner {
    padding: 2.5rem 1.5rem !important;
    border-radius: 24px !important;
  }

  .cta-inner .btn-primary {
    width: 100%;
    justify-content: center;
    padding: 1rem 2rem !important;
  }
}


/* ============================================================
   11. CONTAINER SCROLL (Box Animation) — Mobile optimization
   ============================================================ */
@media (max-width: 768px) {
  .container-scroll {
    height: 35rem !important;
    padding: 0.5rem !important;
  }

  .container-scroll-inner {
    padding: 2rem 0 !important;
  }

  .container-scroll-card {
    height: 22rem !important;
    border-radius: 20px !important;
    padding: 0.5rem !important;
  }

  .container-scroll-content {
    border-radius: 14px;
    padding: 0.75rem !important;
  }

  /* Make projects inside the scroll card stack vertically on mobile */
  .container-scroll-content .projects-grid {
    grid-template-columns: 1fr !important;
    gap: 0.75rem;
  }

  .container-scroll-content .project-card.large {
    grid-column: span 1 !important;
  }
}


/* ============================================================
   12. SMOOTH SECTION SPACING — Consistent mobile padding
   ============================================================ */
@media (max-width: 768px) {
  .services-section {
    padding-top: 3rem !important;
    padding-bottom: 3rem !important;
  }

  .projects-section {
    padding-top: 2rem !important;
    padding-bottom: 2rem !important;
  }

  /* Ensure the page has enough bottom padding for the pill nav */
  .site-footer {
    padding-bottom: 90px !important;
  }
}


/* ============================================================
   13. LOADING SCREEN — Mobile polish
   ============================================================ */
@media (max-width: 768px) {
  .loader-logo {
    width: 60px !important;
    height: 85px !important;
  }

  .loader-text {
    font-size: 1.2rem !important;
  }
}


/* ============================================================
   14. MOBILE THEME TOGGLE IN BOTTOM NAV
   ============================================================ */
.mobile-theme-toggle {
  display: none;
}

@media (max-width: 768px) {
  .mobile-theme-toggle {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 8px 14px;
    border-radius: 40px;
    color: var(--text-tertiary);
    font-size: 0.6rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    background: none;
    border: none;
    cursor: pointer;
    transition: all 0.25s ease;
    gap: 4px;
    min-width: 56px;
    font-family: inherit;
  }

  .mobile-theme-toggle svg {
    width: 20px;
    height: 20px;
    stroke-width: 1.8;
  }

  .mobile-theme-toggle:active {
    transform: scale(0.9);
  }

  /* Show/hide sun/moon icons based on theme */
  [data-theme="light"] .mobile-theme-toggle .icon-sun {
    display: none;
  }
  [data-theme="light"] .mobile-theme-toggle .icon-moon {
    display: block;
  }
  [data-theme="dark"] .mobile-theme-toggle .icon-sun {
    display: block;
  }
  [data-theme="dark"] .mobile-theme-toggle .icon-moon {
    display: none;
  }
}


/* ============================================================
   15. HERO MOBILE TEXT OVERLAY
   ============================================================ */
.hero-mobile-text {
  display: none;
}

@media (max-width: 768px) {
  .hero-mobile-text {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    position: absolute;
    bottom: 15vh;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    width: 90%;
  }

  .hero-mobile-text h1 {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: clamp(2.5rem, 10vw, 4rem) !important;
    font-weight: 800;
    color: #ffffff;
    line-height: 1.05 !important;
    letter-spacing: -0.03em;
    text-shadow: 0 4px 30px rgba(0,0,0,0.5), 0 1px 3px rgba(0,0,0,0.4);
    margin-bottom: 0.75rem;
  }

  .hero-mobile-text p {
    font-size: 0.85rem !important;
    color: rgba(255,255,255,0.8);
    font-weight: 500;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    text-shadow: 0 2px 10px rgba(0,0,0,0.4);
  }

  /* The overlay gradient needs to be stronger for text readability */
  .hero-canvas-overlay {
    background: linear-gradient(to top, rgba(0,0,0,0.7) 0%, rgba(0,0,0,0.1) 40%, rgba(0,0,0,0.2) 100%) !important;
  }
}


/* ============================================================
   16. PREMIUM LOADING ANIMATION — Complete Overhaul
   ============================================================ */
.premium-loader {
  position: fixed;
  inset: 0;
  background-color: #000000;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
}

/* Smooth exit */
.premium-loader.exit-active {
  animation: loaderExit 1s cubic-bezier(0.65, 0, 0.35, 1) forwards;
}

@keyframes loaderExit {
  0% {
    opacity: 1;
    clip-path: inset(0 0 0 0);
  }
  100% {
    opacity: 0;
    clip-path: inset(0 0 100% 0);
  }
}

.premium-loader.hidden {
  display: none;
}

/* Progress bar */
.loader-progress {
  position: absolute;
  bottom: 60px;
  left: 50%;
  transform: translateX(-50%);
  width: 120px;
  height: 2px;
  background: rgba(255,255,255,0.1);
  border-radius: 2px;
  overflow: hidden;
}

.loader-progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--gold, #C8A45E), #fff);
  border-radius: 2px;
  transition: width 0.1s linear;
}

.loader-counter {
  position: absolute;
  bottom: 35px;
  left: 50%;
  transform: translateX(-50%);
  font-family: 'Inter', sans-serif;
  font-size: 0.7rem;
  font-weight: 500;
  color: rgba(255,255,255,0.3);
  letter-spacing: 0.1em;
}

@media (max-width: 768px) {
  .luxury-slider-container {
    padding: 2rem 0;
  }
  .luxury-slide {
    flex: 0 0 85vw;
  }
  .luxury-title {
    font-size: clamp(2rem, 9vw, 3.5rem);
    white-space: normal;
    padding: 0 1rem;
  }
  .luxury-slide-footer {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 1.5rem;
  }
  .luxury-slide-footer p {
    max-width: 100%;
  }
  .lp-control {
    width: 44px;
    height: 44px;
  }
  .lp-control.prev { left: 2vw; }
  .lp-control.next { right: 2vw; }
}


