/* ASF Funeral Services - Custom Styles */
/* Egyptian Cultural Design with RTL Support */

/* Performance Optimizations */
* {
    box-sizing: border-box;
}

/* Reduce layout shifts */
img {
    max-width: 100%;
    height: auto;
}

/* Font display optimization - handled by Google Fonts */

/* Critical CSS for above-the-fold content */
.container {
    contain: layout style;
}

/* Prevent layout shifts and forced reflows */
* {
    box-sizing: border-box;
}

/* Font metrics override to prevent layout shifts */
@font-face {
    font-family: 'Cairo-fallback';
    size-adjust: 100%;
    ascent-override: 105%;
    descent-override: 35%;
    line-gap-override: 10%;
    src: local('Arial'), local('Helvetica'), local('sans-serif');
}

@font-face {
    font-family: 'Amiri-fallback';
    size-adjust: 100%;
    ascent-override: 110%;
    descent-override: 40%;
    line-gap-override: 15%;
    src: local('Times New Roman'), local('serif');
}

/* Optimize animations and prevent forced reflows */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Prevent reading layout properties that cause reflows */
.no-reflow {
    will-change: transform;
    transform: translateZ(0);
}

/* Optimize scroll performance */
.scroll-container {
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
}

/* Prevent layout shifts for images */
img {
    max-width: 100%;
    height: auto;
    /* Reserve space to prevent layout shifts */
    aspect-ratio: attr(width) / attr(height);
}

/* Specific optimizations for logo and small images */
.navbar-brand img {
    width: 50px !important;
    height: 50px !important;
    object-fit: cover;
    border-radius: 8px;
    /* Prevent layout shift */
    flex-shrink: 0;
}

.footer-car img {
    width: 80px !important;
    height: 60px !important;
    object-fit: cover;
    /* Prevent layout shift */
    flex-shrink: 0;
}

/* Optimize button animations to prevent reflows */
.btn {
    will-change: transform;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn:hover {
    transform: translateY(-2px);
}

/* Optimize pulse animation */
.pulse-animation {
    will-change: transform;
    animation: pulse 2s infinite;
}

/* Back to top button optimization */
.btn-back-to-top {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
    will-change: transform, opacity;
    transition: transform 0.3s ease, opacity 0.3s ease;
    transform: translateY(100px);
    opacity: 0;
    pointer-events: none;
}

.btn-back-to-top.show {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
}

:root {
    --primary-color: #1a472a;      /* Deep Islamic Green */
    --secondary-color: #d4af37;    /* Egyptian Gold */
    --accent-color: #8b4513;       /* Desert Brown */
    --text-dark: #2c3e50;
    --text-light: #6c757d;
    --bg-light: #f8f9fa;
    --bg-darker: #1a1a1a;
    --white: #ffffff;
    --danger: #dc3545;
    --success: #25d366;
    --shadow: 0 2px 10px rgba(0,0,0,0.1);
    --shadow-lg: 0 4px 20px rgba(0,0,0,0.15);
}

/* Arabic Fonts with fallback optimization */
body {
    font-family: 'Cairo', 'Cairo-fallback', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.7;
    color: var(--text-dark);
    direction: rtl;
    text-align: right;
    font-display: swap;
    /* Prevent layout shifts during font loading */
    font-size: 16px;
    font-weight: 400;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Amiri', 'Amiri-fallback', 'Cairo', 'Times New Roman', serif;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 1rem;
    font-display: swap;
    /* Prevent layout shifts */
    line-height: 1.2;
}

/* Specific heading sizes to prevent shifts */
h1, .display-4 {
    font-size: clamp(2rem, 5vw, 3.5rem);
    line-height: 1.2;
}

h2, .display-5 {
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    line-height: 1.3;
}

h3 {
    font-size: clamp(1.5rem, 3vw, 2rem);
    line-height: 1.3;
}

h4 {
    font-size: clamp(1.25rem, 2.5vw, 1.75rem);
    line-height: 1.4;
}

h5 {
    font-size: clamp(1.1rem, 2vw, 1.5rem);
    line-height: 1.4;
}

h6 {
    font-size: clamp(1rem, 1.5vw, 1.25rem);
    line-height: 1.5;
}

/* Custom Bootstrap Overrides */
.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    font-weight: 600;
}

.btn-primary:hover {
    background-color: #0f2f1a;
    border-color: #0f2f1a;
}

.text-primary {
    color: var(--primary-color) !important;
}

.bg-primary {
    background-color: var(--primary-color) !important;
}

.text-secondary {
    color: var(--secondary-color) !important;
}

/* Top Bar Styles */
.top-bar {
    font-size: 0.9rem;
    background: linear-gradient(135deg, var(--primary-color), #0f2f1a) !important;
}

.top-bar a:hover {
    color: var(--secondary-color) !important;
}

/* Navigation Styles */
.navbar {
    padding: 1rem 0;
    background: var(--white) !important;
    border-bottom: 3px solid var(--secondary-color);
}

.navbar-brand {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color) !important;
}

.navbar-nav .nav-link {
    font-weight: 600;
    color: var(--text-dark) !important;
    padding: 0.75rem 1rem !important;
    transition: all 0.3s ease;
    border-radius: 5px;
    margin: 0 0.25rem;
}

.navbar-nav .nav-link:hover,
.navbar-nav .nav-link.active {
    color: var(--primary-color) !important;
    background-color: rgba(26, 71, 42, 0.1);
}

/* Hero Section - Slanted Split Design */
.hero-section {
    color: var(--white);
    padding: 100px 0;
    text-align: center;
    position: relative;
    min-height: 600px;
    display: flex;
    align-items: center;
    overflow: hidden;
    background: linear-gradient(135deg, #1a472a 0%, #2d5a3d 50%, #0f2e1a 100%);
}

/* Enhanced contrast overlay for green side */
.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 50%;
    height: 100%;
    background: linear-gradient(135deg,
        rgba(0, 0, 0, 0.25) 0%,
        rgba(0, 0, 0, 0.15) 50%,
        rgba(0, 0, 0, 0.35) 100%);
    clip-path: polygon(0% 0%, 85% 0%, 100% 100%, 0% 100%);
    z-index: 1;
}

/* Car Image Side - Right with Slanted Edge */
.hero-section::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 50%;
    height: 100%;
    background: linear-gradient(rgba(0, 0, 0, 0.4), rgba(0, 0, 0, 0.5)),
                url('../images/3.jpg') center/cover;
    clip-path: polygon(15% 0%, 100% 0%, 100% 100%, 0% 100%);
    z-index: 2;
}





.hero-section .container {
    position: relative;
    z-index: 15;
}

.hero-section h1,
.hero-section p {
    text-shadow: 3px 3px 6px rgba(0, 0, 0, 0.9),
                 1px 1px 3px rgba(0, 0, 0, 0.7);
    font-weight: 600;
}

.hero-section h1 {
    color: #ffffff;
    text-shadow: 3px 3px 8px rgba(0, 0, 0, 0.9),
                 0 0 20px rgba(0, 0, 0, 0.5);
}

.hero-section p {
    color: #f8f9fa;
}

.hero-section .btn {
    background: rgba(255, 255, 255, 0.95);
    color: #1a472a;
    border: 2px solid rgba(255, 255, 255, 0.8);
    font-weight: 600;
    text-shadow: none;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4),
                0 2px 8px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

.hero-section .btn:hover {
    background: #ffffff;
    color: #1a472a;
    border-color: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.5),
                0 4px 12px rgba(0, 0, 0, 0.3);
}

.hero-section .btn-outline-light {
    background: transparent;
    color: #ffffff;
    border: 2px solid rgba(255, 255, 255, 0.9);
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
}

.hero-section .btn-outline-light:hover {
    background: rgba(255, 255, 255, 0.95);
    color: #1a472a;
    text-shadow: none;
}

.hero-section h1 {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    color: var(--white);
    text-shadow: 3px 3px 6px rgba(0,0,0,0.8);
    line-height: 1.2;
}

.hero-section p {
    font-size: 1.3rem;
    margin-bottom: 2.5rem;
    color: var(--white);
    text-shadow: 2px 2px 4px rgba(0,0,0,0.7);
    font-weight: 500;
}

.hero-section .btn {
    font-size: 1.1rem;
    padding: 12px 30px;
    font-weight: 600;
    text-shadow: none;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    border: 2px solid transparent;
    transition: all 0.3s ease;
}

.hero-section .btn-primary {
    background: var(--secondary-color);
    border-color: var(--secondary-color);
    color: var(--primary-color);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.hero-section .btn-primary:hover {
    background: transparent;
    border-color: var(--secondary-color);
    color: var(--secondary-color);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(212, 175, 55, 0.4);
}

.hero-section .btn-outline-light {
    border-color: var(--white);
    color: var(--white);
    background: rgba(255, 255, 255, 0.15);
    border-width: 2px;
    font-weight: 600;
}

.hero-section .btn-outline-light:hover {
    background: var(--white);
    color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 255, 255, 0.3);
}

/* Card Styles */
.card {
    border: none;
    border-radius: 15px;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
    overflow: hidden;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.card-header {
    background: linear-gradient(135deg, var(--primary-color), #0f2f1a);
    color: var(--white);
    border: none;
    padding: 1.5rem;
}

.card-body {
    padding: 2rem;
}

/* Service Cards */
.service-card {
    text-align: center;
    padding: 2rem;
    height: 100%;
    transition: all 0.3s ease;
    border-radius: 15px;
}

.service-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(0,0,0,0.1);
}

/* Service Grid Layout */
.services-grid .row {
    margin-left: -0.75rem;
    margin-right: -0.75rem;
}

.services-grid .row > * {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
    margin-bottom: 1.5rem;
}

.service-card .service-icon {
    font-size: 3rem;
    color: var(--secondary-color);
    margin-bottom: 1.5rem;
}

.service-card h4 {
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.service-card p {
    color: var(--text-light);
    line-height: 1.8;
}

/* Car Showcase Section */
.car-showcase {
    transition: all 0.3s ease;
    border-radius: 15px;
    overflow: hidden;
}

.car-showcase:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(0,0,0,0.2);
}

.car-showcase img {
    transition: transform 0.3s ease;
}

.car-showcase:hover img {
    transform: scale(1.05);
}

.car-overlay {
    opacity: 0;
    transition: opacity 0.3s ease;
}

.car-showcase:hover .car-overlay {
    opacity: 1;
}

.feature-box {
    transition: all 0.3s ease;
    border: 1px solid transparent;
}

.feature-box:hover {
    transform: translateY(-5px);
    border-color: var(--primary-color);
    box-shadow: 0 10px 25px rgba(26, 71, 42, 0.1);
}

/* Floating Car */
.floating-car {
    position: absolute;
    top: 50%;
    right: -100px;
    transform: translateY(-50%);
    z-index: 1;
    opacity: 0.7;
    animation: float 6s ease-in-out infinite;
}

.floating-car img {
    width: 200px;
    height: 120px;
    object-fit: cover;
    border-radius: 10px;
    filter: sepia(20%) saturate(80%);
}

@keyframes float {
    0%, 100% {
        transform: translateY(-50%) translateX(0);
    }
    50% {
        transform: translateY(-50%) translateX(-20px);
    }
}

/* Vehicle Cards */
.vehicle-card {
    position: relative;
    overflow: hidden;
}

.vehicle-card img {
    transition: transform 0.3s ease;
}

.vehicle-card:hover img {
    transform: scale(1.05);
}

.vehicle-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0,0,0,0.8));
    color: var(--white);
    padding: 2rem;
    transform: translateY(100%);
    transition: transform 0.3s ease;
}

.vehicle-card:hover .vehicle-overlay {
    transform: translateY(0);
}

/* Footer Styles */
.footer {
    background: linear-gradient(135deg, #1a1a1a, #2c2c2c) !important;
    color: var(--white);
}

.footer h5, .footer h6 {
    color: var(--secondary-color) !important;
}

.footer-bottom {
    background-color: var(--bg-darker) !important;
    border-top: 1px solid #333;
}

.hover-primary:hover {
    color: var(--secondary-color) !important;
}

/* Floating Buttons */
.floating-contact {
    position: fixed;
    bottom: 20px;
    left: 20px;
    z-index: 1000;
}

.floating-whatsapp {
    position: fixed;
    bottom: 90px;
    left: 20px;
    z-index: 1000;
}

.btn-back-to-top {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 999;
    display: none;
    width: 50px;
    height: 50px;
}

/* Animations */
.pulse-animation {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.fade-in {
    animation: fadeIn 0.8s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Contact Form */
.contact-form {
    background: var(--white);
    padding: 3rem;
    border-radius: 15px;
    box-shadow: var(--shadow-lg);
}

.form-control {
    border: 2px solid #e9ecef;
    border-radius: 10px;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(26, 71, 42, 0.25);
}

/* Breadcrumb */
.breadcrumb {
    background: var(--bg-light);
    border-radius: 10px;
    padding: 1rem 1.5rem;
}

.breadcrumb-item + .breadcrumb-item::before {
    content: "←";
    color: var(--text-light);
}

/* Islamic Decorative Elements */
.islamic-pattern {
    background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23d4af37' fill-opacity='0.1'%3E%3Cpath d='M30 30c0-16.569 13.431-30 30-30v60c-16.569 0-30-13.431-30-30z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

/* Top Bar Styles */
.top-bar {
    font-size: 0.9rem;
    background-color: var(--primary-color) !important;
}

.top-bar .contact-info {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: center;
}

.top-bar .social-links {
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
    align-items: center;
}

.top-bar a {
    color: var(--white) !important;
    text-decoration: none;
    transition: color 0.3s ease;
}

.top-bar a:hover {
    color: var(--secondary-color) !important;
}

/* Call to Action Section */
.cta-section {
    background: var(--primary-color) !important;
}

.cta-section .btn {
    margin: 0.25rem;
    min-width: 140px;
    font-weight: 600;
}

.cta-section .btn-light {
    background: var(--white);
    border-color: var(--white);
    color: var(--primary-color);
}

.cta-section .btn-light:hover {
    background: var(--secondary-color);
    border-color: var(--secondary-color);
    color: var(--primary-color);
}

.cta-section .btn-outline-light {
    border-color: var(--white);
    color: var(--white);
}

.cta-section .btn-outline-light:hover {
    background: var(--white);
    color: var(--primary-color);
}

/* CTA Background Car */
.cta-car-bg {
    position: absolute;
    top: 50%;
    left: -50px;
    transform: translateY(-50%);
    opacity: 0.1;
    z-index: 1;
}

.cta-car-bg img {
    width: 150px;
    height: 100px;
    object-fit: cover;
    border-radius: 8px;
    filter: brightness(150%) contrast(80%);
}

/* Fleet Images */
.fleet-image {
    border-radius: 15px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.fleet-image:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.2);
}

.fleet-overlay {
    background: rgba(26, 71, 42, 0.8);
    opacity: 0;
    transition: opacity 0.3s ease;
    border-radius: 15px;
}

.fleet-image:hover .fleet-overlay {
    opacity: 1;
}

/* Contact Page Car */
.contact-car-bg {
    position: absolute;
    top: 50%;
    left: -80px;
    transform: translateY(-50%);
    opacity: 0.15;
    z-index: 1;
}

.contact-car-bg img {
    width: 200px;
    height: 120px;
    object-fit: cover;
    border-radius: 10px;
    filter: brightness(120%);
}

.contact-car-icon {
    animation: pulse 3s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

/* Footer Car */
.footer-car {
    position: absolute;
    top: -20px;
    right: -30px;
    opacity: 0.1;
    z-index: 1;
    animation: footerCarMove 8s ease-in-out infinite;
}

.footer-car img {
    width: 80px;
    height: 50px;
    object-fit: cover;
    border-radius: 5px;
    filter: brightness(150%);
}

@keyframes footerCarMove {
    0%, 100% {
        transform: translateX(0) rotate(0deg);
    }
    25% {
        transform: translateX(-10px) rotate(-2deg);
    }
    50% {
        transform: translateX(-20px) rotate(0deg);
    }
    75% {
        transform: translateX(-10px) rotate(2deg);
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    /* Mobile Hero Section - Slanted Split */
    .hero-section {
        padding: 40px 0;
        background: linear-gradient(135deg, #1a472a 0%, #2d5a3d 50%, #0f2e1a 100%);
        min-height: 70vh;
        display: flex;
        align-items: center;
    }

    .hero-section::before {
        width: 100%;
        height: 50%;
        top: 0;
        left: 0;
        background: linear-gradient(135deg,
            rgba(0, 0, 0, 0.25) 0%,
            rgba(0, 0, 0, 0.15) 50%,
            rgba(0, 0, 0, 0.35) 100%);
        clip-path: polygon(0% 0%, 100% 0%, 100% 90%, 0% 100%);
    }

    .hero-section::after {
        width: 100%;
        height: 50%;
        top: 50%;
        right: 0;
        left: 0;
        clip-path: polygon(0% 6%, 100% 0%, 100% 100%, 0% 100%);
        background: linear-gradient(rgba(0, 0, 0, 0.25), rgba(0, 0, 0, 0.35)),
                    url('../images/3.jpg') center/cover;
        background-size: cover;
        background-position: center center;
        background-repeat: no-repeat;
        background-attachment: scroll;
    }

    .hero-section h1 {
        font-size: 2.2rem;
    }

    .hero-section p {
        font-size: 1.1rem;
        margin-bottom: 2rem;
    }

    .hero-section .btn {
        font-size: 1rem;
        padding: 10px 25px;
        margin: 0.5rem 0.25rem;
        display: inline-block;
        min-width: 140px;
    }

    .floating-contact,
    .floating-whatsapp {
        left: 15px;
    }

    .btn-back-to-top {
        right: 15px;
    }

    .contact-form {
        padding: 2rem 1.5rem;
    }

    .service-card {
        padding: 1.5rem;
        margin-bottom: 2rem;
    }

    /* Services Grid Mobile */
    .service-card .d-flex {
        flex-direction: column;
        text-align: center;
        align-items: center;
    }

    .service-card .service-icon {
        margin-right: 0 !important;
        margin-bottom: 1rem;
        align-self: center;
        width: 50px;
        height: 50px;
    }

    .service-card .service-icon i {
        font-size: 1.8rem !important;
    }

    .service-card .flex-grow-1 {
        flex-grow: 0;
        width: 100%;
        text-align: center;
    }

    .service-card h4,
    .service-card h5 {
        font-size: 1.2rem;
        margin-bottom: 1rem;
        line-height: 1.3;
    }

    .service-card p {
        font-size: 0.95rem;
        line-height: 1.4;
        margin-bottom: 1.25rem;
    }

    .service-card .btn {
        align-self: center;
        min-width: 140px;
        font-size: 0.9rem;
    }

    .service-card .price-range {
        font-size: 0.9rem;
        text-align: center;
    }

    /* Top Bar Mobile */
    .top-bar {
        font-size: 0.8rem;
        padding: 0.75rem 0;
    }

    .top-bar .contact-info {
        justify-content: center;
        margin-bottom: 0.5rem;
        gap: 0.5rem;
    }

    .top-bar .social-links {
        justify-content: center;
        gap: 0.5rem;
    }

    .top-bar .col-md-6 {
        text-align: center;
        margin-bottom: 0.25rem;
    }

    /* Call to Action Mobile */
    .cta-section {
        text-align: center;
        padding: 3rem 0;
    }

    .cta-section .col-lg-8,
    .cta-section .col-lg-4 {
        text-align: center;
        margin-bottom: 1.5rem;
    }

    .cta-section .btn {
        display: block;
        width: 100%;
        max-width: 280px;
        margin: 0.5rem auto;
    }

    /* Car Showcase Mobile */
    .car-showcase {
        margin-bottom: 2rem;
    }

    .car-showcase img {
        height: 300px !important;
    }

    .car-overlay {
        opacity: 1;
        position: static !important;
        padding: 1rem !important;
    }

    .car-overlay .bg-dark {
        background: var(--primary-color) !important;
    }

    .feature-box {
        margin-bottom: 1rem;
    }
}

/* Print Styles */
@media print {
    .navbar, .footer, .floating-contact, .floating-whatsapp, .btn-back-to-top {
        display: none !important;
    }
    
    body {
        font-size: 12pt;
        line-height: 1.5;
    }
    
    h1, h2, h3, h4, h5, h6 {
        page-break-after: avoid;
    }
}

/* Accessibility */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Focus styles for keyboard navigation */
a:focus,
button:focus,
.btn:focus,
.form-control:focus {
    outline: 2px solid var(--secondary-color);
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    :root {
        --primary-color: #000000;
        --secondary-color: #ffff00;
        --text-dark: #000000;
    }
}

/* Tablet Responsive (768px to 991px) */
@media (min-width: 768px) and (max-width: 991px) {
    /* Tablet Hero Section */
    .hero-section {
        min-height: 70vh;
    }

    .hero-section::after {
        clip-path: polygon(18% 0%, 100% 0%, 100% 100%, 3% 100%);
        background-size: cover;
    }

    .hero-section::before {
        clip-path: polygon(0% 0%, 82% 0%, 97% 100%, 0% 100%);
    }

    .service-card .d-flex {
        flex-direction: row;
        text-align: left;
        align-items: flex-start;
    }

    .service-card .service-icon {
        margin-right: 1rem !important;
        margin-bottom: 0;
        width: 50px;
        height: 50px;
    }

    .service-card .service-icon i {
        font-size: 1.5rem !important;
    }

    .service-card .flex-grow-1 {
        flex-grow: 1;
        text-align: left;
    }

    .service-card h4,
    .service-card h5 {
        font-size: 1.1rem;
        margin-bottom: 0.75rem;
    }

    .service-card p {
        font-size: 0.9rem;
        line-height: 1.4;
    }

    .service-card .btn {
        font-size: 0.85rem;
        padding: 6px 12px;
    }
}

/* Additional Responsive Improvements */
@media (max-width: 576px) {
    .hero-section {
        padding: 30px 0;
        min-height: 60vh;
    }

    .hero-section h1 {
        font-size: 1.8rem;
        line-height: 1.3;
    }

    .hero-section p {
        font-size: 1rem;
        margin-bottom: 1.5rem;
    }

    .hero-section .btn {
        font-size: 0.9rem;
        padding: 8px 20px;
        margin: 0.25rem;
        width: 100%;
        max-width: 200px;
    }

    /* Hero Section Mobile Adjustments */
    .hero-section::after {
        height: 55%;
        top: 45%;
        clip-path: polygon(0% 5%, 100% 0%, 100% 100%, 0% 100%);
    }

    .hero-section::before {
        height: 45%;
        clip-path: polygon(0% 0%, 100% 0%, 100% 95%, 0% 100%);
    }

    .display-4 {
        font-size: 1.5rem;
    }

    .display-5 {
        font-size: 1.25rem;
    }

    .navbar-brand {
        font-size: 1.2rem;
    }

    .card-body {
        padding: 1.5rem;
    }

    .service-card {
        padding: 1rem;
    }

    /* Services Grid Extra Small Screens */
    .service-card .d-flex {
        flex-direction: column;
        text-align: center;
        align-items: center;
    }

    .service-card .service-icon {
        margin-right: 0 !important;
        margin-bottom: 0.75rem;
        font-size: 2rem !important;
    }

    .service-card .service-icon i {
        font-size: 2rem !important;
    }

    .service-card .flex-grow-1 {
        flex-grow: 0;
        width: 100%;
        text-align: center;
    }

    .service-card h4 {
        font-size: 1.1rem;
        margin-bottom: 0.75rem;
        line-height: 1.3;
    }

    .service-card h5 {
        font-size: 1rem;
        margin-bottom: 0.75rem;
        line-height: 1.3;
    }

    .service-card p {
        font-size: 0.9rem;
        line-height: 1.4;
        margin-bottom: 1rem;
    }

    .service-card .btn {
        font-size: 0.85rem;
        padding: 6px 12px;
        width: 100%;
        max-width: 160px;
    }

    .service-card .price-range {
        font-size: 0.85rem;
        margin-bottom: 0.75rem;
    }

    .btn-lg {
        padding: 0.75rem 1.5rem;
        font-size: 1rem;
    }

    /* Top Bar Extra Small */
    .top-bar {
        font-size: 0.75rem;
        padding: 0.5rem 0;
    }

    .top-bar .contact-info {
        flex-direction: column;
        gap: 0.25rem;
    }

    .top-bar .social-links {
        margin-top: 0.5rem;
    }

    /* Call to Action Extra Small */
    .cta-section h3 {
        font-size: 1.3rem;
    }

    .cta-section .lead {
        font-size: 1rem;
    }

    .cta-section .btn {
        font-size: 0.9rem;
        padding: 8px 16px;
    }

    /* Car Showcase Extra Small */
    .car-showcase img {
        height: 250px !important;
    }



    .feature-box {
        padding: 1.5rem !important;
    }
}

/* WebP Image Support */
.webp .hero-section {
    background-image: linear-gradient(rgba(26, 71, 42, 0.8), rgba(26, 71, 42, 0.8)),
                      url('../images/hero-bg.webp');
}

/* Loading States */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid var(--primary-color);
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Improved Form Styles */
.form-floating > label {
    right: 0.75rem;
    left: auto;
}

.form-floating > .form-control:focus ~ label,
.form-floating > .form-control:not(:placeholder-shown) ~ label {
    transform: scale(0.85) translateY(-0.5rem) translateX(0.15rem);
}

/* Better Table Responsiveness */
.table-responsive {
    border-radius: 10px;
    box-shadow: var(--shadow);
}

/* Improved Gallery */
.gallery-masonry {
    column-count: 3;
    column-gap: 1rem;
}

@media (max-width: 768px) {
    .gallery-masonry {
        column-count: 2;
    }
}

@media (max-width: 576px) {
    .gallery-masonry {
        column-count: 1;
    }
}

.gallery-masonry .gallery-item {
    break-inside: avoid;
    margin-bottom: 1rem;
}

/* Enhanced Accessibility */
.skip-link {
    position: absolute;
    top: -40px;
    left: 6px;
    background: var(--primary-color);
    color: white;
    padding: 8px;
    text-decoration: none;
    border-radius: 0 0 4px 4px;
    z-index: 9999;
}

.skip-link:focus {
    top: 0;
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .pulse-animation {
        animation: none;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    :root {
        --bg-light: #2c2c2c;
        --text-dark: #ffffff;
        --text-light: #cccccc;
    }

    .bg-light {
        background-color: var(--bg-light) !important;
        color: var(--text-dark);
    }

    .text-muted {
        color: var(--text-light) !important;
    }
}




