/* ===== تصميم متجاوب للجوال - عصري وجميل ===== */

/* إعدادات أساسية للجوال */
@media (max-width: 768px) {
    * {
        box-sizing: border-box;
    }
    
    body {
        font-family: 'Cairo', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
        line-height: 1.6;
        margin: 0;
        padding: 0;
        background: #f8f9fa;
    }
    
    .container {
        width: 100%;
        padding: 0 15px;
        margin: 0 auto;
    }
}

/* ===== الهيدر للجوال ===== */
@media (max-width: 768px) {
    .main-header {
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        padding: 10px 0;
        position: sticky;
        top: 0;
        z-index: 1000;
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    }
    
    .header-content {
        display: flex;
        align-items: center;
        justify-content: space-between;
        flex-wrap: wrap;
        gap: 10px;
    }
    
    .logo-link {
        display: flex;
        align-items: center;
        text-decoration: none;
        color: white;
        font-weight: bold;
        font-size: 1.2rem;
    }
    
    .logo-icon {
        width: 40px;
        height: 40px;
        background: rgba(255, 255, 255, 0.2);
        border-radius: 10px;
        display: flex;
        align-items: center;
        justify-content: center;
        margin-left: 10px;
    }
    
    .logo-icon i {
        font-size: 1.5rem;
        color: white;
    }
    
    .search-box {
        order: 3;
        width: 100%;
        margin-top: 10px;
    }
    
    .search-form {
        display: flex;
        background: white;
        border-radius: 25px;
        overflow: hidden;
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    }
    
    .search-input {
        flex: 1;
        padding: 12px 20px;
        border: none;
        outline: none;
        font-size: 1rem;
    }
    
    .search-btn {
        padding: 12px 20px;
        background: #667eea;
        color: white;
        border: none;
        cursor: pointer;
        transition: background 0.3s ease;
    }
    
    .search-btn:hover {
        background: #5a6fd8;
    }
    
    .user-tools {
        display: flex;
        gap: 10px;
        align-items: center;
    }
    
    .tool-btn {
        width: 40px;
        height: 40px;
        background: rgba(255, 255, 255, 0.2);
        border: none;
        border-radius: 10px;
        color: white;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        position: relative;
        transition: all 0.3s ease;
    }
    
    .tool-btn:hover {
        background: rgba(255, 255, 255, 0.3);
        transform: scale(1.1);
    }
    
    .cart-count {
        position: absolute;
        top: -5px;
        right: -5px;
        background: #ff4757;
        color: white;
        border-radius: 50%;
        width: 20px;
        height: 20px;
        font-size: 0.7rem;
        display: flex;
        align-items: center;
        justify-content: center;
        font-weight: bold;
    }
    
    .mobile-menu-btn {
        width: 40px;
        height: 40px;
        background: rgba(255, 255, 255, 0.2);
        border: none;
        border-radius: 10px;
        color: white;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 1.2rem;
    }
}

/* ===== القائمة الجانبية للجوال ===== */
@media (max-width: 768px) {
    .sidebar-nav {
        position: fixed;
        top: 0;
        right: -300px;
        width: 300px;
        height: 100vh;
        background: white;
        box-shadow: -2px 0 10px rgba(0, 0, 0, 0.1);
        transition: right 0.3s ease;
        z-index: 1001;
        overflow-y: auto;
    }
    
    .sidebar-nav.active {
        right: 0;
    }
    
    .sidebar-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.5);
        z-index: 1000;
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
    }
    
    .sidebar-overlay.active {
        opacity: 1;
        visibility: visible;
    }
    
    .sidebar-header {
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        color: white;
        padding: 20px;
        display: flex;
        align-items: center;
        justify-content: space-between;
    }
    
    .sidebar-logo {
        display: flex;
        align-items: center;
        gap: 10px;
        font-weight: bold;
        font-size: 1.2rem;
    }
    
    .sidebar-close {
        background: rgba(255, 255, 255, 0.2);
        border: none;
        color: white;
        width: 35px;
        height: 35px;
        border-radius: 8px;
        cursor: pointer;
        font-size: 1.2rem;
    }
    
    .sidebar-menu {
        list-style: none;
        padding: 0;
        margin: 0;
    }
    
    .sidebar-menu li {
        border-bottom: 1px solid #f1f3f4;
    }
    
    .sidebar-menu a {
        display: flex;
        align-items: center;
        padding: 15px 20px;
        color: #333;
        text-decoration: none;
        transition: all 0.3s ease;
        font-weight: 500;
    }
    
    .sidebar-menu a:hover {
        background: #f8f9fa;
        color: #667eea;
        padding-right: 25px;
    }
    
    .sidebar-menu a i {
        margin-left: 15px;
        width: 20px;
        text-align: center;
    }
}

/* ===== المنتجات للجوال ===== */
@media (max-width: 768px) {
    .products-grid {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 15px;
        padding: 20px 0;
    }
    
    .product-card {
        background: white;
        border-radius: 15px;
        overflow: hidden;
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
        transition: all 0.3s ease;
        position: relative;
    }
    
    .product-card:hover {
        transform: translateY(-5px);
        box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    }
    
    .product-image {
        position: relative;
        height: 150px;
        overflow: hidden;
    }
    
    .product-image img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        transition: transform 0.3s ease;
    }
    
    .product-card:hover .product-image img {
        transform: scale(1.1);
    }
    
    .product-actions {
        position: absolute;
        top: 10px;
        right: 10px;
        display: flex;
        flex-direction: column;
        gap: 5px;
        opacity: 0;
        transition: opacity 0.3s ease;
    }
    
    .product-card:hover .product-actions {
        opacity: 1;
    }
    
    .action-btn {
        width: 35px;
        height: 35px;
        background: rgba(255, 255, 255, 0.9);
        border: none;
        border-radius: 8px;
        color: #667eea;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 0.9rem;
        transition: all 0.3s ease;
    }
    
    .action-btn:hover {
        background: #667eea;
        color: white;
        transform: scale(1.1);
    }
    
    .featured-badge,
    .new-badge {
        position: absolute;
        top: 10px;
        left: 10px;
        background: #ff4757;
        color: white;
        padding: 5px 10px;
        border-radius: 15px;
        font-size: 0.7rem;
        font-weight: bold;
    }
    
    .new-badge {
        background: #2ed573;
    }
    
    .product-info {
        padding: 15px;
    }
    
    .product-info h3 {
        margin: 0 0 8px 0;
        font-size: 1rem;
        color: #333;
        font-weight: 600;
        line-height: 1.3;
    }
    
    .product-description {
        color: #666;
        font-size: 0.85rem;
        margin-bottom: 10px;
        line-height: 1.4;
    }
    
    .product-price {
        display: flex;
        align-items: center;
        gap: 8px;
        margin-bottom: 12px;
    }
    
    .price {
        font-size: 1.1rem;
        font-weight: bold;
        color: #667eea;
    }
    
    .old-price {
        font-size: 0.9rem;
        color: #999;
        text-decoration: line-through;
    }
    
    .add-to-cart-btn {
        width: 100%;
        padding: 12px;
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        color: white;
        border: none;
        border-radius: 10px;
        font-weight: 600;
        cursor: pointer;
        transition: all 0.3s ease;
        font-size: 0.9rem;
    }
    
    .add-to-cart-btn:hover {
        transform: translateY(-2px);
        box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
    }
}

/* ===== الفئات للجوال ===== */
@media (max-width: 768px) {
    .categories-grid {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 15px;
        padding: 20px 0;
    }
    
    .category-card {
        background: white;
        border-radius: 15px;
        padding: 20px 15px;
        text-align: center;
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
        transition: all 0.3s ease;
        text-decoration: none;
        color: inherit;
    }
    
    .category-card:hover {
        transform: translateY(-5px);
        box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    }
    
    .category-icon {
        width: 60px;
        height: 60px;
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        border-radius: 15px;
        display: flex;
        align-items: center;
        justify-content: center;
        margin: 0 auto 15px;
        color: white;
        font-size: 1.5rem;
        transition: all 0.3s ease;
    }
    
    .category-card:hover .category-icon {
        transform: scale(1.1) rotate(5deg);
    }
    
    .category-card h3 {
        margin: 0 0 8px 0;
        font-size: 1rem;
        color: #333;
        font-weight: 600;
    }
    
    .category-card p {
        margin: 0;
        color: #666;
        font-size: 0.85rem;
        line-height: 1.4;
    }
    
    .category-count {
        background: #f8f9fa;
        color: #667eea;
        padding: 5px 10px;
        border-radius: 15px;
        font-size: 0.8rem;
        font-weight: 600;
        margin-top: 10px;
        display: inline-block;
    }
}

/* ===== الأقسام للجوال ===== */
@media (max-width: 768px) {
    .categories-section,
    .featured-products,
    .new-products {
        padding: 30px 0;
    }
    
    .section-header {
        text-align: center;
        margin-bottom: 30px;
    }
    
    .section-header h2 {
        font-size: 1.8rem;
        color: #333;
        margin-bottom: 10px;
        font-weight: 700;
    }
    
    .section-header p {
        color: #666;
        font-size: 1rem;
        line-height: 1.6;
    }
}

/* ===== الأزرار للجوال ===== */
@media (max-width: 768px) {
    .btn {
        padding: 12px 24px;
        border: none;
        border-radius: 10px;
        font-weight: 600;
        cursor: pointer;
        transition: all 0.3s ease;
        text-decoration: none;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        font-size: 0.9rem;
    }
    
    .btn-primary {
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        color: white;
    }
    
    .btn-primary:hover {
        transform: translateY(-2px);
        box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
    }
    
    .btn-secondary {
        background: #f8f9fa;
        color: #667eea;
        border: 2px solid #667eea;
    }
    
    .btn-secondary:hover {
        background: #667eea;
        color: white;
    }
}

/* ===== التنبيهات للجوال ===== */
@media (max-width: 768px) {
    .notification {
        position: fixed;
        top: 20px;
        right: 20px;
        background: white;
        border-radius: 10px;
        box-shadow: 0 5px 20px rgba(0, 0, 0, 0.15);
        padding: 15px 20px;
        z-index: 10000;
        transform: translateX(400px);
        transition: transform 0.3s ease;
        max-width: 300px;
    }
    
    .notification.show {
        transform: translateX(0);
    }
    
    .notification-success {
        border-right: 4px solid #2ed573;
    }
    
    .notification-error {
        border-right: 4px solid #ff4757;
    }
    
    .notification-warning {
        border-right: 4px solid #ffa502;
    }
    
    .notification-info {
        border-right: 4px solid #3742fa;
    }
}

/* ===== تأثيرات حركية للجوال ===== */
@media (max-width: 768px) {
    @keyframes fadeInUp {
        from {
            opacity: 0;
            transform: translateY(30px);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }
    
    .product-card,
    .category-card {
        animation: fadeInUp 0.6s ease-out;
    }
}

/* ===== تحسينات إضافية للجوال ===== */
@media (max-width: 480px) {
    .container {
        padding: 0 10px;
    }
    
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 12px;
    }
    
    .categories-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 12px;
    }
    
    .product-image {
        height: 120px;
    }
    
    .product-info h3 {
        font-size: 0.9rem;
    }
    
    .product-description {
        font-size: 0.8rem;
    }
    
    .price {
        font-size: 1rem;
    }
    
    .add-to-cart-btn {
        padding: 10px;
        font-size: 0.85rem;
    }
    
    .category-icon {
        width: 50px;
        height: 50px;
        font-size: 1.2rem;
    }
    
    .category-card h3 {
        font-size: 0.9rem;
    }
    
    .category-card p {
        font-size: 0.8rem;
    }
    
    .section-header h2 {
        font-size: 1.5rem;
    }
    
    .section-header p {
        font-size: 0.9rem;
    }
    
    .search-input {
        font-size: 0.9rem;
        padding: 10px 15px;
    }
    
    .search-btn {
        padding: 10px 15px;
    }
    
    .tool-btn {
        width: 35px;
        height: 35px;
    }
    
    .mobile-menu-btn {
        width: 35px;
        height: 35px;
    }
}

/* ===== تحسينات للأجهزة الصغيرة جداً ===== */
@media (max-width: 360px) {
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 10px;
    }
    
    .categories-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
        gap: 10px;
    }
    
    .product-image {
        height: 100px;
    }
    
    .product-info {
        padding: 10px;
    }
    
    .product-info h3 {
        font-size: 0.85rem;
    }
    
    .product-description {
        font-size: 0.75rem;
    }
    
    .price {
        font-size: 0.9rem;
    }
    
    .add-to-cart-btn {
        padding: 8px;
        font-size: 0.8rem;
    }
    
    .category-card {
        padding: 15px 10px;
    }
    
    .category-icon {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }
    
    .category-card h3 {
        font-size: 0.85rem;
    }
    
    .category-card p {
        font-size: 0.75rem;
    }
}

/* ===== تحسينات للأداء ===== */
@media (max-width: 768px) {
    * {
        -webkit-tap-highlight-color: transparent;
    }
    
    .product-card,
    .category-card,
    .btn {
        -webkit-transform: translateZ(0);
        transform: translateZ(0);
    }
    
    .product-card:hover,
    .category-card:hover {
        -webkit-transform: translateY(-5px) translateZ(0);
        transform: translateY(-5px) translateZ(0);
    }
}

/* ===== تحسينات للقراءة ===== */
@media (max-width: 768px) {
    body {
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
    }
    
    .product-info h3,
    .category-card h3,
    .section-header h2 {
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
    }
} 