/*
 * Module: Orders — styles
 * Colors come only from the tokens in mcms-global.css.
 *
 * SECTIONS
 *   1. Status colors (items, orders, payments)
 *   2. Small shared bits (dashed button, meta groups)
 *      (Chips moved to mcms-global.css, section 17 — the trash uses them too.)
 *   3. Quick order page
 *   4. Order page header
 *   5. Item cards + status dropdown (also the offer options)
 *   6. Payment summary
 *   7. Orders listing (tabs, period chips, filters)
 */

/* ==================================================================
   1. STATUS COLORS
   Class pattern: .mcms-st--{group}-{value}  (group: item | order | pay)
   One place to recolor any status.
   ================================================================== */
.mcms-st--item-anamoni          { background: var(--mcms-surface-muted); color: var(--mcms-text-muted); border: 1px solid var(--mcms-line-strong); }
.mcms-st--item-paraggelthike    { background: var(--mcms-warning-soft); color: var(--mcms-warning); }
.mcms-st--item-paralifthike     { background: #E6EEFB; color: var(--mcms-info); }
.mcms-st--item-topothetithike   { background: var(--mcms-brand-soft); color: var(--mcms-brand-strong); }
.mcms-st--item-akyrothike       { background: var(--mcms-danger-soft); color: var(--mcms-danger); }

.mcms-st--order-se_exelixi      { background: var(--mcms-warning-soft); color: var(--mcms-warning); }
.mcms-st--order-oloklirothike   { background: var(--mcms-brand-soft); color: var(--mcms-brand-strong); }
.mcms-st--order-akyrothike      { background: var(--mcms-danger-soft); color: var(--mcms-danger); }

.mcms-st--pay-aplirwto          { background: var(--mcms-danger-soft); color: var(--mcms-danger); }
.mcms-st--pay-merikws           { background: var(--mcms-warning-soft); color: var(--mcms-warning); }
.mcms-st--pay-plirwthike        { background: var(--mcms-brand-soft); color: var(--mcms-brand-strong); }

/* ==================================================================
   2. SMALL SHARED BITS
   ================================================================== */
.mcms-row__meta-group {
	display: inline-flex;
	align-items: center;
	gap: 6px;
}

.mcms-section-head__actions {
	display: flex;
	gap: 4px;
	flex-wrap: wrap;
	justify-content: flex-end;
}

.mcms-wrap .mcms-btn--dashed {
	min-height: 52px;
	border-style: dashed;
	color: var(--mcms-brand-strong);
	background: var(--mcms-surface);
}

/* ==================================================================
   3. QUICK ORDER PAGE
   ================================================================== */
.mcms-neworder .mcms-page__body {
	padding-bottom: 96px; /* room for the save bar */
}

.mcms-wrap .mcms-neworder__title {
	font-size: var(--mcms-text-md);
	font-weight: 700;
	margin-bottom: 12px;
}

.mcms-neworder__customer,
.mcms-neworder__items {
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.mcms-neworder__chosen {
	display: flex;
	align-items: center;
	gap: var(--mcms-gap);
	padding: 12px 14px;
	border-radius: var(--mcms-radius-sm);
	background: var(--mcms-brand-softer);
	border: 1px solid var(--mcms-brand-soft);
}

.mcms-neworder__match {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 6px;
	padding: 12px 14px;
	border-radius: var(--mcms-radius-sm);
	background: var(--mcms-brand-softer);
	border: 1px solid var(--mcms-brand-soft);
	font-size: var(--mcms-text-md);
}

.mcms-neworder__options,
.mcms-neworder__suggest {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px;
}

.mcms-neworder__item {
	display: flex;
	flex-direction: column;
	gap: 10px;
	padding: 12px;
	border-radius: var(--mcms-radius-sm);
	border: 1px solid var(--mcms-line);
	background: var(--mcms-surface-muted);
}

.mcms-neworder__item-head {
	display: flex;
	align-items: center;
	gap: 8px;
}

.mcms-neworder__item-head .mcms-segmented {
	flex: 1;
}

.mcms-neworder__price {
	display: flex;
	align-items: center;
	gap: 12px;
}

.mcms-neworder__price .mcms-input {
	flex: 1;
}

.mcms-wrap .mcms-neworder__price .mcms-input:disabled {
	background: var(--mcms-surface-muted);
	opacity: .6;
}

/* Save bar: fixed to the bottom of the screen on phones. */
.mcms-savebar {
	position: fixed;
	left: 0;
	right: 0;
	bottom: 0;
	z-index: 30;
	padding: 12px var(--mcms-pad);
	padding-bottom: max(12px, env(safe-area-inset-bottom));
	background: var(--mcms-bg);
	border-top: 1px solid var(--mcms-line);
}

.mcms-savebar .mcms-btn {
	max-width: var(--mcms-max-width);
	margin: 0 auto;
	display: flex;
	min-height: 52px;
	font-size: var(--mcms-text-md);
}

/* ==================================================================
   4. ORDER PAGE HEADER
   ================================================================== */
.mcms-order-head {
	display: flex;
	align-items: flex-start;
	gap: var(--mcms-gap);
	padding: 4px 0 8px;
}

.mcms-order-head__text {
	flex: 1;
	min-width: 0;
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.mcms-wrap .mcms-order-head__offer {
	align-self: flex-start;
	font-size: var(--mcms-text-sm);
	font-weight: 700;
	color: var(--mcms-brand-strong);
}

.mcms-order-head__title {
	font-size: clamp(var(--mcms-text-lg), 5.4vw, var(--mcms-text-xl));
	font-weight: 800;
	line-height: 1.15;
}

/* ==================================================================
   5. ITEM CARDS + STATUS DROPDOWN
   The same card is used for order items and offer options.
   ================================================================== */
.mcms-items {
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.mcms-item {
	background: var(--mcms-surface);
	border: 1px solid var(--mcms-line);
	border-radius: var(--mcms-radius-md);
	box-shadow: var(--mcms-shadow);
	overflow: hidden;
}

/*
 * The tappable top of the card is a <button>. The theme styles buttons
 * with white-space: nowrap, which every text inside inherits: long
 * descriptions stayed on one line and were cut by .mcms-item's
 * overflow: hidden. white-space: normal lets them wrap in full.
 */
.mcms-wrap .mcms-item__main {
	display: flex;
	align-items: flex-start;
	gap: 12px;
	width: 100%;
	margin: 0;
	padding: 14px var(--mcms-pad) 10px;
	border: 0;
	background: transparent;
	color: var(--mcms-text);
	text-align: left;
	font: inherit;
	white-space: normal;
	cursor: pointer;
}

.mcms-wrap .mcms-item__main:hover {
	background: var(--mcms-surface-muted);
	color: var(--mcms-text);
}

.mcms-item__content {
	flex: 1;
	min-width: 0;
	display: flex;
	flex-direction: column;
	gap: 4px;
}

/* "✎ Επεξεργασία" in the top-right corner of each item. */
.mcms-item__edit {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	flex-shrink: 0;
	padding: 4px 10px;
	border-radius: 999px;
	background: var(--mcms-brand-softer);
	border: 1px solid var(--mcms-brand-soft);
	color: var(--mcms-brand-strong);
	font-size: var(--mcms-text-xs);
	font-weight: 700;
	white-space: nowrap;
}

.mcms-item__edit svg {
	width: 14px;
	height: 14px;
}

.mcms-wrap .mcms-item__main:hover .mcms-item__edit {
	background: var(--mcms-brand-soft);
	border-color: var(--mcms-brand);
}

/* Phones: just the pencil, so the description gets the width. */
@media (max-width: 480px) {
	.mcms-item__edit-text {
		display: none;
	}
}

.mcms-item__title {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px;
	font-size: var(--mcms-text-md);
	font-weight: 700;
	line-height: 1.35;
	overflow-wrap: anywhere;
}

.mcms-item__sub,
.mcms-item__note {
	font-size: var(--mcms-text-sm);
	color: var(--mcms-text-muted);
	overflow-wrap: anywhere;
}

.mcms-item__note {
	white-space: pre-wrap;
}

/* Bottom of an item: status on the left half, clock + price on the
   right half. Equal halves, so a long status never squashes the price. */
.mcms-item__foot {
	display: grid;
	grid-template-columns: 1fr 1fr;
	align-items: center;
	gap: 8px;
	padding: 0 var(--mcms-pad) 12px;
}

.mcms-item__foot > * {
	min-width: 0;
}

.mcms-item__right {
	display: flex;
	align-items: center;
	justify-content: flex-end;
	gap: 8px;
	min-width: 0;
}

.mcms-item__right .mcms-badge {
	white-space: nowrap;
}

.mcms-item__price {
	font-size: var(--mcms-text-md);
	font-weight: 800;
	white-space: nowrap;
}

/* Cancelled: still visible, clearly out of the totals. */
.mcms-item.is-cancelled .mcms-item__title,
.mcms-item.is-cancelled .mcms-item__price {
	text-decoration: line-through;
	color: var(--mcms-text-muted);
}

/* The status dropdown looks like a colored pill. */
.mcms-wrap .mcms-status-select {
	width: 100%;
	max-width: 100%;
	min-width: 0;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	min-height: 36px;
	padding: 0 26px 0 10px;
	border-radius: 999px;
	border: 1px solid transparent;
	font-family: var(--mcms-font);
	font-size: var(--mcms-text-sm);
	font-weight: 700;
	cursor: pointer;
	-webkit-appearance: none;
	appearance: none;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 8px center;
	background-size: 14px;
}

/* Very narrow phones: slightly smaller status text so it isn't cut. */
@media (max-width: 380px) {
	.mcms-wrap .mcms-status-select {
		font-size: var(--mcms-text-xs);
	}
}

.mcms-wrap .mcms-status-select:disabled {
	opacity: .6;
}

/* Under the items: «Κατάσταση σε πολλά» · «Ενημέρωση πελάτη» · «Όλη η παραγγελία δωρεάν». */
.mcms-items__tools {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.mcms-wrap .mcms-items__tools .mcms-btn {
	min-height: 40px;
	padding: 0 12px;
	font-size: var(--mcms-text-sm);
}

/* «Ενημέρωση πελάτη»: the one that matters when products arrived. */
.mcms-wrap .mcms-items__tools .mcms-items__notify {
	background: var(--mcms-brand-strong);
	border-color: var(--mcms-brand-strong);
	color: var(--mcms-on-brand);
}

.mcms-wrap .mcms-items__tools .mcms-items__notify:hover:not(:disabled) {
	background: var(--mcms-brand-strong-hover);
	border-color: var(--mcms-brand-strong-hover);
	color: var(--mcms-on-brand);
}

.mcms-items__notified {
	font-size: var(--mcms-text-xs);
	color: var(--mcms-text-muted);
}

/* «Κατάσταση σε πολλά» + the «Τι ήρθε» list of «Ενημέρωση πελάτη». */
.mcms-bulk {
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.mcms-bulk__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
}

.mcms-bulk__all {
	display: flex;
	gap: 6px;
}

.mcms-wrap .mcms-bulk__all .mcms-btn {
	min-height: 36px;
	padding: 0 12px;
	font-size: var(--mcms-text-xs);
}

.mcms-bulk__list {
	display: flex;
	flex-direction: column;
	border: 1px solid var(--mcms-line);
	border-radius: var(--mcms-radius-sm);
	overflow: hidden;
}

.mcms-wrap .mcms-bulk__row {
	display: flex;
	align-items: center;
	gap: 10px;
	margin: 0;
	padding: 10px 12px;
	border-top: 1px solid var(--mcms-line);
	background: var(--mcms-surface);
	cursor: pointer;
}

.mcms-wrap .mcms-bulk__row:first-child {
	border-top: 0;
}

.mcms-wrap .mcms-bulk__row .mcms-check__input {
	flex-shrink: 0;
	width: 20px;
	height: 20px;
	margin: 0;
	accent-color: var(--mcms-brand-strong);
}

.mcms-bulk__title {
	flex: 1;
	min-width: 0;
	font-size: var(--mcms-text-sm);
	font-weight: 600;
	overflow-wrap: anywhere;
}

.mcms-bulk__row.is-cancelled .mcms-bulk__title,
.mcms-bulk__row.is-waiting .mcms-bulk__title {
	color: var(--mcms-text-muted);
}

.mcms-bulk__statuses {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 8px;
}

.mcms-wrap .mcms-bulk__status {
	min-height: 48px;
	border: 0;
	font-weight: 700;
}

/* The same colors on the «Κατάσταση σε πολλά» buttons (beat .mcms-wrap .mcms-btn). */
.mcms-wrap .mcms-bulk__status.mcms-st--item-anamoni { background: var(--mcms-surface-muted); color: var(--mcms-text-muted); border: 1px solid var(--mcms-line-strong); }
.mcms-wrap .mcms-bulk__status.mcms-st--item-paraggelthike { background: var(--mcms-warning-soft); color: var(--mcms-warning); }
.mcms-wrap .mcms-bulk__status.mcms-st--item-paralifthike { background: #E6EEFB; color: var(--mcms-info); }
.mcms-wrap .mcms-bulk__status.mcms-st--item-topothetithike { background: var(--mcms-brand-soft); color: var(--mcms-brand-strong); }
.mcms-wrap .mcms-bulk__status.mcms-st--item-akyrothike { background: var(--mcms-danger-soft); color: var(--mcms-danger); }

.mcms-wrap .mcms-bulk__status:hover:not(:disabled) {
	filter: brightness(.95);
}

.mcms-notify__items {
	margin-bottom: 8px;
}

/* ==================================================================
   6. PAYMENT SUMMARY
   ================================================================== */
.mcms-summary {
	padding: 14px var(--mcms-pad);
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.mcms-summary__row {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 12px;
}

.mcms-summary__label {
	color: var(--mcms-text-muted);
	font-size: var(--mcms-text-sm);
}

.mcms-summary__value {
	font-size: var(--mcms-text-md);
	font-weight: 600;
}

.mcms-summary__row--total {
	margin-top: 4px;
	padding-top: 10px;
	border-top: 1px solid var(--mcms-line);
}

.mcms-summary__row--total .mcms-summary__label {
	color: var(--mcms-text);
	font-weight: 700;
	font-size: var(--mcms-text-md);
}

.mcms-summary__value--big {
	font-size: var(--mcms-text-xl);
	font-weight: 800;
}

.mcms-summary__note {
	margin-top: 4px;
	font-size: var(--mcms-text-sm);
	color: var(--mcms-warning);
}

/* ==================================================================
   7. ORDERS LISTING
   ================================================================== */
.mcms-tabs .mcms-segmented__opt {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	padding: 0 6px;
}

.mcms-tabs__count {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 20px;
	height: 20px;
	padding: 0 6px;
	border-radius: 999px;
	background: var(--mcms-danger);
	color: #fff;
	font-size: var(--mcms-text-xs);
	font-weight: 800;
	font-variant-numeric: tabular-nums;
}

.mcms-wrap .mcms-tabs__count[hidden] {
	display: none;
}

/* Period chips scroll sideways on narrow phones instead of wrapping. */
.mcms-orders__periods {
	flex-wrap: nowrap;
	overflow-x: auto;
	padding-bottom: 2px;
	scrollbar-width: none;
}

.mcms-orders__periods::-webkit-scrollbar {
	display: none;
}

.mcms-orders__periods .mcms-chip {
	flex-shrink: 0;
}

/* While searching, the period doesn't apply: show it faded. */
.mcms-orders__periods.is-muted {
	opacity: .45;
}

.mcms-orders__toolbar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: var(--mcms-gap);
}

.mcms-orders__toolbar .mcms-search__hint {
	flex: 1;
}

.mcms-wrap .mcms-orders__filter-btn {
	min-height: 38px;
	margin-left: auto;
}

.mcms-orders__panel {
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.mcms-wrap .mcms-orders__panel[hidden] {
	display: none;
}

.mcms-orders__filters {
	display: grid;
	grid-template-columns: 1fr;
	gap: 12px;
}

@media (min-width: 560px) {
	.mcms-orders__filters {
		grid-template-columns: 1fr 1fr;
	}
}