/* =============================================
   RESPONSIVE DESIGN FIXES
   Optimized for all screen sizes
   ============================================= */

/* === HERO SECTION RESPONSIVE === */
@media (max-width: 1024px) {
    .hero-rrd {
        min-height: 80vh;
        padding: 3rem 2rem;
    }
    
    .hero-rrd-title {
        font-size: clamp(2rem, 5vw, 2.5rem);
    }
    
    .hero-rrd-description {
        font-size: 1rem;
    }
    
    .hero-ribbon {
        width: 200px;
        top: 5%;
        right: 5%;
    }
    
    .grid-pattern {
        width: 50%;
    }
}

@media (max-width: 768px) {
    .hero-rrd {
        min-height: 70vh;
        padding: 2rem 1rem;
        text-align: center;
        justify-content: center;
        display: flex;
        align-items: center;
        background: linear-gradient(135deg, #003d5c 0%, #0a5f7f 30%, #4fa8c5 70%, #7ec8dd 100%);
        color: #ffffff;
        position: relative;
        overflow: hidden;
    }
    
    .hero-rrd-content {
        padding-left: 0;
        text-align: center;
        max-width: 100%;
        position: relative;
        z-index: 10;
    }
    
    .hero-rrd-title {
        font-size: clamp(1.5rem, 4vw, 2rem);
        color: #ffffff;
    }
    
    .hero-rrd-description {
        font-size: 0.95rem;
        max-width: 100%;
        margin: 1rem auto;
        color: rgba(255, 255, 255, 0.9);
    }
    
    .hero-rrd-buttons {
        display: flex;
        flex-direction: column;
        justify-content: center;
        gap: 1rem;
        width: 100%;
        max-width: 100%;
    }
    
    .hero-rrd-buttons .btn {
        width: 100%;
        padding: 1rem 1.5rem;
        font-size: 0.9rem;
        min-height: 50px;
        border-radius: 8px;
    }
    
    .hero-ribbon {
        display: none !important;
    }
    
    .ribbon-glow {
        display: none !important;
    }
    
    .grid-pattern {
        width: 100%;
        opacity: 0.15;
    }
    
    .sparkle {
        display: none !important;
    }
}

@media (max-width: 480px) {
    .hero-rrd {
        min-height: 65vh;
        padding: 2rem 1rem;
        display: flex;
        align-items: center;
        justify-content: center;
        background: linear-gradient(135deg, #003d5c 0%, #0a5f7f 30%, #4fa8c5 70%, #7ec8dd 100%);
    }
    
    .hero-rrd-subtitle {
        font-size: 0.7rem;
        margin-bottom: 0.75rem;
        color: rgba(255, 255, 255, 0.9);
    }
    
    .hero-rrd-title {
        font-size: 1.5rem;
        margin-bottom: 1rem;
        color: #ffffff;
    }
    
    .hero-rrd-description {
        font-size: 0.9rem;
        margin-bottom: 1.5rem;
        color: rgba(255, 255, 255, 0.9);
    }
    
    .hero-rrd-buttons {
        flex-direction: column;
        gap: 1rem;
        width: 100%;
    }
    
    .hero-rrd-buttons .btn {
        width: 100%;
        padding: 1rem 1.5rem;
        font-size: 0.85rem;
        min-height: 48px;
    }
    
    .hero-ribbon {
        display: none !important;
    }
    
    .ribbon-glow {
        display: none !important;
    }
}

/* === RUNNING TEXT RESPONSIVE === */
@media (max-width: 768px) {
    .running-text-wrapper {
        animation-duration: 70s !important;
    }
    
    .running-text-item {
        font-size: 1rem;
        padding: 0 1.5rem;
    }
    
    .running-text-section {
        padding: 1rem 0;
    }
}

@media (max-width: 480px) {
    .running-text-wrapper {
        animation-duration: 100s !important;
    }
    
    .running-text-item {
        font-size: 0.85rem;
        padding: 0 1.25rem;
    }
    
    .running-text-item::before {
        font-size: 1rem;
        margin-right: 0.5rem;
    }
}

/* === STATS SECTION RESPONSIVE === */
@media (max-width: 1024px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
    
    .stat-item {
        padding: 1.25rem 0.75rem;
    }
    
    .stat-number {
        font-size: 2rem;
    }
}

@media (max-width: 768px) {
    .stats-section {
        padding: 3rem 1.5rem;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }
    
    .stat-item {
        padding: 1rem 0.5rem;
    }
    
    .stat-number {
        font-size: 1.75rem;
    }
    
    .stat-label {
        font-size: 0.7rem;
    }
}

@media (max-width: 480px) {
    .stats-section {
        padding: 2rem 1rem;
    }
    
    .stat-number {
        font-size: 2rem;
    }
}

/* === SERVICES SHOWCASE RESPONSIVE === */
@media (max-width: 1024px) {
    .services-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }
    
    .service-card {
        padding: 2rem 1.5rem;
    }
}

@media (max-width: 768px) {
    .services-showcase {
        padding: 3rem 1.5rem;
    }
    
    .services-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .service-card {
        padding: 1.5rem 1rem;
    }
    
    .service-icon {
        font-size: 2.5rem;
    }
    
    .service-card h3 {
        font-size: 1.25rem;
    }
    
    .service-card p {
        font-size: 0.95rem;
    }
}

@media (max-width: 480px) {
    .services-showcase {
        padding: 2rem 1rem;
    }
    
    .service-icon {
        font-size: 2rem;
    }
}

/* === PROJECTS SECTION RESPONSIVE === */
@media (max-width: 1024px) {
    .projects-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 2rem;
    }
    
    .project-card {
        padding: 2rem;
    }
}

@media (max-width: 768px) {
    .projects-section {
        padding: 3rem 1.5rem;
    }
    
    .projects-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .project-card {
        padding: 1.5rem;
    }
    
    .project-card h3 {
        font-size: 1.25rem;
    }
    
    .project-card p {
        font-size: 0.95rem;
    }
}

@media (max-width: 480px) {
    .projects-section {
        padding: 2rem 1rem;
    }
    
    .project-card {
        padding: 1rem;
    }
}

/* === IMAGE GALLERY RESPONSIVE === */
@media (max-width: 1024px) {
    .image-gallery {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }
}

@media (max-width: 768px) {
    .image-gallery {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .gallery-item {
        height: 250px;
    }
}

@media (max-width: 480px) {
    .image-gallery {
        gap: 0.8rem;
    }
    
    .gallery-item {
        height: 200px;
    }
    
    .gallery-overlay h3 {
        font-size: 1rem;
    }
}

/* === AWARDS SECTION RESPONSIVE === */
@media (max-width: 1024px) {
    .awards-content {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .awards-text h3 {
        font-size: 2rem;
    }
}

@media (max-width: 768px) {
    .awards-section {
        padding: 3rem 1.5rem;
    }
    
    .awards-text h3 {
        font-size: 1.75rem;
    }
    
    .awards-text p {
        font-size: 1rem;
    }
    
    .awards-text h4 {
        font-size: 1.1rem;
    }
    
    .certifications-list li {
        font-size: 0.95rem;
        padding: 0.6rem 0;
    }
}

@media (max-width: 480px) {
    .awards-section {
        padding: 2rem 1rem;
    }
    
    .awards-text h3 {
        font-size: 1.5rem;
    }
    
    .awards-text p {
        font-size: 0.95rem;
    }
    
    .certifications-list li {
        font-size: 0.9rem;
    }
}

/* === CONTACT SECTION RESPONSIVE === */
@media (max-width: 1024px) {
    .contact-content {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .contact-office {
        padding: 1.5rem;
    }
}

@media (max-width: 768px) {
    .contact-section {
        padding: 3rem 1.5rem;
    }
    
    .contact-office {
        padding: 1.25rem;
    }
    
    .contact-office h3 {
        font-size: 1.1rem;
    }
    
    .contact-office p {
        font-size: 0.95rem;
    }
}

@media (max-width: 480px) {
    .contact-section {
        padding: 2rem 1rem;
    }
    
    .contact-office {
        padding: 1rem;
    }
    
    .contact-office h3 {
        font-size: 1rem;
    }
    
    .contact-office p {
        font-size: 0.9rem;
    }
}

/* === CTA SECTION RESPONSIVE === */
@media (max-width: 768px) {
    .cta-section {
        padding: 3rem 1.5rem;
    }
    
    .cta-content h2 {
        font-size: 1.75rem;
    }
    
    .cta-content p {
        font-size: 1rem;
    }
    
    .cta-buttons {
        flex-direction: column;
        gap: 1rem;
    }
}

@media (max-width: 480px) {
    .cta-section {
        padding: 2rem 1rem;
    }
    
    .cta-content h2 {
        font-size: 1.5rem;
    }
    
    .cta-content p {
        font-size: 0.95rem;
    }
    
    .btn-outline-white {
        width: 100%;
    }
}

/* === FOOTER RESPONSIVE === */
@media (max-width: 1024px) {
    .footer-content {
        grid-template-columns: repeat(2, 1fr);
        gap: 2rem;
    }
}

@media (max-width: 768px) {
    .footer {
        padding: 3rem 1.5rem 1rem;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .footer h3 {
        font-size: 1.1rem;
    }
    
    .footer p {
        font-size: 0.95rem;
    }
}

@media (max-width: 480px) {
    .footer {
        padding: 2rem 1rem 0.5rem;
    }
    
    .footer h3 {
        font-size: 1rem;
    }
    
    .footer p {
        font-size: 0.9rem;
    }
    
    .footer-bottom {
        font-size: 0.85rem;
    }
}

/* === BACK TO TOP BUTTON RESPONSIVE === */
@media (max-width: 768px) {
    .back-to-top {
        width: 45px;
        height: 45px;
        font-size: 1.2rem;
        bottom: 1.5rem;
        right: 1.5rem;
    }
}

@media (max-width: 480px) {
    .back-to-top {
        width: 40px;
        height: 40px;
        font-size: 1rem;
        bottom: 1rem;
        right: 1rem;
    }
}

/* === MEGA MENU RESPONSIVE === */
/* Handled by mega-menu-final.css */

/* === MOBILE MENU OPTIMIZATION === */
/* Mobile menu is now handled by mobile-menu-new.css - DO NOT OVERRIDE */
@media (max-width: 768px) {
    .mobile-toggle {
        display: flex;
    }
}

/* === TOUCH-FRIENDLY TARGETS === */
@media (max-width: 768px) {
    button,
    a,
    input,
    select,
    textarea {
        min-height: 44px;
        min-width: 44px;
    }
}

/* === LANDSCAPE MODE OPTIMIZATION === */
@media (max-height: 600px) and (orientation: landscape) {
    .hero-rrd {
        min-height: 100vh;
        padding: 2rem;
    }
    
    .navbar {
        height: 60px;
    }
    
    .nav-container {
        height: 60px;
    }
}


/* === IMAGE OPTIMIZATION FOR ALL DEVICES === */
img {
    max-width: 100%;
    height: auto;
    display: block;
}

.card-image,
.gallery-item,
.awards-image,
.contact-map {
    position: relative;
    overflow: hidden;
    background: #f0f0f0;
}

.card-image img,
.gallery-item img,
.awards-image img,
.contact-map img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
}

/* === CARD IMPROVEMENTS === */
@media (max-width: 768px) {
    .card,
    .project-card,
    .service-card {
        border-radius: 12px;
        overflow: hidden;
        background: white;
        box-shadow: 0 2px 12px rgba(0,0,0,0.08);
        margin-bottom: 1.5rem;
    }
    
    .card-image {
        width: 100%;
        height: 220px;
        margin: 0;
        border-radius: 0;
    }
    
    .card-content {
        padding: 1.25rem;
    }
    
    .card h3,
    .project-card h3 {
        font-size: 1.15rem;
        margin: 0 0 0.75rem 0;
        color: #1e3555;
        font-weight: 700;
    }
    
    .card p,
    .project-card p {
        font-size: 0.9rem;
        line-height: 1.6;
        color: #5c6b7a;
        margin-bottom: 1rem;
    }
    
    .btn-outline {
        width: 100%;
        text-align: center;
        padding: 0.75rem 1rem;
    }
}

/* === GRID SYSTEM FIX === */
@media (max-width: 768px) {
    .grid,
    .grid-2,
    .grid-3,
    .grid-4,
    .services-grid,
    .projects-grid {
        display: grid;
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
}

/* === SECTION SPACING === */
@media (max-width: 768px) {
    .section,
    .section-light {
        padding: 2.5rem 1rem;
    }
    
    .section-header {
        margin-bottom: 2rem;
        text-align: center;
    }
    
    .section-subtitle {
        display: inline-block;
        padding: 0.5rem 1rem;
        font-size: 0.75rem;
        margin-bottom: 1rem;
    }
    
    .section-header h2 {
        font-size: 1.5rem;
        margin-bottom: 1rem;
        line-height: 1.3;
    }
    
    .section-header p {
        font-size: 0.95rem;
        line-height: 1.6;
        max-width: 100%;
    }
}

/* === PREVENT LAYOUT SHIFT === */
@media (max-width: 768px) {
    * {
        box-sizing: border-box;
    }
    
    html {
        overflow-x: clip; /* prevents horizontal scroll without blocking position:fixed */
        max-width: 100vw;
    }
    
    .container {
        max-width: 100%;
        padding-left: 1rem;
        padding-right: 1rem;
    }
}
