/* ==========================================================================
   TECH BAZAAR - Professional Industrial Design System
   Integrated with Bootstrap 5
   ========================================================================== */

:root {
    /* Colors - Sophisticated Industrial Palette */
    --primary: #D90429;
    --primary-dark: #8D0801;
    --secondary: #2B2D42;
    --accent: #EF233C;
    --dark: #01161E;
    --darker: #000000;
    --light: #FFFFFF;
    --gray-light: #F8F9FA;
    --gray-mid: #ADB5BD;
    --gray-dark: #495057;

    /* Typography */
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;

    /* Effects */
    --transition-smooth: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
    --shadow-soft: 0 10px 40px rgba(0, 0, 0, 0.05);
    --shadow-deep: 0 20px 60px rgba(0, 0, 0, 0.15);
    --glass: rgba(255, 255, 255, 0.03);
    --glass-border: rgba(255, 255, 255, 0.1);

    --radius-sm: 8px;
    --radius-md: 16px;
    --radius-lg: 32px;
}

/* Base Styles */
body {
    font-family: var(--font-body);
    color: var(--dark);
    background-color: var(--light);
    line-height: 1.7;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-heading);
    font-weight: 800;
    color: var(--dark);
    letter-spacing: -0.02em;
}

.text-white h1,
.text-white h2,
.text-white h3,
.text-white h4,
.text-white h5,
.text-white h6,
.bg-dark h1,
.bg-dark h2,
.bg-dark h3,
.bg-dark h4,
.bg-dark h5,
.bg-dark h6,
.bg-darker h1,
.bg-darker h2,
.bg-darker h3,
.bg-darker h4,
.bg-darker h5,
.bg-darker h6,
.hero h1,
.hero h2,
.hero h3,
.hero h4,
.hero h5,
.hero h6 {
    color: var(--light) !important;
}

a {
    text-decoration: none;
    transition: var(--transition-smooth);
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--dark);
}

::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 10px;
}

/* Scroll Progress Bar */
#scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 4px;
    background: var(--primary);
    z-index: 9999;
    transition: width 0.1s ease-out;
}

/* Header & Navigation */
.header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1050;
    /* Above Bootstrap navbar but below some modals */
    padding: 1.5rem 0;
    transition: var(--transition-smooth);
}

.header.scrolled {
    padding: 0.8rem 0;
    background: rgba(1, 22, 30, 0.9);
    backdrop-filter: blur(15px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.navbar-brand {
    font-family: var(--font-heading);
    font-weight: 900;
    font-size: 1.8rem;
    color: white !important;
}

.nav-link {
    color: rgba(255, 255, 255, 0.8) !important;
    font-weight: 600;
    margin: 0 1rem;
    position: relative;
}

.nav-link:hover,
.nav-link.active {
    color: var(--primary) !important;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary);
    transition: var(--transition-smooth);
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

/* Hero Section */
.hero {
    height: 100vh;
    min-height: 700px;
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
    background-color: var(--dark);
    color: white;
}

.hero-img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.4;
    z-index: 0;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at center, transparent 0%, var(--dark) 100%);
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 2;
    padding-top: 5rem;
    /* Pushes content down to avoid overlap with fixed header */
}

.hero h1 {
    font-size: clamp(3rem, 8vw, 6.5rem);
    line-height: 1;
    margin-bottom: 1.5rem;
    color: white;
}

/* Glassmorphism */
.glass {
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.glass-card {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: var(--shadow-soft);
}

/* Buttons */
.btn-tech {
    padding: 1rem 2.5rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-radius: 50px;
    transition: var(--transition-smooth);
}

.btn-tech-primary {
    background: var(--primary);
    color: white;
    border: none;
}

.btn-tech-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(217, 4, 41, 0.3);
    color: white;
}

.btn-tech-outline {
    background: transparent;
    border: 2px solid white;
    color: white;
}

.btn-tech-outline:hover {
    background: white;
    color: var(--dark);
    transform: translateY(-3px);
}

/* Category Cards */
.cat-card {
    background: white;
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: var(--transition-smooth);
    border: 1px solid #eee;
    height: 100%;
}

.cat-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-deep);
}

.cat-img-box {
    height: 250px;
    overflow: hidden;
}

.cat-img-box img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 1s ease;
}

.cat-card:hover .cat-img-box img {
    transform: scale(1.1);
}

/* Utilities */
.text-red {
    color: var(--primary);
}

.bg-darker {
    background-color: var(--darker);
    color: var(--light);
}

.bg-dark {
    background-color: var(--dark);
    color: var(--light);
}

.section-padding {
    padding: 8rem 0;
}

.footer-title {
    color: white !important;
    margin-bottom: 1.5rem;
    font-size: 1.25rem;
}

/* ==========================================================================
   Responsive Design System & Scroll Fixes
   ========================================================================== */

/* Global Scroll Lock */
html, body {
    overflow-x: hidden;
    width: 100%;
    position: relative;
}

/* Medium Screens (Tablets / Laptops) */
@media (max-width: 991.98px) {
    .section-padding {
        padding: 5rem 0;
    }

    .header {
        padding: 1rem 0;
        background: var(--dark);
    }

    .header.scrolled {
        padding: 0.8rem 0;
    }

    .navbar-collapse {
        background: var(--dark);
        margin: 1rem -1rem -1rem -1rem;
        padding: 2rem;
        border-top: 1px solid rgba(255,255,255,0.1);
        border-radius: 0 0 20px 20px;
    }

    .nav-link {
        margin: 0.5rem 0;
        font-size: 1.1rem;
    }

    .nav-link::after {
        display: none;
    }

    .hero {
        height: auto;
        padding: 7rem 0 5rem !important; /* Balanced for tablet */
        display: flex;
        align-items: center;
    }

    .hero-content {
        padding-top: 0 !important;
    }

    .hero h1 {
        font-size: 3.5rem;
    }

    .display-1 { font-size: 3.5rem; }
    .display-2 { font-size: 3rem; }
    .display-4 { font-size: 2.2rem; }
}

/* Small Screens (Mobile Phones) */
@media (max-width: 767.98px) {
    .hero {
        padding: 6rem 0 4rem !important; /* Optimized for mobile */
    }

    .hero h1 {
        font-size: 2.5rem;
    }

    .display-1 { font-size: 2.5rem; }
    .display-2 { font-size: 2.2rem; }
    .display-4 { font-size: 1.8rem; }
    .display-5 { font-size: 1.6rem; }

    .section-padding {
        padding: 4rem 0;
    }

    .btn-tech {
        width: 100%;
        margin-bottom: 0.5rem;
        padding: 0.8rem 1.5rem;
    }

    .cat-img-box {
        height: 200px;
    }

    .glass-card {
        padding: 1.5rem !important;
    }

    .translate-middle-y, .translate-middle-x {
        position: static !important;
        transform: none !important;
        width: 100% !important;
        margin-top: 1.5rem;
    }
}

/* Extra Small Screens */
@media (max-width: 480px) {
    .hero h1 {
        font-size: 2rem;
    }

    .display-1 { font-size: 2rem; }

    .header .navbar-brand {
        font-size: 1.3rem;
    }
}

/* Grid & Layout Fixes */
.row {
    margin-right: 0 !important;
    margin-left: 0 !important;
}

img {
    max-width: 100%;
    height: auto;
}