/* ===================================================
   The Eye Optometry Center - Main Stylesheet
   =================================================== */

body {
    font-family: 'Cairo', sans-serif;
    background-color: #F8F9FA;
    overflow-x: hidden;
    color: #1A1A24;
}

.brand-font {
    font-family: 'Comfortaa', cursive, sans-serif;
}

.zain-font {
    font-family: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* Custom Scrollbars */
::-webkit-scrollbar {
    width: 8px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #6A1B9A;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #4D148C;
}

/* Sidebar Accordions */
.submenu {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease;
    opacity: 0;
}

.submenu.open {
    max-height: 450px;
    opacity: 1;
}

.rotate-arrow {
    transition: transform 0.3s ease;
}

.rotate-arrow.open {
    transform: rotate(180deg);
}

/* Off-canvas Drawers */
.sidebar-drawer {
    transform: translateX(100%);
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.sidebar-drawer.open {
    transform: translateX(0);
}

.cart-drawer {
    transform: translateX(-100%);
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.cart-drawer.open {
    transform: translateX(0);
}

/* Modals */
.modal-overlay {
    display: none;
    opacity: 0;
    transition: opacity 0.25s ease;
}

.modal-overlay.active {
    display: flex !important;
    opacity: 1;
}

.modal-content {
    animation: modalPop 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalPop {
    from {
        opacity: 0;
        transform: scale(0.96) translateY(8px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.service-modal-pop {
    animation: serviceModalPop 0.35s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes serviceModalPop {
    0% {
        opacity: 0;
        transform: scale(0.88) translateY(18px);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* Glassmorphism Navigation */
.glass-nav {
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

/* Header Navigation Purple Pill Items */
.nav-header-item {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.45rem 0.85rem;
    border-radius: 0.75rem; /* rounded-xl */
    font-size: 0.85rem;
    font-weight: 700;
    color: #4b5563; /* text-gray-600 */
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1.5px solid transparent;
    cursor: pointer;
    text-decoration: none;
    user-select: none;
    white-space: nowrap;
}

.nav-header-item:hover {
    background-color: #f3e8ff; /* purple-100 */
    color: #4D148C; /* primary */
    border-color: #e9d5ff; /* purple-200 */
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(77, 20, 140, 0.1);
}

.nav-header-item.active {
    background: linear-gradient(135deg, #4D148C, #6A1B9A) !important;
    color: #ffffff !important;
    border-color: #4D148C !important;
    box-shadow: 0 3px 12px rgba(77, 20, 140, 0.28) !important;
    font-weight: 800;
}

.nav-header-item.active i {
    color: #fbbf24 !important; /* amber accent for icon when active */
}


/* Store Navigation Dropdowns */
.store-dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 0.5rem;
    z-index: 50;
    min-width: 220px;
    max-width: calc(100vw - 1.5rem);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.12), 0 8px 10px -6px rgba(0, 0, 0, 0.08);
}

.store-dropdown-menu.active {
    display: block;
    animation: fadeIn 0.2s ease-in-out;
}

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

/* Color Swatches Selection */
.color-swatch {
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.color-swatch:hover {
    transform: scale(1.15);
}

.color-swatch.active {
    transform: scale(1.2);
    box-shadow: 0 0 0 3px #4D148C;
}

/* Smooth Transitions */
.transition-smooth {
    transition: all 0.25s ease-in-out;
}

/* ===================================================
   Luxurious Repeating Scroll Animation Engine
   =================================================== */
.reveal-on-scroll {
    opacity: 0;
    transform: translateY(38px) scale(0.96);
    filter: blur(4px);
    transition: 
        opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1),
        transform 0.7s cubic-bezier(0.16, 1, 0.3, 1),
        filter 0.7s cubic-bezier(0.16, 1, 0.3, 1);
    will-change: opacity, transform, filter;
}

.reveal-on-scroll.is-visible {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: blur(0);
}

/* Stagger Delay Helpers */
.delay-50  { transition-delay: 40ms; }
.delay-100 { transition-delay: 80ms; }
.delay-150 { transition-delay: 130ms; }
.delay-200 { transition-delay: 180ms; }
.delay-250 { transition-delay: 230ms; }
.delay-300 { transition-delay: 280ms; }
.delay-350 { transition-delay: 330ms; }
.delay-400 { transition-delay: 380ms; }

/* Service Card Design & Micro-interactions */
.service-card {
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.35s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.3s ease;
    border: 1px solid rgba(229, 231, 235, 0.9);
    background: #ffffff;
    position: relative;
    overflow: hidden;
}

.service-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3.5px;
    background: linear-gradient(90deg, #4D148C, #8E24AA, #F5A623);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.service-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 18px 32px -10px rgba(77, 20, 140, 0.14), 0 8px 16px -4px rgba(0, 0, 0, 0.04);
    border-color: rgba(142, 36, 170, 0.32);
}

.service-card:hover::before {
    opacity: 1;
}

.service-icon-wrapper {
    transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.35s ease;
}

.service-card:hover .service-icon-wrapper {
    transform: scale(1.1) rotate(-4deg);
    box-shadow: 0 10px 18px -4px rgba(77, 20, 140, 0.18);
}

/* Category Filter Buttons */
.service-filter-btn {
    transition: all 0.25s ease;
}

.service-filter-btn.active {
    background-color: #4D148C !important;
    color: #ffffff !important;
    border-color: #4D148C !important;
    box-shadow: 0 4px 14px rgba(77, 20, 140, 0.25);
}

/* ===================================================
   Channel Buttons (Icon-only, Purple Highlight on Hover & Click)
   =================================================== */
.channel-btn-purple {
    width: 48px;
    height: 48px;
    border-radius: 16px;
    background-color: #ffffff;
    color: #4A4A58;
    border: 1.5px solid rgba(106, 27, 154, 0.16);
    box-shadow: 0 3px 10px rgba(77, 20, 140, 0.05);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    cursor: pointer;
    position: relative;
    text-decoration: none;
}

.channel-btn-purple:hover,
.channel-btn-purple:focus,
.channel-btn-purple:active {
    background-color: #4D148C !important;
    color: #ffffff !important;
    border-color: #4D148C !important;
    transform: translateY(-4px) scale(1.08);
    box-shadow: 0 10px 22px -3px rgba(77, 20, 140, 0.38);
}

.channel-btn-purple:active {
    transform: translateY(-1px) scale(1.02);
    background-color: #380E68 !important;
    border-color: #380E68 !important;
}

/* Footer Direct Contact Buttons */
.footer-contact-btn {
    transition: all 0.25s ease;
    border: 1px solid rgba(142, 36, 170, 0.25);
}

.footer-contact-btn:hover,
.footer-contact-btn:focus,
.footer-contact-btn:active {
    background-color: #4D148C !important;
    border-color: #8E24AA !important;
    color: #ffffff !important;
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(77, 20, 140, 0.35);
}

.footer-contact-btn:active {
    transform: translateY(0);
    background-color: #380E68 !important;
}

/* Footer Social Media Buttons (Purple Highlight on Hover & Click) */
.footer-social-btn {
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.footer-social-btn:hover,
.footer-social-btn:focus,
.footer-social-btn:active {
    background-color: #4D148C !important;
    color: #ffffff !important;
    border-color: #8E24AA !important;
    transform: translateY(-3px) scale(1.1);
    box-shadow: 0 8px 18px rgba(77, 20, 140, 0.4);
}

.footer-social-btn:active {
    background-color: #380E68 !important;
    border-color: #380E68 !important;
    transform: translateY(0) scale(1);
}

/* ===================================================
   Mobile Screen Optimizations (Smartphones & Tablets)
   =================================================== */

/* Prevent iOS Safari auto-zoom on input focus */
@media screen and (max-width: 768px) {
    input[type="text"],
    input[type="tel"],
    input[type="number"],
    input[type="email"],
    input[type="search"],
    input[type="password"],
    select,
    textarea {
        font-size: 16px !important;
    }
}

/* Hide scrollbars cleanly for horizontal carousels and categories */
.no-scrollbar::-webkit-scrollbar {
    display: none;
}
.no-scrollbar {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* Mobile Off-canvas Drawer Widths */
@media (max-width: 480px) {
    .sidebar-drawer,
    .cart-drawer {
        width: 86vw !important;
        max-width: 340px !important;
    }
}

/* Responsive Store Dropdown Menus */
@media (max-width: 640px) {
    .store-dropdown-menu {
        max-width: calc(100vw - 1.5rem);
        max-height: calc(85vh - 60px);
        overflow-y: auto;
    }
}

/* Modal mobile usability, safe viewport boundaries & smooth touch scrolling */
@media (max-width: 640px) {
    .modal-overlay {
        padding: 0.75rem !important;
    }
    .modal-content {
        max-height: calc(100dvh - 2rem) !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch;
        margin-top: auto !important;
        margin-bottom: auto !important;
    }
}

/* Eliminate tap highlight flicker on touch screens */
* {
    -webkit-tap-highlight-color: transparent;
}

/* ===================================================
   Animated Attention-Grabbing Red Notice for Lens Pricing
   =================================================== */
.lens-price-notice {
    background: linear-gradient(135deg, #fff5f5 0%, #fee2e2 50%, #fecaca 100%);
    border: 2px solid #ef4444;
    border-radius: 1rem;
    position: relative;
    overflow: hidden;
    animation: pulseNoticeBorder 2.4s ease-in-out infinite;
    box-shadow: 0 4px 15px -1px rgba(239, 68, 68, 0.25);
}

@keyframes pulseNoticeBorder {
    0%, 100% {
        border-color: #ef4444;
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4), 0 4px 15px -1px rgba(239, 68, 68, 0.25);
        transform: scale(1);
    }
    50% {
        border-color: #dc2626;
        box-shadow: 0 0 0 6px rgba(239, 68, 68, 0.15), 0 8px 24px -1px rgba(220, 38, 38, 0.35);
        transform: scale(1.008);
    }
}

.lens-notice-icon {
    animation: noticeIconBounce 1.8s cubic-bezier(0.36, 0.07, 0.19, 0.97) infinite;
}

@keyframes noticeIconBounce {
    0%, 100% {
        transform: scale(1) rotate(0deg);
    }
    20% {
        transform: scale(1.15) rotate(-6deg);
    }
    40% {
        transform: scale(1.1) rotate(6deg);
    }
    60% {
        transform: scale(1.15) rotate(-3deg);
    }
    80% {
        transform: scale(1.05) rotate(0deg);
    }
}

/* Delivery Option Cards */
.delivery-option-card {
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
}
.delivery-option-card:hover {
    border-color: #6A1B9A;
    background-color: #faf5ff;
}
.delivery-option-card.selected {
    border-color: #4D148C;
    background-color: #f3e8ff;
    box-shadow: 0 0 0 2px #4D148C;
}

/* Multi-category tags in Admin */
.admin-cat-pill {
    transition: all 0.15s ease;
    user-select: none;
}
.admin-cat-pill:hover {
    border-color: #4D148C;
}
.admin-cat-pill input:checked + span {
    background-color: #4D148C;
    color: #ffffff;
    border-color: #4D148C;
}

/* Amazon-style 2-column mobile text truncation */
.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

