/* ###########################################################
   ###   2418521        Antony O'Neill                     ###
   ###   TEMPUS PRIVÉ - MOBILE OVERRIDES STYLING MODULE    ###
   ###   Last Updated: 08-07-2025                          ###
   ########################################################### */

/*
===============================================
Removes animations on touch devices while
maintaining exact desktop layout in final state
Enhances touch targets and improves mobile UX
for luxury watch clientele on premium devices
EXCEPTION: Collection cards retain animations for luxury feel
===============================================
*/

/* ###########################################################
   ###   1. CSS CUSTOM PROPERTIES - Mobile Specific        ###
   ########################################################### */

   :root {
    /* ====== Touch Target Sizes ====== */
    --touch-target-min: 44px;  /* iOS Human Interface Guidelines */
    --touch-target-comfort: 48px;  /* Material Design recommendation */
    
    /* ====== Mobile Transitions ====== */
    --mobile-transition-instant: 0.01ms;  /* For reduced motion */
    --mobile-transition-fast: 150ms ease-out;
    
    /* ====== Mobile Spacing Adjustments ====== */
    --mobile-padding-reduction: 0.85;  /* 85% of desktop padding */
    --mobile-gap-reduction: 0.75;  /* 75% of desktop gaps */
}

/* ###########################################################
   ###   2. GLOBAL MOBILE & TABLET OVERRIDES               ###
   ########################################################### */

/* ====== Primary Touch Device Detection ====== */
@media (max-width: 1024px), (hover: none) and (pointer: coarse) {
    
    /* ===== Remove MOST Animations & Transitions ===== */
    /* Prevents janky animations on lower-powered mobile devices */
    /* EXCEPTION: Collection cards are excluded from this rule */
    *:not(.product-card):not(.hero-watch):not(.luxury-product-card):not(.btn-add-collection):not(.watch-card),
    *:not(.product-card):not(.hero-watch):not(.luxury-product-card):not(.btn-add-collection):not(.watch-card)::before,
    *:not(.product-card):not(.hero-watch):not(.luxury-product-card):not(.btn-add-collection):not(.watch-card)::after {
        /* Override any component-specific animations */
        animation-duration: var(--mobile-transition-instant) !important;
        animation-delay: 0s !important;
        transition-duration: var(--mobile-transition-instant) !important;
        transition-delay: 0s !important;
    }
    
    /* Maintain smooth scrolling - critical for luxury UX */
    html {
        scroll-behavior: smooth;
    }
    
    /* ===== Body Scroll Lock When Menu Open ===== */
    body.menu-open {
        position: fixed;
        width: 100%;
        overflow: hidden;
        /* Prevent iOS bounce scrolling */
        -webkit-overflow-scrolling: auto;
    }
}

/* ###########################################################
   ###   3. MOBILE HEADER LAYOUT - 4 Element Design        ###
   ########################################################### */

@media (max-width: 1100px) {
    
    /* ====== Hide Currency Dropdown Completely ====== */
    .currency-selector-wrapper {
        display: none !important;
    }
    
    /* ====== Header Container Adjustments ====== */
    .nav-container {
        display: flex;
        align-items: center;
        justify-content: space-between;
        width: 100%;
        padding: 0 1rem;
        gap: 0.5rem;
    }
    
    /* ====== Logo Section ====== */
    .nav-brand {
        flex: 0 0 auto;
        order: 1;
    }
    
    /* ====== Navigation Actions - Even Distribution ====== */
    .nav-actions {
        /* Reset any existing margins/positioning */
        position: static;
        margin: 0;
        /* Create flex container for even spacing */
        display: flex;
        align-items: center;
        justify-content: space-between;
        /* Take up available space between logo and burger */
        flex: 1;
        padding: 0 2rem; /* Space from logo and burger */
        order: 2;
    }
    
    /* ====== Individual Action Buttons ====== */
    .nav-action-btn {
        min-width: var(--touch-target-min);
        min-height: var(--touch-target-min);
        padding: 0.5rem;
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: 50%;
        transition: background-color 0.2s ease;
    }
    
    .nav-action-btn:active {
        background-color: rgba(var(--imperial-gold-rgb, 194, 157, 92), 0.1);
    }
    
    /* ====== Mobile Menu Toggle ====== */
    .mobile-menu-toggle {
        flex: 0 0 auto;
        order: 3;
        min-width: var(--touch-target-min);
        min-height: var(--touch-target-min);
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    /* ====== Collection Count Badge ====== */
    .collection-count {
        font-size: 0.7rem;
        padding: 1px 4px;
        min-width: 16px;
        height: 16px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
}

/* ====== Responsive Header Adjustments ====== */
@media (max-width: 480px) {
    .nav-actions {
        padding: 0 1rem; /* Reduced padding for small screens */
    }
    
    .nav-action-btn {
        min-width: 40px;
        min-height: 40px;
        padding: 0.4rem;
    }
    
    .nav-action-btn svg {
        width: 18px;
        height: 18px;
    }
}

/* ###########################################################
   ###   4. HEADER OVERFLOW FIX (1127px - 767px)           ###
   ########################################################### */

/* ====== Show Burger Menu from 1100px ====== */
@media (max-width: 1100px) {
    /* Hide desktop navigation */
    .nav-menu {
        display: none !important;
    }
    
    /* Show mobile menu toggle */
    .mobile-menu-toggle {
        display: flex !important;
    }
}

/* Ensure desktop nav shows above 1100px */
@media (min-width: 1101px) {
    .nav-menu {
        display: flex !important;
    }
    
    .mobile-menu-toggle {
        display: none !important;
    }
}

/* ====== Fix Header Overflow Between 1127px - 767px ====== */
@media (max-width: 1127px) and (min-width: 768px) {
    /* Adjust nav container to prevent overflow */
    .nav-container {
        padding: 0 1rem;
        gap: 1rem;
    }
    
    /* Reduce nav menu gap */
    .nav-menu {
        gap: var(--space-6); /* Reduced from var(--space-8) */
    }
    
    /* Smaller nav links */
    .nav-link {
        font-size: 0.875rem; /* Slightly smaller */
        padding: var(--space-1) 0;
    }
    
    /* Compact nav actions */
    .nav-actions {
        gap: var(--space-2); /* Reduced from var(--space-3) */
    }
    
    /* Smaller action buttons */
    .nav-action-btn {
        padding: 0.375rem; /* Reduced padding */
    }
    
    /* Adjust brand logo if needed */
    .nav-brand img {
        max-height: 40px; /* Ensure logo doesn't force header height */
    }
}

/* ====== Currency selector adjustment for mid-range screens ====== */
@media (max-width: 1200px) {
    .navbar {
        padding: 0 1rem;
    }
    
    /* Hide currency selector earlier to save space */
    .currency-selector-wrapper {
        display: none;
    }
}

/* ###########################################################
   ###   5. MOBILE MENU STRUCTURE                          ###
   ########################################################### */

@media (max-width: 1100px) {
    /* ====== Mobile Menu Container ====== */
    .nav-menu.mobile-open {
        display: flex !important;
        position: fixed;
        top: 70px;
        left: 0;
        width: 100%;
        background: rgba(255, 255, 255, 0.98);
        backdrop-filter: blur(20px);
        flex-direction: column;
        padding: 2rem;
        gap: 1rem;
        box-shadow: var(--shadow-lg);
        z-index: 999;
        max-height: calc(100vh - 70px);
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    /* ====== Currency Selector in Mobile Menu ====== */
    .mobile-currency-wrapper {
        display: flex;
        flex-direction: column;
        gap: 0.5rem;
        padding: 1rem 0;
        border-bottom: 1px solid var(--light-gray);
        margin-bottom: 1rem;
    }
    
    .mobile-currency-label {
        font-size: 0.875rem;
        font-weight: 600;
        color: var(--medium-gray);
        text-transform: uppercase;
        letter-spacing: 0.05em;
    }
    
    /* Currency dropdown styling for mobile menu */
    .mobile-currency-wrapper #currency-dropdown {
        width: 100%;
        padding: 0.75rem 1rem;
        font-size: 1rem;
        border: 2px solid var(--light-gray);
        border-radius: 8px;
        background: white;
        appearance: none;
        background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L6 6L11 1' stroke='%23c29d5c' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
        background-repeat: no-repeat;
        background-position: right 1rem center;
        background-size: 12px;
    }
    
    /* ====== Navigation Links in Mobile ====== */
    .nav-menu.mobile-open .nav-link {
        font-size: 1.2rem;
        padding: 1rem 0;
        border-bottom: 1px solid var(--light-gray);
        display: block;
        text-align: left;
    }
    
    .nav-menu.mobile-open .nav-link:last-child {
        border-bottom: none;
    }
}

/* ###########################################################
   ###   6. WHITE GLOVE SERVICE OVERFLOW FIX               ###
   ########################################################### */

/* ====== Fix White Glove Service Overflow 1625px - 1424px ====== */
@media (max-width: 1625px) {
    /* Global containment for service pages */
    .service-page {
        overflow-x: hidden;
        max-width: 100vw;
    }
    
    /* Service content container */
    .service-content {
        max-width: 100%;
        padding: 0 2rem;
        box-sizing: border-box;
    }
    
    /* Service hero containment */
    .service-page .service-hero {
        max-width: calc(100vw - 4rem);
        margin: 0 auto 5rem;
        box-sizing: border-box;
    }
    
    /* Service features grid adjustment */
    .service-features {
        max-width: 100%;
        padding: 0;
        margin: 0 auto;
        box-sizing: border-box;
        grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
        gap: 1.5rem;
    }
    
    /* Feature cards containment */
    .feature-card {
        max-width: 100%;
        box-sizing: border-box;
        word-wrap: break-word;
        overflow-wrap: break-word;
        hyphens: auto;
    }
    
    /* Process steps containment */
    .process-steps {
        max-width: 100%;
        padding: 0;
        box-sizing: border-box;
    }
    
    /* Guarantees grid containment */
    .guarantees-grid {
        max-width: 100%;
        padding: 0;
        box-sizing: border-box;
    }
    
    /* Contact CTA containment */
    .contact-cta {
        max-width: calc(100% - 2rem);
        margin: 3rem auto;
        box-sizing: border-box;
    }
    
    /* Button containment */
    .btn-primary,
    .btn-secondary,
    .btn-luxury {
        max-width: 100%;
        white-space: normal;
        word-wrap: break-word;
    }
    
    /* Text elements containment */
    .service-page h1,
    .service-page h2,
    .service-page h3,
    .service-page p {
        max-width: 100%;
        word-wrap: break-word;
        overflow-wrap: break-word;
    }
    
    /* List items containment */
    .feature-details li,
    .service-page ul li,
    .service-page ol li {
        max-width: 100%;
        word-wrap: break-word;
        overflow-wrap: break-word;
    }
}

/* Specific range targeting for more aggressive containment */
@media (max-width: 1625px) and (min-width: 1424px) {
    .container {
        padding: 0 1.5rem;
    }
    
    .section {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    /* Reduce feature card padding to prevent overflow */
    .feature-card {
        padding: 2rem 1.5rem;
    }
}

/* ====== Additional responsive breakpoint for smoother transition ====== */
@media (max-width: 1400px) {
    /* Container adjustments */
    .container {
        max-width: 100%;
        padding: 0 2rem;
    }
    
    /* Service features responsive grid */
    .service-features {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    }
}

/* ###########################################################
   ###   7. COLLECTION CARDS - Premium Touch Interactions  ###
   ########################################################### */

@media (max-width: 1100px), (hover: none) and (pointer: coarse) {
    /* ====== Product Card Touch States ====== */
    .product-card,
    .luxury-product-card,
    .watch-card {
        /* Maintain premium feel with subtle transitions */
        transition: transform 0.2s ease, box-shadow 0.2s ease;
    }
    
    /* Active/pressed state for touch */
    .product-card:active,
    .luxury-product-card:active,
    .watch-card:active {
        transform: scale(0.98);
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    }
    
    /* ====== Heart Button Touch Enhancement ====== */
    .btn-add-collection {
        /* Larger touch target on mobile */
        min-width: var(--touch-target-comfort);
        min-height: var(--touch-target-comfort);
        /* Maintain animation for luxury feel */
        transition: transform 0.2s ease, background-color 0.2s ease;
    }
    
    .btn-add-collection:active {
        transform: scale(0.9);
        background-color: rgba(var(--imperial-gold-rgb, 194, 157, 92), 0.1);
    }
    
    /* Keep heart animation */
    .btn-add-collection.added svg {
        animation: heartBeat 0.6s ease-out;
    }
    
    @keyframes heartBeat {
        0%, 100% { transform: scale(1); }
        25% { transform: scale(1.3); }
        50% { transform: scale(1.1); }
    }
}

/* ###########################################################
   ###   8. NAVIGATION & DESKTOP MENU PRESERVATION         ###
   ########################################################### */

@media (max-width: 1024px), (hover: none) and (pointer: coarse) {
    
    /* ====== Mobile Navigation Drawer ====== */
    .mobile-menu {
        /* Instant appearance for better perceived performance */
        transition: none !important;
    }
    
    /* Navigation links - larger touch targets */
    .nav-link,
    .mobile-nav-link {
        min-height: var(--touch-target-comfort);
        display: flex;
        align-items: center;
        padding: 0.75rem 1rem;
    }
}

/* ###########################################################
   ###   9. FORM ELEMENTS & INPUTS                         ###
   ########################################################### */

@media (max-width: 1024px), (hover: none) and (pointer: coarse) {
    
    /* ====== Touch-Optimized Inputs ====== */
    input[type="text"],
    input[type="email"],
    input[type="tel"],
    input[type="search"],
    textarea,
    select {
        /* Larger touch targets */
        min-height: var(--touch-target-comfort);
        /* Prevent zoom on iOS */
        font-size: 16px !important;
        /* Remove transitions */
        transition: none !important;
    }
    
    /* Checkbox and radio buttons */
    input[type="checkbox"],
    input[type="radio"] {
        /* Larger clickable area */
        min-width: 24px;
        min-height: 24px;
    }
}

/* ###########################################################
   ###   10. GENERAL ANIMATION REMOVALS                    ###
   ########################################################### */

@media (max-width: 1024px), (hover: none) and (pointer: coarse) {
    
    /* ====== Disable Parallax Effects ====== */
    .hero-section,
    .parallax-element,
    [data-parallax] {
        transform: none !important;
        will-change: auto !important;
    }
    
    /* ====== Disable Fade/Slide Animations ====== */
    .animate-fade-in,
    .animate-slide-up,
    .animate-stagger-in,
    .fade-in,
    .slide-up,
    [data-aos] {
        /* Show content immediately */
        opacity: 1 !important;
        transform: translateY(0) !important;
        transition: none !important;
    }
    
    /* ====== Loading States ====== */
    .skeleton-shimmer {
        /* Disable shimmer animation on mobile */
        animation: none !important;
    }
    
    /* Keep spinner for critical loading states */
    .loading-spinner {
        /* Reduce animation speed for better performance */
        animation-duration: 1.5s !important;
    }
}

/* ###########################################################
   ###   11. FILTER & SORT CONTROLS                        ###
   ########################################################### */

@media (max-width: 768px) {
    /* ====== Filter Tabs ====== */
    .filter-tabs {
        /* Horizontal scroll for filters */
        display: flex;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scroll-snap-type: x mandatory;
        gap: 0.5rem;
        padding: 0.5rem 0;
        /* Hide scrollbar */
        scrollbar-width: none;
        -ms-overflow-style: none;
    }
    
    .filter-tabs::-webkit-scrollbar {
        display: none;
    }
    
    .filter-tab {
        flex: 0 0 auto;
        scroll-snap-align: start;
        min-width: fit-content;
        padding: 0.75rem 1.5rem;
    }
    
    /* ====== Sort Control ====== */
    .sort-control {
        width: 100%;
        margin-top: 1rem;
    }
    
    .sort-control select {
        width: 100%;
    }
}

/* ###########################################################
   ###   12. SCROLL PERFORMANCE OPTIMIZATIONS              ###
   ########################################################### */

@media (max-width: 1024px), (hover: none) and (pointer: coarse) {
    /* ====== Optimize Scrolling ====== */
    .scrollable-container,
    .product-grid,
    .luxury-grid {
        /* Prevent repaints during scroll */
        will-change: scroll-position;
        /* Smooth momentum scrolling on iOS */
        -webkit-overflow-scrolling: touch;
    }
    
    /* Remove will-change after scroll */
    .scrollable-container:not(:hover),
    .product-grid:not(:hover),
    .luxury-grid:not(:hover) {
        will-change: auto;
    }
}

/* ###########################################################
   ###   13. TOUCH FEEDBACK & STATES                       ###
   ########################################################### */

@media (hover: none) and (pointer: coarse) {
    /* ====== Button Press States ====== */
    .btn,
    .btn-primary,
    .btn-secondary,
    .btn-luxury {
        /* Remove hover effects on touch devices */
        &:hover {
            transform: none;
            box-shadow: none;
        }
        
        /* Active state for touch feedback */
        &:active {
            transform: scale(0.97);
            transition: transform 0.1s ease;
        }
    }
}

/* ###########################################################
   ###   14. IOS-SPECIFIC FIXES                            ###
   ########################################################### */

/* ====== iOS Safari Specific Overrides ====== */
@supports (-webkit-touch-callout: none) {
    /* Prevent tap highlight on buttons */
    button,
    .btn,
    a {
        -webkit-tap-highlight-color: transparent;
    }
    
    /* Fix iOS momentum scrolling */
    .scrollable-container {
        -webkit-overflow-scrolling: touch;
    }
    
    /* Prevent selection of UI elements */
    .btn,
    .nav-link {
        -webkit-touch-callout: none;
        -webkit-user-select: none;
        -moz-user-select: none;
        -ms-user-select: none;
        user-select: none;  /* Standard property should come last */
    }
}

/* ###########################################################
   ###   15. NOTIFICATION SYSTEM - Mobile Size Reduction   ###
   ########################################################### */

@media (max-width: 768px) {
    /* Global notifications (main.js) */
    .notification {
        padding: 0.5rem 0.75rem !important;
        font-size: 1.1rem;
        top: 10px !important;
        right: 10px !important;
        
        /* Scale down shadow and border radius */
        border-radius: 4px !important;
        box-shadow: 0 5px 12px rgba(0, 0, 0, 0.1) !important;
    }
    
    .notification-content {
        /* Adjust spacing between message and close button */
        display: flex;
        align-items: center;
        gap: 0.5rem;
    }
    
    .notification-message {
        font-size: 1.1rem;
    }
    
    .notification-close {
        font-size: 1.1rem;
        margin-left: 0.5rem !important;
        min-width: 48px;
        min-height: 48px;
        padding: 12px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    /* Currency-specific notifications */
    .currency-notification {
        padding: 0.375rem 0.5rem;
        font-size: 1.1rem;
        border-radius: 4px;
    }
    
    /* Admin notifications */
    .admin-notification {
        padding: 0.5rem 0.75rem;
        font-size: 1.1rem;
        top: 10px;
        right: 10px;
        border-radius: 4px;
    }
}

/* ###########################################################
   ###   16. GENERAL OVERFLOW PREVENTION                   ###
   ########################################################### */

/* Prevent horizontal scroll on all viewports */
html,
body {
    overflow-x: hidden;
    max-width: 100%;
}

/* Ensure all sections respect viewport bounds */
.section {
    max-width: 100vw;
    overflow-x: hidden;
}

/* Container overflow safety */
.container {
    max-width: min(1400px, calc(100% - 2rem));
}

/* ###########################################################
   ###   17. SMOOTH TRANSITIONS FOR BREAKPOINTS            ###
   ########################################################### */

/* Add smooth transitions for responsive changes */
@media (min-width: 768px) {
    .nav-container,
    .nav-menu,
    .nav-actions,
    .service-features,
    .container {
        transition: all 0.3s ease;
    }
}

/* Disable transitions on mobile for performance */
@media (max-width: 767px) {
    * {
        transition-duration: 0s !important;
    }
    
    /* Exception: Keep transitions for collection cards */
    .product-card,
    .luxury-product-card,
    .watch-card,
    .btn-add-collection {
        transition-duration: 0.2s !important;
    }
}

/* ###########################################################
   ###            END OF MOBILE OVERRIDES                  ###
   ########################################################### */

/*
=======================================================
IMPLEMENTATION NOTES: MOBILE OVERRIDES 
=======================================================

MOBILE HEADER LAYOUT:
- Clean 4-element design: Logo | Search | Heart | Burger
- Currency dropdown moved to burger menu (top position)
- Perfect touch targets (44px minimum)
- Even spacing with flexbox distribution

MOBILE MENU STRUCTURE:
1. Currency selector (with label) - at top
2. Navigation links (existing)
3. Proper luxury styling throughout

COLLECTION CARDS:
- Restored beautiful animations for premium feel
- Touch-based interactions replace hover
- Heart button animations preserved
- Performance optimized with selective animation control

CURRENCY FUNCTIONALITY:
- Hidden from header on mobile (clean layout)
- Accessible via burger menu with luxury styling
- Proper touch targets and iOS zoom prevention
- Enhanced dropdown arrow and selection states

RESPONSIVE BREAKPOINTS:
- 480px: Mobile phones
- 768px: Tablets
- 1024px: Desktop threshold
- 1100px: Burger menu appears (NEW)
- 1127px: Header overflow fix
- 1424px-1625px: White glove service fix (ENHANCED)
- Touch detection overrides

PERFORMANCE OPTIMIZATIONS:
- Reduced animations on mobile
- Hardware acceleration
- Minimal repaints
- Battery friendly

NEW FIXES ADDED:
- Header overflow prevention (1127px-767px)
- White glove service containment (1625px-1424px)
- General overflow prevention rules
- Smooth transition management
=======================================================
*/