:root {
    --primary-color: #00b8d4;
    --dark-bg: #212529;
    --text-light: #f8f9fa;
    --text-dark: #343a40;
    --font-family: 'Tajawal', sans-serif;
        --navbar-height: 85px; /* Define navbar height as a variable */

}
html {
    scroll-padding-top: var(--navbar-height);
    scroll-behavior: smooth;
}
body {
    font-family: var(--font-family);
    background-color: #fff;
    color: var(--text-dark);
    overflow-x: hidden; /* Add this line */
}

/* ======== NEW PRELOADER STYLES (RECTANGULAR ORBIT) ======== */
#preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    background: #111; /* Darker background */
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.5s ease, visibility 0.5s ease;
    visibility: visible;
    opacity: 1;
}

#preloader.hidden {
    opacity: 0;
    visibility: hidden;
}

.preloader-hero-box {
    position: relative;
    text-align: center;
    padding: 2.5rem 4rem;
    border-radius: 15px;
    background-color: transparent; /* Make it transparent */
    border: 1px solid rgba(255, 255, 255, 0.1);
    opacity: 0;
    animation: zoomInFade 1s ease forwards;
}

.preloader-title {
    font-size: 3.5rem;
    font-weight: 700;
    color: #fff;
}

.preloader-subtitle {
    font-size: 1.2rem;
    color: #a0a0a0; /* Lighter grey */
    margin-top: 0.5rem;
}

/* Keyframe for the rectangular path animation */
@keyframes rectangular-orbit {
    0%   { top: -20px; left: -20px; } /* Top-left corner */
    25%  { top: -20px; left: calc(100% - 10px); } /* Top-right corner */
    50%  { top: calc(100% - 10px); left: calc(100% - 10px); } /* Bottom-right corner */
    75%  { top: calc(100% - 10px); left: -20px; } /* Bottom-left corner */
    100% { top: -20px; left: -20px; } /* Back to start */
}

/* The container for the orbiting icons */
.rectangular-orbit-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.orbiting-icon {
    position: absolute;
    font-size: 1.5rem;
    color: var(--primary-color);
    text-shadow: 0 0 15px var(--primary-color);
    animation-name: rectangular-orbit;
    animation-duration: 8s; /* Speed of one full loop */
    animation-timing-function: linear;
    animation-iteration-count: infinite;
}

/* Stagger the start position of each icon using animation-delay */
.orbiting-icon.icon-one { animation-delay: 0s; }        /* Starts at top-left */
.orbiting-icon.icon-two { animation-delay: -2s; }       /* Starts at top-right */
.orbiting-icon.icon-three { animation-delay: -4s; }     /* Starts at bottom-right */
.orbiting-icon.icon-four { animation-delay: -6s; }      /* Starts at bottom-left */

/* ======== KEYFRAME ANIMATIONS ======== */
@keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
@keyframes spin-slow { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
@keyframes draw-square {
    0%   { clip-path: inset(0 100% 0 0); border-top-color: var(--primary-color); }
    25%  { clip-path: inset(0 0 0 0);   border-top-color: var(--primary-color); border-right-color: var(--primary-color); }
    50%  { clip-path: inset(0 0 0 0);   border-top-color: var(--primary-color); border-right-color: var(--primary-color); border-bottom-color: var(--primary-color); }
    75%  { clip-path: inset(0 0 0 0);   border-top-color: transparent; border-right-color: var(--primary-color); border-bottom-color: var(--primary-color); border-left-color: var(--primary-color); }
    100% { clip-path: inset(0 0 100% 0); border-color: transparent; border-left-color: var(--primary-color); }
}
@keyframes zoomInFade { from { opacity: 0; transform: scale(0.9); } to { opacity: 1; transform: scale(1); } }
@keyframes slideUpFade { from { opacity: 0; transform: translateY(40px); } to { opacity: 1; transform: translateY(0); } }
@keyframes blink { 0%, 100% { opacity: 0.4; } 50% { opacity: 1; } }
@keyframes wire-movement { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }
@keyframes blink-glow { 0%, 100% { border-color: rgba(0, 184, 212, 0.8); } 50% { border-color: rgba(0, 184, 212, 0.4); } }
@keyframes icon-pulse { from { transform: scale(1); } to { transform: scale(1.4); } }


/* ======== HEADER & NAVBAR STYLES ======== */
.main-header {
    background: linear-gradient(rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0.7)), url('img/background.png');
    background-size: cover;
    background-position: center;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
        padding-top: var(--navbar-height);

}
.navbar.fixed-top { /* Style the navbar when it's fixed */
    background-color: rgba(30, 30, 30, 0.8);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}
.navbar {
    background-color: rgba(30, 30, 30, 0.8);
    backdrop-filter: blur(10px);
    padding: 0.8rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}
.nav-link {
    font-size: 1.1rem;
    font-weight: 500;
    margin: 0 0.5rem;
    padding: 0.5rem 1rem !important;
    border-radius: 50px;
    transition: all 0.3s ease;
    color: #e0e0e0 !important;
}
.nav-link:hover {
    color: #fff !important;
    background-color: rgba(255, 255, 255, 0.1);
}
.nav-link.active {
    background-color: var(--primary-color);
    color: white !important;
    box-shadow: 0 4px 15px rgba(0, 184, 212, 0.3);
}
.btn-cta {
    background-color: var(--primary-color);
    color: white;
    border-radius: 50px;
    padding: 0.6rem 1.8rem;
    font-weight: 700;
    transition: all 0.3s ease;
    border: none;
}
.btn-cta:hover {
    background-color: #0097a7;
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(0, 184, 212, 0.5);
}
.logo-container {
    width: 65px;
    height: 65px;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: white;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s ease;
    padding: 8px;
    border-radius: 50%;
}
.logo-container:hover { transform: scale(1.05); }
.logo-container::before, 
.logo-container::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: inherit;
    border: 3px solid transparent;
    animation: draw-square 2s linear infinite;
}
.logo-container::after { animation-delay: -1s; }
.logo-container img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 50%;
}
.company-name {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
}
.navbar-brand { padding-top: 0; padding-bottom: 0; }

/* ======== HERO SECTION STYLES ======== */
.hero-section {
    flex-grow: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}
.hero-title-box {
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(8px);
    padding: 2.5rem 4rem;
    border-radius: 15px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
    opacity: 0;
    animation: zoomInFade 0.8s ease-out 0.2s forwards;
    position: relative;
    overflow: visible;
}
.hero-title-box h1, .hero-title-box p {
    opacity: 0;
    animation-fill-mode: forwards;
}
.hero-title-box h1 {
    font-size: 4.5rem;
    font-weight: 700;
    color: #fff;
    text-shadow: 0 2px 10px rgba(0,0,0,0.5);
    animation: slideUpFade 0.7s ease-out 0.6s forwards;
}
.hero-title-box p {
    font-size: 1.5rem;
    color: #e0e0e0;
    margin-top: 0.5rem;
    animation: slideUpFade 0.7s ease-out 0.9s forwards;
}
.hero-title-box::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 15px;
    border: 2px dashed var(--primary-color);
    animation: blink-glow 2s ease-in-out infinite;
    opacity: 0.8;
}




/* ======== PRODUCTS SLIDER SECTION ======== */
#products { background-color: #ffffff; }
.product-category-slider { margin-bottom: 4rem; }
.category-title {
    font-size: 1.8rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    padding-right: 15px;
    border-right: 4px solid var(--primary-color);
}
.swiper { width: 100%; padding: 50px 0; }
.swiper-slide {
    background-position: center;
    background-size: cover;
    width: 450px;
    height: 350px;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    position: relative;
}
.swiper-slide img { display: block; width: 100%; height: 100%; object-fit: cover; }
.slide-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 1.5rem 1rem;
    background: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
    color: white;
    font-size: 1.3rem;
    font-weight: 500;
    text-align: right;
}
.swiper-button-next, .swiper-button-prev {
    width: 44px;
    height: 44px;
    background-color: rgba(255, 255, 255, 0.95);
    border-radius: 50%;
    box-shadow: 0 2px 10px rgba(0,0,0,0.15);
    color: var(--primary-color) !important;
}
.swiper-button-next:after, .swiper-button-prev:after { font-size: 1rem !important; font-weight: 900; }
.swiper-pagination { bottom: 15px !important; }
.swiper-pagination-bullet { width: 10px; height: 10px; background-color: #aaa; opacity: 1; }
.swiper-pagination-bullet-active { background-color: var(--primary-color) !important; }


/* ======== GENERAL SECTIONS (ABOUT, CONTACT, FOOTER) ======== */
.section-title {
    font-weight: 700;
    position: relative;
    padding-bottom: 15px;
    margin-bottom: 3rem !important;
}
.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background-color: var(--primary-color);
    border-radius: 2px;
}
#contact .form-control { padding: 0.75rem 1rem; border-radius: 8px; border: 1px solid #ddd; }
#contact .form-control:focus { box-shadow: 0 0 0 0.25rem rgba(0, 184, 212, 0.25); border-color: var(--primary-color); }
#contact .btn-primary { background-color: var(--primary-color); border: none; padding: 0.75rem; font-weight: bold; }
#contact .text-primary{ color: var(--primary-color) !important; }
.map-container { border-radius: 15px; overflow: hidden; border: 1px solid #ddd; box-shadow: 0 5px 15px rgba(0,0,0,0.05); }
footer { background-color: var(--dark-bg); color: #bdc3c7; padding: 50px 0 20px 0; }
footer h5 { color: #fff; }
footer a { text-decoration: none; color: #bdc3c7; transition: color 0.3s ease; }
footer a:hover { color: var(--primary-color) !important; }
footer .row .border-top { border-color: #444 !important; }


/* ======== RESPONSIVE ADJUSTMENTS ======== */
@media (max-width: 991.98px) {
    .navbar-brand { order: 1; }
    .navbar-toggler { order: 2; }
    .navbar-collapse { order: 3; }
    .btn-cta { display: none; }
    .hero-title-box h1 { font-size: 3rem; }
    .hero-title-box p { font-size: 1.2rem; }
}
@media (max-width: 768px) {
    .swiper-slide { width: 300px; height: 250px; }
    .hero-title-box { padding: 2rem; }
}

/* ======== RESPONSIVE STYLES FOR PRELOADER ======== */

/* For screens smaller than 768px (most mobile phones) */
@media (max-width: 767.98px) {
    
    /* Make the box smaller */
    .preloader-hero-box {
        padding: 2rem 1.5rem; /* Reduce padding */
        width: 90%; /* Limit the width */
    }

    /* Make the title font smaller */
    .preloader-title {
        font-size: 2.2rem; /* Smaller font size for the title */
    }

    /* Make the subtitle font smaller */
    .preloader-subtitle {
        font-size: 1rem; /* Smaller font size for the subtitle */
    }

    /* Make the orbiting icons smaller and their path tighter */
    .orbiting-icon {
        font-size: 1.2rem; /* Smaller icons */
    }
    
    /* Adjust the orbit path for the smaller box */
    @keyframes rectangular-orbit {
        0%   { top: -15px; left: -15px; }
        25%  { top: -15px; left: calc(100% - 5px); }
        50%  { top: calc(100% - 5px); left: calc(100% - 5px); }
        75%  { top: calc(100% - 5px); left: -15px; }
        100% { top: -15px; left: -15px; }
    }
}


/* We need to redefine the keyframe for a larger box */
/* This is a copy of the preloader's animation, but with larger values */
@keyframes hero-rectangular-orbit {
    0%   { top: -25px; left: -25px; }
    25%  { top: -25px; left: calc(100% - 15px); }
    50%  { top: calc(100% - 15px); left: calc(100% - 15px); }
    75%  { top: calc(100% - 15px); left: -25px; }
    100% { top: -25px; left: -25px; }
}

/* Apply the new, larger keyframe to the icons inside the hero box */
.hero-orbit .orbiting-icon {
    animation-name: hero-rectangular-orbit;
    font-size: 1.8rem; /* Make icons slightly bigger */
}


/* REMOVE THE DASHED BORDER FROM hero-title-box */
/* Find the old .hero-title-box::before rule and replace it with this empty one, or delete it */
.hero-title-box::before {
    content: none; /* This will remove the dashed border */
}