/* ========================================
   RESPONSIVE DESIGN - Kerala Business List
   Mobile-First Approach
   ======================================== */

/* ========================================
   MOBILE NAVIGATION
   ======================================== */

/* Mobile Menu Toggle Button */
.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    z-index: 1000;
}

.mobile-menu-toggle span {
    display: block;
    width: 25px;
    height: 3px;
    background: var(--text-dark);
    border-radius: 3px;
    transition: all 0.3s ease;
}

.mobile-menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(7px, 7px);
}

.mobile-menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
}

/* Mobile Navigation Overlay */
.mobile-nav-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: rgba(0, 0, 0, 0.5);
    z-index: 998;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.mobile-nav-overlay.active {
    opacity: 1;
}

/* Mobile Navigation Menu */
.mobile-nav {
    display: none;
    position: fixed;
    top: 0;
    right: -100%;
    width: 80%;
    max-width: 320px;
    height: 100vh;
    background: var(--white);
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.1);
    z-index: 999;
    padding: 2rem 1.5rem;
    overflow-y: auto;
    transition: right 0.3s ease;
}

.mobile-nav.active {
    right: 0;
}

.mobile-nav .nav-link {
    display: block;
    padding: 1rem 0;
    border-bottom: 1px solid var(--light-gray);
    color: var(--text-dark);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
}

.mobile-nav .nav-link:hover {
    color: var(--primary-yellow);
}

.mobile-nav .btn {
    width: 100%;
    margin-top: 1rem;
    justify-content: center;
}

/* ========================================
   TABLET BREAKPOINT (768px - 1024px)
   ======================================== */

@media (max-width: 1024px) {

    /* Container */
    .container {
        padding: 0 1.5rem;
    }

    /* Header */
    .header-content {
        height: 70px;
    }

    /* Hero Section */
    .hero {
        padding: 4rem 0;
    }

    .hero-title {
        font-size: 2.75rem;
    }

    .hero-subtitle {
        font-size: 1.125rem;
    }

    .hero-logo {
        width: 100px;
        height: 100px;
    }

    /* Search Bar */
    .hero-search {
        max-width: 700px;
        gap: 0.5rem;
    }

    .search-input,
    .search-select {
        font-size: 0.875rem;
    }

    .search-btn {
        padding: 0.875rem 1.5rem;
    }

    /* Section Titles */
    .section-title {
        font-size: 2rem;
    }

    .section-subtitle {
        font-size: 1rem;
    }

    /* Category Grid */
    .category-grid {
        grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
        gap: 0.875rem;
    }

    /* Feature Grid */
    .feature-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    /* Business Grid */
    .business-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }

    /* Pricing Grid */
    .pricing-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 2rem;
    }

    .pricing-card.popular {
        transform: scale(1);
    }

    /* Footer */
    .footer-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 2rem;
    }

    /* CTA Section */
    .cta-title {
        font-size: 2rem;
    }

    .cta-text {
        font-size: 1.125rem;
    }
}

/* ========================================
   MOBILE BREAKPOINT (max-width: 768px)
   ======================================== */

@media (max-width: 768px) {

    /* Show Mobile Menu Toggle */
    .mobile-menu-toggle {
        display: flex;
    }

    .mobile-nav-overlay,
    .mobile-nav {
        display: block;
    }

    /* Hide Desktop Navigation */
    .nav {
        display: none !important;
    }

    /* Container */
    .container {
        padding: 0 1rem;
    }

    /* Header */
    .header-content {
        height: 60px;
    }

    .logo-image {
        width: 40px;
        height: 40px;
    }

    .logo-text {
        font-size: 1.125rem;
    }

    /* Hero Section */
    .hero {
        padding: 3rem 0;
    }

    .hero-title {
        font-size: 2.25rem;
        line-height: 1.2;
    }

    .hero-subtitle {
        font-size: 1rem;
        margin-bottom: 2rem;
    }

    .hero-logo {
        width: 80px;
        height: 80px;
        margin-bottom: 1.5rem;
    }

    /* Search Bar - Stack Vertically */
    .hero-search {
        flex-direction: column;
        padding: 0.75rem;
        gap: 0.75rem;
    }

    .search-input,
    .search-select,
    .search-btn {
        width: 100%;
        height: 48px;
    }

    .search-btn {
        padding: 0.875rem 1rem;
    }

    /* Hero CTA */
    .hero-cta {
        flex-direction: column;
        gap: 1rem;
    }

    .hero-cta .btn {
        width: 100%;
    }

    /* Section */
    .section {
        padding: 3rem 0;
    }

    .section-title {
        font-size: 1.75rem;
    }

    .section-subtitle {
        font-size: 0.95rem;
    }

    /* Category Grid */
    .category-grid {
        grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
        gap: 0.75rem;
    }

    .category-card {
        padding: 0.875rem 0.5rem;
    }

    .category-icon {
        width: 44px;
        height: 44px;
        font-size: 1.25rem;
    }

    .category-name {
        font-size: 0.75rem;
    }

    /* Feature Grid */
    .feature-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }

    .feature-card {
        padding: 1.25rem;
    }

    .feature-icon {
        width: 40px;
        height: 40px;
        font-size: 1.25rem;
    }

    .feature-title {
        font-size: 0.9rem;
    }

    .feature-text {
        font-size: 0.75rem;
    }

    /* Business Grid */
    .business-grid {
        grid-template-columns: 1fr;
        gap: 1.25rem;
    }

    .business-image {
        height: 180px;
    }

    .business-content {
        padding: 1rem;
    }

    .business-name {
        font-size: 1.125rem;
    }

    /* Pricing Grid */
    .pricing-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .pricing-card {
        padding: 2rem 1.5rem;
    }

    .pricing-card.popular {
        transform: scale(1);
    }

    .pricing-name {
        font-size: 1.25rem;
    }

    .pricing-price {
        font-size: 2.5rem;
    }

    /* CTA Section */
    .cta-section {
        padding: 3rem 0;
    }

    .cta-title {
        font-size: 1.75rem;
    }

    .cta-text {
        font-size: 1rem;
    }

    /* Footer */
    .footer {
        padding: 2rem 0 1rem;
    }

    .footer-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .footer-logo-text {
        font-size: 1.25rem;
    }

    /* Buttons */
    .btn {
        padding: 0.75rem 1.5rem;
        font-size: 0.9rem;
    }

    .btn-lg {
        padding: 0.875rem 2rem;
        font-size: 1rem;
    }
}

/* ========================================
   SMALL MOBILE (max-width: 480px)
   ======================================== */

@media (max-width: 480px) {

    /* Container */
    .container {
        padding: 0 0.875rem;
    }

    /* Header */
    .header-content {
        height: 56px;
    }

    .logo-image {
        width: 36px;
        height: 36px;
    }

    .logo-text {
        font-size: 1rem;
    }

    /* Hero Section */
    .hero {
        padding: 2.5rem 0;
    }

    .hero-title {
        font-size: 1.875rem;
    }

    .hero-subtitle {
        font-size: 0.9rem;
    }

    .hero-logo {
        width: 70px;
        height: 70px;
    }

    /* Search Bar */
    .search-input,
    .search-select,
    .search-btn {
        height: 44px;
        font-size: 0.875rem;
    }

    /* Section */
    .section {
        padding: 2.5rem 0;
    }

    .section-title {
        font-size: 1.5rem;
    }

    .section-subtitle {
        font-size: 0.875rem;
    }

    /* Category Grid */
    .category-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.625rem;
    }

    .category-card {
        padding: 0.75rem 0.375rem;
    }

    .category-icon {
        width: 40px;
        height: 40px;
        font-size: 1.125rem;
        margin-bottom: 0.5rem;
    }

    .category-name {
        font-size: 0.7rem;
    }

    /* Feature Grid */
    .feature-grid {
        grid-template-columns: 1fr;
        gap: 0.875rem;
    }

    .feature-card {
        padding: 1rem;
    }

    /* Business Card */
    .business-image {
        height: 160px;
    }

    .business-content {
        padding: 0.875rem;
    }

    .business-name {
        font-size: 1rem;
    }

    .business-actions {
        flex-direction: column;
        gap: 0.5rem;
    }

    .btn-icon {
        width: 100%;
    }

    /* Pricing */
    .pricing-card {
        padding: 1.5rem 1rem;
    }

    .pricing-price {
        font-size: 2rem;
    }

    /* CTA Section */
    .cta-title {
        font-size: 1.5rem;
    }

    .cta-text {
        font-size: 0.9rem;
    }

    /* Footer */
    .footer-logo-text {
        font-size: 1.125rem;
    }

    .footer-tagline,
    .footer-links a {
        font-size: 0.875rem;
    }
}

/* ========================================
   ADMIN PANEL RESPONSIVE
   ======================================== */

@media (max-width: 1024px) {
    :root {
        --sidebar-width: 240px;
    }

    .sidebar {
        width: var(--sidebar-width);
        padding: 1.25rem;
    }

    .sidebar-brand {
        margin-bottom: 2rem;
    }

    .nav-link {
        padding: 0.75rem 0.875rem;
        font-size: 0.9rem;
    }

    .main-content {
        padding: 1.5rem;
    }

    .top-bar {
        padding: 0.875rem 1.5rem;
    }
}

@media (max-width: 768px) {

    /* Hide Sidebar on Mobile */
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }

    .sidebar.mobile-open {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
        padding: 1rem;
    }

    .top-bar {
        margin: -1rem -1rem 1.5rem -1rem;
        padding: 0.75rem 1rem;
        flex-wrap: wrap;
    }

    .search-bar {
        order: 3;
        width: 100%;
        margin-top: 0.75rem;
    }

    /* Mobile Sidebar Toggle */
    .mobile-sidebar-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 40px;
        height: 40px;
        background: white;
        border: 1px solid #e2e8f0;
        border-radius: 8px;
        cursor: pointer;
        margin-right: auto;
    }

    /* Admin Cards */
    .stats-grid,
    .chart-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    /* Admin Tables */
    .table-responsive {
        overflow-x: auto;
    }

    table {
        min-width: 600px;
    }
}

@media (max-width: 480px) {
    .main-content {
        padding: 0.75rem;
    }

    .top-bar {
        padding: 0.625rem 0.75rem;
    }

    .nav-link {
        padding: 0.625rem 0.75rem;
        font-size: 0.85rem;
    }

    .sidebar-brand {
        gap: 0.75rem;
    }
}

/* ========================================
   LISTING PAGES RESPONSIVE
   ======================================== */

@media (max-width: 768px) {

    /* Listing Detail Page */
    .listing-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .listing-images {
        grid-template-columns: 1fr;
    }

    .listing-info-grid {
        grid-template-columns: 1fr;
    }

    .listing-sidebar {
        position: static;
        width: 100%;
    }

    /* Directory/Search Page */
    .filters-sidebar {
        position: static;
        width: 100%;
        margin-bottom: 1.5rem;
    }

    .results-grid {
        grid-template-columns: 1fr;
    }
}

/* ========================================
   FORM RESPONSIVE
   ======================================== */

@media (max-width: 768px) {
    .form-grid {
        grid-template-columns: 1fr;
    }

    .form-row {
        flex-direction: column;
    }

    .form-group {
        width: 100%;
    }

    .form-actions {
        flex-direction: column;
        gap: 0.75rem;
    }

    .form-actions .btn {
        width: 100%;
    }
}

/* ========================================
   UTILITY CLASSES
   ======================================== */

/* Hide on Mobile */
.hide-mobile {
    display: block;
}

@media (max-width: 768px) {
    .hide-mobile {
        display: none !important;
    }
}

/* Show only on Mobile */
.show-mobile {
    display: none;
}

@media (max-width: 768px) {
    .show-mobile {
        display: block !important;
    }
}

/* Text Alignment */
@media (max-width: 768px) {
    .text-center-mobile {
        text-align: center !important;
    }
}

/* Full Width on Mobile */
@media (max-width: 768px) {
    .full-width-mobile {
        width: 100% !important;
    }
}