/* =========================================
   FINAL PRELOADER ANIMATION (Sequential Drawing/Erasing)
   ========================================= */

/* =========================================
   PRELOADER ANIMATION (Sequential Drawing/Erasing - SLOWED)
   ========================================= */

:root {
    --tj-theme-primary: #D61A3C; /* Assuming Red */
    --loader-size: 100px;
    --border-thickness: 3px;
    --anim-duration: 7s  !important; /* <<< INCREASED DURATION TO 8 SECONDS */
}

/* 1. Container for the logo and animation */
.animation-preloader .spinner {
    position: relative;
    width: var(--loader-size);
    height: var(--loader-size);
    margin: 0 auto 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 2. The Border Box (The static container for the animated border) */
.logo-border-box {
    position: absolute;
    width: var(--loader-size);
    height: var(--loader-size);
    border-radius: 6px;
}

/* 3. The Logo Holder (Static Content) */
.animation-preloader .loader-icon {
    width: 100%;
    height: 100%;
    z-index: 2;
    background-color: #fff;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 4. The Logo Image (Ensured to be STATIC) */
.animation-preloader .loader-icon img {
    width: 80%;
    height: 80%;
    object-fit: contain;
    transform: none; 
    animation: none;
}


/* 5. The Animated Border (::before) - Uses background-size to "draw" the lines */
.logo-border-box::before {
    content: '';
    position: absolute;
    inset: -5px; /* Creates padding around the box */
    border-radius: 6px; 
    
    /* Define the four sides using background-image gradients */
    background-image:
        linear-gradient(to right, var(--tj-theme-primary), var(--tj-theme-primary)), /* Top */
        linear-gradient(to bottom, var(--tj-theme-primary), var(--tj-theme-primary)), /* Right */
        linear-gradient(to left, var(--tj-theme-primary), var(--tj-theme-primary)), /* Bottom */
        linear-gradient(to top, var(--tj-theme-primary), var(--tj-theme-primary)); /* Left */
    
    background-repeat: no-repeat;
    background-position: top left, top right, bottom right, bottom left;
    
    /* Apply the animation with the new, long duration */
    animation: drawBorder var(--anim-duration) ease-in-out infinite;
    z-index: 1;
}

/* --- KEYFRAME ANIMATION (SLOWED DOWN) --- */

@keyframes drawBorder {
    0% { 
        background-size: 0% var(--border-thickness), var(--border-thickness) 0%, 0% var(--border-thickness), var(--border-thickness) 0%; 
        opacity: 1;
    }
    
    /* 1. Draw Top (Left to Right) */
    10% { background-size: 100% var(--border-thickness), var(--border-thickness) 0%, 0% var(--border-thickness), var(--border-thickness) 0%; }
    
    /* 2. Draw Right (Top to Bottom) */
    20% { background-size: 100% var(--border-thickness), var(--border-thickness) 100%, 0% var(--border-thickness), var(--border-thickness) 0%; }
    
    /* 3. Draw Bottom (Right to Left) */
    30% { background-size: 100% var(--border-thickness), var(--border-thickness) 100%, 100% var(--border-thickness), var(--border-thickness) 0%; }
    
    /* 4. Draw Left (Bottom to Top) - FULL FRAME COMPLETE */
    40% { background-size: 100% var(--border-thickness), var(--border-thickness) 100%, 100% var(--border-thickness), var(--border-thickness) 100%; }
    
    /* 5. Hold Full Frame */
    60% { background-size: 100% var(--border-thickness), var(--border-thickness) 100%, 100% var(--border-thickness), var(--border-thickness) 100%; }
    
    /* 6. Erase Top (Right to Left) - Simulates reversal */
    70% { background-size: 0% var(--border-thickness), var(--border-thickness) 100%, 100% var(--border-thickness), var(--border-thickness) 100%; }
    
    /* 7. Erase Right (Bottom to Top) */
    80% { background-size: 0% var(--border-thickness), var(--border-thickness) 0%, 100% var(--border-thickness), var(--border-thickness) 100%; }
    
    /* 8. Erase Bottom (Left to Right) */
    90% { background-size: 0% var(--border-thickness), var(--border-thickness) 0%, 0% var(--border-thickness), var(--border-thickness) 100%; }
    
    /* 9. Erase Left (Top to Bottom) - FRAME EMPTY, ready for reset */
    100% { 
        background-size: 0% var(--border-thickness), var(--border-thickness) 0%, 0% var(--border-thickness), var(--border-thickness) 0%; 
        opacity: 1; /* Ensure opacity is 1 for clean restart */
    }
}

/* 4. The Animated Horizontal Line (::before) - Draws Top and Bottom */
.logo-border-box::before {
    content: '';
    position: absolute;
    height: var(--border-thickness);
    background-color: var(--tj-theme-primary);
    left: 0;
    width: 0;
    z-index: 1;
    animation: drawHorizontal var(--anim-duration) ease-in-out infinite;
    box-shadow: 0 0 5px rgba(214, 26, 60, 0.6);
}

/* 5. The Animated Vertical Line (::after) - Draws Left and Right */
.logo-border-box::after {
    content: '';
    position: absolute;
    width: var(--border-thickness);
    background-color: var(--tj-theme-primary);
    top: 0;
    height: 0;
    z-index: 1;
    animation: drawVertical var(--anim-duration) ease-in-out infinite;
    box-shadow: 0 0 5px rgba(214, 26, 60, 0.6);
}


/* --- KEYFRAME ANIMATIONS --- */

/* Horizontal Line Animation (Top and Bottom Draw/Erase) */
@keyframes drawHorizontal {
    0% { width: 0; left: 0; top: 0; opacity: 1; }
    
    /* Draw Top (>>>>>>>) */
    10% { width: 100%; left: 0; top: 0; opacity: 1; }
    20% { width: 0; left: 100%; top: 0; opacity: 1; } /* Quickly erase right */

    /* Draw Bottom (<<<<<<<) - Must reverse direction */
    30% { width: 0; left: 100%; top: calc(var(--loader-size) - var(--border-thickness)); opacity: 1; }
    40% { width: 100%; left: 0; top: calc(var(--loader-size) - var(--border-thickness)); opacity: 1; }
    50% { width: 0; left: 0; top: calc(var(--loader-size) - var(--border-thickness)); opacity: 1; } /* Quickly erase left */

    /* Hold/Pause before Vertical starts */
    50.1% { opacity: 0; }
    100% { opacity: 0; }
}


/* Vertical Line Animation (Right and Left Draw/Erase) */
@keyframes drawVertical {
    0% { height: 0; top: 0; left: 0; opacity: 0; }
    
    /* Draw Right Side (downwards) */
    20% { opacity: 0; } /* Wait for Top draw */
    30% { height: 0; top: 0; left: calc(var(--loader-size) - var(--border-thickness)); opacity: 1; }
    40% { height: 100%; top: 0; left: calc(var(--loader-size) - var(--border-thickness)); opacity: 1; }
    50% { height: 0; top: 100%; left: calc(var(--loader-size) - var(--border-thickness)); opacity: 1; } /* Quickly erase bottom */
    
    /* Draw Left Side (upwards) */
    60% { height: 0; top: 100%; left: 0; opacity: 1; }
    70% { height: 100%; top: 0; left: 0; opacity: 1; }
    80% { height: 0; top: 0; left: 0; opacity: 1; } /* Quickly erase top */

    /* Reset/Pause */
    80.1% { opacity: 0; }
    100% { opacity: 0; }
}


.logo-animation-wrapper {
            position: relative;
            width: 90px; /* Controls the overall size */
            height: 90px; /* Controls the overall size */
            border-radius: 0; /* Ensures the container is a rectangle */
            display: flex;
            align-items: center;
            justify-content: center;
        }

        /* NEW ANIMATION RULE FOR THE BORDER */
        .logo-animation-wrapper::before {
            content: '';
            position: absolute;
            inset: -4px; /* Makes the border appear on the outside */
            border-radius: 0; /* Keep it rectangular */

            /* We create 4 gradients to act as the 4 sides of the border */
            background-image:
                linear-gradient(red, red), /* Top bar */
                linear-gradient(red, red), /* Right bar */
                linear-gradient(red, red), /* Bottom bar */
                linear-gradient(red, red); /* Left bar */

            background-repeat: no-repeat;
            
            /* Position each gradient at a corner */
            background-position:
                top left,
                top right,
                bottom right,
                bottom left;
                
            /* Set the initial size of the gradients. This is what we animate. */
            /* width height, width height, width height, width height */
            background-size: 0% 4px, 4px 0%, 0% 4px, 4px 0%;

            /* Apply the new drawing animation */
            animation: draw-border 4s linear infinite;
        }

        .logo-animation-wrapper .logo-image {
            width: 100%;
            height: 100%;
            object-fit: contain; /* Ensures logo fits well */
            border-radius: 0; /* Make the logo image itself rectangular */
            background-color: white;
            padding: 5px; /* Space between logo and rotating border */
            box-sizing: border-box; /* Important for padding calculation */
            position: relative; /* To ensure it stays on top */
            z-index: 1;
        }
        
        /* REMOVE THE OLD ROTATE KEYFRAME */
        /* @keyframes rotate-border { ... } can be deleted */

        /* NEW KEYFRAME ANIMATION TO "DRAW" THE BORDER */
        @keyframes draw-border {
            0% {
                /* Start with nothing drawn */
                background-size: 0% 4px, 4px 0%, 0% 4px, 4px 0%;
            }
            25% {
                /* 1. Top bar draws from left to right */
                background-size: 100% 4px, 4px 0%, 0% 4px, 4px 0%;
            }
            50% {
                /* 2. Right bar draws from top to bottom */
                background-size: 100% 4px, 4px 100%, 0% 4px, 4px 0%;
            }
            75% {
                /* 3. Bottom bar draws from right to left */
                background-size: 100% 4px, 4px 100%, 100% 4px, 4px 0%;
            }
            100% {
                /* 4. Left bar draws from bottom to top, completing the loop */
                background-size: 100% 4px, 4px 100%, 100% 4px, 4px 100%;
            }
        }

        @keyframes rotate-border {
            from {
                transform: rotate(0deg);
            }
            to {
                transform: rotate(360deg);
            }
        }

        .slider-content .slider-title {
            text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.6); /* Adds a subtle shadow to make text more readable */
        }
        .slider-content .slider-desc {
            font-size: 1.2rem; /* Makes the description text slightly larger */
            font-weight: 500;
            text-shadow: 1px 1px 6px rgba(0, 0, 0, 0.7);
        }

        .main-menu .language-btn {
            border: 1px solid rgba(255, 255, 255, 0.8); /* A subtle white border */
            padding: 8px 15px;
            border-radius: 5px;
            transition: all 0.3s ease;
            margin-left: 15px; /* Adds space from the other menu items */
        }
        .main-menu .language-btn:hover {
            background-color: red; /* Or your theme's main color */
            border-color: red;
            color: #fff !important;
        }
        .main-menu .language-btn i {
            margin-right: 8px; /* Space between icon and text */
        }

       
/* =======================================
   1. Filter Menu Design (Product Filters)
   ======================================= */
.product-filters {
    list-style: none;
    padding: 10px;
    margin: 0 auto;
    background: #f0f0f0; /* Light gray background for the container */
    border-radius: 50px; /* Pill shape for the entire menu */
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
    max-width: fit-content;
    display: inline-flex;
}

.filter-item {
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    padding: 8px 20px;
    margin: 0 5px;
    color: #444;
    transition: all 0.3s ease;
    border-radius: 40px; /* Pill shape for individual buttons */
    position: relative;
    overflow: hidden;
}

/* Hover and Active State */
.filter-item:hover {
    color: var(--tj-theme-primary); /* Accent color text on hover */
}

.filter-item.active {
    background-color: var(--tj-theme-primary);
    color: white;
    box-shadow: 0 4px 10px rgba(var(--tj-theme-primary-rgb), 0.3);
    transform: translateY(-2px);
}

.filter-item.active:hover {
    color: white; /* Keep text white when active and hovered */
}

/* =======================================
   2. Product Card Design (Product Card Style)
   ======================================= */
.product-card-style {
    background: #ffffff;
    border: 1px solid #ddd;
    border-radius: 10px;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08); /* Stronger shadow */
    height: 100%; /* Ensures all cards in a row are the same height */
}

.product-card-style:hover {
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.15); /* High elevation effect on hover */
    transform: translateY(-8px); /* Clear vertical lift */
}

/* Image Box */
.product-image-box {
    position: relative;
    padding: 30px 15px; /* More vertical padding for space */
    background: #fcfcfc; /* Very subtle off-white background */
    display: flex;
    justify-content: center;
    align-items: center;
    height: 350px; /* Increased image size for impact */
    border-bottom: 2px solid #eee; /* Clear separator */
}

.product-image-box img {
    max-height: 100%;
    width: auto;
    object-fit: contain;
    transition: transform 0.4s ease;
}

.product-card-style:hover .product-image-box img {
    transform: scale(1.05); /* Gentle zoom on tool image */
}

/* Category Tag */
.product-tag {
    position: absolute;
    top: 0;
    left: 0;
    background: #333; /* Darker, industrial color for the tag */
    color: white;
    padding: 8px 15px;
    border-radius: 10px 0 10px 0;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.2);
}

/* Content Area */
.product-content-box {
    padding: 25px;
    text-align: left; /* Aligns content better for professional look */
}

.product-title {
    font-size: 22px;
    font-weight: 800;
    margin-bottom: 15px;
    color: #111; /* Very dark text */
}

/* Toggle Button & Description */
.description-toggle {
    display: flex; /* Use flex to align icon and text */
    justify-content: space-between;
    align-items: center;
    width: 100%;
    font-weight: 600;
    border: 1px solid var(--tj-theme-primary);
    background-color: transparent;
    color: var(--tj-theme-primary);
    padding: 10px 15px;
    border-radius: 5px;
    margin-top: 10px;
    transition: all 0.3s ease;
}

.description-toggle:hover {
    background-color: var(--tj-theme-primary);
    color: white;
}

.product-description {
    font-size: 15px;
    color: #555;
    line-height: 1.6;
    margin-top: 15px;
    padding: 10px;
    border-left: 4px solid var(--tj-theme-primary);
    background-color: #f8f8f8;
    border-radius: 4px;
}

.product-filters {
    /* Keep existing desktop properties: */
    list-style: none;
    padding: 10px;
    margin: 0 auto;
    background: #f0f0f0;
    border-radius: 50px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
    max-width: fit-content; /* Ensure it centers */
    display: flex;
    justify-content: center; /* Center items on desktop */
    
    /* Disable scrolling properties from previous attempt */
    flex-wrap: nowrap; /* Reset to default */
    overflow-x: visible; /* Reset to default */
}

/* Apply wrapping and alignment changes ONLY on mobile devices (e.g., screen width < 768px)
*/
@media (max-width: 767.98px) {
    /* Main Container Changes */
    .product-filters {
        width: 100%; 
        max-width: 100%;
        padding: 5px 0; 
        flex-wrap: wrap; 
        justify-content: center; /* Center groups of buttons */
        background: transparent;
        box-shadow: none;
    }

    /* Individual Button Enhancement */
    .product-filters .filter-item {
        /* Layout & Sizing */
        flex-shrink: 0; 
        width: 48%; /* Slightly less than 50% for margin space */
        margin: 5px 1%; /* Horizontal and vertical margin between buttons */
        padding: 12px 10px; /* More vertical padding for a taller button look */
        
        /* Design */
        text-align: left; /* Text alignment inside the button */
        font-size: 14px;
        font-weight: 600;
        border-radius: 8px; /* Slightly rounded rectangles */
        border: 1px solid #ddd;
        background-color: #ffffff; /* White background for clean look */
        color: #555;
        
        /* Ensure content stays together */
        display: flex;
        align-items: center;
        justify-content: flex-start; /* Align text to the left */
        gap: 8px; /* Space between icon and text */
        
        /* Animation */
        transition: all 0.3s ease;
    }
    
    /* Active State (The Highlight) */
    .product-filters .filter-item.active {
        background-color: var(--tj-theme-primary); /* Use your primary color */
        color: white;
        border-color: var(--tj-theme-primary);
        box-shadow: 0 4px 8px rgba(var(--tj-theme-primary-rgb), 0.3); /* Clear shadow for elevation */
        transform: translateY(-2px);
    }
    
    /* Active Icon Color */
    .product-filters .filter-item.active i {
        color: white;
    }

    /* Hover/Tap Effect */
    .product-filters .filter-item:hover:not(.active) {
        background-color: #f0f0f0;
        color: #333;
    }
}


/*product */

       .tj-main-menu ul.main-menu {
            display: flex;
            flex-wrap: wrap; /* Allows items to wrap onto the next line */
            justify-content: flex-end; /* Aligns all items to the right */
            align-items: center;
        }

        /* Target the language dropdown item specifically */
        .main-menu li.language-dropdown-item {
            flex-basis: 100%; /* This is the key: it forces this item to take the full width, pushing it to a new line */
            margin-top: 10px; /* Adds space between the main menu and the language button */
            justify-content: flex-end; /* Ensures it stays aligned to the right */
        }

          .tj-main-menu .dropdown-menu {
            background-color: #222; 
            border: 1px solid rgba(255, 255, 255, 0.1);
        }
        /* Styles for the items inside the dropdown */
        .tj-main-menu .dropdown-menu .dropdown-item {
            color: #fff; /* White text for readability */
        }
        /* Hover effect for dropdown items */
        .tj-main-menu .dropdown-menu .dropdown-item:hover {
            background-color: red; /* Your theme's accent color on hover */
            color: #fff;
        }
        /* Style for the currently active language */
        .tj-main-menu .dropdown-menu li.active > a {
            background-color: red;
            color: #fff;
        }