/**
 * Frontend Custom Styles
 * Industrial B2B Website - COOLTRON
 */

/* ===== General ===== */
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    color: #333;
    line-height: 1.6;
}

a {
    transition: all 0.2s ease;
}

/* ===== Top Bar ===== */
.top-bar {
    font-size: 0.8rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

/* ===== Navbar ===== */
.navbar {
    padding: 0.5rem 0;
}

.navbar-brand {
    font-size: 1.3rem;
    letter-spacing: -0.5px;
}

.nav-link {
    font-weight: 500;
    padding: 0.5rem 1rem !important;
    color: #333 !important;
}

.nav-link:hover,
.nav-link:focus {
    color: #0d6efd !important;
}

/* ===== Dropdown Menus & Submenus Hover Optimization ===== */
.dropdown-menu {
    border: none !important;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1) !important;
    border-radius: 8px !important;
    padding: 0.5rem !important;
    background-color: #fff !important;
}

.dropdown-menu .dropdown-item {
    border-radius: 6px !important;
    padding: 0.55rem 1rem !important;
    font-size: 0.9rem !important;
    color: #333 !important;
    background-color: transparent !important;
    transition: background-color 0.2s ease, color 0.2s ease !important;
}

.dropdown-menu .dropdown-item:hover,
.dropdown-menu .dropdown-item:focus,
.dropdown-menu .dropdown-item.active {
    background-color: #0d6efd !important;
    color: #ffffff !important;
}

/* Multi-level Dropdown Submenu (Hover-based for desktop) */
.dropdown-submenu {
    position: relative !important;
}

.dropdown-submenu > .dropdown-menu {
    top: 0 !important;
    left: 100% !important;
    margin-top: -6px !important;
    margin-left: -1px !important;
    display: none !important;
}

.dropdown-submenu:hover > .dropdown-menu,
.dropdown-submenu:focus-within > .dropdown-menu {
    display: block !important;
}

/* ===== Navbar Mega Menu & Dropdown Enhancements ===== */
.navbar-nav > .nav-item > .nav-link {
    border-radius: 6px;
    transition: background-color 0.2s ease, color 0.2s ease;
}

/* Hover state when dropdown is closed */
.navbar-nav > .nav-item > .nav-link:hover {
    background-color: #f1f3f5;
    color: #0d6efd !important;
}

/* Persistent highlight when dropdown is open/clicked (stays highlighted even when mouse leaves) */
.navbar-nav > .nav-item.dropdown.show > .nav-link,
.navbar-nav > .nav-item > .nav-link.dropdown-toggle[aria-expanded="true"] {
    background-color: #e7f1ff !important;
    color: #0d6efd !important;
}

/* ===== Mega Menu Links Hover Effects ===== */
.mega-menu .list-unstyled a {
    transition: all 0.2s ease-in-out;
    padding: 4px 8px;
    border-radius: 4px;
}

.mega-menu .list-unstyled a:hover {
    background-color: #f0f4ff !important;
    color: #0d6efd !important;
    padding-left: 12px !important;
}

.mega-menu h6 a {
    transition: color 0.2s ease;
}

.mega-menu h6 a:hover {
    color: #0a58ca !important;
    text-decoration: underline !important;
}

/* ===== Hero Section ===== */
.hero-section {
    background: linear-gradient(135deg, #0d6efd 0%, #0a58ca 50%, #084298 100%);
    padding: 2rem 0;
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 50%;
    height: 100%;
    background: linear-gradient(45deg, transparent, rgba(255,255,255,0.05));
}

/* ===== Product Cards ===== */
.product-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border-radius: 12px;
    overflow: hidden;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 30px rgba(0,0,0,0.12) !important;
}

/* ===== Application Cards ===== */
.app-card {
    transition: all 0.3s ease;
    border-radius: 8px;
}

.app-card:hover {
    border-color: #0d6efd !important;
    background-color: #f0f7ff;
    transform: scale(1.02);
}

.app-grid-card {
    transition: all 0.3s ease;
    border-radius: 12px;
}

.app-grid-card:hover {
    box-shadow: 0 8px 30px rgba(0,0,0,0.1) !important;
    transform: translateY(-3px);
}

/* ===== Hover Shadow Utility ===== */
.hover-shadow {
    transition: box-shadow 0.2s ease;
}

.hover-shadow:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1) !important;
}

/* ===== Breadcrumb ===== */
.breadcrumb {
    font-size: 0.85rem;
}

.breadcrumb-item a {
    text-decoration: none;
    color: #555;
}

.breadcrumb-item a:hover {
    color: #0d6efd;
}

/* ===== Product Listing Table ===== */
.table thead th {
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #666;
}

.table tbody tr {
    transition: background-color 0.15s;
}

.table tbody tr:hover {
    background-color: #f8f9ff;
}

/* ===== Product Detail ===== */
.carousel-item img {
    max-height: 400px;
    object-fit: contain;
}

.product-description {
    line-height: 1.8;
}

.product-description h3 {
    font-size: 1.2rem;
    margin-top: 1.5rem;
    color: #333;
}

/* ===== Article Content ===== */
.article-content {
    font-size: 1.05rem;
    line-height: 1.8;
}

.article-content p {
    margin-bottom: 1.2rem;
}

.article-content h2,
.article-content h3 {
    margin-top: 2rem;
    margin-bottom: 1rem;
}

.article-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 1.5rem 0;
}

/* ===== Page Content ===== */
.page-content {
    line-height: 1.8;
}

.page-content h2 {
    margin-top: 2rem;
}

.page-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
}

/* ===== Footer ===== */
footer {
    font-size: 0.9rem;
}

footer h5, footer h6 {
    letter-spacing: 0.3px;
}

footer ul li a:hover {
    color: #fff !important;
}

/* ===== Stats Bar ===== */
.stats-bar .h3 {
    font-size: 2rem;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .hero-section h1 {
        font-size: 1.8rem;
    }

    .hero-section .lead {
        font-size: 1rem;
    }

    .stats-bar .h3 {
        font-size: 1.5rem;
    }
}

/* ===== Filter Sidebar ===== */
.list-group-item.active {
    background-color: #0d6efd;
    border-color: #0d6efd;
}

.badge {
    font-weight: 500;
    letter-spacing: 0.3px;
}

/* ===== Card ===== */
.card {
    border-radius: 8px;
}

.card-header {
    border-radius: 8px 8px 0 0 !important;
}

/* ===== Scrollbar ===== */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a1a1a1;
}

/* ===== Product Description Rich Text Images ===== */
.product-description img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 1rem 0;
}

/* ===== Banner Carousel & Fade Effect ===== */
.hero-section.banner-hero-section,
.custom-banner-section {
    background-color: transparent !important;
    background-blend-mode: normal !important;
}
.hero-section.banner-hero-section::before,
.custom-banner-section::before,
.custom-banner-section::after {
    display: none !important;
    background: none !important;
}

.carousel-item {
    display: none;
    position: relative;
    width: 100%;
}
.carousel-item.active {
    display: block;
}
.carousel-fade .carousel-item {
    opacity: 0;
    transition: opacity .8s ease-in-out;
}
.carousel-fade .carousel-item.active {
    opacity: 1;
}
