/* =======================================================
   PRECISION SPARE EXCHANGE - MASTER STYLESHEET
   Optimized for: Performance, Consistency & Industrial Branding
======================================================= */

/* 1. BRAND VARIABLES & CORE SETUP */
:root {
    /* Brand Colors */
    --pse-blue: #003366;
    --pse-blue-dark: #021024;
    --pse-blue-light: #052659;
    --pse-orange: #F05A28;
    --pse-warning: #ffc107;
    --pse-accent: #0d6efd;

    /* UI Colors */
    --text-main: #2d3436;
    --text-muted: #64748b;
    --text-light: #b0c4de;
    --bg-light: #f8f9fa;
    --glass-bg: rgba(0, 26, 51, 0.75);

    /* Shadows */
    --shadow-sm: 0 4px 15px rgba(0,0,0,0.05);
    --shadow-md: 0 10px 30px rgba(0,0,0,0.1);
    --shadow-lg: 0 15px 40px rgba(0,0,0,0.2);
}

/* 2. BASE ELEMENTS */
body {
    font-family: 'Inter', sans-serif;
    color: var(--text-main);
    line-height: 1.6;
    overflow-x: hidden;
    background-color: #fff;
}

h1, h2, h3, h4, h5, .display-3, .navbar-brand {
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
}

.object-fit-cover { object-fit: cover; }
.hover-grow { transition: transform 0.3s cubic-bezier(0.165, 0.84, 0.44, 1); }
.hover-grow:hover { transform: translateY(-5px) scale(1.02); box-shadow: 0 10px 20px rgba(0,0,0,0.1); }

/* 3. BUTTONS */
.btn-primary {
    background: var(--pse-blue);
    border: none;
    padding: 12px 25px;
    font-weight: 600;
    transition: all 0.3s ease;
}
.btn-primary:hover {
    background-color: var(--pse-blue-light);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}
.btn-outline-danger:hover {
    background-color: #dc3545;
    color: #fff;
    transform: scale(1.05);
}

/* 4. NAVIGATION */
.top-bar { 
    background: var(--pse-blue-dark); 
    font-size: 0.85rem; 
    color: rgba(255,255,255,0.8); 
    padding: 8px 0;
}

.navbar {
    transition: all 0.4s cubic-bezier(0.4,0,0.2,1);
    background: #fff !important;
    padding: 20px 0 !important;
}

.nav-scrolled {
    padding: 5px 0 !important;
    background: rgba(255,255,255,0.98) !important;
    backdrop-filter: blur(8px);
}

.logo-main {
    height: 105px;
    width: 150px;
    transition: all 0.4s ease-in-out;
    margin: -10px 0;
}

.nav-scrolled .logo-main {
    height: 60px;
    margin: 0;
}

.navbar-brand img {
    height: 110px;
    width: 150px;
    margin: -15px 0;
    transition: transform 0.3s ease;
    z-index: 1020;
    filter: drop-shadow(0 4px 6px rgba(0,0,0,0.1));
}

.nav-link {
    color: var(--pse-blue) !important;
    font-weight: 600;
    margin: 0 10px;
    transition: 0.3s;
}
.nav-link:hover { transform: scale(1.05); }

/* Back to Top */
#backToTop {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 55px;
    height: 55px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    background-color: var(--pse-blue);
    color: #fff;
    border: none;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease, transform 0.3s ease;
}
#backToTop:hover {
    background-color: var(--pse-warning);
    color: var(--pse-blue-dark);
    transform: translateY(-5px);
}

/* 5. HERO CAROUSEL */
.carousel-item {
    height: 85vh;
    min-height: 550px;
    background: #000;
    overflow: hidden;
    transition: opacity 1.2s ease-in-out;
}
.zoom-container { width: 100%; height: 100%; overflow: hidden; }

.zoom-animation { animation: scaleImage 20s infinite alternate; }
@keyframes scaleImage { from { transform: scale(1); } to { transform: scale(1.1); } }

.carousel-caption {
    top: 50%;
    transform: translateY(-50%);
    bottom: auto !important;
    z-index: 10;
}

.hero-content-card {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border-left: 5px solid var(--pse-warning);
    max-width: 650px;
}

/* 6. BRAND LOGOS */
.brand-card {
    background: var(--bg-light);
    border: 1px solid transparent;
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    border-radius: 12px;
    transition: all 0.3s ease;
}
.brand-card:hover {
    border-color: var(--pse-warning);
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
    z-index: 2;
}
.brand-logo-img, .grayscale-img {
    max-height: 55px;
    width: auto;
    filter: grayscale(100%);
    opacity: 0.7;
    transition: all 0.4s ease;
}
.brand-card:hover .brand-logo-img,
.brand-card:hover .grayscale-img { filter: grayscale(0%); opacity: 1; }

/* 7. CATALOG & SEARCH */
.catalog-header {
    background: linear-gradient(135deg, var(--pse-blue-dark) 0%, var(--pse-blue-light) 100%);
    padding: 100px 0;
    color: white;
}
.search-wrapper { margin-top: -45px; position: relative; z-index: 100; }
.search-input {
    height: 65px;
    border-radius: 50px;
    padding-left: 30px;
    border: none;
    box-shadow: var(--shadow-lg);
    font-size: 1.1rem;
    transition: transform 0.3s, box-shadow 0.3s;
}
.search-input:focus { transform: scale(1.01); box-shadow: 0 20px 50px rgba(0,0,0,0.25); }

/* Filter Buttons */
.category-nav-container {
    width: 100%;
    overflow-x: hidden;
    padding-bottom: 10px;
}
.category-nav-container::-webkit-scrollbar { display: none; }
.category-flex-wrapper {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
}
.filter-btn {
    padding: 10px 18px;
    border-radius: 50px;
    background: #fff;
    border: 2px solid #dee2e6;
    font-size: 0.75rem;
    font-weight: 700;
    white-space: nowrap;
    cursor: pointer;
    transition: all 0.3s ease;
}
.filter-btn:hover, .filter-btn.active {
    background-color: var(--pse-blue);
    color: #fff !important;
    border-color: var(--pse-blue);
    transform: translateY(-2px);
}

/* Part Cards */
.part-card {
    border-radius: 15px;
    border: 1px solid rgba(0,0,0,0.08);
    overflow: hidden;
    transition: all 0.3s ease;
}
.part-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-lg);
    border-color: var(--pse-warning);
}
.part-preview-box {
    height: 220px;
    background: #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}
.part-preview-box i { font-size: 4rem; color: var(--pse-accent); opacity: 0.2; }

/* Loading Overlay */
#catalogOverlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(255,255,255,0.8);
    display: none;
    z-index: 9999;
    align-items: center;
    justify-content: center;
}

/* 8. FLOATING BUTTONS / WHATSAPP */
.floating-controls { position: fixed; bottom: 30px; right: 30px; z-index: 9999; display: flex; flex-direction: column; gap: 15px; align-items: flex-end; }
.whatsapp-float-container { position: fixed; bottom: 30px; left: 30px; z-index: 1000; display: flex; align-items: center; gap: 12px; }
.whatsapp-btn, .whatsapp-float {
    width: 60px; height: 60px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
    font-size: 30px; color: #fff; text-decoration: none; background: #25d366; border: 3px solid #fff;
    transition: all 0.3s ease;
}
.whatsapp-btn:hover, .whatsapp-float:hover { transform: scale(1.1); background-color: #128c7e; color: #fff; }
.whatsapp-bubble {
    background: #fff; color: #333;
    padding: 8px 15px; border-radius: 20px;
    font-size: 13px; font-weight: 600;
    box-shadow: var(--shadow-sm);
    pointer-events: none;
}

/* 9. RESPONSIVE */
@media (max-width: 991px) {
    .navbar-brand img { height: 60px; }
    .hero-content-card { margin: 0 15px; text-align: center; border-left: none; border-top: 5px solid var(--pse-warning); }
}
@media (max-width: 768px) {
    .carousel-item { height: 60-65vh; }
    .display-3 { font-size: 2.2rem; }
    .search-input { height: 55px; font-size: 1rem; }
    .brand-card { height: 100px; }
    .whatsapp-bubble { display: none; }
    .whatsapp-float-container { bottom: 20px; left: 20px; }
    #backToTop { bottom: 20px; right: 20px; width: 50px; height: 50px; }
    .category-flex-wrapper { flex-wrap: nowrap; overflow-x: auto; justify-content: flex-start; padding-bottom: 10px; }
}