/* ============================================================
   BestFoodPack - Main Stylesheet
   Food Vacuum Packaging B2B Export Website
   Brand Color: #09958b
   ============================================================ */

/* ==================== CSS Variables ==================== */
:root {
    --brand: #09958b;
    --brand-dark: #077a71;
    --brand-light: #0bb8a8;
    --text-primary: #111827;
    --text-secondary: #4b5563;
    --text-muted: #9ca3af;
    --bg-light: #f9fafb;
    --white: #ffffff;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    --transition-base: 300ms ease;
}

/* ==================== Smooth Scroll ==================== */
html {
    scroll-behavior: smooth;
    scroll-padding-top: 80px;
}

/* ==================== Selection Color ==================== */
::selection {
    background-color: var(--brand);
    color: var(--white);
}

/* ==================== Font Smoothing ==================== */
body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

/* ==================== Navigation ==================== */
.nav-item.active {
    color: var(--brand) !important;
    font-weight: 600;
}

.nav-item.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 2px;
    background-color: var(--brand);
    border-radius: 1px;
}

.nav-item {
    position: relative;
}

/* Dropdown menu arrow on hover */
.dropdown:hover .dropdown-toggle {
    color: var(--brand);
}

/* ==================== Carousel Animation ==================== */
.carousel-slide {
    transition: opacity 700ms ease-in-out;
}

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

.animate-slide-up {
    animation: slideUp 0.6s ease-out forwards;
    opacity: 0;
}

/* ==================== Product Card Hover Effect ==================== */
.product-card {
    transform: translateY(0);
    transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94), box-shadow 0.4s ease;
}

.product-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-xl);
}

.product-card.hidden-product {
    display: none;
}

/* ==================== Product Category Tabs ==================== */
.product-tab.active {
    background-color: var(--brand);
    color: var(--white);
    box-shadow: var(--shadow-md);
}

/* ==================== Sidebar Buttons Hover ==================== */
.sidebar-btn:hover {
    transform: translateX(-4px);
    transition: all 0.3s ease;
}

/* Back to Top Button Visibility */
#back-to-top.visible {
    opacity: 1 !important;
    visibility: visible !important;
}

/* ==================== Mobile Menu ==================== */
#mobile-menu.open {
    transform: translateX(0);
}

#mobile-menu-overlay.open {
    display: block !important;
}

.mobile-submenu.open {
    display: block !important;
}

.mobile-dropdown-toggle.open svg {
    transform: rotate(180deg);
}

/* ==================== Search Overlay ==================== */
#search-overlay.open {
    display: flex !important;
}

#search-overlay:not(.hidden) {
    display: flex;
}

/* Search input placeholder color */
#search-input::placeholder {
    color: #9ca3af;
}

/* Search overlay close button hover effect */
#search-close:hover {
    transform: scale(1.1);
}

/* ==================== Line Clamp Utility ==================== */
.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ==================== Sticky Header Shadow on Scroll ==================== */
#main-nav.scrolled {
    box-shadow: var(--shadow-lg);
}

/* ==================== Newsletter Input Focus ==================== */
#newsletter-email:focus {
    outline: none;
}

/* ==================== Product Card Reveal Animation ==================== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.product-card.animate-in {
    animation: fadeInUp 0.4s ease-out forwards;
}

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

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

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

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* ==================== Focus States for Accessibility ==================== */
a:focus-visible,
button:focus-visible,
input:focus-visible {
    outline: 2px solid var(--brand);
    outline-offset: 2px;
}

/* ==================== Print Styles ==================== */
@media print {
    #fixed-sidebar,
    #mobile-menu,
    #mobile-menu-overlay,
    #search-overlay {
        display: none !important;
    }
}

/* ==================== Loading Spinner (for newsletter) ==================== */
@keyframes spin {
    to { transform: rotate(360deg); }
}

.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    display: inline-block;
}

/* ==================== Reduced Motion ==================== */
@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
    .animate-slide-up,
    .product-card.animate-in {
        animation: none;
        opacity: 1;
    }
    .carousel-slide {
        transition: none;
    }
}
