/* Alameri Digital Integration - Frontend Styles */
.alameri-products-grid {
    display: grid;
    gap: 20px;
    direction: rtl;
}

.alameri-product-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s;
}

.alameri-product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(0,0,0,0.15);
}

.alameri-product-image {
    width: 100%;
    height: 180px;
    object-fit: cover;
}

.alameri-product-content {
    padding: 15px;
}

.alameri-product-category {
    font-size: 12px;
    color: #666;
    margin-bottom: 5px;
}

.alameri-product-title {
    font-size: 16px;
    font-weight: bold;
    margin: 0 0 10px;
    color: #333;
}

.alameri-product-price {
    font-size: 20px;
    font-weight: bold;
    color: #2563eb;
    margin-bottom: 10px;
}

.alameri-product-stock {
    font-size: 12px;
    color: #10b981;
    margin-bottom: 10px;
}

.alameri-product-stock.out-of-stock {
    color: #ef4444;
}

.alameri-btn {
    display: inline-block;
    padding: 10px 20px;
    background: linear-gradient(135deg, #2563eb, #7c3aed);
    color: #fff;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
    transition: opacity 0.3s;
    width: 100%;
    text-align: center;
}

.alameri-btn:hover {
    opacity: 0.9;
}

.alameri-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Categories */
.alameri-categories-grid {
    display: grid;
    gap: 15px;
    direction: rtl;
}

.alameri-category-card {
    background: linear-gradient(135deg, #f3f4f6, #e5e7eb);
    border-radius: 10px;
    padding: 20px;
    text-align: center;
    transition: transform 0.3s;
}

.alameri-category-card:hover {
    transform: scale(1.05);
}

.alameri-category-icon {
    font-size: 40px;
    margin-bottom: 10px;
}

.alameri-category-name {
    font-weight: bold;
    color: #333;
}

/* Balance Widget */
.alameri-balance {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, #10b981, #059669);
    color: #fff;
    padding: 10px 20px;
    border-radius: 25px;
    font-weight: bold;
}

.alameri-balance-label {
    opacity: 0.9;
}

.alameri-balance-amount {
    font-size: 18px;
}

/* Purchase Form */
.alameri-purchase-form {
    max-width: 400px;
    margin: 0 auto;
    padding: 20px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    direction: rtl;
}

.alameri-purchase-form .form-group {
    margin-bottom: 15px;
}

.alameri-purchase-form label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: #333;
}

.alameri-purchase-form input,
.alameri-purchase-form select {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
}

.alameri-purchase-form input:focus,
.alameri-purchase-form select:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* Result Messages */
.alameri-result {
    margin-top: 15px;
    padding: 15px;
    border-radius: 8px;
}

.alameri-result.success {
    background: #d1fae5;
    color: #065f46;
}

.alameri-result.error {
    background: #fee2e2;
    color: #991b1b;
}

.alameri-codes {
    background: #f3f4f6;
    padding: 10px;
    border-radius: 5px;
    margin-top: 10px;
    font-family: monospace;
}

.alameri-code-item {
    padding: 5px;
    border-bottom: 1px solid #e5e7eb;
}

.alameri-code-item:last-child {
    border-bottom: none;
}

/* Loading */
.alameri-loading {
    text-align: center;
    padding: 40px;
    color: #666;
}

.alameri-spinner {
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 3px solid #f3f4f6;
    border-top-color: #2563eb;
    border-radius: 50%;
    animation: alameri-spin 1s linear infinite;
}

@keyframes alameri-spin {
    to { transform: rotate(360deg); }
}

/* Modal */
.alameri-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.alameri-modal {
    background: #fff;
    border-radius: 12px;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    direction: rtl;
}

.alameri-modal-header {
    padding: 15px 20px;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.alameri-modal-title {
    font-weight: bold;
    font-size: 18px;
}

.alameri-modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #666;
}

.alameri-modal-body {
    padding: 20px;
}

.alameri-modal-footer {
    padding: 15px 20px;
    border-top: 1px solid #e5e7eb;
    text-align: left;
}
