/**
 * Reformas BCN - Premium Design System v3.0
 * 
 * Architecture:
 * 1. Design Tokens & Custom Properties
 * 2. Base/Reset Styles  
 * 3. Typography System
 * 4. Layout Components
 * 5. UI Components
 * 6. Sections
 * 7. Utilities
 * 8. Animations
 * 9. Responsive Breakpoints
 * 10. Dark Mode
 * 11. Print Styles
 * 12. Accessibility Enhancements
 */

/* ============================================
   1. DESIGN TOKENS & CUSTOM PROPERTIES
   ============================================ */

:root {
    /* === Color System (HSL for easy theming) === */
    --color-primary-50: hsl(218, 55%, 97%);
    --color-primary-100: hsl(218, 55%, 92%);
    --color-primary-200: hsl(218, 55%, 82%);
    --color-primary-300: hsl(218, 55%, 68%);
    --color-primary-400: hsl(218, 55%, 50%);
    --color-primary-500: hsl(218, 55%, 38%); /* Primary */
    --color-primary-600: hsl(218, 55%, 28%); /* Primary Light */
    --color-primary-700: hsl(218, 60%, 22%);
    --color-primary-800: hsl(218, 65%, 16%);
    --color-primary-900: hsl(218, 70%, 10%); /* Primary Dark */
    --color-primary-950: hsl(218, 75%, 5%);

    /* Semantic Colors */
    --color-accent: hsl(38, 72%, 52%);
    --color-accent-hover: hsl(38, 72%, 46%);
    --color-accent-light: hsl(38, 72%, 94%);

    /* Neutral Colors */
    --color-text-primary: hsl(210, 24%, 16%);
    --color-text-secondary: hsl(210, 14%, 40%);
    --color-text-muted: hsl(210, 10%, 60%);
    --color-bg-primary: hsl(0, 0%, 100%);
    --color-bg-secondary: hsl(210, 20%, 98%);
    --color-bg-tertiary: hsl(210, 15%, 95%);
    --color-border: hsl(210, 14%, 90%);
    --color-border-light: hsl(210, 14%, 95%);

    /* Status Colors */
    --color-success: hsl(142, 70%, 45%);
    --color-success-light: hsl(142, 70%, 94%);
    --color-error: hsl(0, 84%, 60%);
    --color-error-light: hsl(0, 84%, 96%);
    --color-warning: hsl(38, 92%, 50%);
    --color-info: hsl(217, 91%, 60%);

    /* Brand Colors */
    --color-whatsapp: hsl(142, 70%, 45%);
    --color-white: hsl(0, 0%, 100%);
    --color-black: hsl(0, 0%, 0%);

    /* === Typography Scale (Modular Scale) === */
    --font-family-heading: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-family-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-family-mono: 'SF Mono', Monaco, 'Cascadia Code', monospace;

    --font-size-xs: clamp(0.75rem, 0.7rem + 0.25vw, 0.8125rem);
    --font-size-sm: clamp(0.875rem, 0.85rem + 0.25vw, 0.9375rem);
    --font-size-base: clamp(1rem, 0.95rem + 0.25vw, 1.0625rem);
    --font-size-lg: clamp(1.125rem, 1.05rem + 0.35vw, 1.25rem);
    --font-size-xl: clamp(1.25rem, 1.15rem + 0.5vw, 1.5rem);
    --font-size-2xl: clamp(1.5rem, 1.35rem + 0.75vw, 1.875rem);
    --font-size-3xl: clamp(1.875rem, 1.65rem + 1.1vw, 2.25rem);
    --font-size-4xl: clamp(2.25rem, 1.95rem + 1.5vw, 3rem);
    --font-size-5xl: clamp(3rem, 2.5rem + 2.5vw, 3.75rem);

    --font-weight-normal: 400;
    --font-weight-medium: 500;
    --font-weight-semibold: 600;
    --font-weight-bold: 700;
    --font-weight-extrabold: 800;

    --line-height-tight: 1.15;
    --line-height-normal: 1.5;
    --line-height-relaxed: 1.7;

    --letter-spacing-tight: -0.02em;
    --letter-spacing-normal: 0em;
    --letter-spacing-wide: 0.05em;
    --letter-spacing-wider: 0.1em;

    /* === Spacing System (8px grid) === */
    --space-1: 0.25rem; /* 4px */
    --space-2: 0.5rem; /* 8px */
    --space-3: 0.75rem; /* 12px */
    --space-4: 1rem; /* 16px */
    --space-5: 1.25rem; /* 20px */
    --space-6: 1.5rem; /* 24px */
    --space-8: 2rem; /* 32px */
    --space-10: 2.5rem; /* 40px */
    --space-12: 3rem; /* 48px */
    --space-16: 4rem; /* 64px */
    --space-20: 5rem; /* 80px */
    --space-24: 6rem; /* 96px */

    /* === Border Radius === */
    --radius-none: 0;
    --radius-sm: 0.5rem; /* 8px */
    --radius-md: 1rem; /* 16px */
    --radius-lg: 1.5rem; /* 24px */
    --radius-xl: 2rem; /* 32px */
    --radius-full: 9999px;

    /* === Shadows (Elevation System) === */
    --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-sm: 0 2px 4px -1px rgba(0, 0, 0, 0.06), 0 1px 2px -1px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -2px rgba(0, 0, 0, 0.04);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.04);
    --shadow-xl: 0 20px 25px -5px rgba(15, 23, 42, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.03);
    --shadow-premium: 0 25px 50px -12px rgba(15, 23, 42, 0.18);
    --shadow-glow: 0 0 20px rgba(245, 158, 11, 0.3);
    --shadow-inner: inset 0 2px 4px 0 rgba(0, 0, 0, 0.06);

    /* === Transitions === */
    --duration-fast: 150ms;
    --duration-normal: 250ms;
    --duration-slow: 400ms;
    --duration-slower: 600ms;

    --ease-default: cubic-bezier(0.4, 0, 0.2, 1);
    --ease-in: cubic-bezier(0.4, 0, 1, 1);
    --ease-out: cubic-bezier(0, 0, 0.2, 1);
    --ease-bounce: cubic-bezier(0.175, 0.885, 0.32, 1.275);
    --ease-spring: cubic-bezier(0.68, -0.55, 0.265, 1.55);

    --transition-base: all var(--duration-normal) var(--ease-default);
    --transition-fast: all var(--duration-fast) var(--ease-default);
    --transition-bounce: all var(--duration-slow) var(--ease-bounce);

    /* === Layout === */
    --header-height: 80px;
    --header-height-scrolled: 70px;
    --container-max-width: 1200px;
    --container-padding: var(--space-6);
    --section-padding-y: var(--space-24);

    /* === Z-index Scale === */
    --z-dropdown: 100;
    --z-sticky: 200;
    --z-fixed: 300;
    --z-modal-backdrop: 400;
    --z-modal: 500;
    --z-popover: 600;
    --z-tooltip: 700;
    --z-toast: 800;
    --z-max: 9999;

    /* === Other === */
    --backdrop-blur: blur(12px);
    --glass-bg: rgba(255, 255, 255, 0.85);
    --glass-border: rgba(255, 255, 255, 0.4);
}

/* ============================================
   2. BASE / RESET STYLES
   ============================================ */

*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    contain: paint style;
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

body {
    font-family: var(--font-family-body);
    font-size: var(--font-size-base);
    line-height: var(--line-height-normal);
    color: var(--color-text-primary);
    background-color: var(--color-bg-secondary);
    overflow-x: hidden;
    min-height: 100vh;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-family-heading);
    font-weight: var(--font-weight-bold);
    line-height: var(--line-height-tight);
    color: var(--color-primary-900);
    margin-bottom: var(--space-4);
}

h1 {
    font-size: var(--font-size-5xl);
    letter-spacing: var(--letter-spacing-tight);
}
h2 {
    font-size: var(--font-size-4xl);
    letter-spacing: var(--letter-spacing-tight);
}
h3 {
    font-size: var(--font-size-2xl);
}
h4 {
    font-size: var(--font-size-xl);
}

p {
    margin-bottom: var(--space-4);
    max-width: 65ch;
}

a {
    color: inherit;
    text-decoration: none;
    transition: var(--transition-base);
}

ul,
ol {
    list-style: none;
}

img {
    display: block;
    max-width: 100%;
    height: auto;
}

button {
    cursor: pointer;
    border: none;
    background: none;
    font-family: inherit;
}

input,
textarea,
select {
    font-family: inherit;
    font-size: inherit;
}

/* ============================================
   3. FOCUS STYLES & ACCESSIBILITY
   ============================================ */

.skip-link {
    position: absolute;
    top: -100%;
    left: var(--space-4);
    background: var(--color-accent);
    color: var(--color-primary-900);
    padding: var(--space-2) var(--space-4);
    border-radius: 0 0 var(--radius-sm) 0;
    z-index: var(--z-max);
    font-weight: var(--font-weight-semibold);
    transition: top var(--duration-fast) var(--ease-out);
}

.skip-link:focus {
    top: 0;
    outline: 2px solid var(--color-white);
    outline-offset: 2px;
}

:focus-visible {
    outline: 3px solid var(--color-accent);
    outline-offset: 2px;
}

:focus:not(:focus-visible) {
    outline: none;
}

/* Ensure interactive elements have visible focus indicators */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
[tabindex]:not([tabindex='-1']):focus-visible {
    outline: 3px solid var(--color-accent);
    outline-offset: 2px;
    border-radius: var(--radius-sm);
}

/* will-change for animated hero elements */
.hero-subtitle,
.hero-title,
.hero-description,
.hero-buttons {
    will-change: transform, opacity;
}

/* will-change for animated service cards and gallery items */
.service-card,
.gallery-item {
    will-change: transform, opacity;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* ============================================
   4. LAYOUT COMPONENTS
   ============================================ */

.container {
    width: 100%;
    max-width: var(--container-max-width);
    margin-inline: auto;
    padding-inline: var(--container-padding);
}

.section-padding {
    padding-block: var(--section-padding-y);
}

.bg-light {
    background-color: var(--color-bg-secondary);
}

.text-white {
    color: var(--color-white);
}
.accent-color {
    color: var(--color-accent);
}

/* Grid Utilities */
.grid {
    display: grid;
    gap: var(--space-8);
}

.grid-cols-2 {
    grid-template-columns: repeat(2, 1fr);
}
.grid-cols-3 {
    grid-template-columns: repeat(3, 1fr);
}
.grid-cols-auto {
    grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr));
}

.flex-center {
    display: flex;
    align-items: center;
    justify-content: center;
}

.flex-between {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* ============================================
   5. UI COMPONENTS
   ============================================ */

/* --- Button System --- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    font-family: var(--font-family-heading);
    font-weight: var(--font-weight-semibold);
    font-size: var(--font-size-sm);
    line-height: 1;
    padding: var(--space-3) var(--space-6);
    border-radius: var(--radius-sm);
    border: 2px solid transparent;
    cursor: pointer;
    transition: var(--transition-bounce);
    white-space: nowrap;
    user-select: none;
    position: relative;
    overflow: hidden;
}

.btn::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to right, transparent, rgba(255, 255, 255, 0.2), transparent);
    transform: translateX(-100%);
    transition: transform 0.5s ease;
}

.btn:hover::after {
    transform: translateX(100%);
}

.btn-primary {
    background-color: var(--color-accent);
    color: var(--color-primary-900);
    box-shadow:
        var(--shadow-sm),
        0 4px 14px rgba(245, 158, 11, 0.4);
}

.btn-primary:hover {
    background-color: var(--color-accent-hover);
    transform: translateY(-2px);
    box-shadow:
        var(--shadow-md),
        0 6px 20px rgba(245, 158, 11, 0.5);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-primary:disabled,
.btn-primary[disabled] {
    background-color: #9ca3af;
    color: #6b7280;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-outline {
    background-color: transparent;
    color: var(--color-white);
    border-color: var(--color-white);
}

.btn-outline:hover {
    background-color: var(--color-white);
    color: var(--color-primary-900);
    transform: translateY(-2px);
}

.btn-lg {
    padding: var(--space-4) var(--space-8);
    font-size: var(--font-size-base);
}

.btn-block {
    width: 100%;
}

.btn-loading .btn-text {
    opacity: 0;
}
.btn-loading .btn-loading-spinner {
    opacity: 1;
    display: flex;
}

.btn-loading-spinner {
    display: none;
    align-items: center;
    gap: var(--space-2);
}

.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid currentColor;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* --- Card Component --- */
.card {
    background: var(--color-bg-primary);
    border-radius: var(--radius-md);
    padding: var(--space-10);
    border: 1px solid var(--color-border);
    box-shadow: var(--shadow-sm);
    transition: var(--transition-bounce);
    position: relative;
    overflow: hidden;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--color-accent);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform var(--duration-slow) var(--ease-default);
}

.card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-premium);
    border-color: transparent;
}

.card:hover::before {
    transform: scaleX(1);
}

/* --- Form Components --- */
.form-group {
    margin-bottom: var(--space-6);
    position: relative;
}

.form-group label {
    display: block;
    margin-bottom: var(--space-2);
    font-weight: var(--font-weight-semibold);
    font-size: var(--font-size-sm);
    color: var(--color-text-primary);
}

.form-input,
.form-textarea,
.form-group input,
.form-group textarea {
    width: 100%;
    padding: var(--space-4);
    border-radius: var(--radius-sm);
    border: 1px solid var(--color-border);
    background-color: var(--color-bg-secondary);
    color: var(--color-text-primary);
    transition: var(--transition-base);
}

.form-input:focus,
.form-textarea:focus,
.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--color-primary-500);
    box-shadow:
        0 0 0 4px rgba(37, 99, 235, 0.1),
        0 0 0 6px var(--color-accent);
    background-color: var(--color-bg-primary);
    transform: translateY(-1px);
}

.form-input.error,
.form-textarea.error,
.form-group input.error,
.form-group textarea.error {
    border-color: var(--color-error);
    background-color: var(--color-error-light);
    box-shadow: 0 0 0 4px rgba(220, 38, 38, 0.1);
}

.form-textarea,
.form-group textarea {
    resize: vertical;
    min-height: 120px;
    line-height: var(--line-height-relaxed);
}

.error-message {
    color: var(--color-error);
    font-size: var(--font-size-xs);
    margin-top: var(--space-1);
    display: none;
    animation: slideDown 0.3s var(--ease-out);
}

.error-message.show {
    display: block;
}

.char-count {
    text-align: right;
    font-size: var(--font-size-xs);
    color: var(--color-text-muted);
    margin-top: var(--space-1);
}

.char-count.has-error {
    color: var(--color-error);
}

/* Form feedback notifications */
.toast-notification {
    position: fixed;
    top: var(--space-5);
    right: var(--space-5);
    padding: var(--space-4) var(--space-6);
    border-radius: var(--radius-sm);
    color: var(--color-white);
    font-weight: var(--font-weight-semibold);
    z-index: var(--z-toast);
    transform: translateX(calc(100% + var(--space-5)));
    transition: transform var(--duration-slow) var(--ease-bounce);
    box-shadow: var(--shadow-lg);
    max-width: 400px;
}

.toast-notification.visible {
    transform: translateX(0);
}

.toast-notification--success {
    background-color: var(--color-success);
}
.toast-notification--error {
    background-color: var(--color-error);
}

/* Recovery message */
.recovery-message {
    background: var(--color-warning);
    color: #78350f;
    padding: var(--space-4);
    border-radius: var(--radius-sm);
    margin-bottom: var(--space-4);
    font-size: var(--font-size-sm);
    animation: slideDown 0.3s var(--ease-out);
    border-left: 4px solid #d97706;
}

.recovery-btn {
    margin-left: 10px;
    padding: 4px 8px;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: inherit;
    color: white;
}

.recovery-btn--load {
    background: var(--color-accent);
}

.recovery-btn--discard {
    background: #6b7280;
}

/* ============================================
   6. SECTIONS
   ============================================ */

/* Scroll margin for anchor targets to compensate fixed header */
#inicio,
#servicios,
#galeria,
#contacto {
    scroll-margin-top: var(--header-height);
}

/* Content visibility removed to fix rendering overlap bugs */

/* --- Header & Navigation --- */
.main-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    background: var(--glass-bg);
    backdrop-filter: var(--backdrop-blur);
    -webkit-backdrop-filter: var(--backdrop-blur);
    border-bottom: 1px solid var(--glass-border);
    z-index: var(--z-fixed);
    box-shadow: var(--shadow-xs);
    transition: var(--transition-base);
}

.main-header.scrolled {
    background: rgba(255, 255, 255, 0.95);
    height: var(--header-height-scrolled);
    box-shadow: var(--shadow-sm);
}

.header-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
    max-width: var(--container-max-width);
    margin-inline: auto;
    padding-inline: var(--container-padding);
}

.logo {
    display: flex;
    align-items: center;
}

.logo-text {
    font-family: var(--font-family-heading);
    font-size: var(--font-size-xl);
    font-weight: var(--font-weight-extrabold);
    color: var(--color-text-primary);
    letter-spacing: var(--letter-spacing-tight);
}

.nav-menu ul {
    display: flex;
    align-items: center;
    gap: var(--space-8);
}

.nav-link {
    font-family: var(--font-family-heading);
    font-weight: var(--font-weight-medium);
    font-size: var(--font-size-sm);
    color: var(--color-text-primary);
    position: relative;
    padding-block: var(--space-2);
    transition: var(--transition-base);
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--color-accent);
    transition: width var(--duration-slow) var(--ease-default);
}

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

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

.nav-btn {
    padding: var(--space-3) var(--space-6);
}

/* Mobile Menu */
.mobile-menu-btn {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 28px;
    height: 20px;
    background: transparent;
    border: none;
    cursor: pointer;
    z-index: calc(var(--z-fixed) + 10);
    border-radius: var(--radius-sm);
}

.mobile-menu-btn .bar {
    display: block;
    width: 100%;
    height: 2.5px;
    background: var(--color-primary-900);
    border-radius: 2px;
    transition: var(--transition-base);
}

.mobile-menu-btn.active .bar:nth-child(1) {
    transform: translateY(8.5px) rotate(45deg);
}
.mobile-menu-btn.active .bar:nth-child(2) {
    opacity: 0;
}
.mobile-menu-btn.active .bar:nth-child(3) {
    transform: translateY(-9px) rotate(-45deg);
}

.nav-menu {
    position: fixed;
    top: 0;
    right: -100%;
    width: 80%;
    max-width: 320px;
    height: 100vh;
    background: var(--color-bg-primary);
    box-shadow: -10px 0 30px rgba(0, 0, 0, 0.1);
    padding: calc(var(--header-height) + var(--space-8)) var(--space-8) var(--space-10);
    transition: var(--duration-slow) var(--ease-default);
    z-index: var(--z-modal);
    overflow-y: auto;
}

.nav-menu.open {
    right: 0;
}

.nav-menu {
    pointer-events: none;
}

.nav-menu.open {
    pointer-events: auto;
}

.nav-menu ul {
    pointer-events: auto;
}

.nav-menu::before {
    content: '';
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: -1;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition-base);
}

.nav-menu.open::before {
    opacity: 1;
    visibility: visible;
}

body.menu-open {
    overflow: hidden;
    position: fixed;
    width: 100%;
}

@media (max-width: 768px) {
    .mobile-menu-btn {
        display: flex;
    }
    .nav-menu ul {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--space-6);
    }
    .nav-link {
        font-size: var(--font-size-lg);
    }
    .nav-btn {
        width: 100%;
        margin-top: var(--space-4);
    }
}

/* --- Hero Section --- */
.hero {
    position: relative;
    padding-top: calc(var(--header-height) + var(--space-16));
    padding-bottom: var(--space-24);
    background: linear-gradient(135deg, var(--color-primary-900) 0%, var(--color-primary-600) 100%);
    color: var(--color-white);
    overflow: hidden;
}

.hero-overlay {
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 80% 20%, rgba(245, 158, 11, 0.15) 0%, transparent 60%);
    pointer-events: none;
}

.hero-content {
    position: relative;
    z-index: 10;
    max-width: 780px;
    text-align: center;
    margin-inline: auto;
}

.hero-subtitle {
    font-family: var(--font-family-heading);
    font-weight: var(--font-weight-semibold);
    text-transform: uppercase;
    letter-spacing: var(--letter-spacing-wider);
    color: var(--color-accent);
    font-size: var(--font-size-sm);
    display: inline-block;
    margin-bottom: var(--space-4);
    animation: fadeInDown 0.8s var(--ease-out);
}

.hero-title {
    font-size: var(--font-size-5xl);
    font-weight: var(--font-weight-extrabold);
    color: var(--color-white);
    margin-bottom: var(--space-6);
    animation: fadeInUp 0.8s var(--ease-out);
}

.hero-description {
    font-size: var(--font-size-lg);
    color: rgba(255, 255, 255, 0.88);
    margin-bottom: var(--space-10);
    font-weight: var(--font-weight-normal);
    line-height: var(--line-height-relaxed);
    animation: fadeInUp 0.9s var(--ease-out);
}

.hero-buttons {
    display: flex;
    justify-content: center;
    gap: var(--space-4);
    animation: fadeInUp 1s var(--ease-out);
}

@media (max-width: 768px) {
    .hero-title {
        font-size: var(--font-size-4xl);
    }
    .hero-description {
        font-size: var(--font-size-base);
    }
    .hero-buttons {
        flex-direction: column;
        gap: var(--space-3);
        align-items: stretch;
        padding-inline: var(--space-4);
    }
}

/* --- Section Headers --- */
.section-header {
    text-align: center;
    max-width: 650px;
    margin-inline: auto;
    margin-bottom: var(--space-16);
}

.section-tagline {
    font-family: var(--font-family-heading);
    font-weight: var(--font-weight-semibold);
    font-size: var(--font-size-xs);
    color: var(--color-accent);
    text-transform: uppercase;
    letter-spacing: var(--letter-spacing-wider);
    display: block;
    margin-bottom: var(--space-3);
}

.section-title {
    font-size: var(--font-size-3xl);
    font-weight: var(--font-weight-extrabold);
    margin-bottom: var(--space-4);
}

.section-desc {
    color: var(--color-text-secondary);
    font-size: var(--font-size-base);
}

@media (max-width: 768px) {
    .section-title {
        font-size: var(--font-size-2xl);
    }
}

/* --- Services Section --- */
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(350px, 100%), 1fr));
    gap: var(--space-8);
}

.service-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 60px;
    border-radius: var(--radius-sm);
    background: var(--color-accent-light);
    color: var(--color-accent);
    margin-bottom: var(--space-6);
    transition: var(--transition-base);
}

.service-icon svg {
    stroke: currentColor;
    fill: none;
}

.card:hover .service-icon,
.service-card:hover .service-icon {
    background: var(--color-accent);
    color: var(--color-primary-900);
}

.service-card-title {
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-bold);
    margin-bottom: var(--space-3);
}

.service-card-desc {
    color: var(--color-text-secondary);
    font-size: var(--font-size-sm);
    line-height: var(--line-height-relaxed);
}

/* --- Gallery Section --- */
.gallery-filters {
    display: flex;
    justify-content: center;
    gap: var(--space-3);
    margin-bottom: var(--space-10);
    flex-wrap: wrap;
}

.filter-btn {
    background: var(--color-bg-primary);
    border: 1px solid var(--color-border);
    color: var(--color-text-primary);
    font-family: var(--font-family-heading);
    font-weight: var(--font-weight-semibold);
    padding: var(--space-3) var(--space-6);
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: var(--transition-base);
}

.filter-btn:hover,
.filter-btn.active {
    background: var(--color-primary-900);
    color: var(--color-white);
    border-color: var(--color-primary-900);
    box-shadow: var(--shadow-sm);
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(340px, 100%), 1fr));
    gap: var(--space-8);
}

.gallery-item {
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    background: var(--color-bg-primary);
    transition: var(--transition-base);
}

.gallery-item:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.gallery-img-wrapper {
    position: relative;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    cursor: zoom-in;
}

.gallery-img-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s var(--ease-default);
    will-change: transform;
}

.gallery-hover-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(15, 23, 42, 0.85) 0%, rgba(15, 23, 42, 0.1) 100%);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: var(--space-6);
    opacity: 0;
    transition: var(--transition-base);
}

.zoom-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.8);
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-primary-900);
    box-shadow: var(--shadow-md);
    opacity: 0;
    transition: var(--transition-bounce);
}

.gallery-hover-title {
    color: var(--color-white);
    font-family: var(--font-family-heading);
    font-weight: var(--font-weight-semibold);
    font-size: var(--font-size-lg);
    transform: translateY(10px);
    transition: var(--transition-base);
}

.gallery-img-wrapper:hover img {
    transform: scale(1.08);
}
.gallery-img-wrapper:hover .gallery-hover-overlay {
    opacity: 1;
}
.gallery-img-wrapper:hover .zoom-icon {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}
.gallery-img-wrapper:hover .gallery-hover-title {
    transform: translateY(0);
}

/* --- Contact Section --- */
.contact-section {
    background: linear-gradient(135deg, var(--color-primary-950) 0%, var(--color-primary-900) 100%);
    color: var(--color-white);
}

.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-20);
    align-items: center;
}

.contact-desc {
    color: rgba(255, 255, 255, 0.82);
    font-size: var(--font-size-lg);
    margin-bottom: var(--space-10);
}

.contact-details {
    display: flex;
    flex-direction: column;
    gap: var(--space-8);
}

.contact-detail-item {
    display: flex;
    align-items: center;
    gap: var(--space-5);
}

.detail-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 54px;
    height: 54px;
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.08);
    color: var(--color-accent);
    flex-shrink: 0;
}

.detail-label {
    font-size: var(--font-size-xs);
    color: rgba(255, 255, 255, 0.58);
    text-transform: uppercase;
    letter-spacing: var(--letter-spacing-wide);
    margin-bottom: var(--space-1);
}

.detail-link {
    font-family: var(--font-family-heading);
    font-size: var(--font-size-xl);
    font-weight: var(--font-weight-semibold);
    color: var(--color-white);
}

.detail-link:hover {
    color: var(--color-accent);
}

.contact-card {
    background: var(--color-bg-primary);
    border-radius: var(--radius-lg);
    padding: var(--space-12);
    box-shadow: var(--shadow-premium);
    color: var(--color-text-primary);
}

.contact-form {
    display: flex;
    flex-direction: column;
    gap: var(--space-6);
}

.form-success-msg {
    display: none;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: var(--space-8) 0;
}

.success-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: var(--color-success-light);
    color: var(--color-success);
    font-size: var(--font-size-2xl);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: var(--space-6);
    animation: successPulse 0.6s var(--ease-bounce);
}

.form-success-msg h3 {
    margin-bottom: var(--space-3);
}
.form-success-msg p {
    color: var(--color-text-secondary);
}
.form-success-msg .btn-outline {
    margin-top: var(--space-5);
}

@media (max-width: 992px) {
    .contact-grid {
        grid-template-columns: 1fr;
        gap: var(--space-16);
    }
}

@media (max-width: 768px) {
    .contact-card {
        padding: var(--space-8) var(--space-6);
    }
}

/* --- Footer --- */
.main-footer {
    background: var(--color-primary-950);
    color: rgba(255, 255, 255, 0.68);
    padding: var(--space-20) 0 var(--space-8);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: var(--space-20);
    margin-bottom: var(--space-16);
}

.footer-brand .logo-text {
    margin-bottom: var(--space-5);
    display: inline-block;
    color: var(--color-white);
}

.footer-tagline {
    font-size: var(--font-size-sm);
    max-width: 450px;
}

.footer-links h4 {
    color: var(--color-white);
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-semibold);
    margin-bottom: var(--space-6);
}

.footer-links ul {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

.footer-links a:hover {
    color: var(--color-accent);
}

.footer-bottom {
    text-align: center;
    padding-top: var(--space-8);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    font-size: var(--font-size-xs);
}

@media (max-width: 768px) {
    .footer-grid {
        grid-template-columns: 1fr;
        gap: var(--space-10);
    }
}

/* --- Floating Elements --- */
.whatsapp-float {
    position: fixed;
    bottom: var(--space-8);
    right: var(--space-8);
    width: 60px;
    height: 60px;
    background: var(--color-whatsapp);
    color: var(--color-white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 20px rgba(34, 197, 94, 0.4);
    z-index: var(--z-fixed);
    transition: var(--transition-bounce);
    animation: pulse 2s infinite;
    will-change: transform;
}

.whatsapp-float svg {
    width: 32px;
    height: 32px;
    flex-shrink: 0;
}

.whatsapp-float:hover {
    transform: scale(1.1) rotate(10deg);
    background: hsl(142, 70%, 40%);
}

@keyframes pulse {
    0%,
    100% {
        box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7);
    }
    70% {
        box-shadow: 0 0 0 15px rgba(34, 197, 94, 0);
    }
}

.mobile-call-bar {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(8px);
    padding: var(--space-3) var(--space-6);
    box-shadow: 0 -4px 15px rgba(0, 0, 0, 0.1);
    z-index: calc(var(--z-fixed) - 1);
}

@media (max-width: 768px) {
    .mobile-call-bar {
        display: block;
    }
    .whatsapp-float {
        bottom: calc(var(--space-8) + 56px);
    }
    body {
        padding-bottom: 74px;
    }
}

/* --- Lightbox Modal --- */
.lightbox-modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.95);
    z-index: var(--z-modal);
    align-items: center;
    justify-content: center;
    user-select: none;
}

.lightbox-content {
    max-width: 90%;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.lightbox-content img {
    max-width: 100%;
    max-height: 75vh;
    border-radius: var(--radius-sm);
    object-fit: contain;
    box-shadow: var(--shadow-premium);
    transform: scale(0.95);
    opacity: 0;
    will-change: transform, opacity;
    transition:
        opacity 0.3s,
        transform 0.3s var(--ease-spring);
}

.lightbox-content img.visible {
    transform: scale(1);
    opacity: 1;
}

.lightbox-caption {
    color: var(--color-white);
    margin-top: var(--space-4);
    font-family: var(--font-family-heading);
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-medium);
}

.lightbox-close,
.lightbox-prev,
.lightbox-next {
    position: absolute;
    background: rgba(255, 255, 255, 0.12);
    border: none;
    color: var(--color-white);
    font-size: var(--font-size-2xl);
    cursor: pointer;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-base);
    backdrop-filter: blur(4px);
}

.lightbox-close:hover,
.lightbox-prev:hover,
.lightbox-next:hover {
    background: var(--color-accent);
    color: var(--color-primary-900);
}

.lightbox-close {
    top: var(--space-8);
    right: var(--space-8);
    font-size: var(--font-size-3xl);
}
.lightbox-prev {
    left: var(--space-8);
    top: 50%;
    transform: translateY(-50%);
}
.lightbox-next {
    right: var(--space-8);
    top: 50%;
    transform: translateY(-50%);
}

@media (max-width: 768px) {
    .lightbox-prev,
    .lightbox-next {
        width: 40px;
        height: 40px;
        font-size: var(--font-size-lg);
    }
    .lightbox-close {
        width: 40px;
        height: 40px;
        font-size: var(--font-size-2xl);
        top: var(--space-5);
        right: var(--space-5);
    }
    .lightbox-prev {
        left: var(--space-3);
    }
    .lightbox-next {
        right: var(--space-3);
    }
}

/* ============================================
   7. ANIMATIONS
   ============================================ */

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

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

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes successPulse {
    0%,
    100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.1);
        opacity: 0.85;
    }
}

@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

/* Staggered animations for form fields */
.form-group {
    animation: fadeInUp 0.6s var(--ease-out) both;
}
.form-group:nth-child(1) {
    animation-delay: 0.1s;
}
.form-group:nth-child(2) {
    animation-delay: 0.2s;
}
.form-group:nth-child(3) {
    animation-delay: 0.3s;
}
.form-group:nth-child(4) {
    animation-delay: 0.4s;
}
.form-group:nth-child(5) {
    animation-delay: 0.5s;
}

/* ============================================
   8. DARK MODE SUPPORT
   ============================================ */

@media (prefers-color-scheme: dark) {
    :root {
        --color-text-primary: hsl(210, 20%, 90%);
        --color-text-secondary: hsl(210, 14%, 65%);
        --color-text-muted: hsl(210, 10%, 50%);
        --color-bg-primary: hsl(222, 20%, 12%);
        --color-bg-secondary: hsl(222, 18%, 17%);
        --color-bg-tertiary: hsl(222, 15%, 22%);
        --color-border: hsl(210, 14%, 25%);
        --color-border-light: hsl(210, 14%, 20%);

        --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.2);
        --shadow-sm: 0 2px 4px -1px rgba(0, 0, 0, 0.3);
        --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.35);
        --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.4);

        --glass-bg: rgba(17, 24, 39, 0.85);
        --glass-border: rgba(255, 255, 255, 0.08);
    }

    .hero {
        background: linear-gradient(
            135deg,
            var(--color-primary-950) 0%,
            var(--color-primary-700) 100%
        );
    }

    .contact-section {
        background: linear-gradient(135deg, #000 0%, var(--color-primary-900) 100%);
    }

    /* Force all titles and logo text to be white in dark mode */
    h1,
    h2,
    h3,
    h4,
    h5,
    h6 {
        color: var(--color-white) !important;
    }

    .logo-text {
        color: var(--color-white) !important;
    }
}

/* ============================================
   9. PRINT STYLES
   ============================================ */

@media print {
    *,
    *::before,
    *::after {
        background: transparent !important;
        color: black !important;
        box-shadow: none !important;
        text-shadow: none !important;
    }

    .main-header,
    .whatsapp-float,
    .mobile-call-bar,
    .lightbox-modal,
    .btn,
    nav,
    .gallery-filters {
        display: none !important;
    }

    body {
        font-size: 12pt;
        line-height: 1.5;
        color: black;
        background: white;
    }

    .hero {
        padding: 20pt 0;
        background: none;
        color: black;
    }

    .hero-title,
    .hero-subtitle,
    .section-title {
        page-break-after: avoid;
    }

    .section-padding {
        padding: 20pt 0;
    }

    .card,
    .contact-card {
        break-inside: avoid;
        border: 1px solid #ccc;
        box-shadow: none;
    }

    .gallery-item {
        break-inside: avoid;
        page-break-inside: avoid;
    }

    a[href]::after {
        content: ' (' attr(href) ')';
        font-size: 0.8em;
    }

    img {
        max-width: 100% !important;
        page-break-inside: avoid;
    }
}

/* ============================================
   10. ADDITIONAL UTILITIES
   ============================================ */

.visually-hidden {
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    height: 1px;
    overflow: hidden;
    position: absolute;
    white-space: nowrap;
    width: 1px;
}

.no-scroll {
    overflow: hidden;
}
.text-center {
    text-align: center;
}
.text-left {
    text-align: left;
}
.text-right {
    text-align: right;
}

.mt-auto {
    margin-top: auto;
}
.mb-auto {
    margin-bottom: auto;
}
.mx-auto {
    margin-inline: auto;
}

/* ============================================
   11. MOBILE-FIRST RESPONSIVE DESIGN
   ============================================ */

/* --- Mobile Base Styles (< 480px) --- */
@media (max-width: 479px) {
    :root {
        --header-height: 64px;
        --header-height-scrolled: 56px;
        --container-padding: var(--space-4);
        --section-padding-y: var(--space-16);
    }

    html {
        font-size: 15px;
    }

    body {
        -webkit-text-size-adjust: 100%;
        -webkit-tap-highlight-color: transparent;
        touch-action: pan-x pan-y;
    }

    /* Larger touch targets for mobile */
    .btn {
        min-height: 48px;
        min-width: 48px;
        padding: var(--space-4) var(--space-6);
    }

    .filter-btn {
        min-height: 44px;
        padding: var(--space-3) var(--space-5);
        font-size: var(--font-size-xs);
    }

    .nav-link {
        padding-block: var(--space-3);
        font-size: var(--font-size-lg);
    }

    /* Mobile-specific spacing */
    .hero {
        padding-top: calc(var(--header-height) + var(--space-12));
        padding-bottom: var(--space-16);
    }

    .hero-title {
        font-size: clamp(1.75rem, 8vw, 2.25rem);
        letter-spacing: -0.02em;
    }

    .hero-description {
        font-size: var(--font-size-base);
        line-height: var(--line-height-relaxed);
    }

    /* Mobile gallery - single column */
    .gallery-grid {
        grid-template-columns: 1fr;
        gap: var(--space-4);
    }

    .gallery-img-wrapper {
        aspect-ratio: 4 / 3;
    }

    /* Mobile form adjustments */
    .contact-card {
        padding: var(--space-6) var(--space-4);
        border-radius: var(--radius-md);
    }

    .form-input,
    .form-textarea,
    .form-group input,
    .form-group textarea {
        padding: var(--space-4);
        font-size: 16px; /* Prevent iOS zoom on focus */
    }

    /* Mobile service cards */
    .services-grid {
        grid-template-columns: 1fr;
        gap: var(--space-5);
    }

    .card {
        padding: var(--space-6);
    }

    /* Mobile footer */
    .footer-grid {
        grid-template-columns: 1fr;
        gap: var(--space-10);
    }

    .main-footer {
        padding: var(--space-16) 0 var(--space-6);
    }

    /* Mobile floating elements */
    .whatsapp-float {
        width: 56px;
        height: 56px;
        bottom: calc(var(--space-8) + 60px);
        right: var(--space-4);
        box-shadow: 0 4px 12px rgba(34, 197, 94, 0.35);
    }

    .mobile-call-bar {
        padding: var(--space-3) var(--space-4);
        box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.08);
    }

    body {
        padding-bottom: 70px;
    }

    /* Mobile section headers */
    .section-header {
        margin-bottom: var(--space-10);
    }

    .section-title {
        font-size: var(--font-size-2xl);
    }

    /* Mobile contact section */
    .contact-grid {
        gap: var(--space-12);
    }

    .contact-detail-item {
        gap: var(--space-4);
    }

    .detail-icon {
        width: 48px;
        height: 48px;
    }

    .detail-link {
        font-size: var(--font-size-lg);
    }

    /* Mobile lightbox */
    .lightbox-content img {
        max-height: 60vh;
        border-radius: var(--radius-sm);
    }

    .lightbox-close,
    .lightbox-prev,
    .lightbox-next {
        width: 40px;
        height: 40px;
        font-size: var(--font-size-xl);
    }

    .lightbox-close {
        top: var(--space-4);
        right: var(--space-4);
    }
    .lightbox-prev {
        left: var(--space-2);
    }
    .lightbox-next {
        right: var(--space-2);
    }

    /* Mobile text sizes */
    .hero-subtitle {
        font-size: var(--font-size-xs);
        letter-spacing: 0.08em;
    }

    .service-card-title {
        font-size: var(--font-size-base);
    }

    .gallery-hover-title {
        font-size: var(--font-size-base);
    }

    /* Mobile error messages */
    .error-message {
        font-size: var(--font-size-xs);
    }

    /* Mobile recovery message */
    .recovery-message {
        font-size: var(--font-size-xs);
        padding: var(--space-3);
    }
}

/* --- Small Tablets (480px - 767px) --- */
@media (min-width: 480px) and (max-width: 767px) {
    :root {
        --container-padding: var(--space-5);
        --section-padding-y: var(--space-20);
    }

    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-5);
    }

    .services-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-6);
    }

    .hero-title {
        font-size: var(--font-size-4xl);
    }

    .whatsapp-float {
        bottom: calc(var(--space-8) + 64px);
    }
}

/* --- Tablets (768px - 1023px) --- */
@media (min-width: 768px) and (max-width: 1023px) {
    :root {
        --header-height: 72px;
        --header-height-scrolled: 64px;
    }

    .services-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .nav-menu {
        width: 70%;
        max-width: 280px;
    }

    .mobile-call-bar {
        display: none !important;
    }

    .whatsapp-float {
        bottom: var(--space-8);
    }

    body {
        padding-bottom: 0;
    }
}

/* --- Desktop (1024px+) --- */
@media (min-width: 1024px) {
    .main-header.scrolled {
        background: rgba(255, 255, 255, 0.98);
    }

    .services-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .gallery-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* --- Large Desktop (1280px+) --- */
@media (min-width: 1280px) {
    :root {
        --container-max-width: 1240px;
    }

    .services-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
    }
}

/* ============================================
   12. TOUCH & INTERACTION OPTIMIZATIONS
   ============================================ */

/* Touch device detection */
@media (hover: none) and (pointer: coarse) {
    /* Remove hover effects on touch devices */
    .card:hover {
        transform: none;
        box-shadow: var(--shadow-sm);
    }

    .card:active {
        transform: scale(0.98);
        transition: transform 0.1s ease;
    }

    .gallery-item:hover {
        transform: none;
    }

    .gallery-item:active {
        transform: scale(0.98);
    }

    .btn:hover {
        transform: none;
    }

    .btn:active {
        transform: scale(0.96);
    }

    .nav-link::after {
        display: none;
    }

    /* Show tap feedback */
    .filter-btn:active,
    .nav-link:active {
        background: rgba(245, 158, 11, 0.15);
        border-radius: var(--radius-sm);
    }

    /* Better touch scrolling */
    .nav-menu {
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
    }

    /* Gallery hover states for touch */
    .gallery-hover-overlay {
        opacity: 0.85;
        background: linear-gradient(to top, rgba(15, 23, 42, 0.9) 0%, transparent 100%);
    }

    .zoom-icon {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }

    .gallery-hover-title {
        transform: translateY(0);
        opacity: 1;
    }
}

/* High DPI / Retina displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .logo-text {
        -webkit-font-smoothing: subpixel-antialiased;
    }

    .hero-title,
    .section-title {
        -webkit-font-smoothing: antialiased;
    }

    /* Sharper borders on retina */
    .card,
    .contact-card,
    .form-input,
    .form-textarea,
    .form-group input,
    .form-group textarea {
        border-width: 0.5px;
    }
}

/* Landscape orientation on mobile */
@media (max-height: 500px) and (orientation: landscape) {
    .hero {
        min-height: 100vh;
        padding-top: calc(var(--header-height-scrolled) + var(--space-4));
        padding-bottom: var(--space-4);
    }

    .hero-content {
        padding: var(--space-4);
    }

    .hero-title {
        font-size: var(--font-size-2xl);
        margin-bottom: var(--space-3);
    }

    .hero-description {
        font-size: var(--font-size-sm);
        margin-bottom: var(--space-4);
        display: none;
    }

    .hero-buttons {
        flex-direction: row;
        gap: var(--space-3);
    }

    .hero-buttons .btn {
        padding: var(--space-3) var(--space-5);
        font-size: var(--font-size-sm);
    }

    .section-padding {
        padding: var(--space-10) 0;
    }

    .main-header {
        height: var(--header-height-scrolled);
    }
}

/* Safe area insets for notched devices */
@supports (padding: env(safe-area-inset-bottom)) {
    .mobile-call-bar {
        padding-bottom: env(safe-area-inset-bottom);
        padding-left: env(safe-area-inset-left);
        padding-right: env(safe-area-inset-right);
    }

    .whatsapp-float {
        bottom: calc(env(safe-area-inset-bottom) + var(--space-8));
    }

    body {
        padding-bottom: calc(env(safe-area-inset-bottom) + 74px);
    }

    @media (max-width: 768px) {
        body {
            padding-bottom: calc(env(safe-area-inset-bottom) + 74px);
        }
    }
}

/* ============================================
   13. MOBILE PERFORMANCE OPTIMIZATIONS
   ============================================ */

/* GPU acceleration only when needed */
@media (max-width: 768px) {
    .hero-overlay,
    .gallery-hover-overlay,
    .lightbox-modal {
        will-change: auto;
        transform: translateZ(0);
    }

    /* Reduce animations on low-end devices */
    @media (prefers-reduced-motion: reduce) or (max-width: 480px) {
        .hero-subtitle,
        .hero-title,
        .hero-description,
        .hero-buttons {
            animation: none;
            opacity: 1;
            transform: none;
        }

        .card,
        .gallery-item {
            animation: none;
            opacity: 1;
            transform: none;
        }

        .form-group {
            animation: none;
            opacity: 1;
            transform: none;
        }
    }
}

/* Mobile network conditions */
@media (max-width: 768px) and (prefers-reduced-data: reduce) {
    .hero-overlay {
        display: none;
    }

    .gallery-hover-overlay {
        display: none;
    }

    .whatsapp-float {
        animation: none;
        box-shadow: var(--shadow-md);
    }
}

/* ============================================
   13. MOBILE PERFORMANCE & UX OPTIMIZATIONS
   ============================================ */

/* iOS Safari safe area support for notched devices */
@supports (padding: env(safe-area-inset-top)) {
    .main-header,
    .mobile-call-bar {
        padding-left: env(safe-area-inset-left);
        padding-right: env(safe-area-inset-right);
    }

    .main-header {
        padding-top: env(safe-area-inset-top);
        height: calc(var(--header-height) + env(safe-area-inset-top));
    }

    .main-header.scrolled {
        height: calc(var(--header-height-scrolled) + env(safe-area-inset-top));
    }

    .mobile-call-bar {
        padding-bottom: env(safe-area-inset-bottom);
    }

    .whatsapp-float {
        bottom: calc(var(--space-8) + env(safe-area-inset-bottom));
    }

    @media (max-width: 768px) {
        .whatsapp-float {
            bottom: calc(var(--space-8) + 56px + env(safe-area-inset-bottom));
        }
    }

    .gallery-content {
        padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom)
            env(safe-area-inset-left);
    }
}

@supports (padding: constant(safe-area-inset-top)) {
    .main-header,
    .mobile-call-bar {
        padding-left: constant(safe-area-inset-left);
        padding-right: constant(safe-area-inset-right);
    }

    .main-header {
        padding-top: constant(safe-area-inset-top);
    }

    .mobile-call-bar {
        padding-bottom: constant(safe-area-inset-bottom);
    }
}

/* Prevent text size adjustment on orientation change */
html {
    -webkit-text-size-adjust: 100%;
}

/* Prevent callout on long press in iOS */
img,
a {
    -webkit-touch-callout: none;
}

/* Smooth scrolling for anchor links on mobile */
@media (prefers-reduced-motion: no-preference) {
    html {
        scroll-behavior: smooth;
    }
}

/* Better touch targets for mobile */
@media (hover: none) and (pointer: coarse) {
    .nav-link,
    .filter-btn,
    .btn,
    .gallery-img-wrapper,
    .detail-link,
    .whatsapp-float {
        min-height: 44px;
    }

    .btn {
        padding: var(--space-4) var(--space-6);
    }

    .filter-btn {
        padding: var(--space-3) var(--space-5);
    }

    .nav-link {
        padding: var(--space-3) var(--space-2);
    }

    .gallery-img-wrapper {
        min-height: 200px;
    }

    .contact-detail-item {
        padding: var(--space-3) 0;
    }

    /* Increase touch area for lightbox buttons */
    .lightbox-prev,
    .lightbox-next {
        width: 56px;
        height: 56px;
    }

    .lightbox-prev {
        left: var(--space-2);
    }

    .lightbox-next {
        right: var(--space-2);
    }
}

/* Prevent zoom on input focus for iOS */
@media screen and (max-width: 768px) {
    input,
    textarea,
    select {
        font-size: 16px;
    }
}

/* Mobile-specific card improvements */
@media (max-width: 480px) {
    .card {
        padding: var(--space-6);
    }

    .service-icon {
        width: 48px;
        height: 48px;
    }

    .service-icon svg {
        width: 20px;
        height: 20px;
    }

    .gallery-grid {
        gap: var(--space-4);
    }

    .gallery-filters {
        gap: var(--space-2);
        padding: 0 var(--space-2);
    }

    .filter-btn {
        font-size: var(--font-size-xs);
        padding: var(--space-2) var(--space-4);
    }

    .contact-card {
        padding: var(--space-6) var(--space-4);
    }

    .section-padding {
        padding: var(--space-16) 0;
    }
}

/* Mobile bottom sheet behavior for filter buttons */
@media (max-width: 480px) {
    .gallery-filters {
        position: sticky;
        top: var(--header-height);
        background: var(--color-bg-secondary);
        padding: var(--space-3) var(--space-4);
        z-index: var(--z-sticky);
        margin: 0 calc(-1 * var(--container-padding)) var(--space-6);
        width: calc(100% + var(--container-padding) * 2);
        overflow-x: auto;
        flex-wrap: nowrap;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        gap: var(--space-2);
    }

    .gallery-filters::-webkit-scrollbar {
        display: none;
    }

    .filter-btn {
        white-space: nowrap;
        flex-shrink: 0;
    }
}

/* ============================================
   14. MOBILE ACCESSIBILITY ENHANCEMENTS
   ============================================ */

@media (max-width: 768px) {
    /* Larger focus indicators for touch */
    *:focus-visible {
        outline-width: 3px;
        outline-offset: 2px;
    }

    /* Skip link positioning for mobile */
    .skip-link {
        top: -50px;
        left: var(--space-2);
        right: var(--space-2);
        border-radius: 0 0 var(--radius-sm) var(--radius-sm);
        font-size: var(--font-size-sm);
        text-align: center;
    }

    /* Form labels always visible on mobile */
    .form-group label {
        position: static;
        transform: none;
    }

    /* Error messages more prominent on mobile */
    .error-message {
        font-size: var(--font-size-sm);
        padding: var(--space-2);
        background: var(--color-error-light);
        border-radius: var(--radius-sm);
        margin-top: var(--space-2);
        border-left: 3px solid var(--color-error);
    }

    /* Mobile menu accessibility */
    .nav-menu.open {
        position: fixed;
        inset: 0;
        width: 100%;
        max-width: 100%;
        z-index: var(--z-modal);
    }

    .nav-menu.open ul {
        padding: var(--space-20) var(--space-6) var(--space-6);
        justify-content: flex-start;
    }

    /* Mobile button sizing */
    .btn-primary.nav-btn {
        width: 100%;
        margin-top: var(--space-4);
        text-align: center;
    }
}

/* Dark mode mobile enhancements */
@media (prefers-color-scheme: dark) and (max-width: 768px) {
    .mobile-call-bar {
        background: rgba(17, 24, 39, 0.95);
        color: var(--color-white);
    }

    .nav-menu {
        background: var(--color-bg-primary);
    }

    .recovery-message {
        background: #78350f;
        color: #fef3c7;
    }
}
