/* =====================================================
   MSA 24/7 Towing Calgary Ltd - Responsive Stylesheet
   Version: 1.0
   Author: Professional Frontend Developer
   ===================================================== */

/* ========== EXTRA LARGE DEVICES (1400px and below) ========== */
@media (max-width: 1399.98px) {
    .hero-title {
        font-size: 4.5rem;
    }

    .hero-stats {
        gap: 40px;
    }

    .stat-number {
        font-size: 2rem;
    }

    #testimonialCarousel .carousel-control-prev {
        left: -60px;
    }

    #testimonialCarousel .carousel-control-next {
        right: -60px;
    }
}

/* ========== LARGE DEVICES (1200px and below) ========== */
@media (max-width: 1199.98px) {
    :root {
        --section-padding: 80px;
    }

    .hero-title {
        font-size: 4rem;
    }

    .section-title {
        font-size: 2.5rem;
    }

    .btn-nav-bc span {
        display: none;
    }

    .btn-nav-bc {
        padding: 10px 12px;
    }

    .mega-menu {
        width: 600px;
        padding: 18px;
    }

    .mega-menu-cta {
        padding: 15px;
    }

    #testimonialCarousel .carousel-control-prev,
    #testimonialCarousel .carousel-control-next {
        display: none;
    }

    .stat-count {
        font-size: 3rem;
    }

    .cta-title {
        font-size: 1.75rem;
    }
}

/* ========== MEDIUM DEVICES / TABLETS (992px and below) ========== */
@media (max-width: 991.98px) {
    :root {
        --section-padding: 70px;
    }

    /* Top Header */
    #top-header {
        display: none;
    }

    /* Navigation */
    #main-navbar {
        padding: 12px 0;
    }

    #main-navbar.scrolled {
        padding: 10px 0;
    }

    .navbar-collapse {
        background-color: var(--accent-color);
        padding: 20px;
        margin-top: 15px;
        border-radius: var(--radius-md);
        box-shadow: var(--shadow-lg);
        max-height: 80vh;
        overflow-y: auto;
    }

    .navbar-nav {
        padding: 10px 0;
    }

    .navbar-nav .nav-link {
        padding: 12px 15px;
        border-bottom: 1px solid #eee;
    }

    .navbar-nav .nav-link::after {
        display: none;
    }

    .navbar-cta {
        margin-top: 15px;
        padding-top: 15px;
        border-top: 1px solid #eee;
        flex-direction: column;
    }

    .btn-nav-bc span {
        display: inline;
    }

    .btn-nav-bc {
        padding: 11px 20px;
    }

    .btn-nav-cta,
    .btn-nav-bc {
        width: 100%;
        justify-content: center;
    }

    /* Logo */
    .logo-wrapper img {
        max-height: 70px;
    }

    .logo-tagline-img {
        max-height: 35px !important;
    }

    /* Mega Menu */
    .mega-dropdown {
        position: relative;
    }

    .mega-menu::before {
        display: none;
    }

    .mega-menu {
        position: static;
        left: auto;
        width: 100%;
        max-width: 100%;
        padding: 15px;
        border-top: none;
        border-radius: 0;
        box-shadow: none;
        background-color: var(--bg-light);
        margin-top: 0 !important;
        opacity: 1;
        visibility: visible;
        transform: none !important;
        display: none;
        transition: none;
    }

    .mega-dropdown.show .mega-menu,
    .mega-menu.show,
    .mega-dropdown .dropdown-menu.show,
    .mega-dropdown.show:hover .mega-menu {
        display: block !important;
    }

    .mega-dropdown:not(.show):hover .mega-menu {
        display: none !important;
    }

    .mega-dropdown .dropdown-toggle::after {
        transition: transform 0.3s ease;
    }

    .mega-dropdown.show .dropdown-toggle::after {
        transform: rotate(180deg);
    }

    .mega-menu .container {
        padding: 0;
    }

    .mega-menu .row {
        flex-direction: column;
    }

    .mega-menu-col {
        flex: 0 0 100%;
        max-width: 100%;
        width: 100%;
        padding: 12px 0;
        border-right: none;
        border-bottom: 1px solid #ddd;
    }

    .mega-menu-col:last-child {
        border-bottom: none;
    }

    .mega-menu-featured {
        margin-top: 10px;
    }

    .mega-menu-cta {
        padding: 15px;
    }

    .mega-menu-title {
        font-size: 0.85rem;
        margin-bottom: 10px;
        padding-bottom: 6px;
    }

    .mega-menu-list a {
        padding: 6px 0;
        font-size: 0.85rem;
    }

    .mega-menu-list li {
        margin-bottom: 4px;
    }

    .mega-menu-cta i {
        font-size: 1.5rem;
        margin-bottom: 8px;
    }

    .mega-menu-cta h5 {
        font-size: 0.95rem;
    }

    .mega-menu-cta p {
        font-size: 0.8rem;
        margin-bottom: 10px;
    }

    /* Hero Section */
    .hero-slide {
        min-height: 80vh;
    }

    .hero-content {
        padding: 80px 0;
    }

    .hero-title {
        font-size: 3rem;
    }

    .hero-subtitle {
        font-size: 1.1rem;
    }

    .hero-stats {
        gap: 30px;
    }

    .stat-number {
        font-size: 1.75rem;
    }

    .carousel-control-prev,
    .carousel-control-next {
        width: 45px;
        height: 45px;
    }

    .carousel-control-prev {
        left: 15px;
    }

    .carousel-control-next {
        right: 15px;
    }

    .scroll-indicator {
        display: none;
    }

    /* About Section */
    .about-image-wrapper {
        margin-bottom: 50px;
    }

    .about-content {
        padding-left: 0;
    }

    /* What We Do Section */
    .video-wrapper {
        margin-bottom: 50px;
    }

    .what-we-do-content {
        padding-left: 0;
    }

    /* Statistics */
    .stat-box {
        margin-bottom: 30px;
    }

    /* Gallery */
    .gallery-card-tall {
        min-height: 300px;
    }

    /* Contact */
    .contact-card {
        margin-bottom: 20px;
    }

    .contact-form-section .map-wrapper {
        min-height: 400px;
        margin-bottom: 20px;
    }

    /* CTA */
    .cta-section {
        text-align: center;
    }

    .cta-section .col-lg-8 {
        margin-bottom: 30px;
    }

    .cta-section .text-lg-end {
        text-align: center !important;
    }

    /* Footer */
    .footer-widget {
        margin-bottom: 40px;
    }

    .footer-bottom-links {
        justify-content: center;
        margin-top: 15px;
    }
}

/* ========== SMALL DEVICES / LANDSCAPE PHONES (768px and below) ========== */
@media (max-width: 767.98px) {
    :root {
        --section-padding: 60px;
    }

    h1 {
        font-size: 2.5rem;
    }

    h2 {
        font-size: 2rem;
    }

    h3 {
        font-size: 1.75rem;
    }

    h4 {
        font-size: 1.25rem;
    }

    .section-title {
        font-size: 2rem;
    }

    .section-subtitle {
        font-size: 1rem;
    }

    .btn {
        padding: 10px 25px;
        font-size: 0.9rem;
    }

    .btn-lg {
        padding: 12px 30px;
    }

    /* Logo */
    .logo-icon {
        font-size: 2rem;
    }

    .logo-wrapper img {
        max-height: 65px;
    }

    .logo-tagline-img {
        max-height: 30px !important;
    }

    .brand-name {
        font-size: 1.25rem;
    }

    .brand-tagline {
        font-size: 0.65rem;
    }

    /* Hero */
    .hero-slide {
        min-height: 100vh;
    }

    .hero-content {
        padding: 60px 0;
    }

    .hero-badge {
        font-size: 0.75rem;
        padding: 8px 20px;
    }

    .hero-title {
        font-size: 2.5rem;
        letter-spacing: 2px;
    }

    .hero-subtitle {
        font-size: 1rem;
    }

    .hero-buttons {
        flex-direction: column;
        gap: 15px;
    }

    .hero-buttons .btn {
        width: 100%;
    }

    .hero-stats {
        flex-wrap: wrap;
        gap: 20px;
        justify-content: center;
    }

    .stat-item {
        flex: 0 0 45%;
    }

    .stat-number {
        font-size: 1.5rem;
    }

    .stat-label {
        font-size: 0.75rem;
    }

    .carousel-indicators {
        bottom: 20px;
    }

    /* About */
    .about-image-badge {
        padding: 20px;
    }

    .badge-number {
        font-size: 2.5rem;
    }

    .about-image-shape {
        transform: translate(-10px, -10px);
    }

    .about-lead {
        font-size: 1.1rem;
    }

    .feature-item {
        padding: 12px;
    }

    .feature-icon {
        width: 45px;
        height: 45px;
        font-size: 1rem;
    }

    /* Services */
    .service-card {
        padding: 30px 25px;
    }

    .service-icon {
        width: 70px;
        height: 70px;
        font-size: 1.75rem;
    }

    /* Video Section */
    .play-button {
        width: 70px;
        height: 70px;
        font-size: 1.5rem;
    }

    .play-button::before {
        width: 90px;
        height: 90px;
    }

    /* Statistics */
    .stats-section {
        padding: 60px 0;
    }

    .stat-box .stat-icon {
        width: 60px;
        height: 60px;
    }

    .stat-box .stat-icon i {
        font-size: 1.5rem;
    }

    .stat-count {
        font-size: 2.5rem;
    }

    .stat-title {
        font-size: 0.875rem;
    }

    /* Testimonials */
    .testimonial-card {
        padding: 40px 25px;
    }

    .testimonial-quote {
        width: 50px;
        height: 50px;
        top: -20px;
    }

    .testimonial-quote i {
        font-size: 1.25rem;
    }

    .testimonial-text {
        font-size: 1rem;
    }

    .author-avatar {
        width: 50px;
        height: 50px;
    }

    .author-info h5 {
        font-size: 1rem;
    }

    .author-info p {
        font-size: 0.8rem;
    }

    /* Gallery */
    .gallery-card-tall {
        min-height: 250px;
    }

    /* Blog */
    .blog-image {
        height: 200px;
    }

    .blog-content {
        padding: 20px;
    }

    .blog-meta {
        gap: 15px;
    }

    .blog-title {
        font-size: 1rem;
    }

    /* Contact */
    .contact-card {
        padding: 30px 20px;
    }

    .contact-icon {
        width: 70px;
        height: 70px;
        font-size: 1.75rem;
    }

    .contact-form-wrapper {
        padding: 30px 20px;
    }

    .form-title {
        font-size: 1.25rem;
    }

    .contact-form .form-control,
    .contact-form .form-select {
        padding: 12px 15px;
    }

    /* CTA */
    .cta-section {
        padding: 50px 0;
    }

    .cta-title {
        font-size: 1.5rem;
    }

    .btn-cta {
        padding: 12px 25px;
        width: 100%;
    }

    /* Footer */
    .footer-main {
        padding: 60px 0 40px;
    }

    .footer-logo i {
        font-size: 2.5rem;
    }

    .footer-brand {
        font-size: 1.5rem;
    }

    .footer-bottom-links {
        flex-wrap: wrap;
        gap: 15px;
    }

    /* Back to Top */
    .back-to-top {
        width: 45px;
        height: 45px;
        right: 20px;
        bottom: 20px;
    }
}

/* ========== EXTRA SMALL DEVICES / PHONES (576px and below) ========== */
@media (max-width: 575.98px) {
    :root {
        --section-padding: 50px;
    }

    .container {
        padding-left: 20px;
        padding-right: 20px;
    }

    .section-tag {
        font-size: 0.75rem;
        letter-spacing: 2px;
    }

    .section-title {
        font-size: 1.75rem;
    }

    /* Logo */
    .logo-wrapper img {
        max-height: 55px;
    }

    .logo-tagline-img {
        display: none;
    }

    /* Hero */
    .hero-title {
        font-size: 2rem;
    }

    .hero-badge {
        font-size: 0.7rem;
        padding: 6px 15px;
    }

    .hero-stats {
        flex-direction: column;
        align-items: center;
        gap: 15px;
    }

    .stat-item {
        flex: 0 0 100%;
        display: flex;
        align-items: center;
        gap: 15px;
    }

    .stat-number {
        font-size: 1.75rem;
    }

    /* About */
    .about-image-wrapper {
        padding: 15px;
    }

    .about-image-badge {
        position: relative;
        bottom: auto;
        right: auto;
        margin-top: 20px;
        display: inline-block;
    }

    .about-image-shape {
        display: none;
    }

    .feature-item {
        flex-direction: column;
        text-align: center;
    }

    /* Services */
    .service-card {
        padding: 25px 20px;
    }

    .service-icon {
        width: 60px;
        height: 60px;
        font-size: 1.5rem;
    }

    .service-title {
        font-size: 1.1rem;
    }

    /* Video */
    .video-badge {
        bottom: 10px;
        left: 10px;
        padding: 10px 15px;
    }

    .video-badge i {
        font-size: 1.25rem;
    }

    .video-badge span {
        font-size: 0.75rem;
    }

    .service-list-item {
        flex-direction: column;
        text-align: center;
    }

    .service-list-icon {
        width: 100%;
    }

    /* Statistics */
    .stat-box {
        padding: 20px 15px;
    }

    .stat-box .stat-icon {
        width: 50px;
        height: 50px;
    }

    .stat-box .stat-icon i {
        font-size: 1.25rem;
    }

    .stat-count {
        font-size: 2rem;
    }

    /* Testimonials */
    .testimonial-card {
        padding: 35px 20px;
    }

    .testimonial-text {
        font-size: 0.95rem;
        line-height: 1.7;
    }

    .testimonial-author {
        flex-direction: column;
        gap: 10px;
    }

    .author-info {
        text-align: center;
    }

    /* Gallery */
    .gallery-card-tall {
        min-height: 200px;
    }

    .gallery-content h5 {
        font-size: 1.1rem;
    }

    .gallery-zoom {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }

    /* Blog */
    .blog-image {
        height: 180px;
    }

    .blog-meta {
        flex-direction: column;
        gap: 5px;
    }

    /* Contact */
    .contact-card {
        padding: 25px 15px;
    }

    .contact-icon {
        width: 60px;
        height: 60px;
        font-size: 1.5rem;
    }

    .contact-title {
        font-size: 1.1rem;
    }

    .contact-link {
        font-size: 0.9rem;
    }

    .contact-form-wrapper {
        padding: 25px 15px;
    }

    .contact-form .form-control,
    .contact-form .form-select {
        padding: 10px 12px;
        font-size: 0.95rem;
    }

    .contact-form-section .map-wrapper {
        min-height: 300px;
    }

    /* CTA */
    .cta-title {
        font-size: 1.25rem;
    }

    .cta-text {
        font-size: 0.9rem;
    }

    /* Footer */
    .footer-main {
        padding: 50px 0 30px;
    }

    .footer-logo {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .footer-logo i {
        font-size: 2rem;
    }

    .footer-brand {
        font-size: 1.25rem;
    }

    .footer-widget-title {
        font-size: 1.1rem;
    }

    .footer-qr {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .qr-placeholder {
        width: 60px;
        height: 60px;
    }

    .qr-placeholder i {
        font-size: 2rem;
    }

    .footer-bottom {
        text-align: center;
    }

    .copyright {
        font-size: 0.8rem;
    }

    .footer-bottom-links {
        justify-content: center;
        gap: 10px;
    }

    .footer-bottom-links a {
        font-size: 0.8rem;
    }
}

/* ========== LANDSCAPE ORIENTATION FIXES ========== */
@media (max-height: 500px) and (orientation: landscape) {
    .hero-slide {
        min-height: 100vh;
    }

    .hero-content {
        padding: 30px 0;
    }

    .hero-title {
        font-size: 2rem;
    }

    .hero-subtitle {
        font-size: 0.9rem;
        margin-bottom: 20px;
    }

    .hero-stats {
        display: none;
    }

    .scroll-indicator {
        display: none;
    }
}

/* ========== TOUCH DEVICE HOVER FIXES ========== */
@media (hover: none) {
    .service-card:hover {
        transform: none;
    }

    .service-card:hover .service-icon {
        transform: none;
    }

    .blog-card:hover {
        transform: none;
    }

    .contact-card:hover {
        transform: none;
        background-color: var(--bg-light);
    }

    .contact-card:hover .contact-icon {
        background-color: var(--secondary-color);
    }

    .contact-card:hover .contact-title,
    .contact-card:hover .contact-text,
    .contact-card:hover .contact-link {
        color: inherit;
    }

    .gallery-overlay {
        opacity: 1;
        background: linear-gradient(to top,
                rgba(139, 45, 45, 0.9) 0%,
                transparent 100%);
    }

    .gallery-content {
        transform: translateY(0);
        position: absolute;
        bottom: 20px;
        left: 20px;
        right: 20px;
        text-align: left;
    }

    .gallery-zoom {
        position: absolute;
        top: 20px;
        right: 20px;
    }

    .feature-item:hover {
        transform: none;
        background-color: var(--bg-light);
    }

    .feature-item:hover .feature-icon {
        background-color: var(--primary-color);
        color: var(--accent-color);
    }

    .feature-item:hover .feature-text h5,
    .feature-item:hover .feature-text p {
        color: inherit;
    }
}

/* ========== PRINT STYLES ========== */
@media print {
    * {
        background: transparent !important;
        color: #000 !important;
        box-shadow: none !important;
        text-shadow: none !important;
    }

    #preloader,
    #top-header,
    #main-navbar,
    .hero-section,
    .scroll-indicator,
    .back-to-top,
    .carousel-control-prev,
    .carousel-control-next,
    .carousel-indicators {
        display: none !important;
    }

    body {
        font-size: 12pt;
        line-height: 1.5;
    }

    h1 {
        font-size: 24pt;
    }

    h2 {
        font-size: 20pt;
    }

    h3 {
        font-size: 16pt;
    }

    h4 {
        font-size: 14pt;
    }

    a {
        text-decoration: underline;
    }

    img {
        max-width: 100%;
    }

    .container {
        width: 100%;
        max-width: none;
    }

    .section-padding {
        padding: 30px 0;
    }
}

/* ========== HIGH CONTRAST MODE ========== */
@media (prefers-contrast: high) {
    :root {
        --primary-color: #a00;
        --secondary-color: #000;
        --text-dark: #000;
        --text-medium: #333;
    }

    .btn {
        border-width: 3px;
    }

    .nav-link::after {
        height: 3px;
    }
}

/* ========== REDUCED MOTION ========== */
@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    html {
        scroll-behavior: auto;
    }

    .carousel-item {
        transition: none;
    }
}

/* ========== DARK MODE PREFERENCE ========== */
@media (prefers-color-scheme: dark) {
    /* Optional dark mode styles can be added here */
    /* Currently disabled to maintain brand consistency */
}