/* ========================================
   Homepage Interactive Enhancements
   ======================================== */

/* ---- Scroll Reveal Animations ---- */
.reveal {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}
.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}
.reveal-left {
    opacity: 0;
    transform: translateX(-50px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}
.reveal-left.visible {
    opacity: 1;
    transform: translateX(0);
}
.reveal-right {
    opacity: 0;
    transform: translateX(50px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}
.reveal-right.visible {
    opacity: 1;
    transform: translateX(0);
}
.reveal-scale {
    opacity: 0;
    transform: scale(0.9);
    transition: opacity 0.6s ease, transform 0.6s ease;
}
.reveal-scale.visible {
    opacity: 1;
    transform: scale(1);
}

/* Stagger children */
.stagger-children > * {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}
.stagger-children.visible > *:nth-child(1) { transition-delay: 0s; opacity: 1; transform: translateY(0); }
.stagger-children.visible > *:nth-child(2) { transition-delay: 0.1s; opacity: 1; transform: translateY(0); }
.stagger-children.visible > *:nth-child(3) { transition-delay: 0.2s; opacity: 1; transform: translateY(0); }
.stagger-children.visible > *:nth-child(4) { transition-delay: 0.3s; opacity: 1; transform: translateY(0); }
.stagger-children.visible > *:nth-child(5) { transition-delay: 0.4s; opacity: 1; transform: translateY(0); }
.stagger-children.visible > *:nth-child(6) { transition-delay: 0.5s; opacity: 1; transform: translateY(0); }

/* ---- Service Cards Interactive ---- */
.service-card {
    transition: transform 0.35s ease, box-shadow 0.35s ease !important;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}
.service-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.08), transparent);
    transition: left 0.6s ease;
}
.service-card:hover {
    transform: translateY(-8px) !important;
    box-shadow: 0 20px 40px rgba(0,0,0,0.12) !important;
}
.service-card:hover::after {
    left: 100%;
}
.service-card .card-icon-lg {
    transition: transform 0.4s ease, color 0.3s ease;
}
.service-card:hover .card-icon-lg {
    transform: scale(1.15) rotate(-5deg);
}

/* ---- Stats Cards Pulse ---- */
.stats-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease !important;
}
.stats-card:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 12px 30px rgba(0,0,0,0.15) !important;
}

/* ---- Counter Numbers ---- */
.counter-item h3 {
    transition: transform 0.3s ease;
}
.counter-item:hover h3 {
    transform: scale(1.1);
}
.counter-item {
    transition: background 0.3s ease, transform 0.3s ease;
}
.counter-item:hover {
    background: rgba(0,132,212,0.04);
    border-radius: 12px;
    transform: translateY(-3px);
}

/* ---- Testimonial Cards ---- */
.testimonial-card {
    transition: transform 0.4s ease, box-shadow 0.4s ease !important;
}
.testimonial-card:hover {
    transform: translateY(-6px) !important;
    box-shadow: 0 16px 40px rgba(0,0,0,0.1) !important;
}
.testimonial-card .testimonial-image img {
    transition: transform 0.4s ease;
}
.testimonial-card:hover .testimonial-image img {
    transform: scale(1.05);
}

/* ---- Warehouse Cards ---- */
.warehouse-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease !important;
}
.warehouse-card:hover {
    transform: translateY(-5px) !important;
    box-shadow: 0 12px 30px rgba(0,0,0,0.1) !important;
    border-color: #0084d4 !important;
}

/* ---- Partner Logos Float ---- */
.partner-logo {
    transition: transform 0.4s ease, filter 0.3s ease !important;
    filter: grayscale(0.3);
}
.partner-logo:hover {
    transform: translateY(-5px) scale(1.08) !important;
    filter: grayscale(0) !important;
}

/* ---- Tracking Input Focus ---- */
.tracking-input-modern {
    transition: border-color 0.3s ease, box-shadow 0.3s ease !important;
}
.tracking-input-modern:focus {
    box-shadow: 0 0 0 4px rgba(0,132,212,0.15) !important;
}

/* ---- Track Button ---- */
.btn-track-now {
    transition: transform 0.2s ease, box-shadow 0.3s ease !important;
}
.btn-track-now:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,132,212,0.3) !important;
}
.btn-track-now:active {
    transform: translateY(0);
}

/* ---- About Image ---- */
.about-image {
    transition: transform 0.5s ease;
    overflow: hidden;
    border-radius: 12px;
}
.about-image:hover {
    transform: scale(1.02);
}
.about-image img {
    transition: transform 0.6s ease;
}
.about-image:hover img {
    transform: scale(1.05);
}

/* ---- Step Numbers Bounce ---- */
.step-number {
    transition: transform 0.3s ease, box-shadow 0.3s ease !important;
}
.step:hover .step-number {
    transform: scale(1.15);
    box-shadow: 0 6px 20px rgba(0,132,212,0.3);
}
.step {
    transition: background 0.3s ease;
    border-radius: 12px;
    padding: 8px;
}
.step:hover {
    background: rgba(0,132,212,0.03);
}

/* ---- Header Buttons ---- */
.header-buttons .btn {
    transition: transform 0.2s ease, box-shadow 0.3s ease !important;
}
.header-buttons .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15) !important;
}

/* ---- Map Markers - No animation to prevent blur ---- */

/* ---- Typing Effect for Hero ---- */
.text-highlight {
    position: relative;
}
.text-highlight::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 3px;
    background: linear-gradient(90deg, #0084d4, #2cbeff);
    border-radius: 2px;
    transition: width 0.6s ease;
}
.hero-text:hover .text-highlight::after,
.visible .text-highlight::after {
    width: 100%;
}

/* ---- Floating Cards Animation ---- */
@keyframes floatUp {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

/* ============================================
   Responsive — Homepage, Customer & Manufacturer
   ============================================ */

/* ---- Header: hide portal buttons on mobile, show hamburger ---- */
@media (max-width: 767px) {
    .header-buttons .btn { display: none !important; }
    .header-buttons .mobile-menu-toggle { display: flex !important; }

    /* Mobile nav dropdown includes portal links */
    .nav-menu {
        display: none;
        position: fixed;
        top: 60px;
        left: 0;
        right: 0;
        background: #fff;
        flex-direction: column;
        padding: 1rem 1.5rem;
        box-shadow: 0 8px 24px rgba(0,0,0,0.1);
        z-index: 999;
        gap: 0;
    }
    .nav-menu.active {
        display: flex !important;
    }
    .nav-menu li { padding: 10px 0; border-bottom: 1px solid #f0f0f0; }
    .nav-menu li:last-child { border-bottom: none; }
    .nav-menu a { font-size: 0.95rem; }

    /* Mobile portal links injected via JS */
    .nav-menu .mobile-portal-link {
        display: block;
        padding: 10px 14px;
        margin-top: 4px;
        background: #f0f9ff;
        border-radius: 8px;
        color: #0284c7;
        font-weight: 600;
        font-size: 0.9rem;
        text-decoration: none;
        text-align: center;
    }
    .nav-menu .mobile-portal-link:last-child { margin-bottom: 0; }
}

/* ---- Tablet (992px) ---- */
@media (max-width: 991px) {
    /* Hero: stack to 1 column */
    .hero-section .container > div { grid-template-columns: 1fr !important; gap: 2rem !important; }
    .hero-section { min-height: auto !important; padding: 6rem 0 3rem !important; }

    /* Tracking: stack */
    #tracking .container > div:first-child { grid-template-columns: 1fr !important; gap: 1.5rem !important; }

    /* Story: stack */
    #about .container > div > div { grid-template-columns: 1fr !important; }
    #about [style*="min-height:500px"] { min-height: 300px !important; }
    #about [style*="grid-template-columns:repeat(3"] { grid-template-columns: repeat(3, 1fr) !important; }

    /* Counters: 2-col */
    .counter-grid, [style*="grid-template-columns:repeat(4"] { grid-template-columns: repeat(2, 1fr) !important; }

    /* Service bottom row: 2-col */
    [style*="grid-template-columns:repeat(3,1fr)"] { grid-template-columns: 1fr 1fr !important; }

    /* Warehouse: stack list on top of map */
    [style*="grid-template-columns:30%"] { grid-template-columns: 1fr !important; }
    #wh-list { max-height: 250px !important; }
    #map { height: 300px !important; }

    /* How it works steps */
    .hw-step { padding: 0 0.5rem !important; }

    /* Manufacturer portal: smaller card min */
    #manufacturers-grid { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)) !important; }

    /* Page header stats: wrap */
    .page-header-section [style*="display: flex; justify-content: center; gap: 3rem"] { gap: 1.5rem !important; }
}

/* ---- Mobile (767px) ---- */
@media (max-width: 767px) {
    /* Typography */
    .hero-section h1 { font-size: 2rem !important; }
    h2[style*="font-size:2rem"], h2[style*="font-size:2.2rem"] { font-size: 1.5rem !important; }
    [style*="font-size:1.6rem"] { font-size: 1.3rem !important; }
    h1[style*="font-size:2.5rem"] { font-size: 1.8rem !important; }

    /* Hero image */
    .hero-section [style*="max-height:550px"] { max-height: 300px !important; }

    /* Hide floating stat cards on hero */
    .hero-section .reveal-right > [style*="position:absolute"] { display: none !important; }

    /* All 2-col grids → 1-col */
    [style*="grid-template-columns:1fr 1fr"] { grid-template-columns: 1fr !important; }
    [style*="grid-template-columns:repeat(3,1fr)"] { grid-template-columns: 1fr !important; }
    [style*="grid-template-columns:repeat(4,1fr)"] { grid-template-columns: repeat(2, 1fr) !important; }

    /* How it works: vertical */
    .hw-step { flex: none !important; width: 100% !important; }
    [style*="display:flex;justify-content:center;gap:0;"] { flex-direction: column !important; gap: 2rem !important; }
    /* Hide connector line on mobile */
    [style*="display:flex;justify-content:center;gap:0;"] > [style*="position:absolute;top:40px"] { display: none !important; }

    /* Testimonials: 1 per slide */
    #testi-carousel [style*="min-width:50%"] { min-width: 100% !important; }
    #testi-prev, #testi-next { display: none !important; }

    /* PO Tracking: stack */
    #tracking [style*="display:grid"] { display: block !important; }
    #tracking [style*="display:grid"] > div:first-child { margin-bottom: 1.5rem; }
    #tracking [style*="display:flex;gap:1.5rem"] { flex-wrap: wrap; gap: 0.75rem !important; }
    #tracking form[style*="display:flex"] { flex-direction: column !important; }
    #tracking form[style*="display:flex"] button { width: 100%; justify-content: center; }

    /* Section padding reduction */
    section[style*="padding:5rem"] { padding: 3rem 0 !important; }
    section[style*="padding:3rem"] { padding: 2rem 0 !important; }
    section[style*="padding:2.5rem"] { padding: 1.5rem 0 !important; }

    /* CTA buttons: stack */
    [style*="display:flex;gap:12px;flex-wrap:wrap;margin-bottom:2rem"] { flex-direction: column; }
    [style*="display:flex;gap:12px;flex-wrap:wrap;margin-bottom:2rem"] a { text-align: center; justify-content: center; }
    [style*="display:flex;gap:12px;justify-content:center"] { flex-direction: column; align-items: center; }
    [style*="display:flex;gap:12px;justify-content:center"] a { width: 100%; max-width: 300px; text-align: center; justify-content: center; }

    /* Story buttons */
    #about [style*="display:flex;gap:12px;flex-wrap:wrap"] { flex-direction: column; }
    #about [style*="display:flex;gap:12px;flex-wrap:wrap"] a { text-align: center; justify-content: center; width: 100%; }

    /* Story text padding */
    #about [style*="padding:3rem"] { padding: 1.5rem !important; }

    /* Manufacturer Portal */
    .page-header-section { padding: 3rem 0 !important; }
    .page-header-section h1[style*="font-size: 2.5rem"] { font-size: 1.6rem !important; }
    .page-header-section p[style*="font-size: 1.1rem"] { font-size: 0.9rem !important; }
    .page-header-section [style*="display: flex; justify-content: center; gap: 3rem"] { gap: 1rem !important; }
    .page-header-section [style*="font-size: 2.5rem"] { font-size: 1.8rem !important; }
    #manufacturers-grid { grid-template-columns: 1fr !important; }

    /* Partnership logos */
    [style*="display:flex;align-items:center;gap:1.5rem;flex-wrap:wrap"] img { height: 22px !important; }
}

/* ---- Small phones (480px) ---- */
@media (max-width: 480px) {
    .hero-section h1 { font-size: 1.6rem !important; }

    /* All 2-col → 1-col */
    [style*="grid-template-columns:repeat(2"] { grid-template-columns: 1fr !important; }

    /* Story overlay stats: single col */
    #about [style*="grid-template-columns:repeat(3"] { grid-template-columns: 1fr !important; gap: 0.5rem !important; }
    #about [style*="min-height:500px"], #about [style*="min-height:300px"] { min-height: 200px !important; }

    /* Service cards: stack icon + text */
    .svc-card [style*="display:flex;align-items:flex-start;gap:1.5rem"] { flex-direction: column; gap: 1rem !important; }

    /* Testimonial text smaller */
    #testi-carousel p[style*="font-size:1.15rem"] { font-size: 0.95rem !important; }

    /* Counter numbers smaller */
    [style*="font-size:2rem;font-weight:700"], [style*="font-size:2.2rem;font-weight:700"] { font-size: 1.5rem !important; }

    /* Manufacturer portal stats */
    .page-header-section [style*="display: flex; justify-content: center"] { flex-direction: column; gap: 0.75rem !important; }

    /* Container padding bump */
    .container { padding-left: 1rem !important; padding-right: 1rem !important; }

    /* Search input full width */
    #manufacturer-search { font-size: 0.9rem !important; }

    /* WhatsApp floating: smaller */
    a[title="Chat via WhatsApp"] { width: 50px !important; height: 50px !important; bottom: 16px !important; right: 16px !important; }
    a[title="Chat via WhatsApp"] svg { width: 26px !important; height: 26px !important; }
}

/* ---- Smooth Page Load ---- */
body {
    animation: pageLoad 0.6s ease;
}
@keyframes pageLoad {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* ---- Parallax-lite on hero ---- */
.hero-section {
    overflow: hidden;
}
.hero-visual {
    transition: transform 0.3s ease;
}

/* ---- Section Dividers ---- */
.section + .section {
    position: relative;
}

/* ---- WhatsApp Floating Pulse ---- */
a[title="Chat via WhatsApp"] {
    animation: waPulse 2.5s infinite;
}
@keyframes waPulse {
    0%, 100% { box-shadow: 0 4px 12px rgba(37,211,102,0.3); }
    50% { box-shadow: 0 4px 24px rgba(37,211,102,0.5); }
}
