/* =====================================================
   L'Atelier De L'Art - Responsive Styles
   Mobile-First Responsive Design - Enhanced
   ===================================================== */

/* === GLOBAL MOBILE FIX === */
@media (max-width: 768px) {

    html,
    body {
        overflow-x: hidden !important;
        width: 100% !important;
        max-width: 100vw !important;
    }

    .hero-frame,
    .hero-frame-ornament {
        display: none !important;
    }

    main,
    section,
    .container {
        overflow-x: hidden;
        max-width: 100%;
    }
}

/* === MOBILE MENU === */
.mobile-menu {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: rgba(26, 25, 23, 0.98);
    backdrop-filter: blur(20px);
    z-index: 999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2rem;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s ease;
}

.mobile-menu.active {
    opacity: 1;
    visibility: visible;
}

.mobile-menu a {
    font-size: 1.5rem;
    color: var(--text-cream);
    text-transform: uppercase;
    letter-spacing: 0.2em;
    padding: 1rem 2rem;
    transition: color 0.3s;
}

.mobile-menu a:hover {
    color: var(--accent-gold);
}

.mobile-menu-close {
    position: absolute;
    top: 2rem;
    right: 2rem;
    width: 50px;
    height: 50px;
    background: transparent;
    border: 1px solid var(--border-subtle);
    color: var(--accent-gold);
    font-size: 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
}

/* === LARGE TABLETS & SMALL DESKTOPS (max-width: 1200px) === */
@media (max-width: 1200px) {
    .services-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .process-steps {
        grid-template-columns: repeat(2, 1fr);
    }

    .process-step:nth-child(2) {
        border-right: none;
    }

    .process-step:nth-child(1),
    .process-step:nth-child(2) {
        border-bottom: 1px solid var(--border-subtle);
    }

    .partners-grid,
    .clients-grid {
        gap: 1.5rem;
    }

    .partner-logo {
        width: calc(33.333% - 1rem);
        min-width: 180px;
    }
}

/* === TABLETS (max-width: 992px) === */
@media (max-width: 992px) {
    :root {
        --container-padding: 4vw;
        --section-gap: 8vh;
    }

    .philosophy-content {
        grid-template-columns: 1fr;
        gap: 3rem;
    }

    .philosophy-image {
        order: -1;
    }

    .philosophy-image-frame img {
        height: 300px;
    }

    .contact-grid {
        grid-template-columns: 1fr;
        gap: 4rem;
    }

    .partner-logo {
        width: calc(50% - 1rem);
        min-width: 150px;
    }

    .portfolio-item,
    .portfolio-item.tall,
    .portfolio-item.wide {
        grid-column: span 6;
    }
}

/* === SMALL TABLETS & LARGE PHONES (max-width: 900px) === */
@media (max-width: 900px) {
    :root {
        --container-padding: 5vw;
        --section-gap: 8vh;
    }

    .heading-xl {
        font-size: 3rem;
    }

    .hero-logo-img {
        max-width: 350px;
    }

    .philosophy-content {
        grid-template-columns: 1fr;
        gap: 3rem;
    }

    .philosophy-image {
        order: -1;
    }

    .process-steps {
        grid-template-columns: 1fr;
    }

    .process-step {
        border-right: none;
        border-bottom: 1px solid var(--border-subtle);
        padding: 2rem 1.5rem;
    }

    .process-step:last-child {
        border-bottom: none;
    }

    .services-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .portfolio-item,
    .portfolio-item.tall,
    .portfolio-item.wide {
        grid-column: span 12;
        aspect-ratio: 4/3;
    }

    .contact-grid {
        grid-template-columns: 1fr;
        gap: 3rem;
    }

    .nav-links {
        display: none;
    }

    .mobile-menu-btn {
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .hero-frame {
        inset: 20px;
    }

    .hero-frame-corner {
        width: 35px;
        height: 35px;
    }

    .portfolio-header {
        flex-direction: column;
        align-items: center;
        gap: 1.5rem;
        text-align: center;
    }

    .footer-content {
        flex-direction: column;
        gap: 2rem;
        text-align: center;
    }

    .footer-links {
        order: -1;
        flex-wrap: wrap;
        justify-content: center;
    }
}

/* === PHONES (max-width: 768px) === */
@media (max-width: 768px) {
    :root {
        --container-padding: 5vw;
        --section-gap: 6vh;
    }

    /* Navigation */
    nav {
        padding: 0.8rem var(--container-padding);
    }

    nav.scrolled {
        padding: 0.6rem var(--container-padding);
    }

    .nav-logo-img {
        height: 28px;
    }

    /* Hero Section */
    .hero {
        min-height: 100vh;
        min-height: 100dvh;
        padding-top: 60px;
    }

    .hero-content {
        padding: 1rem;
    }

    .hero-frame {
        inset: 15px;
    }

    .hero-frame-corner {
        width: 25px;
        height: 25px;
    }

    .hero-frame-ornament {
        font-size: 1rem;
        display: none;
    }

    .hero-logo-img {
        max-width: 260px;
        width: 75vw;
    }

    .hero-subtitle {
        font-size: 0.8rem;
        gap: 0.8rem;
        flex-wrap: wrap;
        justify-content: center;
        margin-bottom: 1rem;
    }

    .hero-subtitle-line {
        width: 20px;
        display: none;
    }

    .hero-tagline {
        font-size: 0.65rem;
        letter-spacing: 0.15em;
        margin-top: 1.5rem;
        margin-bottom: 2rem;
    }

    .btn-luxury {
        padding: 1rem 2rem;
        font-size: 0.65rem;
        letter-spacing: 0.15em;
    }

    .scroll-indicator {
        bottom: 20px;
    }

    .scroll-indicator span {
        font-size: 0.5rem;
    }

    .scroll-indicator-line {
        height: 30px;
    }

    /* Sections padding */
    .philosophy-section,
    .process-section,
    .services-section,
    .quote-section,
    .partners-section,
    .portfolio-section,
    .contact-section {
        padding: var(--section-gap) 0;
    }

    /* Philosophy */
    .philosophy-text {
        text-align: center;
    }

    .philosophy-image-frame {
        padding: 10px;
    }

    .philosophy-image-frame::before {
        transform: translate(8px, 8px);
    }

    .philosophy-image-frame img {
        height: 220px;
    }

    .featured-quote {
        font-size: 1rem;
        padding: 1.5rem 0;
        text-align: center;
    }

    .featured-quote::before {
        font-size: 2.5rem;
        left: 50%;
        transform: translateX(-50%);
        top: -15px;
    }

    /* Typography */
    .heading-lg {
        font-size: 1.8rem;
        margin-bottom: 1rem;
    }

    .heading-md {
        font-size: 0.8rem;
        letter-spacing: 0.15em;
    }

    .text-body {
        font-size: 0.9rem;
        line-height: 1.7;
    }

    /* Section Headers */
    .section-header {
        margin-bottom: 2.5rem;
    }

    /* Process Section */
    .process-steps {
        border: none;
    }

    .process-step {
        padding: 1.5rem;
        text-align: center;
    }

    .step-number {
        font-size: 2.5rem;
        margin-bottom: 1rem;
    }

    .step-icon {
        margin: 0 auto 1rem;
    }

    .step-title {
        font-size: 1rem;
    }

    .step-desc {
        font-size: 0.85rem;
    }

    /* Services */
    .service-card {
        padding: 1.5rem;
        min-height: auto;
    }

    .service-icon-wrapper {
        width: 65px;
        height: 65px;
        margin-bottom: 1rem;
    }

    .service-icon-box {
        width: 45px;
        height: 45px;
        margin-top: -22.5px;
        margin-left: -22.5px;
    }

    .service-icon {
        font-size: 1.1rem;
    }

    .service-title {
        font-size: 1rem;
        margin-bottom: 0.5rem;
    }

    .service-desc {
        font-size: 0.8rem;
        line-height: 1.5;
    }

    /* Quote Section */
    .quote-content {
        padding: 0 1rem;
    }

    .quote-text {
        font-size: 1.2rem;
        line-height: 1.6;
    }

    .quote-marks {
        font-size: 4rem;
        opacity: 0.1;
    }

    .quote-marks.open {
        top: -20px;
        left: 0;
    }

    .quote-marks.close {
        right: 0;
    }

    .quote-author {
        font-size: 0.75rem;
        margin-top: 1.5rem;
    }

    /* Partners/Clients */
    .partners-grid,
    .clients-grid {
        gap: 0.8rem;
    }

    .partner-logo {
        width: calc(50% - 0.4rem);
        min-width: unset;
        padding: 1rem 0.8rem;
        min-height: 70px;
    }

    .partner-logo img {
        max-width: 100px;
        max-height: 40px;
    }

    /* Contact */
    .contact-info {
        text-align: center;
    }

    .contact-divider {
        margin: 1.5rem auto;
    }

    .contact-details {
        gap: 1.2rem;
        margin-top: 2rem;
    }

    .contact-item {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 0.8rem;
    }

    .contact-item-icon {
        width: 45px;
        height: 45px;
    }

    .contact-item-content h4 {
        font-size: 0.7rem;
    }

    .contact-item-content p {
        font-size: 0.9rem;
    }

    .social-links {
        justify-content: center;
        gap: 0.8rem;
        margin-top: 2rem;
    }

    .social-link {
        width: 45px;
        height: 45px;
    }

    /* Contact Form */
    .form-group {
        margin-bottom: 1.5rem;
    }

    .form-control {
        padding: 1rem 0;
        font-size: 0.9rem;
    }

    /* Portfolio */
    .portfolio-grid {
        gap: 1rem;
    }

    .portfolio-overlay {
        opacity: 1;
        transform: translateY(0);
        padding: 1.5rem 1rem 1rem;
    }

    .portfolio-category {
        font-size: 0.6rem;
    }

    .portfolio-title {
        font-size: 1rem;
    }

    .portfolio-frame {
        display: none;
    }

    /* Footer */
    footer {
        padding: 2.5rem var(--container-padding) 1.5rem;
    }

    .footer-logo img {
        height: 22px;
    }

    .footer-text {
        font-size: 0.65rem;
    }

    .footer-links {
        gap: 1rem;
    }

    .footer-links a {
        font-size: 0.65rem;
    }

    /* Ornament Dividers */
    .ornament-divider {
        margin: 2rem 0;
    }

    .ornament-divider::before,
    .ornament-divider::after {
        width: 40px;
    }

    .ornament-icon {
        margin: 0 0.8rem;
        font-size: 0.9rem;
    }

    .section-divider {
        height: 50px;
    }

    .section-divider-ornament i {
        font-size: 1rem;
    }

    /* Marquee */
    .marquee {
        padding: 2rem 0;
    }

    .client-name {
        font-size: 1.2rem;
    }

    .marquee-item {
        margin: 0 1.5rem;
    }

    .marquee-divider {
        font-size: 0.6rem;
        margin: 0 1rem;
    }
}

/* === SMALL PHONES (max-width: 480px) === */
@media (max-width: 480px) {
    :root {
        --container-padding: 4vw;
        --section-gap: 5vh;
    }

    .heading-xl {
        font-size: 2.2rem;
    }

    .heading-lg {
        font-size: 1.5rem;
    }

    .hero-logo-img {
        max-width: 200px;
        width: 70vw;
    }

    .hero-subtitle {
        font-size: 0.7rem;
    }

    .hero-tagline {
        font-size: 0.6rem;
    }

    .btn-luxury {
        padding: 0.9rem 1.8rem;
        font-size: 0.6rem;
        width: 100%;
        max-width: 280px;
    }

    /* Process */
    .step-number {
        font-size: 2rem;
    }

    .step-title {
        font-size: 0.95rem;
    }

    /* Services */
    .service-card {
        padding: 1.2rem;
    }

    .service-icon-wrapper {
        width: 55px;
        height: 55px;
    }

    .service-icon-box {
        width: 40px;
        height: 40px;
        margin-top: -20px;
        margin-left: -20px;
    }

    .service-icon {
        font-size: 1rem;
    }

    .service-title {
        font-size: 0.9rem;
    }

    .service-desc {
        font-size: 0.75rem;
    }

    /* Quote */
    .quote-text {
        font-size: 1rem;
    }

    .quote-author {
        font-size: 0.7rem;
    }

    /* Partners */
    .partner-logo {
        padding: 0.8rem 0.5rem;
        min-height: 60px;
    }

    .partner-logo img {
        max-width: 80px;
        max-height: 35px;
    }

    /* Philosophy */
    .philosophy-image-frame img {
        height: 180px;
    }

    .featured-quote {
        font-size: 0.9rem;
    }

    /* Contact */
    .contact-item-icon {
        width: 40px;
        height: 40px;
        font-size: 0.9rem;
    }

    .social-link {
        width: 40px;
        height: 40px;
    }

    /* Footer */
    .footer-links {
        flex-direction: column;
        gap: 0.8rem;
    }
}

/* === EXTRA SMALL PHONES (max-width: 360px) === */
@media (max-width: 360px) {
    :root {
        --container-padding: 3.5vw;
    }

    .heading-xl {
        font-size: 1.8rem;
    }

    .heading-lg {
        font-size: 1.3rem;
    }

    .hero-logo-img {
        max-width: 160px;
    }

    .hero-frame {
        inset: 10px;
    }

    .hero-frame-corner {
        width: 20px;
        height: 20px;
    }

    .hero-subtitle {
        font-size: 0.65rem;
    }

    .hero-tagline {
        font-size: 0.55rem;
    }

    .btn-luxury {
        padding: 0.8rem 1.5rem;
        font-size: 0.55rem;
    }

    .service-title {
        font-size: 0.85rem;
    }

    .step-number {
        font-size: 1.8rem;
    }

    .quote-text {
        font-size: 0.9rem;
    }
}

/* === RTL RESPONSIVE ADJUSTMENTS === */
@media (max-width: 768px) {
    html[dir="rtl"] .portfolio-header {
        align-items: center;
    }

    html[dir="rtl"] .hero-subtitle {
        flex-direction: row-reverse;
    }

    html[dir="rtl"] .contact-item {
        flex-direction: column;
    }

    html[dir="rtl"] .philosophy-text {
        text-align: center;
    }

    html[dir="rtl"] .contact-info {
        text-align: center;
    }
}

/* === LANDSCAPE PHONES === */
@media (max-height: 500px) and (orientation: landscape) {
    .hero {
        min-height: 100vh;
        padding: 60px 0 30px;
    }

    .hero-content {
        padding: 0.5rem;
    }

    .hero-logo-img {
        max-width: 180px;
    }

    .hero-subtitle {
        font-size: 0.7rem;
        margin-bottom: 0.5rem;
    }

    .hero-tagline {
        margin-top: 0.5rem;
        margin-bottom: 1rem;
    }

    .btn-luxury {
        padding: 0.8rem 1.5rem;
    }

    .scroll-indicator {
        display: none;
    }

    .hero-frame {
        display: none;
    }
}

/* === TOUCH DEVICE OPTIMIZATIONS === */
@media (hover: none) and (pointer: coarse) {

    /* Remove hover effects for touch devices */
    .cursor,
    .cursor-follower {
        display: none !important;
    }

    body {
        cursor: auto;
    }

    /* Increase tap targets */
    .btn-luxury {
        min-height: 48px;
    }

    .social-link {
        min-width: 48px;
        min-height: 48px;
    }

    .nav-links a {
        padding: 10px 15px;
    }

    .mobile-menu-btn {
        min-width: 48px;
        min-height: 48px;
    }

    /* Adjust hover states for touch - keep natural logo colors */
    .partner-logo img {
        opacity: 1;
    }

    .service-card:active {
        transform: scale(0.98);
        border-color: var(--accent-gold);
    }

    .portfolio-overlay {
        opacity: 1;
        transform: translateY(0);
        background: linear-gradient(to top, rgba(0, 0, 0, 0.85) 0%, rgba(0, 0, 0, 0.4) 60%, transparent 100%);
    }

    /* Better touch feedback */
    .btn-luxury:active {
        transform: scale(0.97);
    }

    .social-link:active {
        background: var(--accent-gold);
        color: var(--bg-deep);
    }
}

/* === HIGH DPI SCREENS === */
@media (-webkit-min-device-pixel-ratio: 2),
(min-resolution: 192dpi) {

    .hero-logo-img,
    .nav-logo-img,
    .footer-logo img {
        image-rendering: -webkit-optimize-contrast;
    }
}

/* === REDUCE MOTION FOR ACCESSIBILITY === */
@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .marquee-content {
        animation: none;
    }

    .pattern-overlay,
    .pattern-overlay-secondary {
        animation: none;
    }
}

/* === SAFE AREA INSETS FOR NOTCHED PHONES === */
@supports (padding: max(0px)) {
    @media (max-width: 768px) {
        nav {
            padding-left: max(var(--container-padding), env(safe-area-inset-left));
            padding-right: max(var(--container-padding), env(safe-area-inset-right));
        }

        .hero {
            padding-top: max(60px, env(safe-area-inset-top));
        }

        footer {
            padding-bottom: max(1.5rem, env(safe-area-inset-bottom));
        }

        .container {
            padding-left: max(var(--container-padding), env(safe-area-inset-left));
            padding-right: max(var(--container-padding), env(safe-area-inset-right));
        }
    }
}