/* Mobile App Experience — Exoluxury Design */
:root {
    --header-height: 4rem;
    --app-radius: 14px;
    --app-radius-sm: 10px;
    --app-shadow: 0 2px 16px rgba(0, 0, 0, 0.06);
    --app-shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.1);
    --drawer-width: min(100vw - 3rem, 22rem);
    --safe-top: env(safe-area-inset-top, 0px);
    --safe-bottom: env(safe-area-inset-bottom, 0px);
}

/* ─── Desktop Services Megamenu ─── */
@media (min-width: 768px) {
    .nav-dropdown-toggle .nav-caret {
        display: inline-flex;
        width: 0.45rem;
        height: 0.45rem;
        border-right: 1.5px solid currentColor;
        border-bottom: 1.5px solid currentColor;
        transform: rotate(45deg) translateY(-1px);
        opacity: 0.55;
        transition: transform 0.25s ease;
    }

    .nav-dropdown.open .nav-caret {
        transform: rotate(-135deg) translateY(1px);
    }

    .nav-dropdown-menu {
        min-width: 34rem;
        padding: 0;
        border-radius: 12px;
        border: 1px solid hsla(var(--border), 0.9);
        box-shadow: 0 20px 60px rgba(0, 0, 0, 0.14), 0 0 0 1px rgba(255, 255, 255, 0.04);
        overflow: hidden;
    }

    .nav-dropdown-inner {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 0;
        padding: 1.25rem 0.5rem;
    }

    .nav-dropdown-group {
        padding: 0.25rem 0.75rem;
    }

    .nav-dropdown-group + .nav-dropdown-group {
        border-top: none;
        margin-top: 0;
        padding-top: 0.25rem;
        border-left: 1px solid hsla(var(--border), 0.5);
    }

    .nav-dropdown-label {
        font-size: 0.6rem;
        letter-spacing: 0.16em;
        padding: 0.5rem 0.75rem 0.65rem;
        color: hsl(var(--accent));
    }

    .nav-dropdown-link {
        padding: 0.55rem 0.75rem;
        font-size: 0.875rem;
        font-weight: 500;
        border-radius: 8px;
        margin: 0.1rem 0;
    }

    .nav-dropdown-link:hover {
        background: hsl(var(--muted));
        color: hsl(var(--accent));
    }

    .nav-dropdown-all {
        margin-top: 0;
        padding: 0.875rem 1.25rem;
        background: hsl(var(--muted));
        text-align: center;
        border-top: 1px solid hsla(var(--border), 0.6);
        font-size: 0.7rem;
        letter-spacing: 0.14em;
    }

    .nav-dropdown-all:hover { color: hsl(var(--accent)); }
}

/* ─── Mobile: App Shell ─── */
@media (max-width: 767px) {
    html {
        -webkit-text-size-adjust: 100%;
        scroll-behavior: smooth;
    }

    body {
        overflow-x: hidden;
    }

    body.menu-open {
        overflow: hidden;
        touch-action: none;
    }

    body.menu-open .header {
        z-index: 90;
        background-color: hsla(var(--background), 0.98);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        box-shadow: 0 1px 0 hsla(var(--border), 0.5);
    }

    .container-custom {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    main {
        padding-bottom: calc(1rem + var(--safe-bottom));
    }

    /* Header */
    .header {
        padding: calc(0.65rem + var(--safe-top)) 0 0.65rem;
    }

    .header.scrolled {
        padding: calc(0.5rem + var(--safe-top)) 0 0.5rem;
        background-color: hsla(var(--background), 0.96);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        box-shadow: 0 1px 0 hsla(var(--border), 0.6);
    }

    .logo-title { font-size: 1.1rem; }
    .logo-subtitle { font-size: 0.55rem; }
    .logo-circle { width: 2.25rem; height: 2.25rem; }
    .logo-circle span { font-size: 1rem; }

    /* Hamburger → X */
    .mobile-menu-button {
        position: relative;
        z-index: 95;
        width: 2.75rem;
        height: 2.75rem;
        border-radius: 10px;
        background: hsl(var(--muted));
        align-items: center;
        gap: 0;
        transition: background 0.25s;
    }

    .mobile-menu-button:active {
        background: hsla(var(--accent), 0.12);
    }

    .mobile-menu-button span {
        width: 1.25rem;
        height: 2px;
        border-radius: 2px;
        transition: transform 0.3s ease, opacity 0.2s ease, margin 0.3s ease;
    }

    .mobile-menu-button span + span { margin-top: 5px; }

    .mobile-menu-button.open {
        background: hsl(var(--foreground));
    }

    .mobile-menu-button.open span {
        background-color: hsl(var(--background));
    }

    .mobile-menu-button.open span:nth-child(1) {
        transform: translateY(7px) rotate(45deg);
    }

    .mobile-menu-button.open span:nth-child(2) {
        opacity: 0;
        transform: scaleX(0);
    }

    .mobile-menu-button.open span:nth-child(3) {
        transform: translateY(-7px) rotate(-45deg);
    }

    /* Overlay */
    .nav-overlay {
        position: fixed;
        inset: 0;
        z-index: 80;
        background: rgba(0, 0, 0, 0.45);
        backdrop-filter: blur(6px);
        -webkit-backdrop-filter: blur(6px);
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.35s ease, visibility 0.35s;
    }

    body.menu-open .nav-overlay {
        opacity: 1;
        visibility: visible;
    }

    /* Drawer nav — starts below fixed header, never under it */
    .nav {
        position: fixed;
        top: var(--mobile-header-total, calc(var(--safe-top) + 5.5rem));
        right: 0;
        bottom: 0;
        left: auto;
        width: var(--drawer-width);
        max-width: 100%;
        margin: 0;
        padding: 0.75rem 0 calc(1.5rem + var(--safe-bottom));
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        background: hsl(var(--background));
        color: hsl(var(--foreground));
        box-shadow: -12px 0 48px rgba(0, 0, 0, 0.18);
        border-top: 1px solid hsla(var(--border), 0.45);
        transform: translateX(105%);
        transition: transform 0.4s cubic-bezier(0.32, 0.72, 0, 1);
        z-index: 85;
        overflow-y: auto;
        overflow-x: hidden;
        -webkit-overflow-scrolling: touch;
        display: flex !important;
        visibility: visible;
    }

    .nav.is-drawer {
        z-index: 85;
    }

    .nav.active {
        transform: translateX(0);
    }

    .nav::before {
        content: 'Menu';
        display: block;
        padding: 0 1.25rem 1rem;
        font-size: 0.65rem;
        text-transform: uppercase;
        letter-spacing: 0.2em;
        color: hsl(var(--gold));
        font-weight: 600;
    }

    .nav-link {
        display: flex;
        align-items: center;
        justify-content: space-between;
        width: 100%;
        padding: 0.95rem 1.25rem;
        font-size: 0.9rem;
        letter-spacing: 0.06em;
        border-bottom: 1px solid hsla(var(--border), 0.45);
        text-align: left;
        color: hsl(var(--foreground));
    }

    .nav-link::after { display: none; }

    .nav-link.active {
        background: hsla(var(--accent), 0.08);
        color: hsl(var(--accent));
        font-weight: 600;
    }

    /* Services accordion in drawer */
    .nav-dropdown {
        width: 100%;
        border-bottom: 1px solid hsla(var(--border), 0.45);
        flex-shrink: 0;
    }

    .nav-dropdown-toggle {
        width: 100%;
        justify-content: space-between;
        padding: 0.95rem 1.25rem;
        border-bottom: none;
    }

    .nav-dropdown.open .nav-dropdown-toggle {
        background: hsla(var(--accent), 0.06);
        color: hsl(var(--accent));
    }

    .nav-caret {
        display: inline-flex;
        width: 0.45rem;
        height: 0.45rem;
        border-right: 2px solid hsl(var(--accent));
        border-bottom: 2px solid hsl(var(--accent));
        transform: rotate(45deg);
        font-size: 0;
        transition: transform 0.3s ease;
        flex-shrink: 0;
    }

    .nav-dropdown.open .nav-caret {
        transform: rotate(-135deg);
    }

    .nav-dropdown-menu {
        position: static !important;
        top: auto !important;
        left: auto !important;
        transform: none !important;
        opacity: 1 !important;
        visibility: hidden;
        pointer-events: none;
        max-height: 0;
        overflow: hidden;
        padding: 0;
        margin: 0;
        border: none;
        box-shadow: none;
        background: hsl(var(--muted));
        border-radius: 0;
        min-width: 0;
        width: 100%;
        transition: max-height 0.35s ease, visibility 0.25s;
        z-index: auto;
    }

    .nav-dropdown.open .nav-dropdown-menu {
        visibility: visible;
        pointer-events: auto;
        max-height: 2000px;
        overflow: visible;
    }

    .nav-dropdown-inner {
        padding: 0.25rem 0 0.5rem;
    }

    .nav-dropdown-group {
        padding: 0;
    }

    .nav-dropdown-group + .nav-dropdown-group {
        border-top: 1px solid hsla(var(--border), 0.35);
        margin-top: 0.25rem;
        padding-top: 0.25rem;
        border-left: none;
    }

    .nav-dropdown-label {
        display: block;
        padding: 0.5rem 1.25rem 0.25rem;
        font-size: 0.6rem;
        text-transform: uppercase;
        letter-spacing: 0.14em;
        color: hsl(var(--accent));
        font-weight: 600;
    }

    .nav-dropdown-link {
        display: block;
        padding: 0.75rem 1.25rem 0.75rem 1.5rem;
        font-size: 0.875rem;
        font-weight: 500;
        text-align: left;
        text-decoration: none;
        color: hsl(var(--foreground));
        border-bottom: 1px solid hsla(var(--border), 0.2);
        transition: background 0.2s;
    }

    .nav-dropdown-link:last-child {
        border-bottom: none;
    }

    .nav-dropdown-link:active {
        background: hsla(var(--accent), 0.12);
        color: hsl(var(--accent));
    }

    .nav-dropdown-all {
        display: flex;
        align-items: center;
        justify-content: center;
        margin: 0;
        padding: 0.875rem 1.25rem;
        background: hsl(var(--foreground));
        color: hsl(var(--background));
        font-size: 0.7rem;
        text-transform: uppercase;
        letter-spacing: 0.12em;
        font-weight: 600;
        text-decoration: none;
        border-top: 1px solid hsla(var(--border), 0.3);
    }

    .nav-dropdown-all:active {
        opacity: 0.9;
    }

    /* Page headers */
    .page-header {
        padding: calc(var(--header-height) + var(--safe-top) + 2rem) 0 2rem;
        text-align: left;
    }

    .page-header h1 {
        font-size: clamp(1.85rem, 7vw, 2.5rem);
        line-height: 1.15;
    }

    .page-header p {
        font-size: 0.95rem;
        line-height: 1.65;
    }

    .section-header {
        margin-bottom: 2rem;
        text-align: left;
    }

    section h2 {
        font-size: clamp(1.5rem, 5.5vw, 2rem);
        line-height: 1.2;
    }

    .subtitle {
        font-size: 0.65rem;
        letter-spacing: 0.2em;
    }

    /* Buttons — app tap targets */
    .btn {
        min-height: 3rem;
        padding: 0.875rem 1.5rem;
        border-radius: var(--app-radius-sm);
        font-size: 0.75rem;
        width: 100%;
        max-width: 100%;
    }

    .hero-buttons {
        flex-direction: column;
        align-items: stretch;
        width: 100%;
        gap: 0.75rem;
    }

    .hero-buttons .btn {
        width: 100%;
        max-width: none;
    }

    .cta .btn-primary,
    .contact-form .btn-dark,
    .service-highlights-box .btn-dark {
        width: 100%;
    }

    /* Hero */
    .hero {
        min-height: 100svh;
        height: 100svh;
    }

    .hero-content {
        min-height: 100svh;
        padding: calc(var(--header-height) + 1rem) 1rem 2rem;
        justify-content: flex-end;
        padding-bottom: 3rem;
    }

    .hero-content h1 {
        font-size: clamp(2rem, 8vw, 2.75rem);
    }

    .hero-content p {
        font-size: 0.95rem;
    }

    /* Bio / About */
    .bio-section,
    .values-section,
    .design-approach {
        padding: 2.5rem 0;
    }

    .bio-grid {
        gap: 1.75rem;
    }

    .bio-image-bg {
        display: none;
    }

    .bio-image img {
        border-radius: var(--app-radius);
    }

    .bio-content h2 {
        font-size: clamp(1.65rem, 6vw, 2rem);
    }

    .bio-text {
        font-size: 0.925rem;
        line-height: 1.75;
    }

    .value-card {
        padding: 1.25rem;
        border-radius: var(--app-radius);
        box-shadow: var(--app-shadow);
    }

    .value-card h3 {
        font-size: 1.15rem;
    }

    /* Projects */
    .projects-section {
        padding: 2.5rem 0;
    }

    .projects-filter {
        gap: 0.5rem;
        margin-bottom: 1.5rem;
        justify-content: stretch;
    }

    .filter-btn {
        flex: 1 1 calc(50% - 0.25rem);
        min-width: 0;
        padding: 0.75rem 0.5rem;
        font-size: 0.65rem;
        border-radius: var(--app-radius-sm);
        text-align: center;
    }

    .project-card {
        border-radius: var(--app-radius);
        box-shadow: var(--app-shadow);
    }

    .project-overlay {
        padding: 1.25rem 1rem 1rem;
    }

    .project-overlay h3 {
        font-size: 1.15rem;
    }

    /* Project detail */
    .project-header {
        padding: calc(var(--header-height) + var(--safe-top) + 1.5rem) 0 2rem;
        min-height: 280px;
    }

    .project-title {
        font-size: clamp(1.65rem, 6vw, 2.25rem);
    }

    .project-meta {
        gap: 0.75rem 1.25rem;
        font-size: 0.7rem;
    }

    .project-content-section {
        padding: 2rem 0;
    }

    .project-content-grid {
        gap: 1.5rem;
    }

    .project-info h2 {
        font-size: 1.5rem;
    }

    .project-info h3 {
        font-size: 1.1rem;
    }

    .project-sidebar {
        position: static;
        padding: 1.25rem;
        border-radius: var(--app-radius);
    }

    .project-gallery,
    .related-projects {
        padding: 1.5rem 0 2.5rem;
    }

    .project-gallery h2,
    .related-projects h2 {
        font-size: 1.5rem;
        margin-bottom: 1.25rem;
    }

    .gallery-item {
        border-radius: var(--app-radius);
    }

    /* Contact */
    .contact-section {
        padding: 2rem 0 2.5rem;
    }

    .contact-grid {
        gap: 1rem;
    }

    .contact-form-wrapper,
    .contact-info {
        padding: 1.25rem;
        border-radius: var(--app-radius);
        box-shadow: var(--app-shadow);
    }

    .contact-form-wrapper h2,
    .contact-info-content h2 {
        font-size: 1.35rem;
        margin-bottom: 1.25rem;
    }

    .form-group input,
    .form-group select,
    .form-group textarea {
        padding: 0.875rem 1rem;
        font-size: 1rem;
        border-radius: var(--app-radius-sm);
        min-height: 3rem;
    }

    .form-group textarea {
        min-height: 120px;
    }

    .contact-image img {
        border-radius: var(--app-radius-sm);
        max-height: 180px;
    }

    /* Testimonials home/about */
    .testimonials {
        padding: 2.5rem 0;
    }

    .testimonial-card {
        padding: 1.25rem;
        border-radius: var(--app-radius);
        box-shadow: var(--app-shadow);
    }

    .testimonial-card blockquote {
        font-size: 0.95rem;
    }

    /* Services pages */
    .service-page-hero {
        padding: calc(var(--header-height) + var(--safe-top) + 2rem) 0 2.5rem;
        min-height: 320px;
    }

    .service-page-hero-content h1 {
        font-size: clamp(1.85rem, 7vw, 2.5rem);
    }

    .service-page-hero-content p:last-child {
        font-size: 0.95rem;
    }

    .services-intro {
        padding: 2.5rem 0;
    }

    .services-intro-grid {
        gap: 1.75rem;
    }

    .services-intro-grid h2 {
        font-size: clamp(1.35rem, 5vw, 1.75rem);
    }

    .services-stats {
        grid-template-columns: repeat(3, 1fr);
        gap: 0.65rem;
    }

    .services-stats > div {
        background: hsl(var(--background));
        padding: 1rem 0.5rem;
        border-radius: var(--app-radius-sm);
        box-shadow: var(--app-shadow);
    }

    .services-stats span {
        font-size: 1.5rem;
    }

    .services-stats p {
        font-size: 0.6rem;
        line-height: 1.3;
    }

    .services-list-section,
    .service-intro-section,
    .service-details-section,
    .service-gallery-section,
    .related-services-section {
        padding: 2.5rem 0;
    }

    .service-card {
        border-radius: var(--app-radius);
        box-shadow: var(--app-shadow);
    }

    .service-card-body {
        padding: 1.15rem;
    }

    .service-card-body h3 {
        font-size: 1.15rem;
    }

    .service-hero {
        min-height: 420px;
        height: auto;
    }

    .service-hero .service-hero-content {
        min-height: 65svh;
        padding: calc(var(--header-height) + 1.5rem) 1rem 2rem;
        align-items: flex-start;
        text-align: left;
    }

    .service-hero .hero-content h1 {
        font-size: clamp(1.75rem, 7vw, 2.5rem);
    }

    .service-intro-grid {
        gap: 1.25rem;
    }

    .service-intro-lead {
        font-size: 0.95rem;
    }

    .service-highlights-box {
        padding: 1.25rem;
        border-radius: var(--app-radius);
        border-top-width: 3px;
    }

    .service-section-block {
        padding: 1.25rem;
        border-radius: var(--app-radius);
        border-left-width: 3px;
    }

    .service-section-block h3 {
        font-size: 1.1rem;
    }

    .gallery-slider-viewport {
        border-radius: var(--app-radius);
    }

    .gallery-prev,
    .gallery-next {
        width: 2.5rem;
        height: 2.5rem;
        font-size: 1.25rem;
        background: hsla(var(--foreground), 0.85);
    }

    /* Reviews page */
    .reviews-hero {
        padding: calc(var(--header-height) + var(--safe-top) + 2rem) 0 2rem;
        text-align: left;
    }

    .reviews-hero h1 {
        font-size: clamp(1.75rem, 6.5vw, 2.25rem);
    }

    .reviews-summary-section {
        padding: 1.5rem 0;
    }

    .reviews-summary-grid {
        gap: 1rem;
    }

    .reviews-score-card,
    .reviews-bars-card {
        padding: 1.25rem;
        border-radius: var(--app-radius);
        box-shadow: var(--app-shadow);
    }

    .reviews-score-value {
        font-size: 2.75rem;
    }

    .reviews-score-note {
        font-size: 0.85rem;
        text-align: left;
    }

    .reviews-list-section {
        padding: 1.5rem 0 2.5rem;
    }

    .reviews-toolbar {
        flex-direction: column;
        align-items: stretch;
        gap: 0.875rem;
        margin-bottom: 1.25rem;
        padding-bottom: 1rem;
    }

    .reviews-filters {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 0.5rem;
    }

    .review-filter-btn {
        padding: 0.65rem 0.5rem;
        font-size: 0.65rem;
        border-radius: var(--app-radius-sm);
        text-align: center;
    }

    .reviews-sort {
        width: 100%;
    }

    .reviews-sort select {
        flex: 1;
        width: 100%;
        min-height: 2.75rem;
        border-radius: var(--app-radius-sm);
    }

    .review-card {
        padding: 1.15rem;
        border-radius: var(--app-radius);
        box-shadow: var(--app-shadow);
    }

    .review-card-header {
        gap: 0.75rem;
    }

    .review-avatar {
        width: 2.5rem;
        height: 2.5rem;
        font-size: 0.75rem;
    }

    .review-quote {
        font-size: 0.9rem;
    }

    .reviews-load-more-wrap .btn {
        max-width: 100%;
    }

    /* CTA */
    .cta {
        padding: 2.5rem 0;
    }

    .cta h2 {
        font-size: clamp(1.5rem, 5.5vw, 2rem);
    }

    .cta p {
        font-size: 0.925rem;
    }

    /* Footer */
    .footer {
        padding: 2.5rem 0 calc(1.5rem + var(--safe-bottom));
    }

    .footer-grid {
        gap: 2rem;
    }

    .footer-brand p {
        margin-top: 1rem;
        font-size: 0.875rem;
    }

    .footer-links nav {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 0.65rem 1rem;
    }

    .footer-links nav a {
        font-size: 0.875rem;
        padding: 0.35rem 0;
    }

    .footer-bottom {
        margin-top: 2rem;
        padding-top: 1.5rem;
    }

    /* Steps */
    .how-it-works {
        padding: 2.5rem 0;
    }

    .step {
        padding: 1.15rem;
        border-radius: var(--app-radius-sm);
        background: hsl(var(--background));
        box-shadow: var(--app-shadow);
        border-left: none;
        border-top: 3px solid hsl(var(--gold-light));
    }

    /* Utility */
    .text-center .btn {
        max-width: 100%;
    }
}
