/* ============================================
   FPTStore — Critical CSS (Above the Fold)
   Variables, Base, Navbar, Hero, Toasts, Preloader
   ============================================ */

/* --- CSS Variables --- */
:root {
    --primary-color: #f37021;
    --secondary-color: #46b549;
    --hover-color: #d65d18;
    --text-color: #333;
}

/* --- Base --- */
body {
    font-family: 'Montserrat', sans-serif;
    color: var(--text-color);
}

.text-primary {
    color: var(--primary-color) !important;
}

.bg-primary {
    background-color: var(--primary-color) !important;
}

.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-primary:hover {
    background-color: var(--hover-color);
    border-color: var(--hover-color);
}

/* --- Navbar --- */
.navbar-brand img {
    height: 40px;
}

.navbar .nav-link {
    font-weight: 600;
    font-size: 1.02rem;
    letter-spacing: 0.2px;
    color: #1f1f1f;
    padding: 0 0.9rem !important;
    /* Increased spacing */
    border-radius: 999px;
    transition: color 0.2s ease, background-color 0.2s ease;
}

.navbar .navbar-nav .nav-link:hover,
.navbar .navbar-nav .nav-link.active,
.navbar .navbar-nav .show>.nav-link {
    color: var(--primary-color);
}

.navbar .dropdown-menu {
    border: 1px solid #f2e3d8;
    box-shadow: 0 12px 28px rgba(26, 26, 26, 0.12);
    border-radius: 12px;
    padding: 0.5rem;
    min-width: 220px;
}

.navbar .dropdown-item {
    border-radius: 8px;
    font-weight: 500;
    padding: 0.5rem 0.75rem;
}

.navbar .dropdown-item:hover,
.navbar .dropdown-item:focus {
    background-color: #fff2e8;
    color: var(--primary-color);
}

.navbar .dropdown-item.active {
    color: var(--primary-color);
    font-weight: 600;
}

.dropdown-submenu {
    position: relative;
}

.dropdown-submenu>.dropdown-menu {
    top: -0.45rem;
    left: calc(100% - 2px);
    margin-top: 0;
}

@media (min-width: 992px) {
    .navbar .dropdown-menu {
        display: block;
        opacity: 0;
        visibility: hidden;
        transform: translateY(8px);
        pointer-events: none;
        transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
    }

    .navbar .dropdown:hover>.dropdown-menu {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
        pointer-events: auto;
    }

    .dropdown-submenu>.dropdown-menu {
        display: block;
        opacity: 0;
        visibility: hidden;
        transform: translateX(8px);
        pointer-events: none;
        transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
    }

    .dropdown-submenu:hover>.dropdown-menu {
        opacity: 1;
        visibility: visible;
        transform: translateX(0);
        pointer-events: auto;
    }
}

@media (max-width: 991.98px) {
    .navbar .nav-link {
        padding: 10px 0.9rem !important;
    }

    .dropdown-submenu>.dropdown-menu {
        position: static;
        border: 0;
        box-shadow: none;
        margin-left: 0.75rem;
        padding-left: 0.35rem;
    }
}

/* --- Menu Separator --- */
@media (min-width: 992px) {
    .navbar-nav .nav-item {
        position: relative;
    }

    .navbar-nav .nav-item:not(:last-child)::after {
        content: "|";
        position: absolute;
        right: 0;
        top: 50%;
        transform: translateY(-50%);
        color: #9ca3af;
        /* Darker gray for visibility */
        font-weight: 300;
        font-size: 0.9rem;
        pointer-events: none;
        z-index: 10;
    }
}

/* --- Hero Section --- */
.hero-section {
    background: linear-gradient(135deg, #fff5f0 0%, #fff 100%);
    padding: 80px 0;
}

/* --- Toast Notifications --- */
.toast-container {
    position: fixed;
    top: 30px;
    right: 30px;
    z-index: 10000;
}

.custom-toast {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 16px;
    padding: 20px 25px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
    transform: translateX(130%);
    transition: all 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    min-width: 320px;
    max-width: 450px;
}

.custom-toast.show {
    transform: translateX(0);
}

.custom-toast.success {
    border-left: 6px solid #46b549;
}

.custom-toast.error {
    border-left: 6px solid #f37021;
}

.toast-icon {
    width: 45px;
    height: 45px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    flex-shrink: 0;
}

.success .toast-icon {
    background: rgba(70, 181, 73, 0.15);
    color: #46b549;
}

.error .toast-icon {
    background: rgba(243, 112, 33, 0.15);
    color: #f37021;
}

.toast-content {
    flex-grow: 1;
}

.toast-title {
    font-weight: 800;
    margin-bottom: 2px;
    color: #1a1a1a;
    font-size: 1.1rem;
}

.toast-message {
    font-size: 0.95rem;
    color: #555;
    line-height: 1.4;
}

@keyframes progress {
    0% {
        width: 100%;
    }

    100% {
        width: 0%;
    }
}

.toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 4px;
    background: rgba(0, 0, 0, 0.05);
    width: 100%;
    border-radius: 0 0 0 16px;
}

.toast-progress-bar {
    height: 100%;
    border-radius: 0 0 0 16px;
    width: 100%;
}

.success .toast-progress-bar {
    background: #46b549;
}

.error .toast-progress-bar {
    background: #f37021;
}

/* --- Preloader --- */
#preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #ffffff;
    z-index: 11000;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.6s ease, transform 0.8s cubic-bezier(0.77, 0, 0.175, 1), visibility 0.8s;
}

#preloader.fade-out {
    opacity: 0;
    visibility: hidden;
    transform: scale(1.1);
    pointer-events: none;
}

.content-hidden {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 1s ease, transform 1s cubic-bezier(0.19, 1, 0.22, 1);
}

.content-visible {
    opacity: 1 !important;
    transform: translateY(0) !important;
}

.loader-content {
    text-align: center;
    position: relative;
    z-index: 2;
}

.loader-logo {
    height: 60px;
    margin-bottom: 25px;
    animation: loaderPulse 2s ease-in-out infinite;
}

@keyframes loaderPulse {

    0%,
    100% {
        transform: scale(1);
        opacity: 0.8;
        filter: drop-shadow(0 0 0px rgba(243, 112, 33, 0));
    }

    50% {
        transform: scale(1.1);
        opacity: 1;
        filter: drop-shadow(0 0 20px rgba(243, 112, 33, 0.4));
    }
}

.loader-progress {
    width: 150px;
    height: 4px;
    background: rgba(0, 0, 0, 0.05);
    border-radius: 10px;
    margin: 0 auto;
    overflow: hidden;
    position: relative;
}

.loader-bar {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--primary-color), #f7931e);
    border-radius: 10px;
    transition: width 0.25s linear;
}

.preloader-bg {
    position: absolute;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 50% 50%, rgba(243, 112, 33, 0.05) 0%, rgba(255, 255, 255, 0) 70%);
    z-index: 1;
}