/**
 * Mobile-First Pixel Perfect Responsive Fixes
 * HealHumanity Theme - Complete Mobile Optimization
 * Version: 1.0.0
 */

/* ===================================
   BASE MOBILE STYLES (320px+)
   =================================== */

/* Ensure proper mobile viewport */
html {
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
    overflow-x: hidden;
}

body {
    overflow-x: hidden;
    width: 100%;
    position: relative;
}

/* Hide desktop elements on mobile */
@media (max-width: 991px) {
    .desktop-only {
        display: none !important;
    }
    
    .mobile-only {
        display: flex !important;
    }
}

/* Show desktop elements on desktop */
@media (min-width: 992px) {
    .desktop-only {
        display: flex !important;
    }
    
    .mobile-only {
        display: none !important;
    }
}

/* Better touch targets for mobile */
button,
a,
input,
select,
textarea {
    min-height: 44px;
    min-width: 44px;
}

/* ===================================
   MOBILE: 320px - 480px
   =================================== */
@media (max-width: 480px) {
    
    /* Container Adjustments */
    .container {
        padding-left: 15px;
        padding-right: 15px;
    }
    
    /* Header Mobile */
    .header {
        height: 60px;
        padding: 0;
    }
    
    .header-inner {
        padding: 10px 0;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 10px;
    }
    
    .logo img {
        height: 28px;
        width: auto;
    }
    
    /* Mobile Header Actions - Cart Icon */
    .mobile-header-actions {
        display: flex !important;
        align-items: center;
        gap: 8px;
        margin-left: auto;
        order: 2;
    }
    
    .mobile-header-actions .header-action-btn {
        width: 40px;
        height: 40px;
        display: flex;
        align-items: center;
        justify-content: center;
        background: var(--gray);
        color: var(--text-dark);
        border-radius: 50%;
        position: relative;
        transition: var(--transition);
        padding: 0;
    }
    
    .mobile-header-actions .header-action-btn i {
        font-size: 16px;
        line-height: 1;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .mobile-header-actions .header-action-btn:hover,
    .mobile-header-actions .header-action-btn:active {
        background: var(--primary);
        color: var(--light);
    }
    
    .mobile-header-actions .cart-badge {
        position: absolute;
        top: -4px;
        right: -4px;
        background: #dc2626;
        color: white;
        font-size: 10px;
        font-weight: 700;
        min-width: 18px;
        height: 18px;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 2px 4px;
        border: 2px solid white;
        animation: pulse-badge 2s ease-in-out infinite;
    }
    
    /* Pulse animation for cart badge when items added */
    @keyframes pulse-badge {
        0%, 100% {
            transform: scale(1);
        }
        50% {
            transform: scale(1.1);
        }
    }
    
    /* Remove animation when cart is empty */
    .mobile-header-actions .cart-badge:empty,
    .mobile-header-actions .cart-badge[style*="display: none"] {
        animation: none;
    }
    
    .nav-toggle {
        width: 40px;
        height: 40px;
        order: 3;
        flex-shrink: 0;
    }
    
    .logo {
        order: 1;
        flex-shrink: 0;
    }
    
    .nav-toggle span {
        width: 20px;
        height: 2px;
    }
    
    /* Mobile Navigation */
    .nav-menu {
        top: 60px;
        padding: 0.5rem 0;
        height: calc(100vh - 60px);
        display: flex;
        flex-direction: column;
    }
    
    .nav-menu li {
        margin: 0;
    }
    
    .nav-menu a {
        padding: 0.9rem 1rem;
        font-size: 0.95rem;
    }
    
    /* Mobile Menu Footer with Login Button */
    .mobile-menu-footer {
        padding: 20px 15px 15px 15px !important;
        border-top: 2px solid var(--gray-dark) !important;
        background: var(--light) !important;
        list-style: none !important;
        margin: 0 !important;
    }
    
    .mobile-menu-footer a {
        padding: 0 !important;
        width: 100% !important;
        display: block !important;
    }
    
    .mobile-menu-login-btn {
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 12px !important;
        width: 100% !important;
        padding: 16px 24px !important;
        background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%) !important;
        color: var(--light) !important;
        border-radius: 12px !important;
        font-weight: 700 !important;
        font-size: 1.05rem !important;
        transition: all 0.3s ease !important;
        text-decoration: none !important;
        border: none !important;
        box-shadow: 0 4px 12px rgba(47, 146, 158, 0.3) !important;
        letter-spacing: 0.5px !important;
        min-height: 56px !important;
    }
    
    .mobile-menu-login-btn:hover,
    .mobile-menu-login-btn:active {
        background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 100%) !important;
        color: var(--light) !important;
        transform: translateY(-2px) !important;
        box-shadow: 0 6px 20px rgba(47, 146, 158, 0.4) !important;
    }
    
    .mobile-menu-login-btn i {
        font-size: 1.2rem !important;
        filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.1)) !important;
        flex-shrink: 0 !important;
    }
    
    .mobile-menu-login-btn span {
        font-weight: 700 !important;
        flex: 1 !important;
        text-align: center !important;
    }
    
    .mobile-menu-login-btn {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 10px;
        width: 100%;
        padding: 14px 20px;
        background: var(--primary);
        color: var(--light);
        border-radius: var(--radius);
        font-weight: 600;
        font-size: 1rem;
        transition: var(--transition);
        text-decoration: none;
    }
    
    .mobile-menu-login-btn:hover {
        background: var(--primary-dark);
        color: var(--light);
    }
    
    .mobile-menu-login-btn i {
        font-size: 1.1rem;
    }
    
    /* Hero Section Mobile */
    .hero {
        min-height: 400px;
        border-radius: 0;
        padding: 40px 0;
    }
    
    .hero-bg {
        width: 100%;
        opacity: 0.15;
        border-radius: 0;
    }
    
    .hero-content {
        padding: 40px 0 20px;
        text-align: center;
    }
    
    .qurbani-badge {
        flex-direction: column;
        align-items: center;
        gap: 8px;
        margin-bottom: 20px;
    }
    
    .qurbani-arabic {
        font-size: 2rem;
        margin: 0;
    }
    
    .qurbani-english {
        font-size: 1.3rem;
        margin: 0;
        letter-spacing: 1px;
    }
    
    .qurbani-years {
        flex-direction: row;
        gap: 8px;
    }
    
    .year-badge {
        width: 42px;
        height: 42px;
        font-size: 0.8rem;
    }
    
    .hero-left h1 {
        font-size: 1.6rem;
        line-height: 1.3;
        margin-bottom: 15px;
    }
    
    .hero-left p {
        font-size: 0.95rem;
        margin-bottom: 20px;
        line-height: 1.6;
    }
    
    .hero-actions {
        flex-direction: row;
        flex-wrap: nowrap;
        gap: 10px;
        width: 100%;
        justify-content: center;
    }
    
    .hero-actions .btn {
        flex: 1;
        max-width: 160px;
        justify-content: center;
        padding: 12px 20px !important;
        font-size: 0.85rem;
    }
    
    /* Donation Bar Mobile */
    .donation-bar {
        margin: -30px 10px 20px;
        padding: 15px;
        border-radius: 12px;
        max-width: calc(100% - 20px);
    }
    
    .donation-bar.bottom-sticky {
        display: none !important;
    }
    
    .donation-form {
        flex-direction: column;
        gap: 12px;
        align-items: stretch;
    }
    
    .donation-select {
        width: 100%;
        order: 1;
    }
    
    .donation-select select {
        width: 100%;
        padding: 10px 35px 10px 12px;
        font-size: 0.9rem;
        height: 44px;
    }
    
    .donation-amounts {
        width: 100%;
        order: 2;
        justify-content: space-between;
        gap: 6px;
        margin: 0;
    }
    
    .donation-amount {
        flex: 1;
        width: 44px !important;
        min-width: 44px;
        max-width: 44px;
        height: 44px !important;
        font-size: 0.85rem;
        padding: 0;
    }
    
    .donation-custom {
        flex: 1;
        min-width: 80px;
        height: 44px;
        padding: 10px 12px;
        font-size: 0.9rem;
    }
    
    .donation-actions {
        width: 100%;
        order: 3;
        flex-direction: column;
        gap: 8px;
    }
    
    .donation-actions .btn {
        width: 100%;
        padding: 12px 16px;
        font-size: 0.9rem;
        height: 44px;
    }
    
    /* Section Spacing */
    .section {
        padding: 50px 0;
    }
    
    .section-title h2 {
        font-size: 1.7rem;
        margin-bottom: 12px;
    }
    
    .section-title p {
        font-size: 0.95rem;
        padding: 0 10px;
    }
    
    /* Campaign/Project Cards Mobile */
    .campaign-grid,
    .projects-grid {
        grid-template-columns: 1fr;
        gap: 20px;
        padding: 0 10px;
    }
    
    .project-card,
    .campaign-card {
        margin: 0 auto;
        max-width: 100%;
        width: 100%;
    }
    
    .project-image-wrapper,
    .campaign-image {
        height: 200px;
    }
    
    .project-content,
    .campaign-content {
        padding: 18px 16px 16px;
    }
    
    .project-title,
    .campaign-title {
        font-size: 1.2rem;
        line-height: 1.3;
        margin-bottom: 10px;
        min-height: auto;
        height: auto;
    }
    
    .project-subtitle {
        font-size: 0.75rem;
        margin-bottom: 10px;
    }
    
    .project-description,
    .campaign-description {
        font-size: 0.85rem;
        line-height: 1.5;
        margin-bottom: 15px;
    }
    
    .project-badges {
        bottom: 12px;
        left: 12px;
        flex-direction: row;
        flex-wrap: wrap;
        gap: 6px;
    }
    
    .project-badge {
        font-size: 0.7rem;
        padding: 4px 10px;
    }
    
    /* Donation Form in Cards */
    .project-donation-form,
    .campaign-actions {
        gap: 10px;
    }
    
    .donation-type-select {
        padding: 10px 35px 10px 12px;
        font-size: 0.85rem;
        height: 42px;
    }
    
    .donation-row {
        gap: 8px;
    }
    
    .donation-amount-input {
        padding: 10px 12px 10px 28px;
        font-size: 0.85rem;
        height: 42px;
    }
    
    .btn-add-to-cart {
        height: 42px;
        padding: 0 14px;
        font-size: 0.85rem;
        white-space: nowrap;
    }
    
    .project-links {
        font-size: 0.8rem;
        margin-top: 10px;
    }
    
    /* Progress Bar Mobile */
    .project-progress {
        margin-bottom: 15px;
    }
    
    .progress-info {
        font-size: 0.85rem;
        gap: 6px;
        flex-wrap: wrap;
    }
    
    .progress-bar {
        height: 5px;
        margin-bottom: 10px;
    }
    
    .progress-percentage {
        font-size: 0.65rem;
        padding: 2px 6px;
        min-width: 45px;
        margin-top: 8px;
    }
    
    /* Project Actions Mobile */
    .project-actions {
        flex-direction: row;
        flex-wrap: nowrap;
        gap: 10px;
        margin-top: 10px;
    }
    
    .btn-donate,
    .btn-learn-more {
        flex: 1;
        padding: 12px 18px;
        font-size: 0.9rem;
        text-align: center;
        justify-content: center;
    }
    
    /* Footer Mobile */
    .pre-footer {
        padding: 25px 15px;
        margin: 0 10px 30px;
        border-radius: 10px;
    }
    
    .newsletter-container {
        flex-direction: column;
        gap: 20px;
    }
    
    .newsletter-content h3 {
        font-size: 1.4rem;
        margin-bottom: 10px;
    }
    
    .newsletter-content p {
        font-size: 0.95rem;
    }
    
    .form-group {
        flex-direction: column;
        gap: 10px;
    }
    
    .form-group input {
        padding: 12px 16px;
    }
    
    .form-group button {
        padding: 12px 20px;
        width: 100%;
    }
    
    .footer-grid {
        grid-template-columns: 1fr;
        gap: 30px;
        padding: 30px 0;
    }
    
    .footer-about {
        grid-column: 1;
    }
    
    .footer-logo img {
        height: 40px;
    }
    
    .footer-links-container {
        grid-template-columns: 1fr;
        gap: 25px;
    }
    
    .footer-links-section h4 {
        font-size: 1.1rem;
        margin-bottom: 15px;
    }
    
    .footer-links li {
        margin-bottom: 10px;
    }
    
    .footer-links a {
        font-size: 0.9rem;
    }
    
    .footer-contact {
        margin-top: 10px;
    }
    
    .footer-contact h4 {
        font-size: 1.1rem;
    }
    
    .footer-contact address p {
        font-size: 0.9rem;
        margin-bottom: 12px;
    }
    
    .footer-social {
        gap: 10px;
        flex-wrap: wrap;
    }
    
    .footer-social a {
        width: 38px;
        height: 38px;
    }
    
    .footer-bottom-content {
        flex-direction: column;
        gap: 12px;
        text-align: center;
    }
    
    .footer-bottom-links {
        flex-direction: column;
        gap: 10px;
    }
    
    .footer-bottom-links a:not(:last-child)::after {
        display: none;
    }
    
    /* Modal Mobile */
    .modal-container {
        width: 95% !important;
        max-width: 95vw !important;
        margin: 10px !important;
        max-height: calc(100vh - 20px) !important;
    }
    
    .modal-content {
        grid-template-columns: 1fr !important;
        min-height: auto !important;
    }
    
    .modal-left,
    .modal-right {
        padding: 20px !important;
    }
    
    .donor-login-modal .modal-container {
        max-width: 95vw !important;
    }
    
    .donor-login-modal .modal-content {
        grid-template-columns: 1fr !important;
        min-height: auto !important;
    }
    
    .donor-login-modal .modal-left {
        display: flex !important;
    }
    
    .donor-login-modal .modal-right {
        padding: 1.5rem !important;
    }
    
    .donor-registration-modal .modal-container {
        max-width: 95vw !important;
    }
    
    .modal-header {
        padding: 15px 20px !important;
    }
    
    .modal-body {
        padding: 20px !important;
        max-height: calc(100vh - 200px) !important;
        overflow-y: auto !important;
    }
    
    .modal-footer {
        padding: 15px 20px !important;
        flex-direction: column !important;
        gap: 10px !important;
    }
    
    .login-title {
        font-size: 1.3rem !important;
    }
    
    /* Password Toggle */
    .password-input-wrapper {
        position: relative;
        display: flex;
        align-items: center;
    }
    
    .password-input-wrapper .password-input {
        padding-right: 40px !important;
    }
    
    .password-toggle {
        width: auto;
        position: absolute;
        background: none;
        color: #ffc266;
        right: 0;
        border: none;
        cursor: pointer;
        padding: 4px;
        height: 28px;
        display: flex;
        align-items: center;
        justify-content: center;
        transition: color 0.3s ease;
        z-index: 10;
    }
    
    .password-toggle:hover {
        color: var(--orange-accent, #FFC266);
    }
    
    .password-toggle i {
        font-size: 12px;
    }
    
    /* Step 4: Gift Aid Mobile Fixes */
    .giftaid-logo img {
        max-width: 120px !important;
        width: 120px !important;
        height: auto !important;
    }
    
    .giftaid-description {
        font-size: 0.95rem !important;
        padding: 0 10px !important;
        margin-bottom: 1.25rem !important;
    }
    
    .radio-group {
        display: flex !important;
        flex-direction: row !important;
        gap: 2rem !important;
        align-items: center !important;
        justify-content: center !important;
        margin-bottom: 1.5rem !important;
    }
    
    .radio-item {
        display: flex !important;
        align-items: center !important;
        gap: 0.75rem !important;
        width: 100% !important;
    }
    
    .radio-input {
        flex-shrink: 0 !important;
        width: 20px !important;
        height: 20px !important;
    }
    
    .radio-label {
        font-size: 1rem !important;
        flex: 1 !important;
    }
    
    .giftaid-declaration {
        font-size: 0.8rem !important;
        padding: 0.75rem !important;
        line-height: 1.4 !important;
        margin-bottom: 0.75rem !important;
    }
    
    .giftaid-link {
        font-size: 0.85rem !important;
        display: inline-block !important;
    }
    
    /* Form Select Fix - Visible Text */
    .donor-registration-modal .form-select,
    .donor-registration-modal select,
    #country {
        color: var(--text-dark) !important;
        background: white !important;
        -webkit-appearance: menulist !important;
        -moz-appearance: menulist !important;
        appearance: auto !important;
        background-image: none !important;
        padding: 1rem !important;
        border: 2px solid var(--gray-dark) !important;
        border-radius: var(--border-radius) !important;
        cursor: pointer !important;
    }
    
    .donor-registration-modal .form-select::-ms-expand,
    #country::-ms-expand {
        display: block !important;
    }
    
    .form-select option {
        color: #333 !important;
        background: white !important;
    }
    
    .form-input,
    .form-select {
        font-size: 16px !important;
        padding: 12px 15px !important;
    }
    
    .login-btn {
        padding: 14px 20px !important;
        font-size: 1rem !important;
    }
    
    .option-card {
        padding: 1.2rem !important;
    }
    
    .forgot-password,
    .guest-checkout {
        font-size: 0.9rem !important;
    }
    
    .footer-btn {
        width: 100%;
        min-width: auto;
    }
    
    .option-card {
        padding: 15px;
    }
    
    .option-icon {
        width: 40px;
        height: 40px;
    }
    
    .option-icon svg {
        width: 20px;
        height: 20px;
    }
    
    .option-content h3 {
        font-size: 0.95rem;
    }
    
    .option-content p {
        font-size: 0.8rem;
    }
    
    /* Form Elements Mobile */
    .form-row {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .form-group {
        margin-bottom: 15px;
    }
    
    .form-input,
    .form-select,
    .form-textarea {
        padding: 12px 16px;
        font-size: 1rem;
        height: auto;
        min-height: 44px;
    }
    
    .form-label {
        font-size: 0.9rem;
        margin-bottom: 6px;
    }
    
    .phone-container {
        grid-template-columns: 1fr;
    }
    
    .phone-input {
        padding: 12px 16px;
    }
    
    .login-btn {
        padding: 14px 20px;
        font-size: 1rem;
        margin-top: 15px;
    }
    
    /* Cart Modal Mobile */
    .cart-items-container {
        max-height: 300px;
    }
    
    .cart-item {
        flex-direction: column;
        align-items: flex-start;
        padding: 15px;
        gap: 12px;
    }
    
    .cart-item-info {
        width: 100%;
    }
    
    .cart-item-controls {
        width: 100%;
        justify-content: space-between;
    }
    
    .cart-actions {
        flex-direction: column;
        gap: 10px;
    }
    
    .cart-actions .btn {
        width: 100%;
    }
    
    /* Payment Page Mobile */
    .payment-section {
        padding: 20px 0 40px;
    }
    
    .payment-header h1 {
        font-size: 1.8rem;
    }
    
    .payment-header p {
        font-size: 1rem;
    }
    
    .payment-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .payment-card {
        padding: 20px 15px;
    }
    
    .donation-summary {
        padding: 20px 15px;
        margin-bottom: 20px;
    }
    
    .cart-total-section {
        padding: 18px 15px;
        margin-bottom: 20px;
    }
    
    .cart-total-actions {
        flex-direction: column;
        gap: 12px;
    }
    
    .cart-total-amount {
        padding: 12px 24px;
        font-size: 1.3rem;
    }
    
    .cart-action-btn {
        padding: 12px 20px;
        width: 100%;
    }
    
    .cart-action-buttons {
        flex-direction: column;
        width: 100%;
    }
    
    .cart-action-buttons .btn {
        width: 100%;
    }
    
    .donor-info-form-card {
        padding: 20px 15px;
        margin-bottom: 20px;
    }
    
    .final-donate-btn {
        padding: 15px 30px;
        font-size: 1.1rem;
    }
    
    .payment-btn {
        padding: 12px 18px;
        font-size: 0.95rem;
    }
    
    .auth-options {
        flex-direction: column;
        gap: 15px;
    }
    
    .auth-btn {
        width: 100%;
    }
    
    .auth-benefits {
        max-width: 100%;
        padding: 20px;
    }
    
    /* Dashboard Mobile */
    .dashboard-header {
        padding: 60px 0 40px;
        margin-bottom: 30px;
    }
    
    .dashboard-header-content {
        flex-direction: column;
        align-items: flex-start;
        gap: 20px;
        padding: 0 15px;
    }
    
    .donor-welcome {
        flex-direction: column;
        text-align: center;
        width: 100%;
        align-items: center;
    }
    
    .donor-avatar {
        margin: 0 0 15px 0;
    }
    
    .donor-avatar .avatar-img {
        width: 70px;
        height: 70px;
    }
    
    .donor-info h1 {
        font-size: 1.9rem;
        text-align: center;
    }
    
    .donor-subtitle {
        font-size: 1rem;
        margin-bottom: 15px;
        text-align: center;
    }
    
    .donor-stats-quick {
        justify-content: center;
        gap: 20px;
        width: 100%;
        flex-wrap: wrap;
    }
    
    .stat-item {
        text-align: center;
        min-width: 100px;
    }
    
    .stat-value {
        font-size: 1.5rem;
    }
    
    .stat-label {
        font-size: 0.85rem;
    }
    
    .dashboard-actions {
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
    }
    
    .dashboard-actions .btn {
        flex: 1 1 calc(50% - 8px);
        min-width: 140px;
        padding: 10px 18px;
        font-size: 0.85rem;
    }
    
    .dashboard-main {
        padding: 25px 15px;
        margin: 0 10px;
    }
    
    .dashboard-cards {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
        margin-bottom: 25px;
        padding-bottom: 15px;
    }
    
    .section-title {
        font-size: 1.6rem;
    }
    
    .section-actions {
        width: 100%;
    }
    
    .section-actions .btn {
        width: 100%;
    }
    
    .data-table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .data-table {
        min-width: 600px;
        font-size: 0.85rem;
    }
    
    .data-table th,
    .data-table td {
        padding: 10px 8px;
        font-size: 0.85rem;
    }
    
    /* Contact Page Mobile */
    .contact-hero {
        padding: 60px 0 40px;
    }
    
    .contact-hero h1 {
        font-size: 1.8rem;
    }
    
    .contact-hero p {
        font-size: 1rem;
    }
    
    .contact-grid {
        grid-template-columns: 1fr;
        gap: 25px;
    }
    
    .contact-method {
        padding: 30px 20px;
    }
    
    .contact-method .icon {
        width: 65px;
        height: 65px;
        font-size: 1.5rem;
    }
    
    .form-container {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    
    .contact-form,
    .contact-info-panel {
        padding: 25px 18px;
    }
    
    .offices-grid {
        grid-template-columns: 1fr;
        gap: 25px;
    }
    
    .office-card {
        padding: 20px 18px;
    }
    
    .faq-question {
        padding: 15px 18px;
        font-size: 0.95rem;
    }
    
    .faq-answer {
        padding: 15px 18px;
    }
    
    .faq-answer p {
        font-size: 0.9rem;
    }
    
    /* About/Programs Mobile */
    .programs-section {
        padding: 50px 0;
    }
    
    .programs-container {
        padding: 0 15px;
    }
    
    .programs-content {
        grid-template-columns: 1fr;
        gap: 40px;
    }
    
    .programs-image-wrapper {
        height: 350px;
        order: -1;
        border-radius: 15px;
    }
    
    .programs-title {
        font-size: 1.9rem;
        line-height: 1.2;
    }
    
    .programs-subtitle {
        font-size: 0.8rem;
        padding: 6px 16px;
    }
    
    .programs-description {
        font-size: 1rem;
        max-width: 100%;
        margin-bottom: 35px;
    }
    
    .programs-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .program-card {
        padding: 25px 20px;
    }
    
    .program-icon {
        width: 48px;
        height: 48px;
        margin-bottom: 15px;
    }
    
    .program-icon i {
        font-size: 1.3rem;
    }
    
    .program-title {
        font-size: 1.15rem;
        margin-bottom: 10px;
    }
    
    .program-description {
        font-size: 0.9rem;
        line-height: 1.5;
    }
    
    /* Zakat Calculator Mobile */
    .zakat-section {
        padding: 50px 0;
    }
    
    .zakat-container {
        flex-direction: column;
        gap: 30px;
    }
    
    .zakat-image {
        order: -1;
    }
    
    .zakat-image img {
        min-height: 250px;
    }
    
    .zakat-content h2 {
        font-size: 1.8rem;
        margin-bottom: 18px;
    }
    
    .zakat-content p {
        font-size: 0.95rem;
        margin-bottom: 20px;
    }
    
    /* Receipt Mobile */
    .donation-receipt {
        margin: 10px;
        max-width: calc(100% - 20px);
        border-radius: 12px;
    }
    
    .receipt-header {
        padding: 25px 18px;
    }
    
    .receipt-title {
        font-size: 1.6rem;
    }
    
    .receipt-subtitle {
        font-size: 1rem;
    }
    
    .receipt-body {
        padding: 25px 18px;
    }
    
    .thank-you-icon {
        width: 65px;
        height: 65px;
        font-size: 1.6rem;
        margin-bottom: 15px;
    }
    
    .thank-you-message {
        font-size: 1.1rem;
    }
    
    .receipt-details,
    .project-info {
        padding: 20px 18px;
        margin-bottom: 20px;
    }
    
    .receipt-footer {
        padding: 20px 18px;
    }
    
    .receipt-actions {
        flex-direction: column;
        padding: 0 18px 25px;
    }
    
    .receipt-btn {
        width: 100%;
        justify-content: center;
    }
    
    /* Notification Mobile */
    .notification {
        top: 10px;
        right: 10px;
        left: 10px;
        max-width: calc(100% - 20px);
        padding: 0.8rem 1rem;
    }
    
    .notification i {
        font-size: 1rem;
    }
    
    .notification-message {
        font-size: 0.85rem;
    }
    
    /* Utility Classes */
    .mobile-hide {
        display: none !important;
    }
    
    .mobile-show {
        display: block !important;
    }
    
    .mobile-center {
        text-align: center !important;
    }
    
    .mobile-full-width {
        width: 100% !important;
    }
    
    /* Prevent horizontal scroll */
    * {
        max-width: 100%;
    }
    
    img {
        height: auto;
        max-width: 100%;
    }
    
    /* Better spacing for mobile */
    h1, h2, h3, h4, h5, h6 {
        word-wrap: break-word;
        overflow-wrap: break-word;
        hyphens: auto;
    }
    
    p {
        word-wrap: break-word;
        overflow-wrap: break-word;
    }
    
    /* Fix header alignment on mobile */
    .header-inner {
        display: flex;
        justify-content: space-between;
        align-items: center;
        width: 100%;
    }
    
    .logo {
        flex-shrink: 0;
        display: flex;
        align-items: center;
    }
    
    .nav-toggle {
        flex-shrink: 0;
        margin-left: auto;
    }
    
    /* Ensure proper stacking context */
    .header {
        z-index: 1000;
        position: sticky;
    }
    
    .nav-menu {
        z-index: 999;
    }
    
    .modal-overlay {
        z-index: 10000;
    }
    
    /* Better form input visibility */
    .form-input,
    .form-select,
    .form-textarea,
    input[type="text"],
    input[type="email"],
    input[type="tel"],
    input[type="number"],
    textarea,
    select {
        font-size: 16px !important; /* Prevents zoom on iOS */
        -webkit-appearance: none;
        appearance: none;
    }
    
    /* Fix iOS input zoom */
    @supports (-webkit-touch-callout: none) {
        input,
        select,
        textarea {
            font-size: 16px !important;
        }
    }
}

/* ===================================
   MOBILE: 481px - 576px
   =================================== */
@media (min-width: 481px) and (max-width: 576px) {
    
    /* Slightly larger mobile devices */
    .hero-left h1 {
        font-size: 1.8rem;
    }
    
    .donation-amount {
        max-width: 60px;
    }
    
    .project-title,
    .campaign-title {
        font-size: 1.3rem;
    }
    
    .section-title h2 {
        font-size: 1.9rem;
    }
    
    .programs-title {
        font-size: 2.1rem;
    }
    
    .donor-info h1 {
        font-size: 2.1rem;
    }
}

/* ===================================
   TABLET: 577px - 768px
   =================================== */
@media (min-width: 577px) and (max-width: 768px) {
    
    /* Header */
    .header {
        height: 70px;
    }
    
    .logo img {
        height: 38px;
    }
    
    .nav-menu {
        top: 70px;
        height: calc(100vh - 70px);
    }
    
    /* Mobile header actions - keep visible on tablet too */
    .mobile-header-actions {
        display: flex !important;
    }
    
    .mobile-header-actions .header-action-btn {
        width: 42px;
        height: 42px;
    }
    
    .nav-toggle {
        width: 42px;
        height: 42px;
    }
    
    /* Hero */
    .hero {
        min-height: 450px;
    }
    
    .hero-left h1 {
        font-size: 2rem;
    }
    
    .hero-actions {
        flex-direction: row;
        justify-content: center;
        flex-wrap: wrap;
    }
    
    .hero-actions .btn {
        width: auto;
        min-width: 160px;
    }
    
    /* Grids */
    .campaign-grid,
    .projects-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
    
    .programs-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .dashboard-cards {
        grid-template-columns: repeat(2, 1fr);
    }
    
    /* Donation Bar */
    .donation-bar {
        padding: 18px 20px;
    }
    
    .donation-amounts {
        justify-content: center;
        gap: 8px;
    }
    
    .donation-amount {
        flex: 0 0 auto;
        max-width: none;
    }
    
    /* Footer */
    .footer-links-container {
        grid-template-columns: repeat(2, 1fr);
        gap: 30px;
    }
    
    /* Modal */
    .modal-container {
        width: 90%;
        max-width: 600px;
    }
    
    .dashboard-actions .btn {
        flex: 0 0 auto;
        min-width: 150px;
    }
}

/* ===================================
   TABLET LANDSCAPE: 769px - 991px
   =================================== */
@media (min-width: 769px) and (max-width: 991px) {
    
    /* Keep mobile cart icon visible on tablet landscape */
    .mobile-header-actions {
        display: flex !important;
    }
    
    .campaign-grid,
    .projects-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 25px;
    }
    
    .programs-content {
        grid-template-columns: 1fr;
        gap: 50px;
    }
    
    .programs-image-wrapper {
        height: 450px;
        order: -1;
    }
    
    .footer-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .footer-about {
        grid-column: span 2;
    }
    
    .dashboard-cards {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* ===================================
   LANDSCAPE ORIENTATION
   =================================== */
@media (max-width: 896px) and (orientation: landscape) {
    
    .hero {
        min-height: 350px;
    }
    
    .hero-content {
        padding: 30px 0 15px;
    }
    
    .hero-left h1 {
        font-size: 1.6rem;
        margin-bottom: 12px;
    }
    
    .hero-left p {
        margin-bottom: 15px;
    }
    
    .qurbani-badge {
        margin-bottom: 15px;
    }
    
    .modal-container {
        max-height: 90vh;
        overflow-y: auto;
    }
    
    .modal-body {
        max-height: calc(90vh - 150px);
    }
}

/* ===================================
   TOUCH-FRIENDLY ADJUSTMENTS
   =================================== */
@media (hover: none) and (pointer: coarse) {
    
    /* Larger touch targets */
    button,
    .btn,
    a {
        min-height: 44px;
        min-width: 44px;
        padding: 12px 18px;
    }
    
    /* Remove hover effects on touch */
    .btn:hover,
    .project-card:hover,
    .campaign-card:hover {
        transform: none;
        box-shadow: var(--shadow);
    }
    
    /* Better tap highlights */
    * {
        -webkit-tap-highlight-color: rgba(47, 146, 158, 0.2);
    }
    
    /* Smooth scrolling for touch */
    .cart-items-container,
    .modal-body,
    .data-table-container {
        -webkit-overflow-scrolling: touch;
    }
}

/* ===================================
   ACCESSIBILITY IMPROVEMENTS
   =================================== */
@media (max-width: 768px) {
    
    /* Better focus states for keyboard navigation */
    *:focus {
        outline: 3px solid var(--primary);
        outline-offset: 2px;
    }
    
    /* Skip to content link */
    .skip-link {
        position: absolute;
        top: -40px;
        left: 0;
        background: var(--primary);
        color: white;
        padding: 8px;
        text-decoration: none;
        z-index: 10000;
    }
    
    .skip-link:focus {
        top: 0;
    }
}

/* ===================================
   PERFORMANCE OPTIMIZATIONS
   =================================== */
@media (max-width: 768px) {
    
    /* Disable animations on mobile for better performance */
    .prefers-reduced-motion,
    .slow-connection {
        * {
            animation-duration: 0.01ms !important;
            animation-iteration-count: 1 !important;
            transition-duration: 0.01ms !important;
        }
    }
    
    /* Lazy load images optimization */
    img[loading="lazy"] {
        min-height: 200px;
    }
}

/* ===================================
   PRINT STYLES
   =================================== */
@media print {
    
    /* Hide unnecessary elements */
    .header,
    .nav-menu,
    .donation-bar,
    .footer-social,
    .newsletter-container,
    .btn,
    .modal-overlay {
        display: none !important;
    }
    
    /* Optimize for print */
    body {
        font-size: 12pt;
        line-height: 1.5;
        color: #000;
        background: #fff;
    }
    
    .container {
        width: 100%;
        max-width: 100%;
        padding: 0;
    }
}
