/* Admin page styles. Keep comments minimal: rationale, a11y, print, integration, magic numbers. */

.stolik-admin-wrap,
.stolik-admin-wrap *,
.stolik-menu-wrapper,
.stolik-menu-wrapper * {
    box-sizing: border-box;
}

#menu-items-list-section {
    max-width: 100%;
    overflow-x: hidden;
}

.stolik-table-responsive-wrapper {
    max-width: 100%;
    box-sizing: border-box;
}

/* Layout shell */
.stolik-wrap {
    /* layout contract */
    --layout-gap: 10px;
    --gutter-x: 5px;
    --gutter-y: 10px;
    --editor-min: 280px;
    --editor-max-pct: 25%;
    --z-dropdown: 30;
    --color-border-soft: #f1f5f9;
    --thead-bg: #f8f9fb;
    --editor-inner-pad-x: 6px;

    margin-top: 20px; width:100%; max-width:100%; margin-left:0; margin-right:0; overflow-x:hidden; scrollbar-gutter: stable;
}
/* Stabilize scrollbar gutter without forcing a root scrollbar */
html.wp-toolbar { scrollbar-gutter: stable; }
@media (max-width:1024px){ .stolik-wrap { padding-right:5px; } }
/* Sort header tooltip */
.stolik-sort-tip-wrapper { display:flex; justify-content:center; }
.stolik-header {
    display: flex;
    flex-wrap: wrap; /* CRITICAL: Allow notice to wrap to full width */
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    position: relative;
}
.stolik-header--compact { margin-bottom: 14px; }
.stolik-header-actions { display:flex; align-items:center; gap:12px; flex-wrap:wrap; }
/* Bulletproof fallback: If ANY notice ends up inside header, force wrap and full width */
.stolik-header .stolik-notice {
    flex: 0 0 100%;
    order: 10; /* Push it below the title and buttons */
    margin-top: 15px;
}
.stolik-shortcode-copy { display:flex; align-items:center; gap:6px; }
.stolik-shortcode-wrapper { position:relative; }
.stolik-shortcode-code {
    display:inline-block;
    padding:4px 8px;
    background:#f3f4f6;
    border:1px solid #d0d7de;
    border-radius:4px;
    font-size:12px;
    cursor:text;
}
.stolik-shortcode-copy-button { margin-left:4px; }
.stolik-shortcode-tip { font-size:11px; color:#555; line-height:1.2; max-width:180px; }
.stolik-hidden { display:none; }
/* Utilities: shared text, badges, tooltips, states */
.stolik-text-error { color:#b32d2e; }
.stolik-text-success { color:#15803d; }
.stolik-text-muted { color:#555; }
.stolik-text-info { color:#2271b1; }
.stolik-text-xs { font-size:11px; }
.stolik-text-sm { font-size:12px; }
.stolik-text-semibold { font-weight:600; }

.stolik-badge { display:inline-flex; align-items:center; gap:3px; padding:2px 6px; border-radius:12px; font-size:11px; font-weight:600; line-height:1; }
.stolik-badge-success { background:#10b981; color:#fff; }
.stolik-badge-error { background:#b32d2e; color:#fff; }

.stolik-tooltip { position:absolute; z-index:9999; background:#d63638; color:#fff; padding:6px 14px; border-radius:4px; font-size:14px; box-shadow:0 2px 8px rgba(0,0,0,0.15); }
.stolik-is-busy { opacity:0.5; }
.stolik-row-odd td { background-color:#fff; }
.stolik-row-even td { background-color:#f6f7f8; }
.stolik-disabled-section { opacity:0.5; pointer-events:none; }

.stolik-flex-row { display:flex; flex-wrap:wrap; align-items:center; gap:8px; }
.stolik-flex-col { display:flex; flex-direction:column; gap:4px; }
.stolik-mt-10 { margin-top:10px; }
.stolik-opacity-70 { opacity:.7; }

.stolik-label-small { position:absolute; bottom:100%; left:50%; transform:translate(-50%, -4px); font-size:10px; line-height:1; font-weight:600; color:#111827; background:transparent; padding:0; pointer-events:none; user-select:none; }
.stolik-lang-select { min-width:140px; margin-left:6px; }
.stolik-cat-change-badge { display:none; font-size:10px; margin-left:6px; align-self:flex-start; color:#d63638; }
.stolik-inline-flash { display:inline-flex; align-items:center; letter-spacing:.2px; }
.stolik-translation-indicator { margin-right:6px; background:#eef6ff; color:#0369a1; cursor:default; }
/* Table header base background */
.stolik-list-column table thead { background:var(--thead-bg, #f8f9fb); }
/* Subtle shadow line */
.stolik-list-column table thead th { background:inherit; box-shadow: inset 0 -1px 0 rgba(0,0,0,0.08); }
/* Safety: keep header above via natural flow only */
tbody#menu-items-list td { position:relative; z-index:1; }
.stolik-admin-title-with-icon { display:flex; align-items:center; gap:10px; font-size:24px; margin:0; line-height:1.2; }
.stolik-admin-icon { display:inline-flex; width:34px; height:34px; align-items:center; justify-content:center; }
.stolik-admin-icon svg { display:block; width:34px; height:34px; }
.stolik-main-layout { display:flex; column-gap:var(--layout-gap, 10px); gap:var(--layout-gap, 10px); flex-wrap:nowrap; align-items:flex-start; }
/* Editor column base; desktop specifics in @media ≥1025px */
.stolik-editor-column { flex: 0 1 var(--editor-min, 280px); min-width: var(--editor-min, 280px); max-width: 480px; }
.stolik-list-column { flex:1 1 auto; min-width:0; }
/* Allow children to shrink within flex */
.stolik-editor-column > *,
.stolik-list-column > * { min-width: 0; }
/* Ensure list wrapper uses full width and stable scrollbar space */
#menu-items-list-section{ overflow-y:visible; overflow-x:hidden; scrollbar-gutter: stable; }
#menu-items-list-section table.wp-list-table{ table-layout:fixed; width:100%; }
.stolik-translation-mode #menu-items-list-section{ overflow-y:visible; overflow-x:hidden; }
.stolik-translation-mode #menu-items-list-section table.wp-list-table{ width:100%; table-layout:auto; }
.stolik-table-responsive-wrapper { width: 100%; max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; box-sizing: border-box; margin-bottom: 15px; }
.stolik-table-responsive-wrapper table.wp-list-table { display: table; width: 100%; }
#menu-items-list-section table.wp-list-table { table-layout: auto !important; width: 100%; }
#menu-items-list-section th.column-image { width: 60px; text-align: center; }
#menu-items-list-section th.column-price,
#menu-items-list-section th[data-sort="price"] { width: 90px; }
#menu-items-list-section th.column-status,
#menu-items-list-section th[data-sort="status"] { width: 80px; }
#menu-items-list-section th.column-actions { width: 140px; }
/* Prevent base-language flash in translation mode until overlays apply */
.stolik-translation-mode #menu-items-list-section.stolik-translations-pending{ visibility:hidden; }
/* Hide base-only controls in translation mode */
.stolik-translation-mode .category-section,
.stolik-translation-mode #show-add-category-form,
.stolik-translation-mode #manage-categories-button,
.stolik-translation-mode .add-category-form,
.stolik-translation-mode .stolik-translation-indicator,
.stolik-translation-mode #add-item-button { display:none !important; }

/* Translation Mode: UI & visibility */
.stolik-translation-controls{ align-items:flex-start; }
.stolik-translation-controls select option{ font-family:inherit; }
.stolik-translation-controls{ margin:8px 0 10px; display:flex; flex-direction:column; gap:6px; }
.stolik-translation-controls-row{ display:flex; align-items:flex-end; flex-wrap:wrap; gap:16px; }
.stolik-translation-lang-block{ display:flex; flex-direction:column; width:100%; min-width:0; }
.stolik-translation-lang-label{ font-weight:600; margin-bottom:5px; }
.stolik-translation-lang-select-wrapper select{ width:100%; max-width:100%; padding:4px 6px; }
.stolik-translation-fallback-note{ font-size:12px; color:#555; margin-top:4px; width:100%; }
.stolik-translation-controls .stolik-inline-actions{ order:2; justify-content:flex-end; width:100%; }
.stolik-translate-instruction{ margin:6px 0 12px; color:#555; }
.stolik-translation-mode-badge .stolik-flag{ display:inline-flex; align-items:center; justify-content:center; width:28px; height:22px; border-radius:4px; overflow:hidden; }
.stolik-translation-mode-badge .stolik-flag .stolik-flag-emoji{ display:block; width:100%; height:100%; }
.stolik-translation-mode-badge .stolik-flag .stolik-flag-emoji--globe{ display:flex; align-items:center; justify-content:center; font-size:16px; }
.stolik-lang-custom{ position:relative; display:inline-block; min-width:260px; }
.stolik-lang-custom button.stolik-lang-current{ display:inline-flex; align-items:center; gap:6px; padding:4px 10px; border:1px solid #ccd0d4; background:#fff; cursor:pointer; border-radius:4px; min-height:32px; min-width:260px; justify-content:flex-start; }
.stolik-lang-custom .stolik-lang-list{ position:absolute; z-index:var(--z-dropdown, 30); top:100%; left:0; margin:4px 0 0; list-style:none; padding:4px 0; background:#fff; border:1px solid #ccd0d4; border-radius:4px; min-width:260px; max-height:260px; overflow:auto; box-shadow:0 3px 8px rgba(0,0,0,.12); display:none; }
.stolik-lang-custom .stolik-lang-list li{ padding:4px 10px; display:flex; align-items:center; gap:8px; cursor:pointer; font-size:13px; line-height:1.3; }
.stolik-lang-custom .stolik-lang-list li:hover{ background:#f0f6ff; }
.stolik-lang-flag{ width:20px; text-align:center; font-family:"Segoe UI Emoji","Apple Color Emoji","Noto Color Emoji",sans-serif; }
.stolik-lang-status{ opacity:.75; font-size:11px; margin-left:auto; }
.stolik-lang-custom.open .stolik-lang-list{ display:block; }
.stolik-inline-exit-btn{ margin-left:12px; }
.stolik-translation-controls .stolik-inline-actions{ margin-left:auto; display:flex; gap:8px; align-items:center; }

.stolik-editor-column .stolik-translation-controls{
    width:100%;
    max-width:100%;
    box-sizing:border-box;
}
.stolik-translation-lang-select-wrapper{
    display:block;
    width:100%;
    max-width:100%;
    position:relative;
}
.stolik-translation-controls .stolik-translation-lang-block{
    display:flex;
    flex-direction:column;
    width:100%;
    min-width:0;
}
.stolik-translation-lang-select-wrapper .select2-container{
    width:100% !important;
    max-width:100% !important;
    display:block;
    box-sizing:border-box;
}
.stolik-translation-lang-select-wrapper .select2-selection{
    width:100% !important;
    box-sizing:border-box;
    height:auto !important;
    padding-top:8px;
    padding-bottom:8px;
    min-height:44px;
    padding-right:42px;
    padding-left:12px;
}
.stolik-translation-lang-select-wrapper .select2-selection__rendered{
    display:flex !important;
    align-items:flex-start;
    gap:8px;
    width:100% !important;
    max-width:100%;
    min-width:0;
    padding:0;
    overflow:hidden !important;
}
.stolik-translation-lang-select-wrapper .stolik-locale-selection{
    display:flex;
    align-items:flex-start;
    gap:8px;
    width:100%;
    min-width:0;
}
.stolik-translation-lang-select-wrapper .stolik-locale-label{
    display:flex;
    flex-direction:column;
    gap:2px;
    flex:1 1 auto;
    min-width:0;
    white-space:normal;
    overflow-wrap:anywhere;
}
.stolik-translation-lang-select-wrapper .stolik-locale-label-line{
    display:block;
    min-width:0;
    line-height:1.25;
}
.stolik-translation-lang-select-wrapper .stolik-locale-label-main{
    font-weight:600;
}
.stolik-translation-lang-select-wrapper .stolik-locale-label-status{
    font-size:12px;
    color:#475569;
    opacity:.85;
}
.stolik-manage-lang-btn{
    display:table;
    margin-top:12px !important;
    margin-left:0 !important;
    margin-right:auto !important;
    width:auto;
    max-width:100%;
    align-self:flex-start;
}

.stolik-add-language-btn{
    display:none;
    margin-top:10px !important;
    margin-left:0 !important;
    margin-right:auto !important;
    width:auto;
    max-width:100%;
    align-self:flex-start;
}

/* Language dropdown full-width inside editor */
.stolik-editor-column .stolik-lang-custom{ width:100%; min-width:0 !important; }
.stolik-editor-column .stolik-lang-custom button.stolik-lang-current{ width:100%; justify-content:space-between; min-width:0 !important; }
.stolik-editor-column .stolik-lang-custom .stolik-lang-list{ width:100% !important; min-width:0 !important; max-width:100% !important; left:0; right:auto; }

/* Category select full-width (Select2 consolidated below) */

/* Translation notice */
.stolik-translation-notice-wrapper{ margin:6px 0 14px; display:block; width:100%; clear:both; }
.notice.stolik-translation-restrictions{ margin:0; }
.notice.stolik-translation-restrictions p{ margin:.5em 0; line-height:1.4; }

/* Downgrade notice: keep dismiss button inside the banner */
.notice.stolik-downgrade-global{ position:relative; padding-right:32px; }
.notice.stolik-downgrade-global .notice-dismiss{ position:absolute; top:8px; right:8px; }

/* Translation context bar */
.stolik-translation-context{ margin:0 0 18px; display:flex; flex-direction:column; gap:12px; }
.stolik-translation-context-row{ display:flex; align-items:center; gap:14px; flex-wrap:wrap; position:relative; }
.stolik-inline-exit-btn, .stolik-exit-translation-btn{ font-weight:600; }
.stolik-translation-mode-badge{ background:#eef6ff; border:1px solid #cce1f5; padding:6px 12px; border-radius:6px; font-weight:600; display:inline-flex; align-items:center; gap:8px; }
.stolik-translation-context-row .stolik-delete-locale-translations{
    margin-left:auto;
    background:#dc2626 !important;
    border-color:#b91c1c !important;
    color:#fff !important;
    box-shadow:none !important;
}
.stolik-translation-context-row .stolik-delete-locale-translations:hover,
.stolik-translation-context-row .stolik-delete-locale-translations:focus{
    background:#b91c1c !important;
    border-color:#991b1b !important;
    color:#fff !important;
}
.stolik-translation-context-row .stolik-delete-locale-translations:disabled,
.stolik-translation-context-row .stolik-delete-locale-translations[disabled]{
    background:#ef4444 !important;
    border-color:#dc2626 !important;
    color:#fff !important;
    opacity:.85;
    cursor:not-allowed;
}

/* Menu title translation block */
.stolik-menu-title-translation{ display:flex; flex-direction:column; gap:6px; max-width:560px; }
.stolik-menu-title-translation label{ font-weight:600; }
.stolik-menu-title-translation .stolik-title-row{ position:relative; display:flex; align-items:center; gap:10px; max-width:620px; flex-wrap:wrap; }
.stolik-menu-title-translation .stolik-title-input-wrap{ position:relative; flex:1; }
#stolik-menu-title-translation-input{ width:100%; padding-right:36px; }
.stolik-title-copy-inside{ position:absolute; right:6px; top:50%; transform:translateY(-50%); border:none; background:transparent; padding:2px; cursor:pointer; line-height:1; z-index:2; }
.stolik-title-copy-inside .dashicons{ font-size:18px; width:18px; height:18px; }
.stolik-title-copy-inside.success,
.stolik-title-copy-inside.success .dashicons{ color:#2ecc71; }
.stolik-title-copy-inside.success::after{ content:'\2713'; font-weight:600; font-size:13px; margin-left:4px; color:#10b981; }
#stolik-menu-title-translation-input{ flex:1; min-width:260px; }
.stolik-menu-title-translation .description{ margin:0; font-size:12px; color:#555; }
.stolik-menu-title-translation .stolik-menu-title-translation-feedback{ font-size:12px; color:#2271b1; display:none; }
.stolik-menu-title-translation .stolik-menu-title-translation-feedback.stolik-text-success{ color:#15803d; }
.stolik-menu-title-translation .stolik-menu-title-translation-feedback.stolik-text-error{ color:#b32d2e; }
.stolik-menu-title-translation .stolik-menu-title-translation-feedback.stolik-text-muted{ color:#555; }

/* Category translation section (migrated from inline) */
.stolik-category-translation-wrapper{ margin-top:28px; }
.stolik-category-translation-wrapper h2{ margin-top:0; display:flex; align-items:center; gap:12px; }
.stolik-system-label-translation-wrapper{ margin-top:18px; }
.stolik-system-label-translation-wrapper h2{ margin-top:0; display:flex; align-items:center; gap:12px; }
.stolik-open-cat-translation,
.stolik-open-system-label-translation{ margin-left:auto; }
.stolik-cat-translation-panel,
.stolik-system-label-translation-panel{ display:none; border:1px solid #d0d7de; background:#fff; padding:16px 16px 18px; border-radius:6px; max-width:760px; }
.stolik-cat-translation-panel p,
.stolik-system-label-translation-panel p{ margin-top:0; font-size:13px; color:#444; }
.stolik-cat-translation-list,
.stolik-system-label-translation-list{ display:flex; flex-direction:column; gap:12px; max-height:340px; overflow:auto; position:relative; }
.stolik-cat-translation-panel .stolik-cat-translation-list .stolik-cat-tr-row,
.stolik-system-label-translation-panel .stolik-system-label-translation-list .stolik-cat-tr-row{ width:100%; }
.stolik-cat-translation-panel .stolik-cat-translation-list .stolik-cat-tr-row input.regular-text,
.stolik-system-label-translation-panel .stolik-system-label-translation-list .stolik-cat-tr-row input.regular-text{
    box-sizing:border-box;
    max-width:calc(100% - 5px) !important;
    width:calc(100% - 5px);
}
.stolik-cat-translation-loading{ font-size:13px; color:#555; }
.stolik-cat-translation-actions,
.stolik-system-label-translation-actions{ margin-top:18px; display:flex; gap:10px; flex-wrap:wrap; align-items:center; }
.stolik-cat-translation-feedback,
.stolik-system-label-translation-feedback{ font-size:12px; color:#2271b1; display:none; margin-left:0; align-self:flex-start; flex:1 1 100%; }
.stolik-cat-translation-actions .button,
.stolik-system-label-translation-actions .button{ max-width:100%; white-space:normal; }
/* Spacing between Save/Cancel in Manage Categories inline edit */
.stolik-cat-edit-actions .button + .button{ margin-left:8px; }

/* Image uploader helpers */
.stolik-upload-hint{ font-size:11px; color:#555; margin-top:10px; }
.stolik-admin-page .image-preview-wrapper{ display:none; position:absolute; inset:0; }

/* Category form controls */
.stolik-manage-categories-button{ margin-left:10px; }
.add-category-form{ display:none; }

/* Hide Category Order in translation mode */
.stolik-translation-mode .stolik-category-order-section{ display:none !important; }
/* Column widths via colgroup; center headers */
#menu-items-list-section thead th{ text-align:center; vertical-align:middle; }
.stolik-th-center{ text-align:center; }
.stolik-vmiddle{ vertical-align:middle; }
.stolik-nowrap{ white-space:nowrap; }
/* Row cells alignment */
#menu-items-list-section tbody td{ vertical-align:middle; }
/* Image column */
.wp-list-table .column-image{ text-align:center; width:84px; }
.wp-list-table .column-image img{ max-width:64px; max-height:48px; object-fit:cover; border-radius:4px; display:inline-block; }
/* Name & Description takes remaining space */
#menu-items-list-section td.item-info-cell{ width:auto; }
#menu-items-list-section td.item-info-cell strong{ display:inline-flex; align-items:center; gap:6px; }
#menu-items-list-section td.item-info-cell p{ margin:4px 0 0; color:#444; }
#menu-items-list-section td.item-info-cell .stolik-admin-item-title-row{
    display:flex;
    align-items:flex-start;
    justify-content:space-between;
    gap:10px;
}
#menu-items-list-section td.item-info-cell .stolik-admin-item-name-wrap{
    display:inline-flex;
    align-items:flex-start;
    min-width:0;
}
#menu-items-list-section td.item-info-cell .stolik-admin-item-name-wrap .stolik-translation-indicator{
    margin-left:8px !important;
    margin-right:0 !important;
    flex:0 0 auto;
}
#menu-items-list-section td.item-info-cell .stolik-admin-likes-preview{
    display:inline-flex;
    align-items:center;
    gap:4px;
    color:var(--stolik-accent-color, #9f1239);
    font-size:12px;
    line-height:1;
    opacity:.9;
}
#menu-items-list-section td.item-info-cell .stolik-admin-like-icon{
    font-size:12px;
}
#menu-items-list-section td.item-info-cell .stolik-admin-item-meta-row{
    display:flex;
    align-items:center;
    gap:12px;
    flex-wrap:wrap;
    margin-top:6px;
    font-size:12px;
    line-height:1.3;
    color:#6b7280;
}
#menu-items-list-section td.item-info-cell .stolik-admin-item-meta-module{
    display:inline-flex;
    align-items:center;
    gap:6px;
    min-width:0;
}
#menu-items-list-section td.item-info-cell .stolik-admin-meta-icon{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    width:1em;
    line-height:1;
    color:currentColor;
    opacity:.8;
}
#menu-items-list-section td.item-info-cell .stolik-admin-meta-icon.allergens-icon{
    font-weight:400;
    opacity:.62;
}
/* Aggressive wrapping inside Name & Description to prevent overflow */
#menu-items-list-section td.item-info-cell{
    white-space: normal;
    overflow-wrap: anywhere; /* modern, allows breaking long tokens */
    word-break: break-word;  /* safe fallback for older engines */
}
/* Small gap between thumbnail and text */
#menu-items-list-section td.item-info-cell { padding-left:5px; }
/* Price column */
#menu-items-list-section td.column-price, #menu-items-list-section th[data-sort="price"]{ text-align:center; white-space:nowrap; width:120px; }
/* Status column */
#menu-items-list-section th[data-sort="status"], #menu-items-list-section td .stolik-status-toggle{ text-align:center; }
#menu-items-list-section td .stolik-status-toggle{ display:inline-block; }
/* Actions column */
#menu-items-list-section td.column-actions{
    white-space: normal;
}
.stolik-actions-wrapper {
    display: flex;
    align-items: center;
    gap: 6px 8px;
    justify-content: flex-end;
    flex-wrap: wrap !important;
    white-space: normal;
    max-width: 100%;
}
#menu-items-list-section th.column-actions,
#menu-items-list td.column-actions {
    width: 176px !important;
    min-width: 176px !important;
}
#menu-items-list-section td.column-actions .stolik-actions-wrapper .edit-item-btn,
#menu-items-list-section td.column-actions .stolik-actions-wrapper .delete-item-btn {
    flex: 1 1 calc(50% - 8px);
    min-width: 74px;
    text-align: center;
}
#menu-items-list-section td.column-actions .stolik-actions-wrapper .js-toggle-featured,
#menu-items-list-section td.column-actions .stolik-actions-wrapper .js-toggle-sold-out {
    flex: 0 0 auto;
}
#menu-items-list-section td.column-actions .button, #menu-items-list-section td.column-actions .button-link{ vertical-align:middle; }
#menu-items-list tr.is-sold-out-row td {
    background-color: #fffbeb !important;
    opacity: 0.85;
}
#menu-items-list td.column-actions .js-toggle-sold-out .dashicons {
    color: #16a34a;
}
#menu-items-list td.column-actions .js-toggle-sold-out.is-active {
    color: #d97706;
    font-weight: 700;
}
#menu-items-list td.column-actions .js-toggle-sold-out.is-active .dashicons {
    color: #d97706 !important;
}
/* Featured star colors */
#menu-items-list-section td.column-actions .js-toggle-featured .dashicons-star-filled{ color:#f59e0b !important; }
#menu-items-list-section td.column-actions .js-toggle-featured .dashicons-star-empty{ color:#cbd5e1 !important; }
/* Category header rows */
#menu-items-list tr.stolik-category-header td{ text-align:center; font-weight:600; background:#f8fafc; }
/* Responsive rules */
@media (max-width:1250px){ .stolik-editor-column { flex-basis:400px; } #menu-items-list th.sortable[data-sort="name"], #menu-items-list td.item-info-cell { min-width:0; } }
@media (max-width:1120px){ .stolik-editor-column { flex-basis:360px; } #menu-items-list th.sortable[data-sort="name"], #menu-items-list td.item-info-cell { min-width:0; } }
@media (max-width: 782px){
    .stolik-main-layout { flex-direction:column; gap:16px; }
    .stolik-editor-column,
    .stolik-list-column { flex:1 1 auto; width:100%; max-width:100%; min-width:0; }
    .stolik-wrap,
    .stolik-admin-wrap,
    .stolik-menu-wrapper { max-width:100%; overflow-x:hidden; }
    #menu-items-list-section,
    .stolik-table-responsive-wrapper { max-width:100%; width:100%; overflow-x:auto; }
    #menu-items-list-section table.wp-list-table { min-width:640px; }
}
@media (min-width: 783px) and (max-width:1024px){
    .stolik-main-layout { flex-direction:column; gap:32px; }
    .stolik-editor-column, .stolik-list-column { flex:1 1 auto; width:100%; max-width:100%; }
    /* Keep Name & Description dominant */
    #menu-items-list-section th.sortable[data-sort="name"],
    #menu-items-list-section td.item-info-cell { min-width: 58% !important; width:auto; }

    /* Tighter caps for supporting columns (tablet) */
    #menu-items-list-section th.column-image,
    #menu-items-list-section td.column-image { width: 56px !important; }

    #menu-items-list-section th.sortable[data-sort="price"],
    #menu-items-list-section td.column-price { width: 29px !important; min-width:29px !important; white-space: nowrap; text-align:center; }

    #menu-items-list-section th.sortable[data-sort="status"],
    #menu-items-list-section td.column-status { width: 36px !important; min-width:36px !important; text-align:center; }

    #menu-items-list-section th.column-actions,
    #menu-items-list-section td.column-actions { width: 60px !important; max-width: 60px !important; white-space: normal; }
    #menu-items-list-section td.column-actions .stolik-actions-wrapper { flex-wrap: nowrap !important; row-gap: 0; column-gap: 6px; }
    /* Remove horizontal padding so target widths are exact */
    #menu-items-list-section th.sortable[data-sort="price"],
    #menu-items-list-section td.column-price,
    #menu-items-list-section th.sortable[data-sort="status"],
    #menu-items-list-section td.column-status,
    #menu-items-list-section th.column-actions,
    #menu-items-list-section td.column-actions { padding-left: 0 !important; padding-right: 0 !important; }
}

/* Two-column 30%/70% split on desktop */
@media (min-width: 1025px){
    .stolik-main-layout{ flex-wrap: nowrap; }
    /* Account for horizontal gap between columns */
    .stolik-editor-column{ flex: 0 0 var(--editor-max-pct, 25%); max-width: var(--editor-max-pct, 25%); min-width: var(--editor-min, 280px); }
    .stolik-list-column{ flex: 1 0 calc(73% - var(--layout-gap, 10px)); max-width: calc(73% - var(--layout-gap, 10px)); min-width: 500px; }
    /* Flexible widths for non-name columns to prevent cutting and share shrinkage */
    #menu-items-list th.column-drag,
    #menu-items-list td.column-drag { width: clamp(20px, 2vw, 28px); }

    #menu-items-list th.column-image,
    #menu-items-list td.column-image { width: clamp(56px, 6vw, 84px); }

    #menu-items-list th.sortable[data-sort="price"],
    #menu-items-list td.column-price { width: clamp(40px, 5vw, 80px); white-space: nowrap; }

    #menu-items-list th.sortable[data-sort="status"],
    #menu-items-list td.column-status { width: clamp(56px, 6vw, 100px); }

    #menu-items-list th.column-actions,
    #menu-items-list td.column-actions { width: clamp(96px, 12vw, 180px); min-width: 0; }

    /* Allow actions to wrap */
    #menu-items-list td.column-actions .item-actions { flex-wrap: wrap; row-gap: 4px; column-gap: 6px; }

    /* Let Name & Description take the remaining space */
    #menu-items-list th.sortable[data-sort="name"],
    #menu-items-list td.item-info-cell { min-width: 0; }
}
/* Desktop wide screens */
@media (min-width: 1400px){
    /* Allow auto layout for more natural column distribution on wide screens */
    #menu-items-list-section table.wp-list-table{ table-layout:auto !important; }

    /* Name & Description gets majority of horizontal space */
    #menu-items-list-section th.sortable[data-sort="name"],
    #menu-items-list-section td.item-info-cell{ width:56% !important; min-width:56% !important; }

    /* Cap supporting columns so they don't dominate */
    #menu-items-list-section th.sortable[data-sort="price"],
    #menu-items-list-section td.column-price{ width:80px !important; max-width:90px; white-space:nowrap; }

    #menu-items-list-section th.sortable[data-sort="status"],
    #menu-items-list-section td.column-status{ width:100px !important; max-width:110px; }

    #menu-items-list-section th.column-actions,
    #menu-items-list-section td.column-actions{ width:160px !important; max-width:180px; white-space:normal; }
    #menu-items-list-section td.column-actions .item-actions{ flex-wrap:wrap; row-gap:4px; column-gap:6px; }
}
/* Main Layout */
.stolik-wrap h1 { color: #d54e21; margin: 0; }
.stolik-wrap h2 { padding-bottom: 10px; border-bottom: 1px solid #eee; margin-bottom: 20px; font-size: 1.5em; }

/* Design & Style layout lives in design-style.css */

.stolik-wrap .form-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid var(--color-border-soft, #f1f5f9);
}

/* QR interface styles live in qr-interface.css */

/* Locale template badge pulse effect */
@keyframes stolik-pulse-scale {
    0% { transform:scale(1); box-shadow:0 0 0 0 rgba(99,102,241,.4); }
    40% { transform:scale(1.08); box-shadow:0 0 0 4px rgba(99,102,241,.15); }
    100% { transform:scale(1); box-shadow:0 0 0 0 rgba(99,102,241,0); }
}

.stolik-inline-flash { display:inline-block; margin-left:6px; font-size:10px; padding:2px 6px; border-radius:10px; line-height:1.2; font-weight:600; letter-spacing:.3px; }
.stolik-inline-flash.success { background:#10b981; color:#fff; }
.stolik-wrap .stolik-inline-flash.success { background:#10b981; color:#fff; }

#menu-items-list-section.stolik-list-soft-loading {
    opacity:.55;
    pointer-events:none;
    transition:opacity .16s ease;
}

@keyframes stolikPulseGreen {
    0% { box-shadow:inset 0 0 0 9999px rgba(70, 180, 80, .40); }
    100% { box-shadow:inset 0 0 0 9999px rgba(70, 180, 80, 0); }
}

tr.stolik-pulse > td {
    animation:stolikPulseGreen 2s ease;
}

@keyframes stolikTranslationPulseOrange {
    0% { box-shadow:inset 0 0 0 9999px rgba(245, 158, 11, .35); }
    100% { box-shadow:inset 0 0 0 9999px rgba(245, 158, 11, 0); }
}

tr.stolik-translation-pulse > td {
    animation:stolikTranslationPulseOrange 2s ease;
}

.stolik-system-label-flash {
    animation:stolikTranslationPulseOrange 2s ease;
    border-radius:6px;
}

#menu-items-list tr.stolik-category-header td.stolik-system-label-flash,
#menu-items-list tr.stolik-category-header td.stolik-translation-pulse {
    border-radius:4px;
}

.stolik-wrap .notice { margin:8px 0 !important; float:none !important; clear:both; max-width:100%; }
.stolik-wrap .notice p { margin:.4em 0; }
.stolik-wrap .notice.is-dismissible { position:static; }

/* Hide all third-party notices inside .stolik-wrap, allowlist our own */
.stolik-wrap .notice:not(.stolik-notice):not(.stolik-rating-notice):not([class*="stolik-"]) {
    display: none !important;
}

/* Allowlist: Show Stolik notices */
#stolik-notices .notice,
.stolik-wrap .notice.stolik-notice,
.stolik-wrap .notice.stolik-rating-notice,
.stolik-wrap .notice[class*="stolik-"],
.stolik-wrap .notice.stolik-translation-restrictions {
    display: block !important;
}

/* Hide specific known third-party notices */
.stolik-wrap .notice.fui-wordpress-notice,
.stolik-wrap .notice.forminator-rating-notice {
    display: none !important;
}

/* Rating Notice Styles */
.stolik-rating-notice {
    border-left-color: #00a32a !important;
    background: #fff;
    padding: 12px 16px !important;
    margin: 0 0 20px 0 !important;
    width: 100%;
    box-sizing: border-box;
}
.stolik-system-label-input-wrap{ position:relative; width:100%; }
.stolik-system-label-input-wrap input.regular-text{ padding-right:34px; }
.stolik-system-label-input-wrap .stolik-cat-copy-btn{ top:50%; right:6px; transform:translateY(-50%); }

/* CRITICAL FIX: When notice is inside .stolik-header (before JS moves it) */
.stolik-header > .stolik-rating-notice {
    flex-basis: 100% !important;
    width: 100% !important;
    order: -1 !important; /* Move visually to top, before h1 */
    margin: 0 0 12px 0 !important;
}

/* FIX: When notice is positioned after .stolik-header */
.stolik-header + .stolik-rating-notice,
.stolik-header + .stolik-notice:not(.stolik-rating-notice) {
    margin-bottom: 20px !important;
}

.stolik-rating-notice p {
    margin: 0.5em 0;
}
.stolik-rating-notice .stolik-rating-actions {
    margin-top: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.stolik-rating-notice .stolik-rating-actions .button {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin: 0;
}
.stolik-rating-notice .dashicons {
    margin: 0 !important;
    line-height: 1 !important;
    font-size: 16px !important;
    width: 16px !important;
    height: 16px !important;
    vertical-align: baseline !important;
}

/* UX: Add top margin when Add Category moves below form */
.category-section #add-category-button{ margin-top:10px; display:none; }

/* Fix sort arrow overlap on tablets */
@media (min-width: 601px) and (max-width: 1024px) {
    #menu-items-list-section table.wp-list-table th { box-sizing: border-box; }
    #menu-items-list-section th.sortable[data-sort="price"],
    #menu-items-list-section th.sortable[data-sort="status"] { padding-right: 14px !important; }
    #menu-items-list-section th.sortable[data-sort="price"]:before,
    #menu-items-list-section th.sortable[data-sort="price"]:after,
    #menu-items-list-section th.sortable[data-sort="status"]:before,
    #menu-items-list-section th.sortable[data-sort="status"]:after { display:none !important; content:none !important; }
}

/* 769–1024px: widen tight columns */
@media (min-width: 769px) and (max-width: 1024px) {
    /* Use auto layout so content minima are respected */
    #menu-items-list-section table.wp-list-table { table-layout: auto !important; }
    /* Slightly relax widths for controls */
    #menu-items-list-section th.sortable[data-sort="price"],
    #menu-items-list-section td.column-price { width: 48px !important; min-width: 48px !important; }

    #menu-items-list-section th.sortable[data-sort="status"],
    #menu-items-list-section td.column-status { width: 56px !important; min-width: 56px !important; }

    #menu-items-list-section th.column-actions,
    #menu-items-list-section td.column-actions { width: 104px !important; min-width: 104px !important; white-space: normal; }

    /* Ensure thumbnail fits inside image column */
    #menu-items-list-section th.column-image,
    #menu-items-list-section td.column-image { width: 56px !important; }
    /* Thumbnail size */
    #menu-items-list .item-thumbnail { width: 52px !important; height: 52px !important; }
    /* Safe gutter between image and text */
    #menu-items-list-section td.column-image { padding-right: 5px !important; }
    #menu-items-list-section td.item-info-cell { padding-left: 5px !important; }

}

/* 901–1024px: slightly reduce N&D min-width */
@media (min-width: 901px) and (max-width: 1024px) {
    #menu-items-list-section th.sortable[data-sort="name"],
    #menu-items-list-section td.item-info-cell,
    #menu-items-list th.sortable[data-sort="name"],
    #menu-items-list td.item-info-cell { min-width: 52% !important; width: auto; }
}

/* 769–900px: reduce N&D dominance and widen Actions */
@media (min-width: 769px) and (max-width: 900px) {
    /* Give back space to controls */
    #menu-items-list-section th.sortable[data-sort="name"],
    #menu-items-list-section td.item-info-cell,
    #menu-items-list th.sortable[data-sort="name"],
    #menu-items-list td.item-info-cell { min-width: 52% !important; width: auto; }

    /* Explicit widths to avoid collisions */
    #menu-items-list-section th.sortable[data-sort="price"],
    #menu-items-list-section td.column-price { width: 48px !important; min-width: 48px !important; }

    #menu-items-list-section th.sortable[data-sort="status"],
    #menu-items-list-section td.column-status { width: 56px !important; min-width: 56px !important; }

    /* More room for actions to avoid collisions */
    #menu-items-list-section th.column-actions,
    #menu-items-list-section td.column-actions { width: 112px !important; min-width: 112px !important; }
}

/* Editor panel: uploader, fields, categories */
.menu-item-editor { display: flex; flex-direction: column; gap: 20px; max-width:100%; overflow-x:hidden; }
.menu-item-editor label { font-weight: 600; display: block; margin-bottom: 5px; }
.item-image-uploader { width: 100%; max-width:100%; box-sizing:border-box; overflow:hidden; }
.image-drop-zone { width: 100%; max-width:100%; box-sizing:border-box; overflow:hidden; height: 200px; border: 2px dashed #ccd0d4; border-radius: 6px; display: flex; align-items: center; justify-content: center; text-align: center; position: relative; background-color: #f9f9f9; transition: background-color 0.2s ease; padding: 8px; }
.image-drop-zone.drag-over { background-color: #e0eafc; border-color: #7e9dff; }
.uploader-instructions { z-index: 1; }
.uploader-instructions p { pointer-events: none; }
.image-preview { max-width: 100%; max-height: 100%; position: absolute; top: 8px; left: 8px; right: 8px; bottom: 8px; width: calc(100% - 16px); height: calc(100% - 16px); object-fit: cover; border-radius: 6px; z-index: 2; box-shadow: 0 2px 6px rgba(0,0,0,0.15); }
.stolik-upload-progress { position:absolute; top:50%; left:50%; transform:translate(-50%,-50%); width:70%; background:rgba(255,255,255,0.85); border:1px solid #d1d5db; border-radius:6px; padding:6px 10px; display:flex; align-items:center; gap:10px; z-index:5; font-size:12px; }
.stolik-upload-progress .bar { height:6px; flex:1; background:#e2e8f0; border-radius:3px; position:relative; overflow:hidden; }
.stolik-upload-progress .bar::after { content:""; position:absolute; top:0; left:0; width:0%; height:100%; background:linear-gradient(90deg,#6366f1,#8b5cf6); transition:width .2s; }
.stolik-upload-progress.active .bar::after { animation: none; }
.stolik-upload-progress .label { min-width:34px; text-align:right; font-weight:600; color:#374151; }
.stolik-upload-progress .bar { --progress:0; }

/* Utility class applied dynamically */
.image-drop-zone.has-image { border-style: solid; border-color:#94a3b8; }
.image-preview-wrapper { position: absolute; inset: 0; display: none; }
.image-preview-actions { position: absolute; bottom: 8px; right: 8px; display: flex; gap: 6px; z-index: 3; }
.image-preview-actions .button-small { padding: 2px 8px; font-size: 11px; line-height: 1.4; }
.item-fields input, .item-fields textarea { width: 100%; }
.item-fields textarea { min-height: 80px; }
.item-fields .stolik-allergens-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(170px,1fr)); gap:8px 12px; margin-top:4px; }
.item-fields .stolik-allergen-option { display:flex; align-items:center; gap:8px; margin:0; font-weight:500; }
.item-fields .stolik-allergen-option input[type="checkbox"] { width:auto; margin:0; }
/* Prevent inputs/selects overflow (placeholder spill fix) */
.menu-item-editor input[type="text"],
.menu-item-editor select,
.menu-item-editor textarea {
    box-sizing: border-box;
    max-width: 100%;
    width: 100%;
    margin: 0;
    display: block;
}
.menu-item-editor .item-fields input[type="number"],
.menu-item-editor input[type="number"] {
    box-sizing: border-box;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    margin: 0;
    display: block;
}
.menu-item-editor .item-fields input[type="number"]::-webkit-outer-spin-button,
.menu-item-editor .item-fields input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
.menu-item-editor .item-fields input[type="number"] {
    -moz-appearance: textfield;
}
/* Prevent Select2 container side margins causing bleed */
.menu-item-editor .select2-container { margin: 0; }
/* Prevent inline copy wrappers increasing measured width */
.menu-item-editor .stolik-item-copy-wrap{ position:relative; width:100%; max-width:100%; }
/* Category Select2 sizing consolidated below */
/* Direct children shrinkable to avoid flex overflow */
.menu-item-editor > * { min-width: 0; }
/* Select2 sizing consolidated below */
/* Select2 (consolidated sizing in editor) */
.stolik-editor-column #item-category,
.stolik-editor-column #item-category + .select2,
.stolik-editor-column #item-category + .select2 .select2-selection,
.stolik-editor-column .select2,
.stolik-editor-column .select2-container,
.stolik-editor-column .select2 .select2-selection,
.stolik-editor-column .select2-container .select2-selection,
.menu-item-editor .category-section .select2,
.menu-item-editor .category-section .select2-container,
.menu-item-editor .category-section .select2 .select2-selection,
.menu-item-editor .category-section .select2-container .select2-selection {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box;
}
/* Prevent item-name and category forcing horizontal scroll */
.menu-item-editor .item-fields,
.menu-item-editor .category-section { min-width: 0; max-width: 100%; overflow: hidden; }
.menu-item-editor .item-name { max-width: 100%; width: 100%; min-width: 0; }
/* Select2 text wrapping inside selection */
.select2-container .select2-selection__rendered { max-width: 100%; white-space: normal; line-height: 1.3; overflow-wrap: anywhere; word-break: break-word; }
/* Native select should not exceed container */
.menu-item-editor select.item-category { max-width: 100%; width: 100%; }
.price-field { display: flex; align-items: center; }

/* Per-Language Template Table simplified badge */
.stolik-effective-template { display:inline-block; font-size:11px; line-height:1.2; padding:3px 8px; border-radius:4px; background:#f1f5f9; color:#334155; font-weight:600; letter-spacing:.2px; }
.stolik-effective-template.is-override { background:#f59e0b; color:#fff; }
.stolik-effective-template.pulse-change { animation: stolikPulse 0.65s ease; }

/* Category Translation Panel (inline copy UX) */
.stolik-cat-tr-row { position:relative; padding:6px 0 2px; border-bottom:1px dashed #e2e8f0; }
.stolik-cat-tr-row:last-child { border-bottom:none; }
.stolik-cat-tr-row input[type=text] { box-sizing:border-box; padding-right:34px; }
.stolik-cat-copy-btn { position:absolute; top:28px; right:6px; width:26px; height:26px; display:inline-flex; align-items:center; justify-content:center; border:1px solid #d1d5db; background:#fff; border-radius:4px; cursor:pointer; color:#475569; font-size:14px; line-height:1; transition:background .15s, color .15s, border-color .15s, box-shadow .15s; }
.stolik-cat-copy-btn:hover { background:#f1f5f9; color:#1e293b; }
.stolik-cat-copy-btn:active { background:#e2e8f0; }
.stolik-cat-copy-btn.success { background:#10b981; border-color:#059669; color:#fff; box-shadow:0 0 0 2px rgba(16,185,129,0.25); }
.stolik-cat-copy-btn.success::after { content:'✓'; font-weight:600; font-size:13px; }
.stolik-cat-copy-btn .dashicons { font-size:16px; width:16px; height:16px; line-height:1; }
@media (max-width: 900px){ .stolik-cat-copy-btn{ top:26px; } }

/* Base language pill (removed: not used) */

/* Item translation inline copy buttons */
.stolik-item-copy-wrap{ position:relative; }
.stolik-item-copy-btn{ position:absolute; top:4px; right:17px; transform:none; width:24px; height:24px; display:inline-flex; align-items:center; justify-content:center; border:1px solid #d1d5db; background:#fff; border-radius:4px; cursor:pointer; color:#475569; font-size:14px; line-height:1; padding:0; transition:background .15s, color .15s, border-color .15s, box-shadow .15s; }
/* Tight screens: keep button accessible but further from scrollbar */
@media (max-width:1100px){ .stolik-item-copy-btn{ right:14px; } }
.stolik-item-copy-btn:hover{ background:#f1f5f9; color:#1e293b; }
.stolik-item-copy-btn:active{ background:#e2e8f0; }
.stolik-item-copy-btn.success{ background:#10b981; border-color:#059669; color:#fff; box-shadow:0 0 0 2px rgba(16,185,129,0.25); }
.stolik-item-copy-btn.success::after{ content:'✓'; font-weight:600; font-size:13px; }
.stolik-item-copy-btn .dashicons{ font-size:16px; width:16px; height:16px; line-height:1; }
.menu-item-editor .item-fields .stolik-item-copy-target{ padding-right:36px; }
.menu-item-editor .item-fields .item-price.stolik-item-copy-target{ padding-right:8px; }

/* Translation mode RTL: move inline copy icons to the left and mirror field padding */
html[dir="rtl"] .stolik-translation-mode .stolik-title-copy-inside,
html[dir="rtl"] .stolik-translation-mode .stolik-cat-copy-btn,
html[dir="rtl"] .stolik-translation-mode .stolik-item-copy-btn,
body.rtl .stolik-translation-mode .stolik-title-copy-inside,
body.rtl .stolik-translation-mode .stolik-cat-copy-btn,
body.rtl .stolik-translation-mode .stolik-item-copy-btn,
.stolik-translation-mode.stolik-translation-locale-rtl .stolik-title-copy-inside,
.stolik-translation-mode.stolik-translation-locale-rtl .stolik-cat-copy-btn,
.stolik-translation-mode.stolik-translation-locale-rtl .stolik-item-copy-btn,
.stolik-translation-mode[dir="rtl"] .stolik-title-copy-inside,
.stolik-translation-mode[dir="rtl"] .stolik-cat-copy-btn,
.stolik-translation-mode[dir="rtl"] .stolik-item-copy-btn{
    left:10px !important;
    right:auto !important;
}
html[dir="rtl"] .stolik-translation-mode .stolik-system-label-input-wrap .stolik-cat-copy-btn,
body.rtl .stolik-translation-mode .stolik-system-label-input-wrap .stolik-cat-copy-btn,
.stolik-translation-mode.stolik-translation-locale-rtl .stolik-system-label-input-wrap .stolik-cat-copy-btn,
.stolik-translation-mode[dir="rtl"] .stolik-system-label-input-wrap .stolik-cat-copy-btn{
    left:10px !important;
    right:auto !important;
}

html[dir="rtl"] .stolik-translation-mode #stolik-menu-title-translation-input,
body.rtl .stolik-translation-mode #stolik-menu-title-translation-input,
.stolik-translation-mode.stolik-translation-locale-rtl #stolik-menu-title-translation-input,
.stolik-translation-mode[dir="rtl"] #stolik-menu-title-translation-input{
    padding-left:36px !important;
    padding-right:8px !important;
}

html[dir="rtl"] .stolik-translation-mode .stolik-cat-tr-row input[type=text],
html[dir="rtl"] .stolik-translation-mode .menu-item-editor .item-fields .stolik-item-copy-target,
body.rtl .stolik-translation-mode .stolik-cat-tr-row input[type=text],
body.rtl .stolik-translation-mode .menu-item-editor .item-fields .stolik-item-copy-target,
.stolik-translation-mode.stolik-translation-locale-rtl .stolik-cat-tr-row input[type=text],
.stolik-translation-mode.stolik-translation-locale-rtl .menu-item-editor .item-fields .stolik-item-copy-target,
.stolik-translation-mode[dir="rtl"] .stolik-cat-tr-row input[type=text],
.stolik-translation-mode[dir="rtl"] .menu-item-editor .item-fields .stolik-item-copy-target{
    padding-left:36px !important;
    padding-right:8px !important;
}

html[dir="rtl"] .stolik-translation-mode .menu-item-editor .item-fields .item-price.stolik-item-copy-target,
body.rtl .stolik-translation-mode .menu-item-editor .item-fields .item-price.stolik-item-copy-target,
.stolik-translation-mode.stolik-translation-locale-rtl .menu-item-editor .item-fields .item-price.stolik-item-copy-target,
.stolik-translation-mode[dir="rtl"] .menu-item-editor .item-fields .item-price.stolik-item-copy-target{
    padding-left:8px !important;
    padding-right:8px !important;
}

.price-field input { width: 50% !important; margin-right: 5px !important; }
.category-section { margin-top: 15px; padding-top: 15px; border-top: 1px solid #eee; }

/* Translate mode button layout fixes (1025–1400px) */
@media (min-width:1025px) and (max-width:1400px){
    /* In Category Translation panel, stack Cancel under Update with spacing */
    .stolik-cat-translation-actions,
    .stolik-system-label-translation-actions{ flex-direction: column; align-items: flex-start; }
    .stolik-cat-translation-actions .stolik-cancel-cat-translation,
    .stolik-system-label-translation-actions .stolik-cancel-system-label-translation{ margin-top:12px; }

    .stolik-translation-mode .stolik-translation-cancel-btn{ margin-top:12px !important; }
}
.add-category-form { display: flex; gap: 10px; align-items: center; }
#new-category-parent { min-width: 150px; }
#show-add-category-form { text-decoration: none; font-size: 12px; margin-top: 5px; display: inline-block; }
.add-category-form { margin-top: 10px; }
#add-item-button, #cancel-edit-button { margin-top: 20px; }

/* Items List & Filters */
.list-filters { display: flex; gap: 15px; margin-bottom: 15px; }
.list-filters input, .list-filters select { max-width: 250px; }
#menu-items-list-section table { margin-top:0; table-layout:auto; width:100%; }
#menu-items-list-section { position:relative; z-index:1; isolation:isolate; }
#menu-items-list-section .widefat { border-collapse:separate; border-spacing:0; }
/* Narrow supporting columns */
#menu-items-list-section th.column-image, #menu-items-list-section td.column-image { width:72px; }
/* Center image in its cell */
#menu-items-list-section td.column-image { display:table-cell !important; vertical-align:middle !important; text-align:center !important; }
#menu-items-list-section td.column-image::before { content:""; display:inline-block; height:100%; vertical-align:middle; }
#menu-items-list-section td.column-image .item-thumbnail,
#menu-items-list-section td.column-image img { display:inline-block !important; vertical-align:middle !important; margin:0 !important; }

/* Keep favorite toggle aligned */
#menu-items-list td.column-actions .favorite-toggle { line-height:1; display:inline-flex; align-items:center; }

/* Keep delete link visual reset */
.stolik-wrap .button-link-delete { color: #a00 !important; text-decoration: underline; cursor: pointer; background: none; border: none; padding: 0; line-height: 1; }
#menu-items-list-section th.sortable { cursor: pointer; }
#menu-items-list-section th.sortable:hover { color: #2271b1; }
#menu-items-list-section th.sortable .dashicons { font-size: 14px; vertical-align: middle; }


/* Persistent sort arrows (unified) */
#menu-items-list-section table.wp-list-table th.sortable { position:relative; padding-right:18px; }
#menu-items-list-section table.wp-list-table th.sortable:after, #menu-items-list-section table.wp-list-table th.sortable:before { position:absolute; right:4px; font-size:11px; line-height:1; opacity:.25; }
#menu-items-list-section table.wp-list-table th.sortable:after { content:'\25B2'; top:42%; transform:translateY(-60%); }
#menu-items-list-section table.wp-list-table th.sortable:before { content:'\25BC'; top:58%; transform:translateY(-40%); }
#menu-items-list-section table.wp-list-table th.sortable.sorted-asc:after { opacity:.9; }
#menu-items-list-section table.wp-list-table th.sortable.sorted-asc:before { opacity:.08; }
#menu-items-list-section table.wp-list-table th.sortable.sorted-desc:before { opacity:.9; }
#menu-items-list-section table.wp-list-table th.sortable.sorted-desc:after { opacity:.08; }
/* Hide sort carets for narrower viewports to reclaim space */
@media (max-width: 1287px) {
    #menu-items-list-section table.wp-list-table th.sortable:before,
    #menu-items-list-section table.wp-list-table th.sortable:after { display: none !important; content: none !important; }
}
/* Global floating tooltip adjustments (removed sort-tip styles) */

/* Status Toggle Switch */
.stolik-status-toggle { cursor: pointer; display: inline-block; position: relative; width: 40px; height: 22px; }
.stolik-status-toggle input { opacity: 0; width: 0; height: 0; }
.stolik-status-toggle .slider { position: absolute; top: 0; left: 0; right: 0; bottom: 0; background-color: #ccc; border-radius: 22px; transition: .4s; }
.stolik-status-toggle .slider:before { position: absolute; content: ""; height: 16px; width: 16px; left: 3px; bottom: 3px; background-color: white; border-radius: 50%; transition: .4s; }
.stolik-status-toggle input:checked + .slider { background-color: #28a745; }
.stolik-status-toggle input:checked + .slider:before { transform: translateX(18px); }

/* Category Sorter */
#category-sort-list { list-style: none; margin: 0; padding: 0; }
#category-sort-list li { background: #fdfdfd; border: 1px solid #ddd; padding: 10px 15px; margin-bottom: 5px; cursor: move; display: flex; align-items: center; gap: 10px; border-radius: 3px; }
#category-sort-list li.stolik-category-just-moved{ background:#dcfce7; border-color:#bbf7d0; box-shadow:0 0 0 1px rgba(34,197,94,0.35) inset; }
#category-sort-list .dashicons-menu { color: #888; }
#menu-items-list td.column-image .dashicons-menu {
    touch-action: none;
    cursor: grab;
    padding: 10px;
}
#category-sort-list .sortable-ghost { background: #eef7ff; opacity: 0.7; }

.ui-sortable-helper {
    background: #fff !important;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2) !important;
    z-index: 9999 !important;
}

/* Grouped list headers */
.stolik-category-header td {
    background-color: #f0f0f1;
    color: #2c3338;
    font-weight: 600;
    padding: 10px 15px !important;
    border-top: 1px solid #c8c8c8;
    border-bottom: 1px solid #c8c8c8;
}

/* Category Management Modal */

.stolik-modal-backdrop {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    z-index: 1000;
}

.stolik-modal {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    max-width: 500px;
    background-color: #fff;
    border-radius: 4px;
    box-shadow: 0 5px 15px rgba(0,0,0,.5);
    z-index: 1001;
}

.stolik-modal.is-visible,
.stolik-modal-backdrop.is-visible {
    display: block;
}

.stolik-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid #ddd;
}

.stolik-modal-header h2 {
    margin: 0;
    font-size: 1.2em;
}

.stolik-modal-close {
    border: none;
    background: none;
    font-size: 1.8em;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    color: #666;
}

.stolik-modal-content {
    padding: 20px;
}

.stolik-modal-section {
    margin-bottom: 25px;
}
.stolik-modal-section:last-child {
    margin-bottom: 0;
}

.stolik-form-inline {
    display: flex;
    gap: 10px;
}

.stolik-form-inline input[type="text"] {
    flex-grow: 1;
}

.stolik-category-list {
    margin: 0;
    padding: 0;
    border: 1px solid #ddd;
    border-radius: 3px;
    max-height: 200px;
    overflow-y: auto;
}

.stolik-category-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 0;
    padding: 10px 15px;
    border-bottom: 1px solid #eee;
}

.stolik-category-list li:last-child {
    border-bottom: none;
}

.stolik-category-list .actions .delete {
    color: #a00;
    text-decoration: none;
}
.stolik-category-list .actions .delete:hover {
    color: #f00;
}

/* SECTION 7 — Table visuals */
.column-drag {
    width: 30px;
    text-align: center;
    vertical-align: middle !important;
}

.stolik-wrap .column-actions .button,
.stolik-wrap .column-actions .button-link {
    margin-right: 8px;
    vertical-align: middle;
}


.stolik-wrap .column-actions .button:last-child,
.stolik-wrap .column-actions .button-link:last-child {
    margin-right: 0;
}

/* Style for the category sorter drag handle */
#category-sort-list li .dashicons-menu {
    color: #2271b1;
    cursor: move;
}

/* Generic menu section spacing (non-PRO variants) */
.stolik-wrap .menu-section { padding-left:var(--gutter-x, 5px); padding-right:var(--gutter-x, 5px); }

/* SECTION 9 — Utilities & misc overrides */
/* Hide the WordPress footer on Stolik admin pages only */
body[class*="stolik-menu"] #wpfooter { display: none !important; }

.stolik-editor-column .menu-section { padding-left:var(--editor-inner-pad-x, 6px) !important; padding-right:var(--editor-inner-pad-x, 6px) !important; }
.stolik-editor-column .menu-item-editor { padding: right 5px; padding-left:5px; }

/* SECTION 8 — Translation Mode: sticky editor on desktop */
/* Translation Mode: keep editor column visible when scrolling next to item list (desktop) */
.stolik-translation-mode .stolik-main-layout { align-items:stretch; }
.stolik-translation-mode .stolik-editor-column { position:sticky; top:var(--sticky-top, 72px); align-self:flex-start; height:fit-content; max-height:none; overflow:visible; scrollbar-width:thin; }
.stolik-translation-mode .stolik-editor-column::-webkit-scrollbar { width:8px; }
.stolik-translation-mode .stolik-editor-column::-webkit-scrollbar-track { background:transparent; }
.stolik-translation-mode .stolik-editor-column::-webkit-scrollbar-thumb { background:#c5cad0; border-radius:4px; }
@media (max-width:1024px){
  .stolik-translation-mode .stolik-editor-column { position:static; max-height:none; overflow:visible; }
}
/* Slight shadow when stuck */
.stolik-translation-mode .stolik-editor-column { box-shadow:0 0 0 rgba(0,0,0,0); transition:box-shadow .25s; }
.stolik-translation-mode .stolik-editor-column.is-stuck { box-shadow:0 2px 6px rgba(0,0,0,0.08); }

/* Translation Mode: smaller locked image drop-zone */
.stolik-translation-mode .menu-item-editor .image-drop-zone.stolik-image-locked { width: 100%; max-width: 324px; }
.stolik-translation-mode .menu-item-editor .image-drop-zone.stolik-image-locked .image-preview { object-fit:cover; }

/* Auto-scroll focus highlight */
tr.stolik-row-focus { animation: stolikRowPulse 1.4s ease; box-shadow:0 0 0 2px #2271b1 inset; }
@keyframes stolikRowPulse { 0% { background:#eef6ff; } 60% { background:#fafdff; } 100% { background:transparent; } }

.stolik-translation-save-btn { margin-bottom: 10px!important; }

/* Desktop narrow band: 1400px → 1025px
     Lower minima specifically for Price, Status, Actions so they shrink earlier
     before the layout switches to one column at 1024px. */
@media (min-width: 1025px) and (max-width: 1400px) {
    /* Neutralize rigid colgroup and fixed table layout so columns can shrink */
    #menu-items-list-section table.wp-list-table { table-layout: auto !important; width: 100% !important; }
    /* Ensure translation mode also uses auto layout (override its fixed !important) */
    .stolik-translation-mode #menu-items-list-section table.wp-list-table { table-layout: auto !important; }
    #menu-items-list-section col { width: auto !important; }
    #menu-items-list-section th, #menu-items-list-section td { min-width: 0; box-sizing: border-box; }
    /* Reduce header padding across all columns to reclaim horizontal space */
    #menu-items-list-section table.wp-list-table th { padding-left: 6px; padding-right: 10px; }
    /* Keep a bit more room for sort arrows */
    #menu-items-list-section table.wp-list-table th.sortable { padding-right: 14px; }

    /* Make the key non-name columns flexible with clear minima/maxima (prevents right overflow) */
    /* Price: reduce minima to free width; keep nowrap so values stay on one line */
    #menu-items-list-section th.sortable[data-sort="price"],
    #menu-items-list-section td.column-price { width: clamp(40px, 4vw, 60px); min-width: 40px; white-space: nowrap; }

    /* Status: relaxed minima to allow earlier shrink */
    #menu-items-list-section th.sortable[data-sort="status"],
    #menu-items-list-section td.column-status { width: clamp(40px, 4vw, 60px); min-width: 40px; }

    /* Actions: slightly tighter minima; allow buttons to wrap to second line */
    #menu-items-list-section th.column-actions,
    #menu-items-list-section td.column-actions { width: clamp(88px, 8vw, 120px); min-width: 88px; }
    #menu-items-list-section td.column-actions .item-actions { flex-wrap: wrap; row-gap: 4px; column-gap: 6px; }

    /* Let Name & Description absorb residual space and wrap without shrinking font size */
    #menu-items-list-section th.sortable[data-sort="name"],
    #menu-items-list-section td.item-info-cell { width: auto; min-width: 0; white-space: normal !important; overflow-wrap:anywhere; word-break:break-word; }
    /* Keep header font consistent with others */
    #menu-items-list-section th.sortable[data-sort="name"]{ font-size: inherit !important; line-height: inherit !important; }

    /* Tighten main layout proportions in this band to reclaim pixels for the table */
    /* Subtract the inter-column gap (10px) from the list column to avoid 1–10px overflow at ~1180px */
    .stolik-editor-column { flex: 0 0 20% !important; max-width: 20% !important; min-width: 200px; }
    .stolik-list-column  { flex: 1 0 calc(78% - 10px) !important; max-width: calc(78% - 10px) !important; min-width: 0; }

    /* Lift language current button above dropdown to avoid overlap in tight widths */
    .stolik-editor-column .stolik-lang-custom.open { padding-top: 38px; }
    .stolik-editor-column .stolik-lang-custom.open button.stolik-lang-current {
        position: absolute;
        top: -38px;
        left: 0;
        right: 0;
        width: 100% !important;
    }
    .stolik-editor-column .stolik-lang-custom.open .stolik-lang-list {
        top: 0;
        width: 100% !important;
    }
}

/* Actions column compact layout in 1287px → 1025px */
@media (min-width: 1025px) and (max-width: 1287px) {
    /* Stack action controls vertically with spacing */
    #menu-items-list-section td.column-actions .item-actions {
        display: inline-flex;
        flex-direction: column;
        align-items: center;

    }
    /* Enforce vertical spacing even if gap is overridden */
    #menu-items-list-section td.column-actions .item-actions > * { display:block; margin-left:auto; margin-right:auto; }
    #menu-items-list-section td.column-actions .item-actions > * + * { margin-top:12px; }
    /* Handle rows without .item-actions wrapper */
    #menu-items-list-section td.column-actions > * { display: block; width: max-content; margin-left:auto; margin-right:auto; }
    #menu-items-list-section td.column-actions > * + * { margin-top:12px; }
    /* Allow wrapping inside the cell */
    #menu-items-list-section td.column-actions { white-space: normal; }

    /* Force very narrow Actions column (header + body) - relaxed minima */
    #menu-items-list-section th.column-actions,
    #menu-items-list-section td.column-actions { width: 56px !important; min-width: 56px !important; }

    /* Hide sort arrows for Name, Price, Status to recover ~6–10px each */
    #menu-items-list-section th.sortable[data-sort="name"]:before,
    #menu-items-list-section th.sortable[data-sort="name"]:after,
    #menu-items-list-section th.sortable[data-sort="price"]:before,
    #menu-items-list-section th.sortable[data-sort="price"]:after,
    #menu-items-list-section th.sortable[data-sort="status"]:before,
    #menu-items-list-section th.sortable[data-sort="status"]:after { display:none !important; content:none !important; }

    /* Tighten horizontal paddings; keep a small gap before Name & Description */
    #menu-items-list-section th.column-image,
    #menu-items-list-section td.column-image,
    #menu-items-list-section th.sortable[data-sort="name"] { padding-left:0 !important; padding-right:2px !important; }
    #menu-items-list-section td.item-info-cell { padding-left:5px !important; padding-right:2px !important; }

    /* Further compress supporting columns */
    #menu-items-list-section th.column-image,
    #menu-items-list-section td.column-image { width:52px !important; min-width:52px !important; }
    #menu-items-list-section th.sortable[data-sort="price"],
    #menu-items-list-section td.column-price { width:34px !important; min-width:32px !important; white-space:nowrap; text-align:center; }
    #menu-items-list-section th.sortable[data-sort="status"],
    #menu-items-list-section td.column-status { width:32px !important; min-width:32px !important; text-align:center; }

    /* Make Name & Description even more elastic */
    #menu-items-list-section th.sortable[data-sort="name"] { white-space:normal !important; font-size: inherit !important; line-height: inherit !important; }
    #menu-items-list-section td.item-info-cell { white-space:normal !important; overflow-wrap:anywhere; word-break:break-word; hyphens:auto; }
    #menu-items-list-section td.item-info-cell strong { line-height:1.25; gap:4px; }
    #menu-items-list-section td.item-info-cell p { line-height:1.3; margin-left:0; margin-right:0; }
}

@media (min-width: 783px) {
    #menu-items-list-section th.column-status,
    #menu-items-list-section td.column-status {
        width: 90px !important;
        min-width: 90px !important;
    }

    #menu-items-list-section th.column-actions,
    #menu-items-list-section td.column-actions {
        width: 170px !important;
        min-width: 170px !important;
    }
}

@media (max-width: 782px) {
    .stolik-main-layout {
        display: flex;
        flex-direction: column;
        width: 100%;
        overflow-x: hidden;
    }

    .stolik-editor-column,
    .stolik-list-column {
        width: 100% !important;
        max-width: 100% !important;
        margin-right: 0;
        box-sizing: border-box;
    }

    .stolik-translation-lang-select-wrapper .select2-container {
        min-width: 0 !important;
        width: 100% !important;
    }

    #menu-items-list-section .list-filters {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    #menu-items-list-section .list-filters input,
    #menu-items-list-section .list-filters select {
        max-width: 100%;
        width: 100%;
    }

    /* Card view mode: convert table layout into stacked cards */
    #menu-items-list-section table.wp-list-table,
    #menu-items-list-section table.wp-list-table tbody,
    #menu-items-list-section table.wp-list-table tr,
    #menu-items-list-section table.wp-list-table td {
        display: block !important;
        width: 100% !important;
        box-sizing: border-box;
    }

    /* Hide table headers/footers in card mode */
    #menu-items-list-section table.wp-list-table thead,
    #menu-items-list-section table.wp-list-table tfoot {
        display: none !important;
    }

    /* Block WP core pseudo-labels in responsive table mode */
    #menu-items-list-section table.wp-list-table td::before {
        display: none !important;
    }

    /* Disable horizontal scroller in card mode */
    .stolik-table-responsive-wrapper {
        overflow-x: visible;
    }

    /* Row as a card */
    #menu-items-list-section table.wp-list-table tr {
        background: #fff;
        border: 1px solid #ccd0d4;
        border-radius: 8px;
        margin-bottom: 15px;
        padding: 12px;
        position: relative;
    }

    /* Image row at top of card */
    #menu-items-list-section td.column-image {
        display: flex !important;
        align-items: center;
        border-bottom: 1px solid #f0f0f1;
        padding-bottom: 10px !important;
        margin-bottom: 10px;
        height: auto !important;
    }

    /* Price + status in one row flow */
    #menu-items-list-section td.column-price,
    #menu-items-list-section td.column-status {
        display: inline-flex !important;
        align-items: center;
        width: auto !important;
        padding: 5px 15px 5px 0 !important;
        vertical-align: middle;
    }

    #menu-items-list-section td.column-status .stolik-status-toggle {
        margin: 0;
    }

    /* Actions section at bottom */
    #menu-items-list-section td.column-actions {
        border-top: 1px solid #f0f0f1;
        padding-top: 10px !important;
        margin-top: 10px;
        text-align: right;
    }

    #menu-items-list-section .stolik-actions-wrapper {
        justify-content: flex-start !important;
    }

    /* Category separator rows should not look like item cards */
    #menu-items-list-section table.wp-list-table tr.category-header-row,
    #menu-items-list-section table.wp-list-table tr.stolik-category-header {
        background: transparent;
        border: none;
        padding: 10px 0;
        font-weight: 600;
        font-size: 1.1em;
        text-align: center;
        margin-bottom: 6px;
    }

    #menu-items-list-section table.wp-list-table tr.category-header-row td,
    #menu-items-list-section table.wp-list-table tr.stolik-category-header td {
        border: 0 !important;
        padding: 0 !important;
        background: transparent !important;
        text-align: center !important;
    }
}

