/* ===== MOBILE RESPONSIVENESS ===== */

/* Mobile Navbar Collapse Styling */
@media (max-width: 991px) {
    .navbar-collapse {
        display: none !important;
        position: absolute !important;
        top: 100% !important;
        left: 0 !important;
        right: 0 !important;
        background: var(--bs-dark) !important;
        z-index: 999 !important;
        width: 100% !important;
        max-height: 80vh !important;
        overflow-y: auto !important;
        border-top: 1px solid rgba(255, 255, 255, 0.1) !important;
    }
    
    .navbar-collapse.show {
        display: block !important;
    }
    
    .navbar-nav {
        flex-direction: column !important;
        padding: 1rem 0 !important;
    }
    
    .nav-item {
        width: 100% !important;
    }
    
    .nav-link {
        padding: 0.75rem 1.5rem !important;
        color: var(--bs-white) !important;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
    }
    
    .nav-link:hover,
    .nav-link.active {
        color: var(--bs-primary) !important;
        background: rgba(147, 31, 18, 0.1) !important;
    }
    
    /* Mega Dropdown Mobile */
    .mega-dropdown {
        position: static !important;
    }
    
    .mega-dropdown .dropdown-menu {
        position: static !important;
        float: none !important;
        width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
        border: none !important;
        box-shadow: none !important;
        background: rgba(0, 0, 0, 0.5) !important;
        display: none !important;
    }
    
    .mega-dropdown .dropdown-menu.show {
        display: block !important;
    }
    
    .mega-menu {
        padding: 1rem !important;
        max-height: 60vh !important;
        overflow-y: auto !important;
    }
    
    .mega-menu .col-lg-3,
    .mega-menu .col-md-6 {
        flex: 0 0 100% !important;
        max-width: 100% !important;
        padding: 0 !important;
        margin-bottom: 1rem !important;
    }
    
    .mega-menu h6 {
        font-size: 0.95rem !important;
        margin-bottom: 0.5rem !important;
        color: var(--bs-primary) !important;
    }
    
    .mega-menu .dropdown-item {
        padding: 0.5rem 0 !important;
        font-size: 0.9rem !important;
        color: var(--bs-white) !important;
    }
    
    .mega-menu .dropdown-item:hover {
        background: transparent !important;
        color: var(--bs-primary) !important;
    }
}

/* ===== EXTRA SMALL DEVICES (320px - 480px) ===== */
@media (max-width: 480px) {
    /* Typography */
    h1, .display-1, .display-2, .display-3 {
        font-size: 1.8rem !important;
        line-height: 1.3 !important;
    }
    
    h2 {
        font-size: 1.5rem !important;
    }
    
    h3 {
        font-size: 1.2rem !important;
    }
    
    h4, h5, h6 {
        font-size: 1.1rem !important;
    }
    
    p {
        font-size: 1rem !important;
    }
    
    /* Navbar */
    .navbar {
        padding: 0.5rem 0.75rem !important;
    }
    
    .navbar-brand img {
        height: 40px !important;
    }
    
    .navbar-toggler {
        padding: 0.2rem 0.4rem !important;
        font-size: 1rem !important;
        border: none !important;
    }
    
    .navbar-toggler:focus {
        box-shadow: none !important;
        outline: none !important;
    }
    
    /* Spacing */
    .container, .container-fluid {
        padding-left: 10px !important;
        padding-right: 10px !important;
    }
    
    .px-4, .px-lg-5 {
        padding-left: 1rem !important;
        padding-right: 1rem !important;
    }
    
    .py-5 {
        padding-top: 2rem !important;
        padding-bottom: 2rem !important;
    }
    
    .mb-5, .my-5 {
        margin-bottom: 1.5rem !important;
    }
    
    /* Cards */
    .card {
        margin-bottom: 1rem !important;
    }
    
    .card-body {
        padding: 1rem !important;
    }
    
    /* Buttons */
    .btn {
        padding: 0.6rem 1rem !important;
        font-size: 0.9rem !important;
        min-height: 44px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
    }
    
    .btn-lg {
        padding: 0.75rem 1.5rem !important;
    }
    
    /* Hero Section */
    .bg-breadcrumb {
        padding: 60px 0 30px 0 !important;
        min-height: auto !important;
    }
    
    .hero-title {
        font-size: 1.5rem !important;
    }
    
    .hero-subtitle {
        font-size: 0.9rem !important;
    }
    
    /* Product Items */
    .product-item {
        margin-bottom: 1rem !important;
    }
    
    .product-item .card-img-top {
        height: 150px !important;
    }
    
    /* Gallery Items */
    .gallery-item {
        aspect-ratio: 1 !important;
        margin-bottom: 0.5rem !important;
    }
    
    /* Related Products */
    .related-product-card {
        margin-bottom: 1rem !important;
    }
    
    .related-product-image {
        aspect-ratio: 4/3 !important;
        height: 120px !important;
    }
    
    /* Application Items */
    .application-item {
        margin-bottom: 1rem !important;
        text-align: center !important;
    }
    
    .application-item i {
        font-size: 2rem !important;
    }
    
    /* Footer */
    .footer {
        padding: 2rem 0 1rem 0 !important;
    }
    
    .footer-item {
        margin-bottom: 1.5rem !important;
    }
    
    .footer-item h4 {
        font-size: 1rem !important;
        margin-bottom: 1rem !important;
    }
    
    /* Back to Top */
    .back-to-top {
        width: 40px !important;
        height: 40px !important;
        bottom: 15px !important;
        right: 15px !important;
        font-size: 1rem !important;
    }
    
    /* Breadcrumb */
    .breadcrumb {
        font-size: 0.8rem !important;
        flex-wrap: wrap !important;
    }
    
    /* Contact Form */
    .form-control {
        font-size: 0.9rem !important;
        padding: 0.5rem 0.75rem !important;
    }
    
    /* Carousel */
    .header-carousel .owl-nav .owl-prev,
    .header-carousel .owl-nav .owl-next {
        width: 40px !important;
        height: 40px !important;
        font-size: 18px !important;
    }
    
    /* Tables */
    .table {
        font-size: 0.8rem !important;
    }
    
    .table th, .table td {
        padding: 0.5rem !important;
    }
}

/* ===== SMALL DEVICES (481px - 768px) ===== */
@media (max-width: 768px) {
    /* Typography */
    h1, .display-1, .display-2, .display-3 {
        font-size: 2.2rem !important;
    }
    
    h2 {
        font-size: 1.8rem !important;
    }
    
    h3 {
        font-size: 1.5rem !important;
    }
    
    h4 {
        font-size: 1.3rem !important;
    }
    
    p {
        font-size: 1.05rem !important;
    }
    
    /* Navbar */
    .navbar {
        padding: 0.5rem 1rem !important;
    }
    
    .navbar-brand img {
        height: 45px !important;
    }
    
    .navbar-toggler {
        padding: 0.25rem 0.5rem !important;
        font-size: 1.1rem !important;
    }
    
    .navbar-nav {
        padding-top: 1rem !important;
    }
    
    .nav-link {
        padding: 0.5rem 0 !important;
        font-size: 0.95rem !important;
    }
    
    /* Dropdown Menu */

    
    /* Spacing */
    .container, .container-fluid {
        padding-left: 15px !important;
        padding-right: 15px !important;
    }
    
    .px-5 {
        padding-left: 1.5rem !important;
        padding-right: 1.5rem !important;
    }
    
    .py-5 {
        padding-top: 2.5rem !important;
        padding-bottom: 2.5rem !important;
    }
    
    /* Grid */
    .row {
        margin-left: -7.5px !important;
        margin-right: -7.5px !important;
    }
    
    .col-md-6, .col-lg-4, .col-lg-3 {
        padding-left: 7.5px !important;
        padding-right: 7.5px !important;
    }
    
    /* Cards */
    .card-body {
        padding: 1.25rem !important;
    }
    
    /* Buttons */
    .btn {
        padding: 0.6rem 1.2rem !important;
        font-size: 0.95rem !important;
        min-height: 44px !important;
    }
    
    /* Product Items */
    .product-item .card-img-top {
        height: 200px !important;
    }
    
    /* Hero Section */
    .bg-breadcrumb {
        padding: 80px 0 40px 0 !important;
    }
    
    .hero-title {
        font-size: 2rem !important;
    }
    
    .hero-subtitle {
        font-size: 1rem !important;
    }
    
    /* Footer */
    .footer {
        padding: 3rem 0 1.5rem 0 !important;
    }
    
    .footer-item {
        margin-bottom: 2rem !important;
    }
    
    /* Carousel */
    .header-carousel .header-carousel-item,
    .header-carousel .header-carousel-item img {
        height: 400px !important;
    }
    
    .header-carousel .owl-nav .owl-prev,
    .header-carousel .owl-nav .owl-next {
        width: 50px !important;
        height: 50px !important;
        font-size: 20px !important;
    }
    
    /* Tables */
    .table {
        font-size: 0.9rem !important;
    }
    
    .table th, .table td {
        padding: 0.75rem !important;
    }
}

/* ===== MEDIUM DEVICES (769px - 992px) ===== */
@media (max-width: 992px) {
    /* Navbar */

    
    /* Spacing */
    .px-lg-5 {
        padding-left: 1.5rem !important;
        padding-right: 1.5rem !important;
    }
    
    /* Hero Section */
    .bg-breadcrumb {
        padding: 100px 0 50px 0 !important;
    }
    
    /* Carousel */
    .header-carousel .header-carousel-item,
    .header-carousel .header-carousel-item img {
        height: 500px !important;
        margin-top: 0 !important;
    }
    
    /* Grid Adjustments */
    .col-lg-4 {
        flex: 0 0 calc(50% - 8px) !important;
    }
    
    .col-lg-3 {
        flex: 0 0 calc(50% - 8px) !important;
    }
}

/* ===== LARGE DEVICES (993px - 1200px) ===== */
@media (min-width: 993px) and (max-width: 1200px) {
    .container {
        max-width: 960px !important;
    }
    
    .col-lg-4 {
        flex: 0 0 calc(33.333% - 10px) !important;
    }
    
    .col-lg-3 {
        flex: 0 0 calc(25% - 10px) !important;
    }
}

/* ===== EXTRA LARGE DEVICES (1201px+) ===== */
@media (min-width: 1201px) {
    .container {
        max-width: 1140px !important;
    }
}

/* ===== LANDSCAPE MODE ===== */
@media (max-height: 500px) and (orientation: landscape) {
    .header-carousel .header-carousel-item,
    .header-carousel .header-carousel-item img {
        height: 300px !important;
    }
    
    .bg-breadcrumb {
        padding: 50px 0 30px 0 !important;
    }
    
    .navbar {
        padding: 0.5rem 1rem !important;
    }
}

/* ===== TOUCH DEVICE OPTIMIZATIONS ===== */
@media (hover: none) and (pointer: coarse) {
    /* Increase touch target sizes */
    .btn {
        min-height: 48px !important;
        min-width: 48px !important;
        padding: 0.75rem 1rem !important;
    }
    
    .nav-link {
        padding: 0.75rem 0.5rem !important;
    }
    
    .dropdown-item {
        padding: 0.75rem 1rem !important;
    }
    
    /* Remove hover effects on touch devices */
    .product-item:hover {
        transform: none !important;
    }
    
    .application-item:hover {
        transform: none !important;
    }
    
    .related-product-card:hover {
        transform: none !important;
    }
}

/* ===== PRINT STYLES ===== */
@media print {
    .navbar, .footer, .back-to-top, .breadcrumb {
        display: none !important;
    }
    
    body {
        background: white !important;
    }
    
    .container {
        max-width: 100% !important;
    }
}

/* ===== ACCESSIBILITY ===== */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ===== DARK MODE SUPPORT ===== */
@media (prefers-color-scheme: dark) {
    body {
        background-color: #1a1a1a !important;
        color: #e0e0e0 !important;
    }
    
    .card {
        background-color: #2a2a2a !important;
        color: #e0e0e0 !important;
    }
}

/* Fix for product cards on mobile */
@media (max-width: 576px) {
    .product-item {
        flex: 0 0 100% !important;
    }
    
    .col-md-6 {
        flex: 0 0 100% !important;
    }
}

/* Fix for footer on mobile */
@media (max-width: 768px) {
    .footer .row {
        flex-direction: column !important;
    }
}

/* Fix for contact form on mobile */
@media (max-width: 576px) {
    .contact-form {
        padding: 1rem !important;
    }
    
    .form-group {
        margin-bottom: 1rem !important;
    }
}

/* Fix for images on mobile */
@media (max-width: 768px) {
    img {
        max-width: 100% !important;
        height: auto !important;
    }
}

/* Fix for tables on mobile */
@media (max-width: 576px) {
    .table {
        font-size: 0.85rem !important;
    }
    
    .table th, .table td {
        padding: 0.5rem !important;
    }
}

/* Fix for modals on mobile */
@media (max-width: 576px) {
    .modal-dialog {
        margin: 0.5rem !important;
    }
    
    .modal-content {
        border-radius: 0.5rem !important;
    }
}

/* Smooth scrolling for mobile */
html {
    scroll-behavior: smooth;
}

/* Fix for fixed elements on mobile */
@media (max-width: 768px) {
    .fixed-top {
        position: relative !important;
    }
}

/* Optimize images for mobile */
@media (max-width: 480px) {
    .card-img-top {
        object-fit: cover !important;
    }
}

/* Fix for long text on mobile */
@media (max-width: 576px) {
    .text-truncate {
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        white-space: nowrap !important;
    }
}

/* ===== BUTTON WRAPPER STYLING ===== */
.pt-2 {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 0.5rem !important;
    align-items: center !important;
}

.carousel-caption-content .pt-2 {
    justify-content: center !important;
}

.btn {
    display: inline-block !important;
    white-space: nowrap !important;
}

/* Contact Form Button */
.contact button.btn {
    display: block !important;
    width: 100% !important;
    margin-top: 1rem !important;
}

/* Footer Inquiry Button */
.footer-item .position-relative button.btn {
    position: absolute !important;
    top: 0 !important;
    right: 0 !important;
    margin-top: 0.25rem !important;
    margin-right: 0.25rem !important;
    padding: 0.5rem 1rem !important;
    white-space: nowrap !important;
}

/* Back to Top Button */
.back-to-top {
    position: fixed !important;
    bottom: 20px !important;
    right: 20px !important;
    z-index: 99 !important;
    width: 50px !important;
    height: 50px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 50% !important;
    opacity: 0 !important;
    visibility: hidden !important;
    transition: all 0.3s ease !important;
}

.back-to-top.show {
    opacity: 1 !important;
    visibility: visible !important;
}

.back-to-top:hover {
    transform: translateY(-5px) !important;
}

@media (max-width: 767px) {
    .pt-2 {
        gap: 0.4rem !important;
    }
    
    .btn {
        padding: 0.5rem 0.8rem !important;
        font-size: 0.85rem !important;
    }
    
    .contact button.btn {
        padding: 0.6rem 1rem !important;
        font-size: 0.9rem !important;
    }
    
    .back-to-top {
        width: 45px !important;
        height: 45px !important;
        bottom: 15px !important;
        right: 15px !important;
    }
}

@media (max-width: 575px) {
    .pt-2 {
        gap: 0.3rem !important;
        flex-direction: column !important;
    }
    
    .btn {
        width: 100% !important;
        padding: 0.6rem 0.8rem !important;
        font-size: 0.8rem !important;
    }
    
    .contact button.btn {
        width: 100% !important;
        padding: 0.6rem 0.8rem !important;
        font-size: 0.8rem !important;
    }
    
    .back-to-top {
        width: 40px !important;
        height: 40px !important;
        bottom: 10px !important;
        right: 10px !important;
        font-size: 0.9rem !important;
    }
}

/* ===== ADDITIONAL MOBILE OPTIMIZATIONS ===== */

/* Improve readability on mobile */
@media (max-width: 576px) {
    body {
        font-size: 16px !important;
        line-height: 1.6 !important;
    }
    
    p {
        margin-bottom: 1rem !important;
    }
    
    ul, ol {
        margin-left: 1.5rem !important;
        margin-bottom: 1rem !important;
    }
    
    li {
        margin-bottom: 0.5rem !important;
    }
}

/* Optimize form inputs for mobile */
@media (max-width: 576px) {
    input[type="text"],
    input[type="email"],
    input[type="phone"],
    textarea,
    select {
        font-size: 16px !important;
        padding: 0.75rem !important;
        border-radius: 4px !important;
        width: 100% !important;
    }
    
    label {
        font-size: 0.95rem !important;
        margin-bottom: 0.5rem !important;
        display: block !important;
    }
}

/* Optimize links for mobile */
@media (max-width: 576px) {
    a {
        word-break: break-word !important;
    }
}

/* Optimize spacing for mobile */
@media (max-width: 576px) {
    .section {
        padding: 2rem 0 !important;
    }
    
    .section-title {
        margin-bottom: 1.5rem !important;
    }
}

/* Product Page Mobile Responsive */
@media (max-width: 991px) {
    .product-info-card .card-body {
        padding: 20px !important;
    }

    .info-item {
        padding: 10px 0 !important;
    }

    .info-icon {
        width: 35px !important;
        height: 35px !important;
        font-size: 0.9rem !important;
        margin-right: 10px !important;
    }

    .info-label {
        font-size: 0.85rem !important;
    }

    .info-value {
        font-size: 0.9rem !important;
    }
}

@media (max-width: 768px) {
    .product-image-main {
        margin-bottom: 20px !important;
    }

    .product-info-card {
        margin-top: 20px !important;
    }

    .product-info-card .card-body {
        padding: 15px !important;
    }

    .info-badge {
        padding: 6px 12px !important;
        font-size: 0.8rem !important;
    }

    .info-item {
        padding: 8px 0 !important;
    }

    .info-icon {
        width: 32px !important;
        height: 32px !important;
        font-size: 0.8rem !important;
        margin-right: 8px !important;
    }

    .info-label {
        font-size: 0.8rem !important;
    }

    .info-value {
        font-size: 0.85rem !important;
    }

    .cta-button,
    .btn-outline-primary {
        padding: 12px 20px !important;
        font-size: 0.9rem !important;
    }

    .nav-tabs .nav-link {
        padding: 10px 15px !important;
        font-size: 0.9rem !important;
    }

    .specs-table th,
    .specs-table td {
        padding: 10px !important;
        font-size: 0.9rem !important;
    }

    .feature-box {
        padding: 15px !important;
    }

    .feature-icon {
        width: 40px !important;
        height: 40px !important;
        font-size: 1.2rem !important;
    }

    .feature-title {
        font-size: 0.95rem !important;
    }

    .feature-text {
        font-size: 0.85rem !important;
    }
}

@media (max-width: 576px) {
    .product-info-card .card-body {
        padding: 12px !important;
    }

    .info-badge {
        padding: 5px 10px !important;
        font-size: 0.75rem !important;
    }

    .info-item {
        padding: 6px 0 !important;
    }

    .info-icon {
        width: 28px !important;
        height: 28px !important;
        font-size: 0.7rem !important;
        margin-right: 6px !important;
    }

    .info-label {
        font-size: 0.75rem !important;
    }

    .info-value {
        font-size: 0.8rem !important;
    }

    .cta-button,
    .btn-outline-primary {
        padding: 10px 15px !important;
        font-size: 0.85rem !important;
    }

    .nav-tabs {
        flex-wrap: wrap !important;
    }

    .nav-tabs .nav-link {
        padding: 8px 10px !important;
        font-size: 0.8rem !important;
    }

    .specs-table th,
    .specs-table td {
        padding: 8px !important;
        font-size: 0.8rem !important;
    }

    .feature-box {
        padding: 12px !important;
    }

    .feature-icon {
        width: 35px !important;
        height: 35px !important;
        font-size: 1rem !important;
        margin-bottom: 10px !important;
    }

    .feature-title {
        font-size: 0.9rem !important;
    }

    .feature-text {
        font-size: 0.8rem !important;
    }

    .section-title {
        font-size: 1.3rem !important;
        margin-bottom: 20px !important;
    }

    .section-title::after {
        width: 40px !important;
    }

    .product-gallery {
        margin-bottom: 20px !important;
    }

    .product-image-main {
        height: auto !important;
        max-height: 300px !important;
    }

    .related-product-image {
        height: 150px !important;
    }

    .related-product-card {
        margin-bottom: 15px !important;
    }
}

/* Quick Specifications Mobile */
@media (max-width: 768px) {
    .bg-white.p-4.rounded-3.shadow-sm {
        margin-top: 20px !important;
        padding: 15px !important;
    }

    .bg-white.p-4.rounded-3.shadow-sm h5 {
        font-size: 1rem !important;
        margin-bottom: 15px !important;
    }

    .bg-white.p-4.rounded-3.shadow-sm ul li {
        font-size: 0.9rem !important;
        margin-bottom: 8px !important;
    }
}

@media (max-width: 576px) {
    .bg-white.p-4.rounded-3.shadow-sm {
        padding: 12px !important;
    }

    .bg-white.p-4.rounded-3.shadow-sm h5 {
        font-size: 0.95rem !important;
        margin-bottom: 12px !important;
    }

    .bg-white.p-4.rounded-3.shadow-sm ul li {
        font-size: 0.85rem !important;
        margin-bottom: 6px !important;
    }
}

/* Hero Section Mobile */
@media (max-width: 768px) {
    .bg-breadcrumb {
        min-height: 300px !important;
        padding: 60px 0 30px 0 !important;
    }

    .display-3 {
        font-size: 1.8rem !important;
    }
}

@media (max-width: 576px) {
    .bg-breadcrumb {
        min-height: 250px !important;
        padding: 40px 0 20px 0 !important;
    }

    .display-3 {
        font-size: 1.5rem !important;
    }

    .fs-5 {
        font-size: 0.9rem !important;
    }
}

/* Tabs Mobile */
@media (max-width: 576px) {
    .nav-tabs {
        border-bottom: 2px solid #dee2e6 !important;
        gap: 0 !important;
    }

    .nav-tabs .nav-link {
        border: none !important;
        border-bottom: 3px solid transparent !important;
        padding: 8px 10px !important;
        font-size: 0.75rem !important;
        margin-right: 0 !important;
    }

    .nav-tabs .nav-link.active {
        border-bottom-color: #dc3545 !important;
    }
}

/* Overview Tab Mobile */
@media (max-width: 768px) {
    .row.g-4 {
        gap: 1rem !important;
    }

    .col-lg-8,
    .col-lg-4 {
        flex: 0 0 100% !important;
        max-width: 100% !important;
    }
}

/* Feature Boxes Mobile */
@media (max-width: 576px) {
    .row.g-4 > .col-md-6 {
        flex: 0 0 100% !important;
        max-width: 100% !important;
    }

    .feature-box {
        margin-bottom: 15px !important;
    }
}

/* Specifications Table Mobile */
@media (max-width: 576px) {
    .specs-table {
        overflow-x: auto !important;
    }

    .specs-table table {
        min-width: 100% !important;
    }

    .specs-table th {
        font-size: 0.8rem !important;
        padding: 8px !important;
    }

    .specs-table td {
        font-size: 0.8rem !important;
        padding: 8px !important;
    }
}

/* CTA Section Mobile */
@media (max-width: 768px) {
    .bg-primary {
        padding: 3rem 0 !important;
    }

    .bg-primary h2 {
        font-size: 1.5rem !important;
    }

    .bg-primary .fs-5 {
        font-size: 0.95rem !important;
    }
}

@media (max-width: 576px) {
    .bg-primary {
        padding: 2rem 0 !important;
    }

    .bg-primary h2 {
        font-size: 1.3rem !important;
    }

    .bg-primary .fs-5 {
        font-size: 0.9rem !important;
    }

    .btn-light {
        padding: 10px 20px !important;
        font-size: 0.9rem !important;
    }
}
