/* Faith Threadz - Custom Styles */
/* Critical CSS - Above the fold optimizations */

/* Performance optimizations */
* {
    box-sizing: border-box;
}

html {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

body {
    font-display: swap;
}

/* Optimize font loading */
@font-face {
    font-family: 'Inter';
    font-display: swap;
}

@font-face {
    font-family: 'Playfair Display';
    font-display: swap;
}

/* Critical path CSS for above-the-fold content */
.hero-section {
    contain: layout style paint;
    will-change: transform;
}

/* GPU acceleration for animations */
.animate-fade-in-up,
.product-card {
    will-change: transform, opacity;
    transform: translateZ(0);
}

/* Optimize images */
img {
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
}

/* Smooth scrolling for the entire page */
html {
    scroll-behavior: smooth;
}

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

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

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

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

@keyframes glow {
    0%, 100% {
        box-shadow: 0 0 20px rgba(255, 215, 0, 0.3);
    }
    50% {
        box-shadow: 0 0 30px rgba(255, 215, 0, 0.6);
    }
}

/* Animation classes */
.animate-fade-in-up {
    animation: fadeInUp 0.8s ease-out forwards;
}

.animate-slide-in-left {
    animation: slideInLeft 0.8s ease-out forwards;
}

.animate-slide-in-right {
    animation: slideInRight 0.8s ease-out forwards;
}

.animate-pulse-subtle {
    animation: pulse 3s ease-in-out infinite;
}

.animate-glow {
    animation: glow 2s ease-in-out infinite;
}

/* Animation delays */
.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;
}

/* Hero section background setup */
.hero-section {
    background-image: linear-gradient(rgba(0, 0, 0, 0.3), rgba(0, 0, 0, 0.3)), 
                      url('../assets/HERO-IMAGE.jpg');
    background-attachment: fixed;
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
    min-height: 100vh;
    position: relative;
}

/* Navigation styles */
.nav-link {
    position: relative;
    overflow: hidden;
}

.nav-link::before {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background-color: #FFD700;
    transition: width 0.3s ease;
}

.nav-link:hover::before {
    width: 100%;
}

/* Product card hover effects */
.product-card {
    position: relative;
    overflow: hidden;
}

.product-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 215, 0, 0.1), transparent);
    transition: left 0.6s ease;
    z-index: 1;
}

.product-card:hover::before {
    left: 100%;
}

/* Scroll animations */
.scroll-animate {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.scroll-animate.animate {
    opacity: 1;
    transform: translateY(0);
}

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

::-webkit-scrollbar-track {
    background: #1a1a1a;
}

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

::-webkit-scrollbar-thumb:hover {
    background: #B8860B;
}

/* Focus styles for accessibility */
a:focus,
button:focus {
    outline: 2px solid #FFD700;
    outline-offset: 2px;
}

/* Loading spinner */
.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #1a1a1a;
    border-top: 4px solid #FFD700;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Text selection */
::selection {
    background: #FFD700;
    color: #000000;
}

::-moz-selection {
    background: #FFD700;
    color: #000000;
}

/* Image optimization and responsive images */
.product-card img {
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
    will-change: transform;
}

.product-card img:hover {
    image-rendering: auto;
}

/* Logo responsive sizing */
.navbar-logo {
    height: clamp(2rem, 4vw, 2.5rem);
}

/* Touch-friendly buttons */
@media (max-width: 768px) {
    .product-card a {
        min-height: 44px;
        min-width: 44px;
        padding: 0.75rem 1.5rem;
    }
    
    .mobile-menu-button {
        min-height: 44px;
        min-width: 44px;
    }
}

/* Mobile-first responsive adjustments */
@media (max-width: 640px) {
    .hero-section {
        background-attachment: scroll; /* Fix for mobile devices */
        min-height: 100vh; /* Full height on mobile */
        padding: 0 1rem;
    }
    
    .animate-fade-in-up {
        animation-duration: 0.6s;
    }
    
    .product-card {
        margin-bottom: 1.5rem;
        max-width: 100%;
    }
    
    /* Ensure no horizontal scroll */
    .max-w-7xl {
        max-width: calc(100vw - 2rem);
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    /* Hero content mobile optimization */
    h1 {
        font-size: 3rem !important;
        line-height: 1.1;
    }
    
    /* Mobile navigation improvements */
    .mobile-menu-button {
        width: 48px;
        height: 48px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    /* Mobile product cards */
    .product-card h3 {
        font-size: 1.5rem;
        line-height: 1.3;
    }
    
    .product-card p {
        font-size: 0.875rem;
        line-height: 1.4;
    }
    
    /* Mobile buttons */
    .product-card a {
        padding: 0.75rem 1rem;
        font-size: 0.875rem;
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    /* Mobile footer adjustments */
    footer {
        padding: 2rem 1rem;
    }
    
    .footer-section {
        margin-bottom: 2rem;
    }
}

/* Tablet styles */
@media (min-width: 641px) and (max-width: 1024px) {
    .hero-section h1 {
        font-size: 4rem;
    }
    
    .product-card {
        margin-bottom: 1.5rem;
    }
    
    .grid {
        gap: 1.5rem;
    }
    
    /* Tablet navigation */
    nav {
        padding: 0 1.5rem;
    }
    
    /* Tablet hero content */
    .hero-section {
        padding: 0 1.5rem;
    }
    
    /* Tablet product grid - 2 columns */
    .product-grid-tablet {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Desktop styles */
@media (min-width: 1025px) {
    .product-card:hover {
        transform: translateY(-8px);
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .text-faith-gold {
        color: #FFFF00 !important;
    }
    
    .bg-faith-gold {
        background-color: #FFFF00 !important;
    }
}

/* 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;
    }
    
    html {
        scroll-behavior: auto;
    }
}

/* Print styles */
@media print {
    .fixed,
    #cookie-banner,
    #scroll-to-top,
    nav {
        display: none !important;
    }
    
    body {
        background: white !important;
        color: black !important;
    }
    
    .text-faith-gold {
        color: #B8860B !important;
    }
}

/* Custom utility classes */
.text-shadow-gold {
    text-shadow: 0 2px 4px rgba(255, 215, 0, 0.5);
}

.glass-effect {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 215, 0, 0.2);
}

.gradient-text {
    background: linear-gradient(45deg, #FFD700, #B8860B);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Enhanced visual effects to make the site pop */
.product-card {
    background: linear-gradient(145deg, #000000, #1a1a1a) !important;
    box-shadow: 
        0 20px 25px -5px rgba(0, 0, 0, 0.8),
        0 10px 10px -5px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(255, 215, 0, 0.1);
    /* Border will be handled inline for visibility */
}

.product-card:hover {
    transform: translateY(-12px) scale(1.02);
    box-shadow: 
        0 35px 60px -12px rgba(255, 215, 0, 0.25),
        0 25px 25px -5px rgba(0, 0, 0, 0.6),
        inset 0 1px 0 rgba(255, 215, 0, 0.3);
    border: 1px solid rgba(255, 215, 0, 0.3);
}

/* Glowing gold buttons */
.bg-faith-gold {
    background: linear-gradient(135deg, #FFD700, #FFA500);
    box-shadow: 
        0 4px 15px rgba(255, 215, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.bg-faith-gold:hover {
    background: linear-gradient(135deg, #FFA500, #FFD700);
    box-shadow: 
        0 8px 25px rgba(255, 215, 0, 0.6),
        0 0 20px rgba(255, 215, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

/* Hero section enhancements */
.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at center, rgba(255, 215, 0, 0.1) 0%, transparent 70%);
    pointer-events: none;
    z-index: 1;
}

/* Navbar enhancement */
nav {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 215, 0, 0.1);
}

/* Text glow effects */
.text-faith-gold {
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

h1, h2, h3 {
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

/* Footer enhancement */
footer {
    background: linear-gradient(135deg, #1a1a1a 0%, #0a0a0a 100%);
    border-top: 1px solid rgba(255, 215, 0, 0.1);
}

/* Global footer text styling */
footer p,
footer li,
footer a:not(.text-faith-gold),
footer span {
    color: white !important;
    font-weight: bold !important;
}

footer .text-gray-300,
footer .text-gray-400,
footer .text-gray-500 {
    color: white !important;
    font-weight: bold !important;
}

/* Image containers */
.product-card img {
    filter: brightness(1.1) contrast(1.1);
    transition: all 0.3s ease;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

.product-card:hover img {
    filter: brightness(1.2) contrast(1.2) saturate(1.1);
}

/* Simplified image display - no conflicts */
img {
    max-width: 100%;
    height: auto;
}

/* Animated background elements */
@keyframes float {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    33% { transform: translateY(-10px) rotate(1deg); }
    66% { transform: translateY(5px) rotate(-1deg); }
}

.product-card:hover {
    animation: float 6s ease-in-out infinite;
}

/* Gold border class for all cards */
.card-border {
    border: 2px solid #FFD700 !important;
}

.card-border:hover {
    border: 2px solid #FFA500 !important;
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(255, 215, 0, 0.3);
}

/* Mobile touch improvements */
@media (max-width: 768px) {
    /* Disable hover effects on mobile and use touch instead */
    .card-border:hover {
        transform: none;
        border: 2px solid #FFD700 !important;
    }
    
    .card-border:active {
        transform: translateY(-4px);
        box-shadow: 0 10px 20px rgba(255, 215, 0, 0.2);
    }
    
    /* Mobile navigation specific */
    #mobile-menu {
        max-height: calc(100vh - 64px);
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    /* Mobile hamburger button */
    .mobile-menu-button {
        -webkit-tap-highlight-color: rgba(255, 215, 0, 0.3);
        tap-highlight-color: rgba(255, 215, 0, 0.3);
    }
    
    /* Mobile links */
    .mobile-nav-link {
        -webkit-tap-highlight-color: rgba(255, 215, 0, 0.1);
        tap-highlight-color: rgba(255, 215, 0, 0.1);
    }
    
    /* Ensure all clickable elements are finger-friendly */
    a, button, .mobile-nav-link {
        min-height: 44px;
        min-width: 44px;
    }
    
    /* Mobile product card improvements */
    .product-card {
        touch-action: manipulation;
    }
    
/* Mobile scroll improvements */
    body {
        -webkit-overflow-scrolling: touch;
    }
}

/* Icon Fallbacks */
.fas, .fab, .far {
    display: inline-block;
    font-style: normal;
    font-variant: normal;
    text-rendering: auto;
    line-height: 1;
}

/* Fallback for missing icons */
.fa-bars::before { content: "≡"; }
.fa-times::before { content: "×"; }
.fa-home::before { content: "🏠"; }
.fa-tshirt::before { content: "👕"; }
.fa-shopping-bag::before { content: "🛍️"; }
.fa-info-circle::before { content: "ℹ️"; }
.fa-envelope::before { content: "✉️"; }
.fa-shield-alt::before { content: "🛡️"; }
.fa-star::before { content: "⭐"; }
.fa-star-half-alt::before { content: "⭐"; }
.fa-lock::before { content: "🔒"; }
.fa-chevron-down::before { content: "⏷"; }
.fa-chevron-up::before { content: "⏶"; }
.fa-facebook-f::before { content: "f"; }
.fa-heart::before { content: "❤️"; }
.fa-praying-hands::before { content: "🙏"; }
.fa-shipping-fast::before { content: "🚚"; }
.fa-arrow-right::before { content: "→"; }
.fa-link::before { content: "🔗"; }
.fa-gavel::before { content: "⚖️"; }
.fa-file-contract::before { content: "📄"; }
.fa-undo::before { content: "↶"; }
.fa-money-bill-wave::before { content: "💵"; }
.fa-exclamation-circle::before { content: "⚠️"; }
.fa-cross::before { content: "♰"; }

/* Custom cross icon for faith-centered */
.faith-cross {
    font-family: Arial, sans-serif;
    font-size: 2rem;
    line-height: 1;
    color: black;
    display: inline-block;
}

/* Ensure icons are visible */
i[class*="fa-"]:empty::before,
i[class*="fas"]:empty::before,
i[class*="fab"]:empty::before,
i[class*="far"]:empty::before {
    opacity: 1;
    visibility: visible;
}

/* Force icon display for all Font Awesome icons */
i.fas, i.fab, i.far, i.fa {
    display: inline-block !important;
    font-style: normal !important;
    font-variant: normal !important;
    text-rendering: auto !important;
    line-height: 1 !important;
    -webkit-font-smoothing: antialiased !important;
    -moz-osx-font-smoothing: grayscale !important;
}

/* Specific icon fixes */
.fa-bars:not(.fa-loaded)::before { content: "☰" !important; font-family: Arial, sans-serif !important; }
.fa-times:not(.fa-loaded)::before { content: "✕" !important; font-family: Arial, sans-serif !important; }
.fa-home:not(.fa-loaded)::before { content: "⌂" !important; font-family: Arial, sans-serif !important; }
.fa-shield-alt:not(.fa-loaded)::before { content: "🛡" !important; font-family: Arial, sans-serif !important; }
.fa-star:not(.fa-loaded)::before { content: "★" !important; font-family: Arial, sans-serif !important; }
.fa-lock:not(.fa-loaded)::before { content: "🔒" !important; font-family: Arial, sans-serif !important; }

/* Mobile menu button specific fix */
.mobile-menu-button i {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Security Badge Styling */
#security-badge {
    backdrop-filter: blur(10px);
    animation: securityPulse 3s ease-in-out infinite;
}

#security-badge:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(34, 197, 94, 0.4);
}

@keyframes securityPulse {
    0%, 100% {
        box-shadow: 0 4px 15px rgba(34, 197, 94, 0.2);
    }
    50% {
        box-shadow: 0 6px 20px rgba(34, 197, 94, 0.4);
    }
}

/* Mobile security badge adjustments */
@media (max-width: 640px) {
    #security-badge {
        bottom: 4rem;
        left: 1rem;
        font-size: 0.75rem;
        padding: 0.75rem;
    }
    
    #security-badge .fa-shield-alt {
        font-size: 1.25rem;
    }
}

/* Button hover effects */
.btn-primary {
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.btn-primary:hover::before {
    left: 100%;
}

/* Image placeholder styles */
.image-placeholder {
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
    border: 2px dashed #FFD700;
    transition: all 0.3s ease;
}

.image-placeholder:hover {
    border-color: #B8860B;
    background: linear-gradient(135deg, #2d2d2d 0%, #1a1a1a 100%);
}