/* ==========================================
   RESPONSIVE DESIGN
   ========================================== */

/* Common adjustments for tablets and smaller devices */
@media (max-width: 992px) {
    .nav-left {
        flex-grow: 1;
        gap: 1rem;
    }
    .nav-links a {
        padding: 0 0.8rem;
    }
    .hero-stats {
        grid-template-columns: repeat(2, 1fr);
    }
    .footer-content {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    }
    .nav-actions {
        flex-shrink: 0;
    }
    .packages-grid.four-cards {
        grid-template-columns: repeat(2, 1fr); /* 2 columns on tablets */
    }
    .packages-grid.five-cards {
        grid-template-columns: repeat(3, 1fr); /* 3 columns on tablets */
    }
}

/* Adjustments for mobile devices */
@media (max-width: 768px) {
    .container {
        width: 100%;
        padding: 0 10px; /* Reduced side padding for a tighter fit on mobile */
    }

    /* Navigation for Mobile */
    .nav-container {
        padding: 0 15px;
        display: flex;
        justify-content: space-between; /* Ensures items are spaced out */
        align-items: center;
        width: 100%;
    }
    .nav-left > .nav-links {
        /* display: none; */ /* This is now handled by the slide-out menu styles */
    }
    .nav-left { flex-grow: 0; } /* Don't let the logo container grow */
    .nav-actions { order: 2; } /* Place auth links before the toggle */
    .nav-toggle { order: 3; } /* Place toggle button last */
    .nav-toggle {
        display: block; /* Show hamburger icon */
        z-index: 1002;
        margin-left: auto;
    }

    .nav-links { /* This is the slide-out menu */
        position: fixed;
        /* top is set by JS */
        left: -250px; /* Start off-screen to the left */
        width: 250px;
        /* height is set by JS */
        background: white;
        flex-direction: column;
        justify-content: flex-start;
        align-items: flex-start;
        transition: left 0.4s ease;
        box-shadow: 5px 0 15px rgba(0,0,0,0.1);
        z-index: 1001; /* Ensure it's above the overlay */
        padding-top: 20px; /* Spacing from the top */
        display: flex; /* Keep as flex for internal alignment */
        max-height: calc(100vh - 60px);
        overflow-y: auto;
        box-sizing: border-box;
    }

    .nav-links.active {
        left: 0; /* Slide in */
    }
    .nav-links li {
        margin: 0;
        width: 100%;
    }
    .nav-links a {
        font-size: 1.2rem;
        padding: 1rem 1.5rem;
        display: block;
        width: 100%;
        border-bottom: 1px solid #f0f0f0;
    }

    /* Hero Section */
    .hero {
        padding: 100px 1rem 30px;
    }
    .hero-title {
        font-size: 2rem;
    }
    .hero-subtitle {
        font-size: 1rem;
    }
    .hero-buttons {
        flex-direction: column;
        gap: 0.8rem;
    }

    /* Section Paddings and Titles */
    .services, .packages, .portfolio, .marketing-showcase, .testimonials, .about, .order-section, .contact {
        padding: 60px 15px;
    }
    .section-title {
        font-size: 2rem;
    }

    .about-content, .contact-content {
        grid-template-columns: 1fr; /* Stack on mobile */
        gap: 2rem;
    }
    /* Grid Layouts */
    .services-grid, .packages-grid, .portfolio-grid, .marketing-gallery-grid, .testimonials-grid {
        grid-template-columns: 1fr;
    }

    /* Form Adjustments */
    .form-row {
        grid-template-columns: 1fr;
    }
    .modal-content.large {
        width: 95%;
        margin: 5% auto;
        padding: 1rem;
    }

    /* Floating Button */
    .floating-order-btn {
        width: 50px;
        height: 50px;
        font-size: 22px;
        right: 15px;
        bottom: 20px; /* Positioned at the bottom right */
        transform: none;
    }

    .form-progress-bar {
        max-width: 90%; /* Make progress bar wider on smaller screens */
    }

    /* Banner adjustments for mobile */
    .top-banner {
        padding-top: 100px;
        padding-bottom: 40px;
    }
    .banner-title { font-size: 1.8rem; }
    .banner-subtitle { font-size: 1rem; }

    /* Responsive Table Adjustments for demo.html */
    .packages-table,
    .features-table {
        display: block;
    }
    #pricing-tables .packages-table, #what-we-deliver .packages-table { display: block; }

    .packages-table,
    .features-table {
        display: block;
        width: 100%;
    }
    #pricing-tables .packages-table {
        display: block;
        width: 100%;
    }

    .packages-table tr,
    .features-table tr {
        display: block;
        margin-bottom: 1.5rem;
        background: white;
        border: 1px solid #e0e0e0;
        border-radius: 10px;
        box-shadow: 0 5px 15px rgba(0,0,0,0.05);
    }    
    #pricing-tables .packages-table tr {
        margin-bottom: 1rem;
    }
    .packages-table td,
    .features-table td {
        display: flex;
        text-align: left;
        padding: 0.75rem 1rem;
        border-bottom: 1px solid #f0f0f0;
    }

    .packages-table td:before,
    .features-table td:before {
        content: attr(data-label);
        font-weight: bold;
        float: left;
        color: #667eea;
        flex-basis: 50%;
        text-align: left;
    }

    .packages-table td:before {
        padding-right: 1rem;
    }

    .coffee-package-grid {
        grid-template-columns: 1fr;
    }

    .packages-table ul li,
    .features-table ul li {
        display: list-item; /* Revert to list view on mobile */
        margin-left: 1.5rem;
    }

    .software-features-section .section-title,
    .software-features-section .section-subtitle {
        text-align: center; /* Center align on mobile for better look */
    }
}

@media (max-width: 768px) {
    .packages-table td::before {
        width: auto; /* Give label a fixed width */
        flex-basis: 40%;
        padding-right: 10px;
        white-space: normal; /* Allow label to wrap */
    }
    .packages-grid.three-cards,
    .packages-grid.four-cards,
    .packages-grid.five-cards {
        grid-template-columns: 1fr;
    }
    .packages-grid {
        grid-template-columns: 1fr; /* Ensure all package grids stack on mobile */
    }
    .two-column-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .filter-container select {
        min-width: 0;
        width: 100%;
        max-width: 100%;
    }
}

/* Extra small devices (phones, less than 480px) */
@media (max-width: 480px) {
  .packages-grid,
  .services-grid,
  .portfolio-grid,
  .marketing-gallery-grid {
    padding: 0; /* Removed extra padding from grids */
  }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: 1.8rem;
    }
    .section-title {
        font-size: 1.8rem;
    }
    .auth-link {
        padding: 0.5rem 0.7rem;
        font-size: 0.8rem;
    }
}

/* Overlay for when mobile menu is open */
.body-menu-open::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000; /* Should be below the nav-links menu (z-index: 1001) */
    opacity: 1;
    transition: opacity 0.4s ease;
}

/* Table Footer for Pagination */
.table-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background-color: #f8f9fa;
    border-top: 1px solid #dee2e6;
    border-radius: 0 0 8px 8px;
    margin-top: -1px; /* To align with the table border */
}

@media (max-width: 768px) {
    .table-footer {
        flex-direction: column;
        gap: 1rem;
    }
}

/* Responsive Work Guidelines */
@media (max-width: 768px) {
    .work-guidelines {
        padding: 0;
        margin-top: 2rem;
    }
    .guidelines-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
}

/* Responsive Employee Table */
/* On mobile, the .table-container has 'overflow-x: auto', which makes the table horizontally scrollable.
   This is a standard and effective way to handle complex tables on small screens without breaking the layout.
   No additional complex styles are needed. */
