﻿/* Reset */
* {
    box-sizing: border-box;
    scrollbar-width: none;
}

*::-webkit-scrollbar {
    display: none;
}

body {
    margin: 0;
    font-family: 'fredoka';
    background: #fff;
    direction: rtl;
}

.error-message {
    color: red;
    font-size: 13px;
    text-align: right;
    margin-top: 5px;
    padding-right: 30px;
}


/* Centered screen */
.screen {
    min-height: 100vh;
    padding: 10px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

#screen-menu {
    height: 100vh;
    min-height: 0;
    justify-content: flex-start;
    align-items: stretch;
    overflow: hidden;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.intro-form {
    padding: 40px 20px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    font-family: 'Fredoka', sans-serif;
    text-align: right;
    padding-bottom: 0;
}

.quicko-logo {
    width: 70%;
    height: auto;
    margin-bottom: 0px;
}

.quicko-name {
    font-size: 2em;
    font-weight: bold;
    color: #4B7BEC;
    margin-bottom: 5px;
}

.quicko-slogan {
    font-size: 1.6em;
    color: #fff;
    margin-bottom: 20px;
    margin-top: 0px;
    font-weight: 500;
}

#screen-welcome {
    background-color: #4B7BEC;
    background-image: linear-gradient(to top,
            #3354a0 0%,
            #3d64bd 60%,
            #4B7BEC 100%);
}

/* Form wrapper */
.form-wrapper {
    width: 100%;
    max-width: 400px;
    max-height: 85vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Input fields */
input {
    font-family: 'fredoka';
    width: 100%;
    padding: 20px 18px;
    font-size: 16px;
    border: 1px solid #ccc;
    border-radius: 30px;
    background-color: #fafafa;
}

/* Button */
button {
    font-family: 'fredoka';
    padding: 10px;
    font-size: 15px;
    font-weight: 500;
    background-color: #3354a0;
    color: #fff;
    border: none;
    border-radius: 30px;
    cursor: pointer;
    width: 90%;
    margin: 0 auto;
}

button,
.builder-tab,
.items-category-chip,
.category-list-row,
.group-row-settings-btn,
.group-settings-btn,
.add-btn,
.add-new-item-btn,
.item-card-addon-group,
.category-manage-row .cat-edit-btn,
.category-manage-row .cat-delete-btn,
.attached-addon-group-remove,
.assignment-mode-btn {
    -webkit-tap-highlight-color: transparent;
}

button:focus:not(:focus-visible),
.builder-tab:focus:not(:focus-visible),
.items-category-chip:focus:not(:focus-visible),
.group-row-settings-btn:focus:not(:focus-visible),
.group-settings-btn:focus:not(:focus-visible),
.add-btn:focus:not(:focus-visible),
.add-new-item-btn:focus:not(:focus-visible),
.item-card-addon-group:focus:not(:focus-visible),
.category-manage-row .cat-edit-btn:focus:not(:focus-visible),
.category-manage-row .cat-delete-btn:focus:not(:focus-visible),
.attached-addon-group-remove:focus:not(:focus-visible),
.assignment-mode-btn:focus:not(:focus-visible) {
    outline: none;
    box-shadow: none;
}

button:focus-visible,
.builder-tab:focus-visible,
.items-category-chip:focus-visible,
.group-row-settings-btn:focus-visible,
.group-settings-btn:focus-visible,
.add-btn:focus-visible,
.add-new-item-btn:focus-visible,
.item-card-addon-group:focus-visible,
.category-manage-row .cat-edit-btn:focus-visible,
.category-manage-row .cat-delete-btn:focus-visible,
.attached-addon-group-remove:focus-visible,
.assignment-mode-btn:focus-visible {
    outline: 2px solid #3354a0;
    outline-offset: 2px;
}

.openInfoModal-ui {
    font-family: 'fredoka';
    padding: 15px;
    font-size: 16px;
    font-weight: 500;
    background-color: #fff;
    color: #3354a0;
    border: none;
    border-radius: 30px;
    cursor: pointer;
    width: 40%;
    margin: 0 auto;
    margin-bottom: 20px;
}

.saveButton {
    font-family: 'fredoka';
    padding: 20px;
    font-size: 20px;
    font-weight: 500;
    background-color: #333;
    color: #fff;
    border: none;
    border-radius: 30px;
    cursor: pointer;
    width: 90%;
    margin: 0 auto;
    margin-bottom: 20px;
}

.item-modal-actions {
    display: flex;
    gap: 10px;
    width: 90%;
    margin: 0 auto 20px;
    direction: ltr;
}

.item-save-button {
    flex: 2.2;
    width: auto;
    margin: 0;
}

.item-delete-button {
    flex: 0.9;
    margin: 0;
    padding: 20px;
    font-size: 1rem;
    line-height: 1.2;
}

.item-flags-row {
    display: flex;
    gap: 12px;
    width: 90%;
    margin: 0 auto 14px;
    flex-wrap: wrap;
}

.item-flag-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    background: #eef3ff;
    border: 1.5px solid #d6e1ff;
    border-radius: 10px;
    padding: 10px 16px;
    flex: 1;
    min-width: 120px;
    transition: background 0.15s, border-color 0.15s;
    user-select: none;
}

.item-flag-checkbox:has(input:checked) {
    background: #3354a0;
    border-color: #3354a0;
}

.item-flag-checkbox:has(input:checked) .item-flag-checkbox-label {
    color: #fff;
}

.item-flag-checkbox:has(input:checked) .item-flag-checkbox-box {
    background: #fff;
    border-color: #fff;
}

.item-flag-checkbox:has(input:checked) .item-flag-checkbox-box::after {
    border-color: #3354a0;
}

.item-flag-checkbox input[type="checkbox"] {
    display: none;
}

.item-flag-checkbox-box {
    width: 20px;
    height: 20px;
    border-radius: 6px;
    border: 2px solid #3354a0;
    background: #fff;
    flex-shrink: 0;
    position: relative;
    transition: background 0.15s, border-color 0.15s;
}

.item-flag-checkbox-box::after {
    content: "";
    position: absolute;
    top: 2px;
    left: 5px;
    width: 6px;
    height: 10px;
    border: 2.5px solid transparent;
    border-top: none;
    border-left: none;
    transform: rotate(45deg);
    opacity: 0;
    transition: opacity 0.15s;
}

.item-flag-checkbox:has(input:checked) .item-flag-checkbox-box::after {
    opacity: 1;
}

.item-flag-checkbox-label {
    font-size: 15px;
    font-weight: 600;
    color: #3354a0;
    font-family: 'Fredoka', sans-serif;
    transition: color 0.15s;
}

input.invalid {
    border: 1px solid red;
    background-color: #fff0f0;
}

/* Image above the form */
.header-image {
    max-width: 250px;
    width: 80%;
    display: block;
    margin: 0 auto 20px auto;
    border-radius: 20px;
}

/* Welcome screen styles */
#welcome-title {
    margin: 20px 0 10px;
}

.welcome-title {
    font-size: 25px;
    text-align: center;
    font-weight: 500;
    color: #fff;
}

.welcome-subtitle {
    color: #fff;
    font-size: 1em;
    line-height: 1.6;
    margin-bottom: 25px;
    text-align: center;
}

/* Modal base */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.3);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.settingsModal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1010;
}

#confirmModal {
    z-index: 1060;
}


.modal-content {
    position: absolute;
    top: 7%;
    background: #fff;
    border-radius: 20px;
    padding: 30px 20px;
    width: 90%;
    max-width: 420px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    text-align: right;
}

/* Close button */
.modal-close {
    margin-top: 10px;
    background: #e0e0e0;
    color: #333;
}

.form-group {
    width: 100%;
}

.item-primary-row {
    display: grid;
    grid-template-columns: minmax(0, 2.4fr) minmax(110px, 0.9fr);
    gap: 12px;
    width: 100%;
    align-items: stretch;
}

.item-primary-row .form-group {
    min-width: 0;
}

.item-primary-row input {
    width: 100%;
}

.hidden {
    display: none !important;
}


#infoModal .form-wrapper {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 5px;
    align-items: center;
}

#infoModal input {
    font-family: 'fredoka';
    width: 100%;
    max-width: 320px;
    padding: 10px 14px;
    font-size: 16px;
    border: 1px solid #ccc;
    border-radius: 30px;
    background-color: #fafafa;
    direction: rtl;
}

#infoModal button {
    width: 61%;
    max-width: 320px;
    padding: 12px;
    font-size: 18px;
    border-radius: 30px;
}

#infoModal button:first-of-type {
    background-color: #4B7BEC;
    color: white;
    font-weight: 500;
}

#infoModal .modal-close {
    background-color: #e0e0e0;
    color: #333;
}

.modal-close-icon {
    position: absolute;
    top: 12px;
    left: 18px;
    font-size: 20px;
    color: #888;
    cursor: pointer;
    z-index: 2;
    transition: 0.2s ease;
}

.modal-close-icon:hover {
    color: #ff3b6b;
}

.builder-header {
    width: 100%;
    max-width: 760px;
    margin: 0;
    flex: 0 0 auto;
    position: sticky;
    top: 0;
    z-index: 30;
    background: #fff;
    padding-top: 4px;
}

.builder-tabs {
    display: flex;
    justify-content: space-between;
    align-items: stretch;
    gap: 8px;
    width: 100%;
    margin-bottom: 12px;
}

.builder-tab {
    flex: 1 1 0;
    margin: 0;
    padding: 12px 10px;
    border-radius: 16px;
    background: #eef3ff;
    color: #3354a0;
    border: 1px solid #d6e1ff;
    font-size: 14px;
    font-weight: 600;
}

.builder-tab.active {
    background: #3354a0;
    color: #fff;
    border-color: #3354a0;
}

.builder-context {
    min-height: 8px;
    color: #667085;
    font-size: 14px;
    text-align: right;
    padding: 0 4px;
    padding-bottom: 10px;
}

.builder-secondary-bar,
.builder-bottom-actions {
    width: 100%;
    max-width: 760px;
    margin: 0 auto;
    flex: 0 0 auto;
    background: #fff;
}

.builder-secondary-bar {
    min-height: 0;
}

.builder-bottom-actions {
    position: fixed;
    left: 50%;
    bottom: 0;
    transform: translateX(-50%);
    z-index: 40;
    width: min(760px, calc(100vw - 20px));
    padding-top: 12px;
    padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px));
    box-shadow: 0 -8px 24px rgba(15, 23, 42, 0.08);
}


.import-summary {
    margin-top: 16px;
    padding: 14px;
    border: 1px solid #d7dfef;
    border-radius: 16px;
    background: #f8fbff;
}

.import-summary.hidden {
    display: none;
}

.import-summary-title,
#importSummaryTitle {
    margin: 0 0 10px;
    font-size: 16px;
    font-weight: 600;
    color: #20304f;
}

.import-summary-counts {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 12px;
}

.import-summary-chip {
    padding: 10px 12px;
    border-radius: 12px;
    background: #fff;
    border: 1px solid #dfe6f5;
    font-size: 14px;
    color: #26385c;
}

.import-errors-title {
    margin-bottom: 8px;
    color: #a33939;
    font-weight: 600;
}

.import-errors-title.hidden {
    display: none;
}

.import-errors-list {
    margin: 0;
    padding-inline-start: 20px;
    color: #8f2e2e;
    font-size: 14px;
}

.import-errors-list:empty {
    display: none;
}

.import-replace-warning {
    margin: 12px 0 0;
    color: #6a4a00;
    font-size: 14px;
    line-height: 1.5;
}

.import-replace-warning.hidden {
    display: none;
}

/* Category management list in edit modal */
.category-manage-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 50vh;
    overflow-y: auto;
    margin-bottom: 10px;
}

.category-manage-row {
    display: flex;
    align-items: center;
    gap: 8px;
    border-bottom: 1px solid #eee;
    padding: 8px 4px;
}

.category-manage-row input {
    flex: 1;
    padding: 8px 12px;
    font-size: 15px;
    border: 1px solid #ccc;
    border-radius: 20px;
    background: #fff;
}


.category-manage-row .cat-edit-btn {
    width: 36px;
    height: 36px;
    padding: 0;
    background-color: #4B7BEC;
    color: #fff;
    border: none;
    border-radius: 50%;
    font-size: 15px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.category-manage-row .cat-delete-btn {
    width: 36px;
    height: 36px;
    padding: 0;
    background-color: #e74c3c;
    color: #fff;
    border: none;
    border-radius: 50%;
    font-size: 15px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.helper-text {
    color: #aaa;
    font-size: 14px;
    padding: 8px;
}

#addCategoryModal input {
    margin-bottom: 5px;
}

.category-inputs-scroll {
    max-height: 300px;
    overflow-y: auto;
    margin-bottom: 5px;
    padding-right: 5px;
}




.bottom-sheet {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    top: auto;
    background: white;
    border-radius: 30px 30px 0 0;
    box-shadow: 0 -2px 15px rgba(0, 0, 0, 0.15);
    transform: translateY(100%);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.34s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.28s ease;
    z-index: 1020;
    will-change: transform, opacity;
}

.bottom-sheet.show {
    transform: translateY(0%);
    opacity: 1;
    pointer-events: auto;
}

.bottom-sheet-content .form-wrapper {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 0 10px;
    width: 100%;
    max-width: 100%;
}

/* Action Menu Bottom Sheet */
.action-menu-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 1099;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.28s ease;
}

.action-menu-overlay.visible {
    opacity: 1;
    pointer-events: auto;
}

.action-menu-sheet {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #fff;
    border-radius: 24px 24px 0 0;
    box-shadow: 0 -4px 30px rgba(0, 0, 0, 0.15);
    z-index: 1100;
    transform: translateY(100%);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.34s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.28s ease;
    padding: 12px 20px calc(28px + env(safe-area-inset-bottom, 0px));
}

.action-menu-sheet.show {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
}

.action-menu-handle {
    width: 40px;
    height: 4px;
    background: #e0e7ff;
    border-radius: 99px;
    margin: 0 auto 20px;
}

.action-menu-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

.action-menu-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 16px 8px;
    background: #f5f8ff;
    border: 1.5px solid #d6e1ff;
    border-radius: 16px;
    color: #3354a0;
    font-size: 13px;
    font-weight: 600;
    font-family: 'Fredoka', sans-serif;
    cursor: pointer;
    width: auto;
    margin: 0;
    transition: background 0.15s;
    text-align: center;
    line-height: 1.3;
}

.action-menu-btn i {
    font-size: 22px;
}

.action-menu-btn:hover {
    background: #dde7ff;
}

.action-menu-btn--danger {
    background: #fff0f0;
    border-color: #ffd0d0;
    color: #c0392b;
}

.action-menu-btn--danger:hover {
    background: #ffe0e0;
}

.action-menu-btn--accent {
    background: #eef3ff;
    border-color: #c5d5ff;
    color: #3354a0;
}

.action-menu-btn--wide {
    grid-column: span 2;
    flex-direction: row;
    gap: 12px;
    justify-content: center;
    padding: 16px;
}

.action-menu-lang {
    border-top: 1px solid #e5e7eb;
    padding-top: 16px;
}

.action-menu-lang-label {
    display: block;
    font-size: 12px;
    color: #667085;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 8px;
}

.action-menu-lang-select {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid #d6e1ff;
    border-radius: 10px;
    background: #eef3ff;
    color: #3354a0;
    font-family: 'Fredoka', sans-serif;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    outline: none;
    box-sizing: border-box;
}

.action-menu-lang-select:focus {
    border-color: #3354a0;
    box-shadow: 0 0 0 3px rgba(51, 84, 160, 0.15);
}

.action-menu-toggle {
    position: fixed;
    bottom: 20px;
    left: 12px;
    width: 52px;
    height: 52px;
    border-radius: 16px;
    background: #3354a0;
    color: #fff;
    border: none;
    font-size: 20px;
    box-shadow: 0 3px 12px rgba(51, 84, 160, 0.4);
    z-index: 1000;
    pointer-events: auto;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    transition: transform 0.15s, box-shadow 0.15s;
}

.action-menu-toggle:hover {
    transform: scale(1.06);
    box-shadow: 0 5px 16px rgba(51, 84, 160, 0.5);
}

#itemModal {
    max-height: min(92vh, 920px);
    overflow: hidden;
}

#itemModal .bottom-sheet-content {
    max-height: min(92vh, 920px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

#itemPreviewModal {
    max-height: min(92vh, 920px);
    overflow: hidden;
}

#itemPreviewModal .bottom-sheet-content {
    display: flex;
    flex-direction: column;
    max-height: min(92vh, 920px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 24px;
}

#itemPreviewModal .sheet-header {
    position: sticky;
    top: 0;
    z-index: 2;
    background: #fff;
    padding-top: 12px;
    padding-bottom: 12px;
    margin-bottom: 12px;
    border-bottom: 1px solid #e5e7eb;
}

.sheet-header {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 20px;
    padding: 0 20px;
}

.sheet-header h3 {
    font-size: 24px;
    font-weight: 600;
    color: #333;
    margin-top: 20px;
    margin-bottom: 10px;
}

/* Better Inputs */
#itemModal input[type="text"],
#itemModal input[type="number"] {
    width: 100%;
    padding: 16px;
    font-size: 16px;
    border-radius: 20px;
    border: 1px solid #ccc;
    background: #f7f7f7;
}

.item-barcode-group {
    margin-top: 4px;
}

.addon-group {
    background: #e6e8e9;
    border: 1px solid #ddd;
    border-radius: 16px;
    padding: 16px;
    margin-bottom: 20px;
}

.attached-addon-group {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    background: #f6f8fb;
    border: 1px solid #dde4f2;
    border-radius: 14px;
    padding: 14px 16px;
    margin-bottom: 10px;
}

.attached-addon-group-main {
    min-width: 0;
}

.attached-addon-group-title {
    margin: 0 0 4px;
    font-size: 16px;
    color: #22314f;
}

.attached-addon-group-meta {
    font-size: 13px;
    color: #7a8599;
}

.attached-addon-group-remove {
    width: auto;
    margin: 0;
    padding: 8px 14px;
    background: #eef3ff;
    color: #3354a0;
    border: 1px solid #d6e1ff;
    border-radius: 999px;
    font-size: 13px;
}

.group-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    gap: 5px;
}

.group-header input {
    flex: 1;
    padding: 10px;
    border-radius: 30px;
    border: 1px solid #ccc;
}

.group-settings-btn {
    background: #333;
    border: none;
    border-radius: 20%;
    width: 50px;
    height: 50px;
    font-size: 18px;
    cursor: pointer;
    padding: 0px;
}

.add-btn {
    background: #333;
    color: #fff;
    border: none;
    border-radius: 20%;
    width: 50px;
    height: 50px;
    font-size: 18px;
    cursor: pointer;
    padding: 0px;
}

.addon-name {
    flex: 2;
}

.addon-price {
    flex: 1;
}


.group-settings-btn img {
    width: 20px;
    height: 20px;
    position: relative;
    top: 5px;
}


.addon-option {
    display: flex;
    gap: 5px;
    align-items: center;
    margin-bottom: 10px;
}

.addon-option input {
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 20px;
    flex: 1;
}

.addon-option button {
    width: 36px;
    height: 36px;
    padding: 0;
    color: #333;
    border: none;
    border-radius: 20%;
    cursor: pointer;
    background-color: transparent;
}

.addon-selector {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 1em;
    direction: rtl;
    max-height: 120px;
    overflow-y: auto;
}

.addon-linking-block {
    width: 100%;
    padding: 6px 0;
}

.addon-linking-label {
    display: block;
    margin-bottom: 8px;
    color: #22314f;
    font-size: 14px;
    font-weight: 600;
}

.item-addon-group-select {
    min-height: auto;
    padding: 14px 12px;
    border-radius: 18px;
    background: #fafafa;
}

.selected-addon-groups {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.selected-addon-group-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 999px;
    background: #eef3ff;
    color: #3354a0;
    font-size: 13px;
    font-weight: 600;
}

.selected-addon-group-chip button {
    width: auto;
    margin: 0;
    padding: 0;
    background: transparent;
    color: inherit;
    border: none;
    font-size: 16px;
    line-height: 1;
}


#addonSettingsModal input[type="number"] {
    width: 100%;
    padding: 12px;
    border: 1px solid #ccc;
    border-radius: 20px;
}

.item-list-placeholder {
    display: flex;
    flex-direction: column;
    padding: 15px 3px;
    text-align: right;
    width: 100%;
    max-width: 760px;
    margin: 0 auto;
    flex: 1 1 auto;
    align-self: stretch;
    min-height: 0;
    height: auto;
    max-height: none;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-gutter: stable;
    box-sizing: border-box;
}

.empty-message {
    color: #aaa;
    font-size: 15px;
}

.items-category-menu {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding: 0 2px 12px;
    margin-bottom: 0;

    background: #fff;
    -webkit-overflow-scrolling: touch;
}

.items-category-chip {
    width: auto;
    flex: 0 0 auto;
    margin: 0;
    padding: 10px 16px;
    border-radius: 999px;
    border: 1px solid #d8e2f8;
    background: #fff;
    color: #3354a0;
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
}

.items-category-chip.active {
    background: #3354a0;
    border-color: #3354a0;
    color: #fff;
}

.addon-group-preview {
    margin-bottom: 20px;
    background-color: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 16px;
    padding: 16px;
}

.addon-group-preview h4 {
    margin: 0 0 12px;
    font-size: 19px;
    font-weight: 500;
    color: #333;
}

.addon-option-preview {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    border-bottom: 1px dashed #ccc;
    font-size: 15px;
    color: #444;
}

.addon-option-preview:last-child {
    border-bottom: none;
}

.item-card {
    background: #fff;
    border-radius: 12px;
    padding: 25px 20px;
    margin-bottom: 12px;
    box-shadow: 0 1px 6px rgba(0, 0, 0, 0.2);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    font-family: "Fredoka", sans-serif;
    cursor: default;
    transition: box-shadow 0.2s ease-in-out;
}

.item-card-main {
    min-width: 0;
    flex: 1;
}

.item-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.item-card h4 {
    font-size: 16px;
    font-weight: 600;
    margin: 0;
    color: #333;
}

.item-card p {
    font-size: 14px;
    margin: 0;
    color: #666;
}

.item-card h4,
.item-card p {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.item-card-side {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.item-card-barcode {
    margin-top: 8px;
    font-size: 13px;
    color: #667085;
}

.item-card-addon-groups {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}

.item-card-flags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}

.item-card-flag {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 999px;
    background: #fff2d6;
    color: #8a5a00;
    font-size: 12px;
    font-weight: 600;
}

.item-card-flag-weight {
    background: #e6f4ea;
    color: #1f6f43;
}

.item-card-flag-tax {
    background: #fdecec;
    color: #b42318;
}

.item-card-addon-group {
    display: inline-flex;
    align-items: center;
    align-self: flex-start;
    padding: 4px 10px;
    border-radius: 999px;
    background: #f0f3f8;
    color: #3354a0;
    font-size: 12px;
    font-weight: 500;
    width: auto;
    max-width: fit-content;
    border: none;
    cursor: pointer;
    font-family: "Fredoka", sans-serif;
    white-space: nowrap;
    margin: 0;
}

.item-card-addon-group:hover {
    background: #e2e9f5;
}

.button-row {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.edit-button {
    flex: 1;
    background-color: #2c2c2c;
    color: white;
    border: none;
    border-radius: 50px;
    padding: 20px;
    font-weight: 500;
    font-size: 1.3rem;
}

.delete-button {
    flex: 1;
    background-color: #e74c3c;
    color: white;
    border: none;
    border-radius: 50px;
    padding: 15px;
    font-weight: 500;
    font-size: 1.3rem;
}

.edit-button:hover {
    background-color: #444;
}

.preview-category-name {
    display: block;
    text-align: center;
    font-size: 0.9rem;
    color: #888;
    margin-top: -5px;
    margin-bottom: 15px;
}

.preview-item-meta {
    gap: 8px;
    margin-bottom: 12px;
}

.preview-item-meta-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 16px;
    background: #f8fafc;
}

.preview-item-meta-label {
    color: #667085;
    font-size: 14px;
}

.preview-item-meta-value {
    color: #111827;
    font-size: 14px;
    font-weight: 600;
}

#previewDeleteItemButton {
    width: 90%;
    margin: 0 auto;
}


.add-new-item-btn {
    text-align: center;
    padding: 12px;
    margin: 0px auto;
    background-color: #f9f9f9;
    color: #a5a5a5;
    border-radius: 10px;
    font-weight: 500;
    border: 2px dashed #ccc;
    width: 100%;
    cursor: pointer;
    transition: background-color 0.2s;
}

.add-new-item-btn:hover {
    background-color: #eee;
}

.builder-list {
    display: flex;
    flex-direction: column;
    gap: 0px;
    width: 100%;
    min-height: 100%;
    box-sizing: border-box;
}

.builder-action-row {
    display: flex;
    gap: 12px;
    width: 100%;
    margin-top: auto;
    background: #fff;
    padding-top: 0;
    padding-bottom: 0;
}

.builder-action-btn {
    flex: 1 1 0;
    width: auto;
    margin: 0;
}

.category-list-row,
.builder-summary-card {
    width: 100%;
    background: #fff;
    border: 1px solid #e6eaf2;
    border-radius: 16px;
    padding: 18px 16px;
    box-shadow: 0 1px 6px rgba(0, 0, 0, 0.08);
    text-align: right;
}

.category-list-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    cursor: pointer;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.category-list-row:hover {
    border-color: #b8c8f2;
    box-shadow: 0 6px 18px rgba(51, 84, 160, 0.1);
    transform: translateY(-1px);
}

.category-list-row.active {
    border-color: #3354a0;
    background: #f5f8ff;
}

.category-list-main {
    min-width: 0;
    flex: 1;
}

.category-row-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 0 0 auto;
}

.group-row-settings-btn {
    width: 34px;
    height: 34px;
    margin: 0;
    flex: 0 0 auto;
    border-radius: 10px;
    background: #eef3ff;
    color: #3354a0;
    border: 1px solid #d6e1ff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
}

.group-row-settings-btn:hover {
    background: #dfe8ff;
}

html[dir="ltr"] .modal-content,
html[dir="ltr"] .builder-context,
html[dir="ltr"] .item-list-placeholder,
html[dir="ltr"] .empty-message,
html[dir="ltr"] .preview-category-name,
html[dir="ltr"] .modal-subtitle,
html[dir="ltr"] .wizard-book,
html[dir="ltr"] .addon-linking-label,
html[dir="ltr"] .addon-setting-description,
html[dir="ltr"] .category-list-row,
html[dir="ltr"] .builder-summary-card {
    text-align: left;
}

html[dir="ltr"] .sheet-header,
html[dir="ltr"] .item-card,
html[dir="ltr"] .category-list-row,
html[dir="ltr"] .group-header,
html[dir="ltr"] .group-row-actions,
html[dir="ltr"] .category-row-actions,
html[dir="ltr"] .wizard-step-actions,
html[dir="ltr"] .item-primary-row {
    direction: ltr;
}

.group-row-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 0 0 auto;
}

.assignment-mode-switch {
    display: flex;
    gap: 10px;
    margin-bottom: 16px;
}

.assignment-mode-btn {
    flex: 1;
    border: 1px solid #d6e1ff;
    background: #f5f8ff;
    color: #3354a0;
    border-radius: 16px;
    padding: 14px 16px;
    font-family: "Fredoka", sans-serif;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
}

.assignment-mode-btn.active {
    background: #3354a0;
    color: #fff;
    border-color: #3354a0;
}

.assignment-items-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 260px;
    overflow-y: auto;
    padding: 4px 0;
}

.assignment-item-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border-radius: 16px;
    border: 1px solid #e5e7eb;
    background: #fff;
    cursor: pointer;
}

.assignment-item-option input {
    width: 18px;
    height: 18px;
    margin: 0;
}

.assignment-item-option-main {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex: 1;
    min-width: 0;
}

.assignment-item-option-name {
    color: #22314f;
    font-size: 15px;
    font-weight: 500;
}

.assignment-item-option-price {
    color: #667085;
    font-size: 14px;
    white-space: nowrap;
}

.category-settings-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 16px;
}

.category-settings-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    border-radius: 16px;
    border: 1px solid #e5e7eb;
    background: #fff;
    color: #22314f;
    font-size: 15px;
    font-weight: 500;
}

.category-settings-option input {
    width: 18px;
    height: 18px;
    margin: 0;
}

.category-filter-suggestions {
    margin-top: 8px;
    border: 1px solid #d8d8d8;
    border-radius: 12px;
    background: #fff;
    max-height: 180px;
    overflow-y: auto;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.08);
}

.category-filter-suggestion {
    width: 100%;
    border: 0;
    background: transparent;
    text-align: right;
    padding: 10px 12px;
    cursor: pointer;
    font: inherit;
    color: inherit;
}

.category-filter-suggestion:hover {
    background: #f5f5f5;
}

.category-list-title {
    margin: 0 0 6px;
    color: #22314f;
    font-size: 18px;
    font-weight: 600;
}

.category-list-meta {
    color: #7a8599;
    font-size: 14px;
}

.category-list-flags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.builder-summary-card h4 {
    margin: 0 0 8px;
    color: #22314f;
    font-size: 18px;
}

.builder-summary-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 10px;
}

.builder-summary-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 5px 10px;
    border-radius: 999px;
    background: #eef3ff;
    color: #3354a0;
    font-size: 12px;
    font-weight: 600;
}

.builder-summary-card p {
    margin: 0;
    color: #667085;
    font-size: 14px;
    line-height: 1.5;
}

.builder-summary-options {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.builder-option-chip {
    padding: 6px 10px;
    border-radius: 12px;
    background: #f6f8fb;
    color: #334155;
    font-size: 13px;
}

.builder-addon-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    direction: rtl;
    text-align: right;
}

.builder-addon-main {
    min-width: 0;
}

.builder-addon-title {
    margin: 0 0 4px;
    color: #22314f;
    font-size: 17px;
    font-weight: 600;
}

.builder-addon-subtitle {
    color: #7a8599;
    font-size: 14px;
}

.builder-addon-price {
    flex-shrink: 0;
    color: #3354a0;
    font-size: 15px;
    font-weight: 700;
}

#addonSettingsModal .form-wrapper>.form-group {
    display: none;
}

.addon-setting-option {
    width: 100%;
    border: 1px solid #e6eaf2;
    border-radius: 14px;
    padding: 14px 16px;
    background: #fafcff;
}

.addon-setting-label {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #22314f;
    font-size: 16px;
    font-weight: 600;
}

.addon-setting-label input {
    width: 18px;
    height: 18px;
    padding: 0;
    margin: 0;
}

.addon-setting-description {
    margin: 8px 0 0;
    color: #667085;
    font-size: 14px;
    line-height: 1.5;
}

.addon-setting-input {
    margin-top: 10px;
    padding: 12px 14px;
    border-radius: 12px;
    font-size: 15px;
}

@media (max-width: 640px) {

    .category-list-row,
    .builder-addon-row {
        align-items: flex-start;
    }

    .builder-addon-row {
        flex-direction: column;
    }
}

.group-meta {
    font-size: 13px;
    color: #666;
    display: flex;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 8px;
    align-items: center;
}

.required-badge {
    background: #a10000;
    color: white;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 12px;
}

.choice-limit {
    font-size: 12px;
    color: #444;
}

.bulk-item-row {
    display: flex;
    gap: 8px;
    margin-bottom: 6px;
    direction: rtl;
}

.bulk-name-input {
    flex: 3;
    padding: 8px 10px;
    border: 1px solid #ccc;
    border-radius: 8px;
    font-size: 15px;
    font-family: 'Fredoka', sans-serif;
}

.bulk-price-input {
    flex: 1;
    padding: 8px 6px;
    border: 1px solid #ccc;
    border-radius: 8px;
    font-size: 15px;
    font-family: 'Fredoka', sans-serif;
    text-align: center;
}

.bulk-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 10px;
    direction: rtl;
}

.bulk-row-controls {
    display: flex;
    gap: 8px;
}

.bulk-row-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    background-color: #e0e0e0;
    color: #333;
    display: flex;
    align-items: center;
    justify-content: center;
}

.bulk-row-btn:hover {
    background-color: #c8c8c8;
}

.bulk-add-error {
    color: #dc3545;
    font-size: 14px;
    margin-top: 6px;
}

.bulk-add-error.hidden {
    display: none;
}

.custom-toast {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background-color: #28a745;
    /* default green */
    color: #fff;
    padding: 12px 20px;
    border-radius: 8px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.2);
    opacity: 0;
    pointer-events: none;
    transform: translateY(20px);
    transition: all 0.3s ease;
    z-index: 9999;
    font-size: 16px;
}

.custom-toast.show {
    opacity: 1;
    transform: translateY(0);
}

.custom-toast.error {
    background-color: #dc3545;
    /* red */
}

.unsaved-modal-content {
    text-align: center;
    direction: rtl;
}

.unsaved-modal-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 20px;
}

.unsaved-save-btn {
    background-color: #4B7BEC;
    color: #fff;
    border: none;
    border-radius: 25px;
    padding: 12px;
    font-size: 16px;
    font-family: 'Fredoka', sans-serif;
    cursor: pointer;
    width: 100%;
}

.unsaved-leave-btn {
    background-color: transparent;
    color: #dc3545;
    border: 1.5px solid #dc3545;
    border-radius: 25px;
    padding: 12px;
    font-size: 16px;
    font-family: 'Fredoka', sans-serif;
    cursor: pointer;
    width: 100%;
}

.unsaved-cancel-btn {
    background-color: transparent;
    color: #888;
    border: none;
    font-size: 15px;
    font-family: 'Fredoka', sans-serif;
    cursor: pointer;
    padding: 6px;
}

.confirm-save-btn {
    background-color: #333;
    color: #fff;
    font-weight: bold;
    padding: 12px 24px;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    font-size: 16px;
}

.modal-subtitle {
    font-size: 15px;
    color: #555;
    margin: 10px 0 20px;
    text-align: center;
}

/* נ“ Wizard Guide Modal */
#wizardGuideModal .modal-content {
    max-width: 620px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 26px;
    border-radius: 24px;
    background: linear-gradient(180deg, #fffdf7 0%, #ffffff 100%);
    direction: rtl;
    font-family: 'Fredoka', sans-serif;
    box-shadow: 0 24px 60px rgba(26, 33, 52, 0.16);
}

.wizard-book {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.wizard-book-header {
    padding: 6px 4px 0;
}

.wizard-book-kicker {
    display: inline-block;
    margin-bottom: 8px;
    padding: 6px 12px;
    border-radius: 999px;
    background: #eef3ff;
    color: #3354a0;
    font-size: 13px;
    font-weight: 600;
}

.wizard-book-header h3 {
    margin: 0 0 8px;
    color: #1f2a44;
    font-size: 1.9rem;
    line-height: 1.2;
}

.wizard-book-header p {
    margin: 0;
    color: #5d687d;
    font-size: 1rem;
    line-height: 1.7;
}

.wizard-step-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.wizard-step-chip {
    width: auto !important;
    margin: 0 !important;
    padding: 10px 14px !important;
    border-radius: 999px !important;
    border: 1px solid #d7dfef !important;
    background: #fff !important;
    color: #50607e !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    cursor: pointer;
}

.wizard-step-chip.active {
    background: #2f4d8f !important;
    color: #fff !important;
    border-color: #2f4d8f !important;
}

.wizard-step-card {
    border-radius: 22px;
    padding: 22px;
    background: #fff;
    border: 1px solid #eceff5;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.wizard-step-counter {
    display: inline-flex;
    align-items: baseline;
    gap: 4px;
    margin-bottom: 12px;
    color: #3354a0;
    font-weight: 600;
}

#wizardStepIndex {
    font-size: 2rem;
    line-height: 1;
}

#wizardStepTotal {
    font-size: 1rem;
}

.wizard-step-card h4 {
    margin: 0 0 10px;
    color: #1f2a44;
    font-size: 1.5rem;
}

.wizard-step-card p {
    margin: 0;
    color: #434f66;
    font-size: 1rem;
    line-height: 1.9;
}

.wizard-step-actions {
    display: flex;
    gap: 12px;
}

.wizard-nav-btn,
.wizard-finish-btn {
    border: none;
    border-radius: 16px;
    padding: 14px 18px;
    font-size: 1rem;
    font-family: 'Fredoka', sans-serif;
    cursor: pointer;
}

.wizard-nav-btn {
    flex: 1;
    background: #2f4d8f;
    color: #fff;
}

.wizard-nav-secondary {
    background: #eef2f8;
    color: #30415f;
}

.wizard-nav-btn:disabled {
    opacity: 0.45;
    cursor: default;
}

.wizard-finish-btn {
    width: 100%;
    background: #222;
    color: #fff;
}

html.i18n-pending body {
    visibility: hidden;
}
