/* Angel Marketplace - Custom CSS */

/* Global Styles */
:root {
    --primary-color: #2563eb;
    --primary-hover: #1d4ed8;
    --secondary-color: #64748b;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --error-color: #ef4444;
    --gray-50: #f8fafc;
    --gray-100: #f1f5f9;
    --gray-200: #e2e8f0;
    --gray-300: #cbd5e1;
    --gray-600: #475569;
    --gray-700: #334155;
    --gray-800: #1e293b;
    --gray-900: #0f172a;
}

/* Font Loading Optimization */
.font-brand {
    font-family: 'Coves', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-display: swap;
}

/* Loading States */
.loading {
    opacity: 0.7;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Image Fallback Styles */
.image-placeholder {
    background-color: var(--gray-200);
    background-image: url("data:image/svg+xml,%3Csvg width='200' height='200' xmlns='http://www.w3.org/2000/svg'%3E%3Crect width='200' height='200' fill='%23f5f5f5'/%3E%3Ctext x='50%25' y='50%25' dominant-baseline='central' text-anchor='middle' fill='%23999999' font-family='sans-serif' font-size='14'%3ENo Image%3C/text%3E%3C/svg%3E");
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

/* Cart Animation */
.cart-bounce {
    animation: bounce 0.5s ease-in-out;
}

@keyframes bounce {
    0%, 20%, 60%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-10px);
    }
    80% {
        transform: translateY(-5px);
    }
}

/* Notification Styles */
.notification {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 9999;
    max-width: 400px;
    padding: 1rem 1.5rem;
    border-radius: 0.5rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    transform: translateX(100%);
    transition: transform 0.3s ease-in-out;
}

.notification.show {
    transform: translateX(0);
}

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

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

.notification.warning {
    background-color: var(--warning-color);
    color: white;
}

.notification.info {
    background-color: var(--primary-color);
    color: white;
}

/* Product Card Enhancements */
.product-card {
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

.product-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.product-image {
    transition: transform 0.3s ease-in-out;
}

.product-card:hover .product-image {
    transform: scale(1.05);
}

/* Button Enhancements */
.btn-primary {
    background-color: var(--primary-color);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 0.375rem;
    font-weight: 500;
    text-decoration: none;
    display: inline-block;
    transition: background-color 0.2s ease-in-out, transform 0.1s ease-in-out;
    border: none;
    cursor: pointer;
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    transform: translateY(-1px);
}

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

.btn-secondary {
    background-color: var(--gray-100);
    color: var(--gray-800);
    padding: 0.75rem 1.5rem;
    border-radius: 0.375rem;
    font-weight: 500;
    text-decoration: none;
    display: inline-block;
    transition: background-color 0.2s ease-in-out;
    border: none;
    cursor: pointer;
}

.btn-secondary:hover {
    background-color: var(--gray-200);
}

/* Form Enhancements */
.form-input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--gray-300);
    border-radius: 0.375rem;
    font-size: 1rem;
    transition: border-color 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-input.error {
    border-color: var(--error-color);
}

.form-error {
    color: var(--error-color);
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

/* ============================================
   LIQUID GLASS DESIGN SYSTEM (Apple-inspired)
   ============================================ */

/* Base liquid glass - light translucent with heavy blur */
.glass {
    backdrop-filter: blur(40px) saturate(180%);
    -webkit-backdrop-filter: blur(40px) saturate(180%);
    background: rgba(255, 255, 255, 0.55);
    border: 1px solid rgba(255, 255, 255, 0.4);
    box-shadow:
        inset 0 1px 0 0 rgba(255, 255, 255, 0.6),
        inset 0 -1px 0 0 rgba(255, 255, 255, 0.1),
        0 2px 16px rgba(0, 0, 0, 0.06);
}

/* Strong liquid glass - more opaque, used for overlays and panels */
.glass-strong {
    backdrop-filter: blur(60px) saturate(200%);
    -webkit-backdrop-filter: blur(60px) saturate(200%);
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid rgba(255, 255, 255, 0.5);
    box-shadow:
        inset 0 1px 0 0 rgba(255, 255, 255, 0.7),
        inset 0 -1px 0 0 rgba(255, 255, 255, 0.15),
        0 8px 32px rgba(0, 0, 0, 0.08),
        0 2px 8px rgba(0, 0, 0, 0.04);
}

/* ============================================
   HEADER - Liquid Glass Scroll Transition
   ============================================ */

.header-glass {
    background: rgba(255, 255, 255, 0.92);
    border-bottom: 1px solid rgba(0, 0, 0, 0.04);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.header-glass.header-scrolled {
    backdrop-filter: blur(60px) saturate(200%);
    -webkit-backdrop-filter: blur(60px) saturate(200%);
    background: rgba(255, 255, 255, 0.62);
    border-bottom: 1px solid rgba(255, 255, 255, 0.35);
    box-shadow:
        inset 0 1px 0 0 rgba(255, 255, 255, 0.7),
        inset 0 -1px 0 0 rgba(255, 255, 255, 0.1),
        0 4px 30px rgba(0, 0, 0, 0.07),
        0 1px 4px rgba(0, 0, 0, 0.04);
}

/* Specular highlight strip at top of scrolled header */
.header-glass.header-scrolled::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.8) 30%, rgba(255,255,255,0.9) 50%, rgba(255,255,255,0.8) 70%, transparent);
    pointer-events: none;
    z-index: 1;
}

/* ============================================
   NAVIGATION - Animated Underlines
   ============================================ */

.nav-link-underline {
    position: relative;
}

.nav-link-underline::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, #FF0055, #FF3366);
    border-radius: 1px;
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-link-underline:hover::after {
    width: 70%;
}

/* ============================================
   HERO SECTION
   ============================================ */

/* Mesh gradient background */
.hero-mesh-gradient {
    background:
        radial-gradient(ellipse at 20% 50%, rgba(255, 0, 85, 0.04) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 20%, rgba(255, 165, 0, 0.03) 0%, transparent 50%),
        radial-gradient(ellipse at 60% 80%, rgba(147, 51, 234, 0.03) 0%, transparent 50%),
        linear-gradient(180deg, #fafbff 0%, #f5f6fa 100%);
}

/* Floating orb animations */
.hero-orb-1 {
    animation: hero-float-1 20s ease-in-out infinite;
}
.hero-orb-2 {
    animation: hero-float-2 25s ease-in-out infinite;
}
.hero-orb-3 {
    animation: hero-float-3 18s ease-in-out infinite;
}

@keyframes hero-float-1 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(-30px, 20px) scale(1.05); }
    66% { transform: translate(20px, -15px) scale(0.95); }
}
@keyframes hero-float-2 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(25px, -20px) scale(1.08); }
    66% { transform: translate(-20px, 15px) scale(0.96); }
}
@keyframes hero-float-3 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(15px, 10px) scale(1.04); }
}

/* Grain texture */
.hero-grain {
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
    background-size: 128px 128px;
}

/* Badge shimmer effect */
.hero-badge-shimmer {
    position: relative;
    overflow: hidden;
}
.hero-badge-shimmer::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 60%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.6), transparent);
    animation: shimmer 3s ease-in-out infinite;
}

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

/* ============================================
   BENTO GRID
   ============================================ */

.bento-grid {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    grid-template-rows: 1fr 1fr;
    gap: 0.75rem;
}

.bento-featured {
    grid-row: 1 / -1;
}


/* ============================================
   ANIMATION UTILITIES
   ============================================ */

.animate-fade-in-up {
    animation: fade-in-up 0.6s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes fade-in-up {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animation-delay-200 { animation-delay: 0.2s; }
.animation-delay-400 { animation-delay: 0.4s; }
.animation-delay-600 { animation-delay: 0.6s; }
.animation-delay-800 { animation-delay: 0.8s; }

/* Legacy header sticky (kept for compatibility) */
.header-sticky {
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

/* Mobile Menu Improvements */
.mobile-menu {
    transform: translateX(-100%);
    transition: transform 0.3s ease-in-out;
}

.mobile-menu.active {
    transform: translateX(0);
}

/* Search Enhancements */
.search-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid var(--gray-200);
    border-top: none;
    border-radius: 0 0 0.375rem 0.375rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    max-height: 300px;
    overflow-y: auto;
    z-index: 50;
}

.search-suggestion {
    padding: 0.75rem 1rem;
    cursor: pointer;
    transition: background-color 0.2s ease-in-out;
}

.search-suggestion:hover {
    background-color: var(--gray-50);
}

/* Mini Cart Enhancements */
.mini-cart {
    max-height: 400px;
    overflow-y: auto;
}

.mini-cart-item {
    transition: background-color 0.2s ease-in-out;
}

.mini-cart-item:hover {
    background-color: var(--gray-50);
}

/* Pagination Styles */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin: 2rem 0;
}

.pagination a,
.pagination span {
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--gray-300);
    border-radius: 0.375rem;
    text-decoration: none;
    color: var(--gray-700);
    transition: all 0.2s ease-in-out;
}

.pagination a:hover {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.pagination .current {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* Responsive Design Helpers */
@media (max-width: 768px) {
    .mobile-hidden {
        display: none !important;
    }
    
    .mobile-full-width {
        width: 100% !important;
    }
    
    .mobile-text-center {
        text-align: center !important;
    }
}

/* Print Styles */
@media print {
    .no-print {
        display: none !important;
    }
    
    .print-break-before {
        page-break-before: always;
    }
    
    .print-break-after {
        page-break-after: always;
    }
}

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

/* Focus styles for better accessibility */
.focus-ring:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    :root {
        --primary-color: #000080;
        --gray-600: #000000;
        --gray-700: #000000;
        --gray-800: #000000;
        --gray-900: #000000;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Dark mode support (if needed later) */
@media (prefers-color-scheme: dark) {
    .dark-mode-support {
        background-color: #1a202c;
        color: #f7fafc;
    }
}

/* ============================================
   MOBILE FORM OPTIMIZATIONS
   ============================================ */

/* Prevent iOS zoom on input focus - use 16px minimum */
@media (max-width: 768px) {
    input[type="text"],
    input[type="email"],
    input[type="tel"],
    input[type="number"],
    input[type="password"],
    input[type="search"],
    input[type="url"],
    textarea,
    select {
        font-size: 16px !important;
    }
    
    /* Better touch targets for mobile */
    input,
    textarea,
    select,
    button {
        min-height: 48px;
    }
    
    /* Improve select dropdown appearance on mobile */
    select {
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%236b7280'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
        background-repeat: no-repeat;
        background-position: right 0.75rem center;
        background-size: 1.25rem;
        padding-right: 2.5rem;
    }
    
    /* Form labels - better spacing on mobile */
    label {
        margin-bottom: 0.5rem;
        display: block;
    }
    
    /* Form groups spacing */
    .form-group,
    .chat-form-group {
        margin-bottom: 1rem;
    }
}

/* ============================================
   CHECKOUT PAGE MOBILE OPTIMIZATIONS
   ============================================ */

@media (max-width: 640px) {
    /* Checkout section padding */
    .checkout-step {
        padding: 1.25rem !important;
        border-radius: 1rem !important;
    }
    
    /* Step numbers smaller on mobile */
    .step-number {
        width: 1.75rem !important;
        height: 1.75rem !important;
        font-size: 0.75rem !important;
    }
    
    /* Checkout step titles */
    .checkout-step h2 {
        font-size: 1.1rem !important;
    }
    
    /* Phone number field layout */
    .checkout-step .flex.gap-3 {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .checkout-step .flex.gap-3 select {
        width: 100% !important;
    }
    
    /* Country code selector - full width on mobile */
    #countryCode {
        width: 100% !important;
    }
    
    /* Shipping method options */
    .shipping-method-option .p-4 {
        padding: 0.875rem !important;
    }
    
    .shipping-method-option .w-10 {
        width: 2.25rem !important;
        height: 2.25rem !important;
    }
    
    .shipping-method-option h3 {
        font-size: 0.9rem !important;
    }
    
    .shipping-method-option p {
        font-size: 0.75rem !important;
    }
    
    /* Payment method options */
    .payment-form .p-6 {
        padding: 1rem !important;
    }
    
    /* Order summary on mobile */
    .lg\\:col-span-1 .sticky {
        position: relative !important;
        top: auto !important;
    }
    
    /* Cart items in order summary */
    .max-h-96 {
        max-height: 200px !important;
    }
    
    /* Total display */
    #total-display {
        font-size: 1.75rem !important;
    }
    
    /* Submit button */
    #submit-btn,
    .chat-form-submit,
    #contact-submit-btn {
        padding: 1rem !important;
        font-size: 1rem !important;
    }
    
    /* Grid adjustments for address fields */
    .grid.grid-cols-1.md\\:grid-cols-3 {
        gap: 0.75rem !important;
    }
}

/* ============================================
   CONTACT PAGE MOBILE OPTIMIZATIONS
   ============================================ */

@media (max-width: 640px) {
    /* Contact form container */
    .bg-white.rounded-3xl.shadow-xl {
        padding: 1.25rem !important;
        border-radius: 1rem !important;
    }
    
    /* Contact info cards */
    .flex.items-start.p-6 {
        padding: 1rem !important;
    }
    
    /* Contact info icon */
    .w-12.h-12 {
        width: 2.5rem !important;
        height: 2.5rem !important;
    }
    
    /* Hero section buttons */
    .flex.flex-wrap.justify-center.gap-4 {
        flex-direction: column;
        width: 100%;
        padding: 0 1rem;
    }
    
    .flex.flex-wrap.justify-center.gap-4 a {
        width: 100%;
        justify-content: center;
    }
    
    /* FAQ grid */
    .grid.md\\:grid-cols-2.gap-8 {
        gap: 1rem !important;
    }
    
    .bg-gray-50.p-8.rounded-2xl {
        padding: 1.25rem !important;
    }
    
    .bg-gray-50.p-8.rounded-2xl h3 {
        font-size: 1rem !important;
    }
}

/* ============================================
   GENERAL MOBILE TOUCH IMPROVEMENTS
   ============================================ */

@media (max-width: 768px) {
    /* Better tap highlighting */
    button,
    a,
    input[type="submit"],
    input[type="button"],
    .cursor-pointer {
        -webkit-tap-highlight-color: rgba(247, 37, 133, 0.1);
    }
    
    /* Prevent text selection on buttons */
    button,
    .btn-primary,
    .btn-secondary {
        -webkit-user-select: none;
        user-select: none;
    }
    
    /* Smooth scrolling for better UX */
    html {
        scroll-behavior: smooth;
    }
    
    /* Fix for iOS input shadows */
    input,
    textarea {
        -webkit-appearance: none;
        appearance: none;
    }
    
    /* Better focus states for mobile */
    input:focus,
    textarea:focus,
    select:focus {
        outline: none;
        box-shadow: 0 0 0 3px rgba(247, 37, 133, 0.2);
    }
}

/* ============================================
   SMALL MOBILE SCREENS (< 375px)
   ============================================ */

@media (max-width: 375px) {
    /* Even smaller padding for very small screens */
    .container {
        padding-left: 0.75rem !important;
        padding-right: 0.75rem !important;
    }
    
    .checkout-step,
    .bg-white.rounded-3xl {
        padding: 1rem !important;
    }
    
    /* Smaller headings */
    h1 {
        font-size: 1.75rem !important;
    }
    
    h2 {
        font-size: 1.25rem !important;
    }
    
    /* Compact form fields */
    input,
    textarea,
    select {
        padding: 0.625rem 0.75rem !important;
    }
}