/* =============================================
   VIGIWOODS RESPONSIVE DESIGN SYSTEM (v2.0)
   Pixel-Perfect Mobile Alignment Fixes
   ============================================= */

/* Universal Overflow Fix */
html,
body {
    overflow-x: hidden;
    width: 100%;
    position: relative;
    margin: 0;
    padding: 0;
    touch-action: pan-y;
    /* Rigid vertical scroll, locks horizontal movement */
    overscroll-behavior-x: none;
    /* Prevents horizontal 'pull' bounce on mobile */
    -webkit-overflow-scrolling: touch;
}

/* Base container adjustment */
.container {
    width: 100%;
    margin-right: auto;
    margin-left: auto;
    padding-right: 1rem;
    padding-left: 1rem;
}

/* 📺 TV & Ultra-wide Screens (1440px+) */
@media (min-width: 1440px) {
    .container {
        max-width: 1320px;
    }

    .hero-text h1 {
        font-size: 5.5rem;
    }
}

/* 📑 Tablets & iPads (768px to 1023px) */
@media (max-width: 1023px) {
    .navbar {
        padding: 10px 0;
        background: rgba(250, 248, 243, 0.98) !important;
        box-shadow: var(--shadow-sm);
    }

    .nav-links {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background: white;
        flex-direction: column;
        padding: 2rem;
        box-shadow: var(--shadow-md);
        text-align: center;
        gap: 1.5rem;
        z-index: 1000;
    }

    .nav-links.active {
        display: flex;
    }

    .nav-links .btn-primary {
        width: fit-content;
        margin: 0 auto;
    }

    .hamburger {
        display: flex;
    }

    .hero-content {
        text-align: center;
        padding-top: 80px;
    }

    .hero-buttons {
        justify-content: center;
        flex-wrap: wrap;
    }

    .about-grid {
        grid-template-columns: 1fr;
        gap: 3rem;
    }

    .service-card {
        max-width: 100%;
    }
}

/* 📱 Mobile Phones & iPhones (0px to 767px) */
@media (max-width: 767px) {

    /* Header Polish */
    .navbar {
        padding: 10px 0;
    }

    .logo {
        font-size: 0.9rem;
    }

    .logo img {
        width: 32px;
        height: 32px;
    }

    .logo span {
        font-size: 1.1rem;
    }

    /* Hero Scaling */
    .hero {
        min-height: 80vh;
        display: flex;
        align-items: center;
    }

    .hero-text h1 {
        font-size: 2rem;
        line-height: 1.2;
    }

    .hero-subtitle {
        font-size: 0.95rem;
        margin-bottom: 1.5rem;
    }

    .btn-large {
        padding: 0.8rem 1.2rem;
        font-size: 0.85rem;
        width: 100%;
    }

    .hero-buttons {
        flex-direction: column;
        gap: 0.75rem;
    }

    /* About Section */
    .about {
        padding: 4rem 0;
    }

    .experience-badge {
        bottom: 10px;
        right: 10px;
        padding: 0.75rem;
    }

    /* Grid Layouts to Single Column */
    .services-grid,
    .stats-grid,
    .contact-grid,
    .footer-content,
    .blog-grid {
        grid-template-columns: 1fr !important;
        gap: 2rem;
    }

    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    /* CONTACT FORM FIXES (Crucial for Overflow) */
    .contact-info-card,
    .contact-form-card {
        width: 100% !important;
        max-width: 100% !important;
        padding: 2rem 1.25rem !important;
        box-sizing: border-box !important;
        margin: 0 !important;
        border-radius: 1.5rem;
    }

    .form-row {
        gap: 1.25rem !important;
        grid-template-columns: 1fr !important;
    }

    .form-group input,
    .form-group textarea,
    .form-group select {
        font-size: 0.95rem !important;
    }

    .info-item {
        margin-bottom: 1.5rem;
    }

    .form-tabs {
        flex-direction: row;
        gap: 0.5rem;
    }

    /* Blog Modal Responsive */
    .modal-content,
    .blog-modal-content,
    .blog-detail-modal-content {
        width: 90%;
        max-width: 100%;
    }

    .modal-header {
        padding: 1.5rem;
    }

    .blog-form {
        padding: 1.5rem;
    }

    .form-actions {
        flex-direction: column;
    }

    .form-actions button {
        width: 100%;
    }

    .blog-detail-content {
        padding: 1.5rem;
    }

    .blog-detail-title {
        font-size: 1.8rem;
    }

    .blog-detail-meta {
        flex-direction: column;
        gap: 1rem;
    }

    .blog-detail-footer {
        flex-direction: column;
    }

    .blog-detail-footer button {
        width: 100%;
    }

    .btn-write-post {
        width: 100%;
        justify-content: center;
    }


    .form-tab {
        font-size: 0.8rem;
        padding: 0.6rem;
    }

    /* Footer Polish */
    .footer-content {
        text-align: center;
    }

    .footer-links-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        text-align: left;
    }

    .dev-brand {
        flex-direction: column;
        gap: 1rem;
    }

    .names-row {
        flex-wrap: wrap;
        justify-content: center;
        font-size: 1.2rem !important;
        gap: 0.5rem !important;
    }

    .developer-credit-section {
        padding: 2.5rem 1rem;
    }

    .footer-bottom {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
        padding-bottom: 2rem;
    }

    .footer-meta {
        font-size: 0.8rem;
    }

    /* Floating Buttons Offset */
    .floating-social {
        bottom: 20px;
        right: 15px;
        gap: 10px;
    }

    .float-btn {
        width: 45px;
        height: 45px;
    }
}

/* 📱 Specific fix for Extra Small Phones (Below 360px) */
@media (max-width: 359px) {
    .hero-text h1 {
        font-size: 1.6rem;
    }

    .logo span {
        display: none;
    }

    .luxury-badge {
        font-size: 0.7rem;
    }

    .gallery-grid {
        grid-template-columns: 1fr;
    }

    .blog-grid {
        grid-template-columns: 1fr;
    }

    .blog-card-title {
        font-size: 1.1rem;
    }

    .modal {
        padding: 1rem;
    }

    .blog-card-header {
        padding: 1rem;
    }

    .blog-card-body {
        padding: 1rem;
    }

    .blog-card-footer {
        padding: 0.75rem;
    }
}

/* Proactive alignment utilities */
.img-responsive {
    width: 100%;
    height: auto;
    object-fit: cover;
}

.section-header h2 {
    font-size: 1.8rem;
}