/* Еленски бут — B2B ordering page
   Mobile-first: most partners will use this on a phone before 7am. */

.eb-box {
	padding: .9rem 1.1rem;
	border-radius: 6px;
	margin: 0 0 1.2rem;
	font-size: .95rem;
}
.eb-box ul { margin: 0; padding-left: 1.1rem; }
.eb-box--ok    { background: #e8f5e9; border-left: 4px solid #43a047; color: #1b5e20; }
.eb-box--error { background: #fdecea; border-left: 4px solid #c62828; color: #8e1b16; }
.eb-box--info  { background: #f3f0e8; border-left: 4px solid #8d6e63; color: #4e342e; }

/* --- Header: delivery date + countdown --- */

.eb-header {
	display: flex;
	flex-wrap: wrap;
	gap: 1rem;
	justify-content: space-between;
	align-items: center;
	background: #4e342e;
	color: #fff;
	padding: 1rem 1.2rem;
	border-radius: 8px;
	margin-bottom: 1.2rem;
}
.eb-header__label {
	display: block;
	font-size: .75rem;
	text-transform: uppercase;
	letter-spacing: .04em;
	opacity: .75;
	margin-bottom: .15rem;
}
.eb-header__date strong { font-size: 1.15rem; }
.eb-header__countdown { text-align: right; }
.eb-header__countdown strong {
	font-size: 1.3rem;
	font-variant-numeric: tabular-nums;
}
/* Last half hour: make it obvious. */
.eb-header__countdown.is-urgent strong { color: #ffcc80; }
.eb-header__countdown.is-expired strong { color: #ef9a9a; }

.eb-hint { font-size: .9rem; color: #6d5c54; margin: 0 0 1rem; }

/* --- Collapsible categories --- */

.eb-cat {
	border: 1px solid #e0d8d0;
	border-radius: 8px;
	margin-bottom: .7rem;
	overflow: hidden;
	background: #fff;
}
.eb-cat__toggle {
	display: flex;
	align-items: center;
	gap: .6rem;
	width: 100%;
	padding: .95rem 1.1rem;
	background: #faf7f4;
	border: 0;
	cursor: pointer;
	font-size: 1rem;
	font-weight: 600;
	color: #3e2723;
	text-align: left;
}
.eb-cat__toggle:hover { background: #f3ece6; }
.eb-cat__name { flex: 1; }

/* Badge showing how many products in this category have a value,
   so a collapsed category never hides entered quantities. */
.eb-cat__count {
	display: none;
	min-width: 1.5rem;
	padding: .1rem .45rem;
	border-radius: 999px;
	background: #a1512b;
	color: #fff;
	font-size: .78rem;
	text-align: center;
}
.eb-cat__count.is-visible { display: inline-block; }

.eb-cat__chevron {
	width: 0; height: 0;
	border-left: 5px solid transparent;
	border-right: 5px solid transparent;
	border-top: 6px solid #8d6e63;
	transition: transform .18s ease;
}
.eb-cat.is-open .eb-cat__chevron { transform: rotate(180deg); }

.eb-cat__body { display: none; padding: .3rem 0; }
.eb-cat.is-open .eb-cat__body { display: block; }

/* --- Product rows --- */

.eb-row {
	display: flex;
	align-items: center;
	gap: 1rem;
	padding: .6rem 1.1rem;
	border-top: 1px solid #f0eae5;
}
.eb-row__label { flex: 1; cursor: pointer; }
.eb-row__name { display: block; font-size: .95rem; color: #3e2723; }
.eb-row__sku  { display: block; font-size: .75rem; color: #a99; margin-top: .1rem; }

.eb-row__input { display: flex; align-items: center; gap: .4rem; }
.eb-row__input input {
	width: 5.5rem;
	padding: .55rem .6rem;
	border: 1px solid #d5c9c0;
	border-radius: 5px;
	font-size: 1.05rem;
	text-align: right;
	font-variant-numeric: tabular-nums;
}
.eb-row__input input:focus {
	outline: 2px solid #a1512b;
	outline-offset: 1px;
	border-color: #a1512b;
}
.eb-row.has-value { background: #fdf8f3; }
.eb-row__unit { font-size: .85rem; color: #8d6e63; min-width: 2rem; }

/* --- Note + actions --- */

.eb-note { display: block; margin: 1.2rem 0; }
.eb-note span { display: block; font-size: .85rem; color: #6d5c54; margin-bottom: .3rem; }
.eb-note textarea {
	width: 100%;
	padding: .6rem;
	border: 1px solid #d5c9c0;
	border-radius: 5px;
	font-family: inherit;
}

.eb-actions { display: flex; gap: .7rem; align-items: center; margin: 1.2rem 0 2rem; }

.eb-btn {
	display: inline-block;
	padding: .8rem 1.5rem;
	border: 0;
	border-radius: 6px;
	font-size: 1rem;
	cursor: pointer;
	text-decoration: none;
}
.eb-btn--primary { background: #a1512b; color: #fff; font-weight: 600; }
.eb-btn--primary:hover { background: #8a4324; }
.eb-btn--primary:disabled { background: #bdb5b0; cursor: not-allowed; }
.eb-btn--plain { background: #efe9e4; color: #4e342e; }
.eb-btn--small { padding: .45rem .9rem; font-size: .85rem; background: #efe9e4; color: #4e342e; }
.eb-btn--danger { background: #f7e0de; color: #8e1b16; }

/* --- Existing orders --- */

.eb-subhead { margin: 2rem 0 .8rem; font-size: 1.1rem; color: #3e2723; }

.eb-order {
	border: 1px solid #e0d8d0;
	border-radius: 8px;
	margin-bottom: .9rem;
	background: #fff;
}
.eb-order__head {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: .7rem 1rem;
	background: #faf7f4;
	border-bottom: 1px solid #f0eae5;
}
.eb-order__status {
	font-size: .78rem;
	padding: .2rem .6rem;
	border-radius: 999px;
	background: #e8eaf6;
	color: #303f9f;
}
.eb-status--dispatched { background: #e8f5e9; color: #1b5e20; }
.eb-status--cancelled  { background: #fdecea; color: #8e1b16; }

.eb-order__lines { width: 100%; border-collapse: collapse; }
.eb-order__lines td { padding: .45rem 1rem; font-size: .92rem; border-bottom: 1px solid #f5f0ec; }
.eb-num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }

.eb-order__actions { display: flex; gap: .5rem; padding: .7rem 1rem; }
.eb-inline { display: inline; }
.eb-order__locked { padding: .7rem 1rem; margin: 0; font-size: .85rem; color: #8d6e63; }

/* --- Small screens --- */

@media (max-width: 480px) {
	.eb-header { flex-direction: column; align-items: flex-start; }
	.eb-header__countdown { text-align: left; }
	.eb-row { flex-wrap: wrap; gap: .5rem; }
	.eb-row__input input { width: 4.5rem; }
}

/* --- Order history --- */

.eb-history { margin-top: 1rem; }
.eb-histday { margin-bottom: 2rem; }
.eb-histday__date {
	margin: 0 0 .7rem;
	padding-bottom: .35rem;
	border-bottom: 2px solid #4e342e;
	font-size: 1.05rem;
	color: #3e2723;
}
.eb-historder {
	border: 1px solid #e0d8d0;
	border-radius: 8px;
	margin-bottom: .8rem;
	background: #fff;
}
.eb-historder__head {
	display: flex;
	align-items: center;
	gap: .7rem;
	flex-wrap: wrap;
	padding: .7rem 1rem;
	background: #faf7f4;
	border-bottom: 1px solid #f0eae5;
}
.eb-historder__head strong { flex: 0 0 auto; }
.eb-historder__head .eb-btn--small { margin-left: auto; }

/* --- Delivery date chooser --- */

.eb-datepick {
	display: flex;
	align-items: center;
	gap: .6rem;
	flex-wrap: wrap;
	margin: 0 0 1.2rem;
	padding: .7rem .9rem;
	background: #faf7f4;
	border: 1px solid #e8e0d8;
	border-radius: 6px;
	font-size: .92rem;
}
.eb-datepick label { color: #6d5c54; }
.eb-datepick select {
	padding: .45rem .6rem;
	border: 1px solid #d5c9c0;
	border-radius: 5px;
	font-size: .95rem;
	max-width: 100%;
}

/* --- Stepper buttons --- */

.eb-step {
	width: 2.1rem;
	height: 2.4rem;
	flex: 0 0 auto;
	border: 1px solid #d5c9c0;
	background: #f7f2ee;
	color: #4e342e;
	font-size: 1.15rem;
	line-height: 1;
	cursor: pointer;
	border-radius: 5px;
	-webkit-user-select: none;
	user-select: none;
}
.eb-step:hover { background: #ede3db; }
.eb-step:active { background: #e0d2c7; }

/* Generous tap targets — this is used on a phone at 6:50am. */
@media (max-width: 480px) {
	.eb-step { width: 2.6rem; height: 2.6rem; font-size: 1.3rem; }
}

/* --- Validation feedback --- */

.eb-row__err {
	flex: 0 0 100%;
	font-size: .8rem;
	color: #c62828;
	min-height: 0;
}
.eb-row.has-error .eb-row__err { min-height: 1.1rem; }
.eb-row.has-error { background: #fdf3f2; }
.eb-row.has-error .eb-row__input input {
	border-color: #c62828;
	background: #fff;
}

/* An invalid value inside a collapsed category must be visible
   from the outside, or it cannot be found and fixed. */
.eb-cat.has-error > .eb-cat__toggle { background: #fdf3f2; }
.eb-cat.has-error > .eb-cat__toggle .eb-cat__name { color: #8e1b16; }
.eb-cat.has-error > .eb-cat__toggle::after {
	content: "!";
	display: inline-block;
	width: 1.2rem; height: 1.2rem;
	line-height: 1.2rem;
	text-align: center;
	border-radius: 50%;
	background: #c62828;
	color: #fff;
	font-size: .8rem;
}

.eb-row { flex-wrap: wrap; }
.eb-row__input { flex-wrap: nowrap; }

/* --- Partner dashboard: left menu + content --- */

.eb-dash {
	display: grid;
	grid-template-columns: 220px minmax(0, 1fr);
	gap: 2rem;
	align-items: start;
}
.eb-dash__nav ul { list-style: none; margin: 0; padding: 0; }
.eb-dash__nav li { margin: 0; border-bottom: 1px solid #eee5dd; }
.eb-dash__nav a {
	display: block;
	padding: .8rem .9rem;
	color: #4e342e;
	text-decoration: none;
	font-size: .98rem;
	border-left: 3px solid transparent;
}
.eb-dash__nav a:hover { background: #faf7f4; color: #a1512b; }
.eb-dash__nav a.is-active {
	border-left-color: #a1512b;
	background: #faf7f4;
	color: #a1512b;
	font-weight: 600;
}
.eb-dash__title { margin: 0 0 1.1rem; font-size: 1.35rem; color: #3e2723; }

/* Phones: the menu becomes a row of tabs above the content. */
@media (max-width: 768px) {
	.eb-dash { grid-template-columns: 1fr; gap: 1.2rem; }
	.eb-dash__nav ul { display: flex; flex-wrap: wrap; gap: .4rem; }
	.eb-dash__nav li { border: 0; }
	.eb-dash__nav a {
		padding: .5rem .8rem;
		border: 1px solid #e0d8d0;
		border-radius: 999px;
		font-size: .9rem;
	}
	.eb-dash__nav a.is-active { border-color: #a1512b; }
}

/* --- Profile details --- */

.eb-profile { width: 100%; max-width: 620px; border-collapse: collapse; margin-bottom: 1rem; }
.eb-profile th,
.eb-profile td { padding: .65rem .8rem; border-bottom: 1px solid #f0eae5; text-align: left; vertical-align: top; }
.eb-profile th { width: 40%; font-weight: 600; color: #6d5c54; font-size: .9rem; }

/* --- Login form --- */

.eb-login { max-width: 420px; }
.eb-login p { margin: 0 0 .9rem; }
.eb-login label { display: block; font-size: .9rem; color: #6d5c54; margin-bottom: .3rem; }
.eb-login input[type="text"],
.eb-login input[type="password"] {
	width: 100%;
	padding: .65rem .7rem;
	border: 1px solid #d5c9c0;
	border-radius: 5px;
	font-size: 1rem;
}
.eb-login .login-remember label { display: inline; }
.eb-login input[type="submit"] {
	padding: .8rem 1.8rem;
	border: 0;
	border-radius: 6px;
	background: #a1512b;
	color: #fff;
	font-weight: 600;
	font-size: 1rem;
	cursor: pointer;
}
.eb-login input[type="submit"]:hover { background: #8a4324; }
