/* ============================================
   KOCER FRUIT - Performance & Enhancement CSS
   Premium animations, preloader, and mobile fixes
   ============================================ */

/* ===========================================
   PRELOADER
   =========================================== */
.preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 50%, #dbeafe 100%);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.preloader.hidden {
    opacity: 0;
    visibility: hidden;
}

/* Logo Container with Pulse Animation */
.preloader-logo {
    width: 280px;
    height: auto;
    animation: logoPulse 2s ease-in-out infinite;
    filter: drop-shadow(0 10px 30px rgba(30, 58, 138, 0.3));
}

/* Hide old spinner - keep for fallback */
.preloader-spinner {
    display: none;
}

.preloader-text {
    margin-top: 2rem;
    color: #1e3a8a;
    font-family: 'Outfit', sans-serif;
    font-size: 1rem;
    font-weight: 500;
    letter-spacing: 3px;
    text-transform: uppercase;
    animation: textFade 2s ease-in-out infinite;
}

/* Premium Logo Pulse Animation */
@keyframes logoPulse {

    0%,
    100% {
        transform: scale(1);
        filter: drop-shadow(0 10px 30px rgba(30, 58, 138, 0.3));
    }

    50% {
        transform: scale(1.08);
        filter: drop-shadow(0 15px 40px rgba(30, 58, 138, 0.5));
    }
}

/* Text Fade Animation */
@keyframes textFade {

    0%,
    100% {
        opacity: 0.6;
    }

    50% {
        opacity: 1;
    }
}

/* Mobile Responsive Preloader */
@media (max-width: 768px) {
    .preloader-logo {
        width: 200px;
    }

    .preloader-text {
        font-size: 0.85rem;
        letter-spacing: 2px;
    }
}

@media (max-width: 480px) {
    .preloader-logo {
        width: 160px;
    }

    .preloader-text {
        font-size: 0.75rem;
    }
}

/* ===========================================
   SCROLL ANIMATIONS (Fade In on Scroll)
   =========================================== */
.fade-in-up {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.fade-in-up.visible {
    opacity: 1;
    transform: translateY(0);
}

.fade-in-left {
    opacity: 0;
    transform: translateX(-40px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.fade-in-left.visible {
    opacity: 1;
    transform: translateX(0);
}

.fade-in-right {
    opacity: 0;
    transform: translateX(40px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.fade-in-right.visible {
    opacity: 1;
    transform: translateX(0);
}

.scale-in {
    opacity: 0;
    transform: scale(0.9);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.scale-in.visible {
    opacity: 1;
    transform: scale(1);
}

/* ===========================================
   LAZY LOADING IMAGES
   =========================================== */
img[data-src] {
    opacity: 0;
    transition: opacity 0.5s ease;
}

img[data-src].loaded {
    opacity: 1;
}

/* Image skeleton placeholder */
.img-skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }

    100% {
        background-position: 200% 0;
    }
}

/* ===========================================
   SMOOTH SCROLL
   =========================================== */
html {
    scroll-behavior: smooth;
}

/* ===========================================
   ENHANCED MOBILE RESPONSIVENESS
   =========================================== */

/* Tablet Breakpoint */
@media (max-width: 1024px) {
    .nav-links {
        gap: 0.5rem;
    }

    .nav-links li a {
        padding: 0.5rem 0.8rem;
        font-size: 0.9rem;
    }

    .btn-contact-modern {
        padding: 0.6rem 1.2rem;
        font-size: 0.9rem;
    }

    .hero {
        min-height: 500px;
    }

    .hero h1 {
        font-size: 2.8rem;
    }

    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }

    .brands-grid {
        gap: 1.5rem;
    }

    .brand-item {
        width: 400px;
        height: 440px;
    }

    .brand-img {
        width: 280px;
        height: 280px;
    }

    .logistics-container {
        flex-direction: column;
    }

    .logistics-content,
    .logistics-image-wrapper {
        width: 100%;
    }
}

/* Mobile Breakpoint */
@media (max-width: 768px) {

    /* Show mobile-only elements */
    .mobile-only {
        display: block !important;
    }

    /* Header Mobile */
    .header-top {
        padding: 0.4rem 0;
        font-size: 0.75rem;
    }

    .top-bar-content {
        flex-direction: column;
        gap: 0.5rem;
        padding: 0 3%;
    }

    .top-left {
        flex-wrap: wrap;
        justify-content: center;
        gap: 0.8rem;
    }

    .top-right {
        gap: 1rem;
    }

    .social-links a {
        width: 32px;
        height: 32px;
        font-size: 1rem;
    }

    .header-main {
        padding: 0.5rem 0;
    }

    .nav-container {
        padding: 0 3%;
    }

    /* Logo Mobile Fix */
    .logo {
        width: 100px;
        height: 40px;
    }

    .logo-mobile {
        height: 60px;
        display: block !important;
    }

    .logo-desktop {
        display: none !important;
    }

    /* Navigation Hidden on Mobile */
    .nav-links {
        position: fixed;
        top: 0;
        right: -100%;
        width: 85%;
        max-width: 320px;
        height: 100vh;
        background: white;
        flex-direction: column;
        padding: 2rem;
        padding-top: 200px;
        box-shadow: -5px 0 20px rgba(0, 0, 0, 0.1);
        transition: right 0.3s ease;
        z-index: 1001;
        margin: 0;
        align-items: stretch;
    }

    .nav-links.active {
        right: 0;
    }

    .nav-links li a {
        padding: 1rem;
        font-size: 1rem;
        border-bottom: 1px solid #f0f0f0;
        display: block;
    }

    .mobile-menu-btn {
        display: block !important;
        z-index: 1002;
    }

    .btn-contact-modern {
        display: none;
    }

    /* Mobile Nav Header */
    .mobile-nav-header {
        display: block !important;
        position: absolute;
        top: 0.5rem;
        left: 1rem;
    }

    .mobile-nav-logo {
        height: 150px;
        width: auto;
    }

    /* Hero Mobile */
    .hero {
        height: auto;
        min-height: 450px;
        padding: 80px 5% 60px;
        margin-top: 100px;
    }

    .hero h1 {
        font-size: 2rem;
        line-height: 1.2;
    }

    .hero p {
        font-size: 1rem;
        margin-bottom: 1.5rem;
    }

    .btn-primary {
        padding: 0.8rem 1.5rem;
        font-size: 0.9rem;
    }

    /* Sections Mobile */
    .section {
        padding: 3rem 4%;
    }

    .section-title {
        font-size: 1.8rem;
        margin-bottom: 2rem;
    }

    /* Products Grid Mobile */
    .products-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        padding: 0 2%;
    }

    .product-card {
        max-width: 100%;
    }

    .product-img {
        height: 200px;
    }

    .product-info {
        padding: 1rem;
    }

    .product-info h3 {
        font-size: 1.3rem;
    }

    .product-info p {
        font-size: 0.9rem;
    }

    /* Brands Grid Mobile */
    .brands-section {
        padding: 3rem 4%;
    }

    .brands-grid {
        gap: 1rem;
        justify-content: center;
    }

    .brand-item {
        width: calc(50% - 0.5rem);
        max-width: 320px;
        height: auto;
        min-height: 320px;
        padding: 1rem;
    }

    .brand-img {
        width: 200px;
        height: 200px;
    }

    .brand-name {
        font-size: 0.9rem;
    }

    /* Marquee Mobile */
    .marquee-section {
        padding: 2rem 0;
    }

    .marquee-content span {
        font-size: 1.5rem;
    }

    /* Logistics Mobile */
    .logistics-section {
        padding: 3rem 4%;
    }

    .logistics-container {
        flex-direction: column;
        gap: 2rem;
    }

    .logistics-content {
        order: 2;
    }

    .logistics-image-wrapper {
        order: 1;
    }

    .logistics-img {
        max-height: 300px;
        width: 100%;
        object-fit: cover;
        border-radius: 12px;
    }

    .features-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .feature-card {
        flex-direction: row;
        padding: 1rem;
    }

    /* Global Section Mobile */
    .global-section {
        padding: 3rem 4%;
    }

    #world-map {
        height: 300px !important;
        min-height: 300px;
    }

    /* Footer Mobile */
    .footer-content {
        flex-direction: column;
        gap: 2rem;
        padding: 0 4%;
    }

    .footer-col {
        width: 100%;
        text-align: center;
    }

    .footer-col.brand-col {
        order: 1;
    }

    .footer-col.links-col {
        order: 2;
    }

    .footer-col.contact-col-modern {
        order: 3;
    }

    .footer-logo img {
        max-height: 80px !important;
    }

    .footer-desc {
        text-align: center;
    }

    .footer-social {
        justify-content: center;
    }

    .social-icons {
        justify-content: center;
    }

    .footer-links {
        text-align: center;
    }

    .footer-links li {
        display: block;
        margin-bottom: 0.5rem;
    }

    .contact-item-modern {
        justify-content: flex-start;
        text-align: left;
        width: 100%;
        max-width: 320px;
        margin-left: auto;
        margin-right: auto;
    }

    .contact-item-modern .icon-circle {
        flex-shrink: 0;
        width: 60px;
        height: 60px;
    }

    .contact-item-modern .contact-text {
        text-align: left;
    }

    .footer-bottom {
        padding: 1.5rem 4%;
    }

    .footer-bottom p {
        font-size: 0.85rem !important;
    }
}

/* Small Mobile Breakpoint */
@media (max-width: 480px) {
    .hero {
        min-height: 400px;
        margin-top: 90px;
    }

    .hero h1 {
        font-size: 1.6rem;
    }

    .hero p {
        font-size: 0.9rem;
    }

    .section-title {
        font-size: 1.5rem;
    }

    .product-img {
        height: 180px;
    }

    .brand-item {
        width: calc(50% - 0.5rem);
        min-height: 280px;
    }

    .brand-img {
        width: 160px;
        height: 160px;
    }

    .brand-name {
        font-size: 0.8rem;
    }

    .feature-card {
        padding: 0.8rem;
    }

    .feature-icon {
        font-size: 1.5rem;
    }

    .feature-info h4 {
        font-size: 1rem;
    }

    .feature-info p {
        font-size: 0.85rem;
    }

    #world-map {
        height: 250px !important;
    }
}

/* ===========================================
   GPU ACCELERATION & PERFORMANCE
   =========================================== */
.product-card,
.brand-item,
.feature-card,
.btn-primary,
.btn-contact-modern,
.social-links a {
    will-change: transform;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

/* 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;
    }

    html {
        scroll-behavior: auto;
    }
}

/* ===========================================
   TOUCH DEVICE OPTIMIZATIONS
   =========================================== */
@media (hover: none) {

    .product-card:hover,
    .brand-item:hover,
    .btn-primary:hover {
        transform: none;
    }

    .product-card:active {
        transform: scale(0.98);
    }

    .brand-item:active {
        transform: scale(0.98);
    }
}

/* ===========================================
   PRINT STYLES
   =========================================== */
@media print {

    .preloader,
    .header-top,
    .mobile-menu-btn,
    .social-links,
    .btn-contact-modern {
        display: none !important;
    }

    .hero {
        margin-top: 0;
        height: auto;
        min-height: auto;
        padding: 2rem;
    }

    .section {
        page-break-inside: avoid;
    }
}