/* ============================================
   Mobile UX Optimizations for Artbella
   ============================================ */

/* ============================================
   1. أحجام الأزرار - Touch Targets
   ============================================ */

@media (max-width: 768px) {
    /* جميع الأزرار */
    .btn,
    button,
    .button,
    input[type="submit"],
    input[type="button"],
    a.btn {
        min-height: 48px !important;
        min-width: 48px !important;
        padding: 12px 24px !important;
        font-size: 16px !important;
        line-height: 1.5 !important;
        border-radius: 8px !important;
        font-weight: 500 !important;
    }
    
    /* أزرار الأيقونات */
    .btn-icon,
    .icon-button,
    button[class*="icon"] {
        min-width: 48px !important;
        min-height: 48px !important;
        padding: 12px !important;
    }
    
    /* أزرار Add to Cart */
    .add-to-cart,
    .btn-add-cart,
    [class*="add-cart"] {
        min-height: 48px !important;
        padding: 12px 20px !important;
        font-size: 16px !important;
    }
}

/* ============================================
   2. أحجام الخطوط - Typography
   ============================================ */

@media (max-width: 768px) {
    /* النصوص الأساسية */
    body,
    p,
    .text,
    .description {
        font-size: 16px !important;
        line-height: 1.7 !important;
    }
    
    /* العناوين */
    h1, .h1 {
        font-size: 28px !important;
        line-height: 1.3 !important;
        margin-bottom: 16px !important;
    }
    
    h2, .h2 {
        font-size: 24px !important;
        line-height: 1.4 !important;
        margin-bottom: 14px !important;
    }
    
    h3, .h3 {
        font-size: 20px !important;
        line-height: 1.4 !important;
        margin-bottom: 12px !important;
    }
    
    h4, .h4 {
        font-size: 18px !important;
        line-height: 1.5 !important;
        margin-bottom: 10px !important;
    }
    
    /* أسماء المنتجات */
    .product-name,
    .product-title,
    .item-title {
        font-size: 16px !important;
        line-height: 1.5 !important;
    }
    
    /* الأسعار */
    .price,
    .product-price,
    .amount {
        font-size: 18px !important;
        font-weight: 600 !important;
    }
    
    /* الروابط */
    a {
        min-height: 44px !important;
        display: inline-flex !important;
        align-items: center !important;
    }
}

/* ============================================
   3. المسافات - Spacing
   ============================================ */

@media (max-width: 768px) {
    /* Container Padding */
    .container,
    .container-fluid {
        padding-left: 16px !important;
        padding-right: 16px !important;
    }
    
    /* Sections Spacing */
    section,
    .section {
        padding-top: 24px !important;
        padding-bottom: 24px !important;
    }
    
    /* Cards Spacing */
    .card,
    .product-item,
    .item {
        margin-bottom: 16px !important;
        padding: 12px !important;
    }
    
    /* Grid Spacing */
    .row {
        margin-left: -8px !important;
        margin-right: -8px !important;
    }
    
    [class*="col-"] {
        padding-left: 8px !important;
        padding-right: 8px !important;
        margin-bottom: 16px !important;
    }
}

/* ============================================
   4. القوائم والنافجيشن - Navigation
   ============================================ */

@media (max-width: 768px) {
    /* Hamburger Menu */
    .navbar-toggler,
    .menu-toggle,
    .hamburger {
        min-width: 48px !important;
        min-height: 48px !important;
        padding: 12px !important;
    }
    
    /* عناصر القائمة */
    .nav-link,
    .menu-item,
    .navigation-item {
        min-height: 48px !important;
        padding: 12px 16px !important;
        font-size: 16px !important;
        display: flex !important;
        align-items: center !important;
    }
    
    /* القائمة المنسدلة */
    .dropdown-menu,
    .submenu {
        padding: 8px 0 !important;
    }
    
    .dropdown-item {
        min-height: 48px !important;
        padding: 12px 20px !important;
        font-size: 16px !important;
    }
    
    /* Header */
    .header,
    .navbar {
        padding: 12px 16px !important;
    }
    
    /* Logo */
    .logo,
    .site-logo {
        max-height: 40px !important;
    }
}

/* ============================================
   5. النماذج - Forms
   ============================================ */

@media (max-width: 768px) {
    /* حقول الإدخال */
    input[type="text"],
    input[type="email"],
    input[type="password"],
    input[type="tel"],
    input[type="number"],
    textarea,
    select,
    .form-control {
        min-height: 48px !important;
        padding: 12px 16px !important;
        font-size: 16px !important;
        border-radius: 8px !important;
    }
    
    /* Labels */
    label,
    .form-label {
        font-size: 16px !important;
        margin-bottom: 8px !important;
        font-weight: 500 !important;
    }
    
    /* Textarea */
    textarea {
        min-height: 120px !important;
    }
    
    /* Checkboxes & Radio */
    input[type="checkbox"],
    input[type="radio"] {
        min-width: 24px !important;
        min-height: 24px !important;
        margin-right: 12px !important;
    }
    
    /* Form Groups */
    .form-group,
    .input-group {
        margin-bottom: 16px !important;
    }
}

/* ============================================
   6. كروت المنتجات - Product Cards
   ============================================ */

@media (max-width: 768px) {
    /* Product Cards */
    .product-item,
    .product-card {
        margin-bottom: 16px !important;
        border-radius: 12px !important;
        overflow: hidden !important;
    }
    
    /* Product Images */
    .product-image,
    .product-img {
        width: 100% !important;
        height: auto !important;
        aspect-ratio: 1 / 1 !important;
        object-fit: cover !important;
    }
    
    /* Product Info */
    .product-info,
    .product-details {
        padding: 12px !important;
    }
    
    /* Product Title */
    .product-title,
    .product-name {
        font-size: 16px !important;
        line-height: 1.5 !important;
        margin-bottom: 8px !important;
        min-height: 48px !important;
        display: -webkit-box !important;
        -webkit-line-clamp: 2 !important;
        -webkit-box-orient: vertical !important;
        overflow: hidden !important;
    }
    
    /* Product Price */
    .product-price {
        font-size: 18px !important;
        font-weight: 600 !important;
        margin-bottom: 8px !important;
    }
    
    /* Product Actions */
    .product-actions {
        display: flex !important;
        gap: 8px !important;
        margin-top: 12px !important;
    }
}

/* ============================================
   7. الجداول - Tables
   ============================================ */

@media (max-width: 768px) {
    /* جعل الجداول قابلة للتمرير */
    .table-responsive {
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
    }
    
    table {
        font-size: 14px !important;
    }
    
    th, td {
        padding: 12px 8px !important;
        min-width: 100px !important;
    }
}

/* ============================================
   8. الصور - Images
   ============================================ */

@media (max-width: 768px) {
    /* جميع الصور */
    img {
        max-width: 100% !important;
        height: auto !important;
    }
    
    /* صور المنتجات */
    .product-image img,
    .product-img img {
        width: 100% !important;
        height: auto !important;
        object-fit: cover !important;
    }
}

/* ============================================
   9. Modal & Popups
   ============================================ */

@media (max-width: 768px) {
    .modal-dialog {
        margin: 16px !important;
        max-width: calc(100% - 32px) !important;
    }
    
    .modal-content {
        border-radius: 12px !important;
    }
    
    .modal-header,
    .modal-body,
    .modal-footer {
        padding: 16px !important;
    }
    
    .modal-title {
        font-size: 20px !important;
    }
}

/* ============================================
   10. Footer
   ============================================ */

@media (max-width: 768px) {
    .footer {
        padding: 24px 16px !important;
    }
    
    .footer-links a {
        min-height: 44px !important;
        display: flex !important;
        align-items: center !important;
        font-size: 16px !important;
        padding: 8px 0 !important;
    }
}

/* ============================================
   11. تحسينات إضافية
   ============================================ */

@media (max-width: 768px) {
    /* منع Zoom على iOS */
    input,
    select,
    textarea {
        font-size: 16px !important;
    }
    
    /* تحسين Tap Highlight */
    * {
        -webkit-tap-highlight-color: rgba(0, 0, 0, 0.1) !important;
    }
    
    /* Smooth Scrolling */
    html {
        scroll-behavior: smooth !important;
    }
    
    /* تحسين الأداء */
    * {
        -webkit-font-smoothing: antialiased !important;
        -moz-osx-font-smoothing: grayscale !important;
    }
}
