/* Waiter Order Interface Styles */
.zs-waiter-order-wrapper {
    display: grid;
    grid-template-columns: 250px 1fr;
    gap: 30px;
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    direction: rtl;
}

.zs-waiter-order-sidebar {
    position: sticky;
    top: 20px;
    align-self: start;
}

/* استفاده از استایل‌های مشترک منوی کناری از admin-frontend.css */
.zs-waiter-order-sidebar .zs-admin-sidebar-menu {
    background: #fff;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    height: fit-content;
}

.zs-waiter-order-content-wrapper {
    min-width: 0;
}

.zs-waiter-order {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

.zs-waiter-order-header {
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 2px solid #ddd;
}

.zs-waiter-order-header h2 {
    margin: 0;
    font-size: 28px;
    color: #333;
}

.zs-waiter-order-error {
    padding: 20px;
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    border-radius: 4px;
    margin: 20px 0;
}

.zs-order-section {
    margin-bottom: 30px;
    padding: 20px;
    background: #f9f9f9;
    border-radius: 8px;
}

.zs-order-section h3 {
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 20px;
    color: #333;
}

.zs-select {
    width: 100%;
    max-width: 400px;
    padding: 10px;
    font-size: 16px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #fff;
}

.zs-order-main {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 30px;
    margin-top: 20px;
    min-width: 0; /* برای جلوگیری از overflow */
}

/* اطمینان از اینکه سبد خرید overflow نمی‌کند */
.zs-order-cart {
    overflow-x: hidden; /* جلوگیری از scroll افقی */
}

.zs-cart-items {
    overflow-x: hidden; /* جلوگیری از scroll افقی */
}

@media (max-width: 1024px) {
    .zs-waiter-order-wrapper {
        grid-template-columns: 1fr;
    }
    
    .zs-waiter-order-sidebar {
        position: static;
        margin-bottom: 20px;
    }
    
    .zs-order-main {
        grid-template-columns: 1fr;
    }
    
    /* منوی آکاردئونی در موبایل - حذف شده چون در admin-frontend.css تعریف شده */
}

/* Menu Styles */
.zs-order-menu {
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.zs-order-menu h3 {
    margin-top: 0;
    margin-bottom: 20px;
    font-size: 22px;
    color: #333;
}

.zs-menu-categories {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.zs-menu-category {
    margin-bottom: 30px;
}

.zs-menu-category h4 {
    margin: 0 0 15px 0;
    font-size: 18px;
    color: #555;
    padding-bottom: 10px;
    border-bottom: 2px solid #e0e0e0;
}

.zs-menu-items {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
}

.zs-menu-item {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
}

.zs-menu-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.zs-menu-item-image {
    width: 100%;
    height: 150px;
    overflow: hidden;
    background: #f0f0f0;
}

.zs-menu-item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.zs-menu-item-content {
    padding: 15px;
}

.zs-menu-item-content h5 {
    margin: 0 0 8px 0;
    font-size: 16px;
    color: #333;
}

.zs-menu-item-description {
    margin: 0 0 10px 0;
    font-size: 14px;
    color: #666;
    line-height: 1.5;
}

.zs-menu-item-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 10px;
}

.zs-menu-item-price {
    font-weight: bold;
    color: #d32f2f;
    font-size: 16px;
}

/* Cart Styles */
.zs-order-cart {
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    position: sticky;
    top: 20px;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    min-width: 0; /* برای جلوگیری از overflow */
    box-sizing: border-box;
}

.zs-order-cart h3 {
    margin-top: 0;
    margin-bottom: 20px;
    font-size: 22px;
    color: #333;
}

.zs-cart-items {
    margin-bottom: 20px;
    min-height: 100px;
}

.zs-cart-empty {
    text-align: center;
    color: #999;
    padding: 40px 20px;
    margin: 0;
}

.zs-cart-item {
    display: flex;
    flex-direction: column;
    padding: 15px;
    margin-bottom: 15px;
    background: #f9f9f9;
    border-radius: 8px;
    gap: 12px;
    border: 1px solid #e0e0e0;
    box-sizing: border-box;
    width: 100%;
    min-width: 0;
}

.zs-cart-item-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    gap: 15px;
    margin-bottom: 12px;
}

.zs-cart-item-name {
    font-weight: bold;
    font-size: 16px;
    color: #333;
    word-wrap: break-word;
    margin: 0;
    flex: 1;
}

.zs-cart-item-info {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.zs-cart-item-controls {
    width: 100%;
}

.zs-cart-item-quantity {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 8px;
}

.zs-cart-item-quantity button {
    width: 32px;
    height: 32px;
    border: 1px solid #ddd;
    background: #fff;
    border-radius: 4px;
    cursor: pointer;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #333;
    transition: all 0.2s;
}

.zs-cart-item-quantity button:hover {
    background: #f0f0f0;
    border-color: #bbb;
}

.zs-cart-item-quantity span {
    min-width: 35px;
    text-align: center;
    font-weight: bold;
    font-size: 16px;
    color: #333;
}

.zs-cart-item-price {
    font-weight: bold;
    color: #d32f2f;
    margin: 0;
    font-size: 16px;
    white-space: nowrap;
    display: block;
    margin-top: 8px;
}

.zs-cart-item-remove {
    background: #e0e0e0;
    color: #333;
    border: 1px solid #ccc;
    padding: 8px 14px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
    flex-shrink: 0;
    transition: all 0.2s;
    min-width: 100px;
    text-align: center;
}

.zs-cart-item-remove:hover {
    background: #d0d0d0;
    border-color: #bbb;
    transform: translateY(-1px);
}

/* فیلد توضیحات برای آیتم‌های سبد خرید */
.zs-cart-item-notes {
    width: 100%;
    margin-top: 10px;
    padding-top: 12px;
    border-top: 1px solid #e0e0e0;
    box-sizing: border-box;
}

.zs-cart-item-notes label {
    display: block;
    font-size: 14px;
    color: #333;
    margin-bottom: 8px;
    font-weight: 500;
}

.zs-item-notes-input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
    direction: rtl;
    text-align: right;
    box-sizing: border-box;
    background: #fff;
    transition: border-color 0.2s, box-shadow 0.2s;
    color: #333;
}

.zs-item-notes-input:focus {
    outline: none;
    border-color: #2196f3;
    box-shadow: 0 0 0 2px rgba(33, 150, 243, 0.1);
}

.zs-item-notes-input::placeholder {
    color: #999;
    font-size: 13px;
}

.zs-cart-total {
    padding: 15px;
    background: #f0f0f0;
    border-radius: 6px;
    margin-bottom: 15px;
    text-align: center;
    font-size: 18px;
    font-weight: bold;
    color: #333;
}

.zs-button {
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    cursor: pointer;
    transition: background 0.2s;
}

.zs-button-primary {
    background: #e0e0e0;
    color: #333;
    width: 100%;
    border: 1px solid #ccc;
    font-weight: 500;
}

.zs-button-primary:hover:not(:disabled) {
    background: #d0d0d0;
    border-color: #bbb;
}

.zs-button-primary:disabled {
    background: #f0f0f0;
    color: #999;
    border-color: #e0e0e0;
    cursor: not-allowed;
}

.zs-add-to-cart {
    background: #2196f3;
    color: #fff;
    padding: 8px 16px;
    font-size: 14px;
}

.zs-add-to-cart:hover {
    background: #1976d2;
}

/* Active Orders */
.zs-active-orders {
    margin-top: 30px;
}

.zs-orders-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.zs-order-card {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.zs-order-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #e0e0e0;
}

.zs-order-number {
    font-weight: bold;
    font-size: 16px;
    color: #333;
}

.zs-order-status {
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: bold;
}

.zs-status-pending {
    background: #ff9800;
    color: #fff;
}

.zs-status-preparing {
    background: #2196f3;
    color: #fff;
}

.zs-status-ready {
    background: #4caf50;
    color: #fff;
}

.zs-status-completed {
    background: #9e9e9e;
    color: #fff;
}

.zs-order-card-body p {
    margin: 8px 0;
    font-size: 14px;
}

.zs-order-card-actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #e0e0e0;
}

.zs-edit-order,
.zs-delete-order {
    flex: 1;
    padding: 8px;
    font-size: 14px;
}

.zs-edit-order {
    background: #2196f3;
    color: #fff;
}

.zs-edit-order:hover {
    background: #1976d2;
}

.zs-delete-order {
    background: #f44336;
    color: #fff;
}

.zs-delete-order:hover {
    background: #d32f2f;
}

/* Busy Tables */
.zs-busy-tables {
    margin-top: 30px;
    background: #fff3cd;
    border: 2px solid #ffc107;
}

.zs-busy-tables h3 {
    color: #856404;
}

.zs-busy-tables-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.zs-busy-table-card {
    background: #fff;
    border: 2px solid #ff9800;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.zs-busy-table-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 2px solid #ff9800;
}

.zs-busy-table-header h4 {
    margin: 0;
    font-size: 18px;
    color: #ff9800;
    font-weight: bold;
}

.zs-busy-table-orders {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 15px;
}

.zs-button-secondary {
    background: #2196f3;
    color: #fff;
    padding: 8px 16px;
    font-size: 14px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s;
}

.zs-button-secondary:hover {
    background: #1976d2;
}

/* RTL Support */
.zs-waiter-order[dir="rtl"] {
    direction: rtl;
    text-align: right;
}

.zs-waiter-order[dir="rtl"] .zs-menu-item-footer {
    flex-direction: row-reverse;
}

/* RTL برای سبد خرید - فقط برای top section */
.zs-waiter-order[dir="rtl"] .zs-cart-item-top {
    flex-direction: row-reverse;
}

.zs-waiter-order[dir="rtl"] .zs-cart-item-price {
    margin-left: 0;
    margin-right: 10px;
}

.zs-waiter-order[dir="rtl"] .zs-busy-table-header {
    flex-direction: row-reverse;
}

/* منوی چسبان سبد خرید برای موبایل */
.zs-mobile-cart-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #fff;
    border-top: 2px solid #2196f3;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    padding: 15px 20px;
    display: none;
    transition: transform 0.3s ease-in-out;
}

.zs-mobile-cart-bar.zs-cart-bar-hidden {
    transform: translateY(100%);
}

.zs-mobile-cart-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    max-width: 1400px;
    margin: 0 auto;
}

.zs-mobile-cart-info {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
}

.zs-mobile-cart-label {
    font-size: 16px;
    color: #333;
    font-weight: 500;
}

.zs-mobile-cart-total {
    font-size: 20px;
    font-weight: bold;
    color: #d32f2f;
}

.zs-mobile-cart-currency {
    font-size: 14px;
    color: #666;
}

.zs-mobile-place-order-button {
    padding: 12px 24px;
    background: #2196f3;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.2s;
}

.zs-mobile-place-order-button:hover:not(:disabled) {
    background: #1976d2;
}

.zs-mobile-place-order-button:disabled {
    background: #ccc;
    color: #999;
    cursor: not-allowed;
}

/* بهبود نمایش در اندازه‌های کوچک */
@media (max-width: 768px) {
    .zs-cart-item-top {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
    
    .zs-cart-item-remove {
        width: 100%;
        text-align: center;
    }
    
    .zs-cart-item-controls {
        justify-content: space-between;
        width: 100%;
    }
    
    .zs-cart-item-notes {
        margin-top: 10px;
    }
    
    .zs-item-notes-input {
        font-size: 16px; /* جلوگیری از zoom در iOS */
    }
    
    /* نمایش منوی چسبان فقط در موبایل */
    .zs-mobile-cart-bar {
        display: block;
    }
    
    /* اضافه کردن padding به body برای جلوگیری از پوشیده شدن محتوا */
    body.zs-mobile-cart-visible {
        padding-bottom: 80px;
    }
}

