/**
 * Market System Plugin CSS
 * Version: 2.0
 */

/* تحسين للشاشات الصغيرة */
@media (max-width: 768px) {
    .market-vendor-card {
        width: 100% !important;
        margin-bottom: 15px;
    }
    .market-product-card {
        width: 100% !important;
        margin-bottom: 20px;
    }
    .market-vendor-profile {
        flex-direction: column !important;
        text-align: center;
    }
}

/* أنيميشن للبطاقات */
.market-vendor-card, 
.market-product-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.market-vendor-card:hover, 
.market-product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
}

/* تحسين عرض الجدول */
.wp-list-table th, 
.wp-list-table td {
    vertical-align: middle !important;
}
.wp-list-table .button-small {
    margin: 2px !important;
    padding: 0 8px !important;
    line-height: 28px !important;
    height: 30px !important;
    font-size: 12px !important;
}
@media (max-width: 1200px) {
    .wp-list-table th, 
    .wp-list-table td {
        font-size: 12px !important;
    }
    .wp-list-table .button-small {
        font-size: 10px !important;
        padding: 0 5px !important;
    }
}

/* Grid للشاشات المختلفة */
@media (min-width: 1025px) {
    .market-products-grid {
        grid-template-columns: repeat(3, 1fr) !important;
    }
}
@media (min-width: 769px) and (max-width: 1024px) {
    .market-products-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}
@media (max-width: 768px) {
    .market-products-grid {
        grid-template-columns: repeat(1, 1fr) !important;
    }
}

/* ألوان وحالات */
.status-active { color: #00a32a; }
.status-inactive { color: #dc3232; }
.featured-star { color: #eab308; }
.featured-none { color: #9ca3af; }
.quantity-out-of-stock { color: #dc3232; }
.quantity-low-stock { color: #eab308; }
.quantity-in-stock { color: #00a32a; }

/* Dashboard Cards */
.market-dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 20px;
}
.market-dashboard-card {
    background: #fff;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}
.market-dashboard-card .number {
    font-size: 36px;
    font-weight: bold;
    margin: 10px 0;
}
.market-quick-actions {
    margin-top: 30px;
    background: #f0fdf4;
    padding: 20px;
    border-radius: 12px;
}
.market-quick-actions-buttons {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    margin-top: 15px;
}

/* بطاقات التجار */
.market-vendors-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}
.market-vendor-card {
    border: 1px solid #ddd;
    padding: 15px;
    width: 250px;
    border-radius: 10px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}
.market-vendor-card h3 {
    margin: 0 0 10px 0;
    font-size: 18px;
}
.market-vendor-card h3 a {
    text-decoration: none;
    color: #111827;
}
.market-vendor-card p {
    margin: 8px 0;
    color: #6b7280;
}

/* صفحة التاجر المنفرد */
.market-single-vendor-container {
    background: #f9fafb;
    padding: 40px 15px;
}
.market-single-vendor-card {
    max-width: 900px;
    margin: auto;
    background: #fff;
    border-radius: 16px;
    padding: 25px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.05);
}
.market-vendor-profile {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
    margin-bottom: 25px;
}
.market-vendor-logo {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    object-fit: cover;
}
.market-vendor-info h2 {
    margin: 0;
    font-size: 24px;
}
.market-contact-wrapper {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}
.market-contact-box {
    flex: 1;
    background: #f9fafb;
    padding: 15px;
    border-radius: 10px;
    border: 1px solid #e5e7eb;
}
.market-whatsapp-btn {
    display: inline-block;
    background: #25D366;
    color: #fff;
    padding: 14px 25px;
    border-radius: 10px;
    text-decoration: none;
    font-weight: bold;
}
.market-whatsapp-btn:hover {
    background: #1ebe5d;
}

/* بطاقات المنتجات */
.market-products-grid {
    display: grid;
    gap: 20px;
}
.market-product-card {
    background: #fff;
    border-radius: 12px;
    padding: 15px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
}
.market-product-image {
    width: 100%;
    height: 180px;
    object-fit: cover;
    border-radius: 10px;
}
.market-product-title {
    margin: 12px 0 8px 0;
    font-size: 16px;
}
.market-product-title a {
    text-decoration: none;
    color: #111827;
}
.market-product-price {
    font-weight: bold;
    margin-top: 10px;
    color: #2563eb;
    font-size: 18px;
}

/* صفحة المنتج المنفرد */
.market-single-product-container {
    background: #f3f4f6;
    padding: 40px 15px;
}
.market-single-product-card {
    max-width: 1100px;
    margin: auto;
    background: #fff;
    border-radius: 20px;
    padding: 30px;
}
.market-product-details {
    display: flex;
    flex-wrap: wrap;
    gap: 40px;
    align-items: center;
}
.market-product-image-single {
    width: 100%;
    max-height: 350px;
    object-fit: cover;
    border-radius: 16px;
}
.market-product-title-single {
    margin: 0;
    font-size: 28px;
}
.market-product-price-single {
    font-size: 26px;
    font-weight: bold;
    color: #2563eb;
}
.market-order-btn {
    display: block;
    margin-top: 25px;
    background: #25D366;
    color: #fff;
    text-align: center;
    padding: 16px;
    border-radius: 12px;
    text-decoration: none;
    font-weight: bold;
}
.market-order-btn-mobile {
    position: fixed;
    bottom: 15px;
    left: 20px;
    right: 20px;
    background: #25D366;
    color: #fff;
    text-align: center;
    padding: 15px;
    border-radius: 12px;
    font-weight: bold;
    z-index: 999;
    display: none;
}

/* رسالة إضافة إلى السلة */
.cart-toast {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: #fff;
    border-radius: 12px;
    padding: 15px 25px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    z-index: 10000;
    min-width: 300px;
    max-width: 500px;
    border-right: 4px solid #10b981;
    animation: slideDown 0.3s ease;
}

.cart-toast.success {
    border-right-color: #10b981;
}

.cart-toast.error {
    border-right-color: #dc3232;
}

@keyframes slideDown {
    from {
        top: -100px;
        opacity: 0;
    }
    to {
        top: 20px;
        opacity: 1;
    }
}

.cart-toast-buttons {
    display: flex;
    gap: 10px;
    margin-top: 12px;
}

.cart-toast-buttons a, .cart-toast-buttons button {
    flex: 1;
    text-align: center;
    padding: 8px 12px;
    border-radius: 8px;
    text-decoration: none;
    font-size: 14px;
    cursor: pointer;
    border: none;
}

.btn-go-cart {
    background: #2563eb;
    color: #fff;
}

.btn-continue {
    background: #e5e7eb;
    color: #374151;
}

.btn-go-cart:hover {
    background: #1d4ed8;
}

.btn-continue:hover {
    background: #d1d5db;
}

/* تنسيق صفحة المنتج - ديسكتوب */
@media (min-width: 769px) {
    .product-desktop-wrapper {
        display: flex !important;
        flex-direction: row !important;
        gap: 40px;
        align-items: center;
    }
    
    .product-desktop-wrapper > div:first-child {
        flex: 1;
        text-align: center;
    }
    
    .product-desktop-wrapper > div:last-child {
        flex: 1;
    }
}

/* تنسيق صفحة المنتج - موبايل وتاب (أقل من 768px) */
@media (max-width: 768px) {
    .product-desktop-wrapper {
        display: flex !important;
        flex-direction: column !important;
        gap: 25px;
    }
    
    .product-desktop-wrapper > div:first-child {
        width: 100%;
        order: 1;
    }
    
    .product-desktop-wrapper > div:last-child {
        width: 100%;
        order: 2;
        text-align: center;
    }
    
    .product-actions {
        flex-direction: column;
        gap: 10px;
    }
    
    .product-actions button,
    .product-actions a {
        width: 100%;
    }
    
    #cart-message-area > div > div:last-child {
        display: flex;
        flex-direction: column;
        gap: 10px;
    }
    
    #cart-message-area a {
        width: 100%;
    }
}