/* Доработки корзины и оформления заказа (aq_checkout.js) */

:root {
	--aq-green: #53b50a;
	--aq-green-dark: #4ba309;
	--aq-green-light: #f0fdf4;
	--aq-border: #e2e8f0;
	--aq-text: #1e293b;
	--aq-muted: #64748b;
	--aq-danger: #e11d48;
}

/* ---------- Плитки слотов доставки ---------- */

.aq-slots {
	margin: 8px 0 20px;
	padding: 16px 20px 20px;
	background: #f8fafc;
	border: 1px solid var(--aq-border);
	border-radius: 12px;
}
.aq-slots.has-error {
	border-color: var(--aq-danger);
	box-shadow: 0 0 0 3px rgba(225, 29, 72, .12);
}
.aq-slots-head {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	justify-content: space-between;
	gap: 4px 16px;
	margin-bottom: 12px;
}
.aq-slots-title {
	font-size: 17px;
	font-weight: 700;
	color: var(--aq-text);
}
.aq-slots-summary {
	font-size: 14px;
	font-weight: 600;
	color: var(--aq-green);
}
.aq-slots-summary:not(:empty) {
	margin-top: 12px;
}
.aq-slots-days {
	display: flex;
	gap: 8px;
	overflow-x: auto;
	padding-bottom: 6px;
	margin-bottom: 12px;
	scroll-snap-type: x proximity;
	-webkit-overflow-scrolling: touch;
	scrollbar-width: thin;
}
.aq-slots-day {
	flex: 0 0 auto;
	min-width: 84px;
	padding: 8px 12px;
	border: 1px solid var(--aq-border);
	border-radius: 10px;
	background: #fff;
	color: var(--aq-text);
	font: inherit;
	line-height: 1.25;
	text-align: center;
	cursor: pointer;
	scroll-snap-align: start;
	transition: border-color .15s, background .15s, color .15s;
}
.aq-slots-day:hover {
	border-color: var(--aq-green);
}
.aq-slots-day.is-active {
	border-color: var(--aq-green);
	background: var(--aq-green);
	color: #fff;
}
.aq-slots-day-label {
	display: block;
	font-size: 14px;
	font-weight: 700;
}
.aq-slots-day-date {
	display: block;
	font-size: 12px;
	opacity: .8;
}
.aq-slots-day.is-selected:not(.is-active) {
	border-color: var(--aq-green);
	background: var(--aq-green-light);
}
.aq-slots-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
	gap: 10px;
}
.aq-slots-grid[hidden] {
	display: none;
}
.aq-slots-tile {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 2px;
	min-height: 64px;
	padding: 10px 14px;
	border: 2px solid var(--aq-border);
	border-radius: 12px;
	background: #fff;
	color: var(--aq-text);
	font: inherit;
	text-align: left;
	cursor: pointer;
	transition: border-color .15s, background .15s, box-shadow .15s;
}
.aq-slots-tile:hover {
	border-color: var(--aq-green);
}
.aq-slots-tile.is-selected {
	border-color: var(--aq-green);
	background: var(--aq-green-light);
	box-shadow: 0 0 0 3px rgba(0, 150, 64, .12);
}
.aq-slots-tile-day {
	font-size: 13px;
	color: var(--aq-muted);
}
.aq-slots-tile-time {
	font-size: 18px;
	font-weight: 700;
	white-space: nowrap;
}
.aq-slots-tile.is-selected .aq-slots-tile-time {
	color: var(--aq-green-dark);
}
.aq-slots-error {
	margin-top: 10px;
	font-size: 14px;
	font-weight: 600;
	color: var(--aq-danger);
}
.aq-slots-error[hidden] {
	display: none;
}
.aq-slots-empty {
	font-size: 15px;
	color: var(--aq-text);
}

/* ---------- Карусель «Добавьте к заказу» ---------- */

.aq-upsell {
	margin: -10px 0 25px;
	padding: 16px 20px;
	background: #fff;
	border: 1px solid var(--aq-border);
	border-radius: 12px;
}
.aq-upsell-head {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 4px 16px;
	margin-bottom: 12px;
}
.aq-upsell-title {
	font-size: 17px;
	font-weight: 700;
	color: var(--aq-text);
}
.aq-upsell-subtitle {
	flex: 1 1 260px;
	font-size: 14px;
	color: var(--aq-muted);
}
.aq-upsell-subtitle b {
	color: var(--aq-danger);
}
.aq-upsell-nav {
	display: flex;
	gap: 6px;
}
.aq-upsell-arrow {
	width: 32px;
	height: 32px;
	border: 1px solid var(--aq-border);
	border-radius: 50%;
	background: #fff;
	color: var(--aq-text);
	font-size: 22px;
	line-height: 28px;
	cursor: pointer;
}
.aq-upsell-arrow:hover {
	border-color: var(--aq-green);
	color: var(--aq-green);
}
.aq-upsell-track {
	display: flex;
	gap: 12px;
	overflow-x: auto;
	padding-bottom: 6px;
	scroll-snap-type: x mandatory;
	-webkit-overflow-scrolling: touch;
	scrollbar-width: thin;
}
.aq-upsell-card {
	flex: 0 0 180px;
	display: flex;
	flex-direction: column;
	padding: 10px;
	border: 1px solid var(--aq-border);
	border-radius: 10px;
	background: #fff;
	scroll-snap-align: start;
}
.aq-upsell-card-img {
	height: 96px;
	display: flex;
	align-items: center;
	justify-content: center;
	margin-bottom: 8px;
}
.aq-upsell-card-img img {
	max-width: 100%;
	max-height: 96px;
	width: auto;
	height: auto;
	object-fit: contain;
}
.aq-upsell-card-name {
	display: -webkit-box;
	-webkit-line-clamp: 3;
	-webkit-box-orient: vertical;
	overflow: hidden;
	min-height: 54px;
	margin-bottom: 8px;
	font-size: 13px;
	line-height: 18px;
	color: var(--aq-text);
}
.aq-upsell-card-bottom {
	margin-top: auto;
}
.aq-upsell-card-price {
	margin-bottom: 6px;
	font-size: 16px;
	font-weight: 700;
	color: var(--aq-text);
}
.aq-upsell-card.is-enough .aq-upsell-card-price::after {
	content: "хватит до минимума";
	display: block;
	font-size: 11px;
	font-weight: 600;
	color: var(--aq-green);
}
.aq-upsell-card-btn {
	width: 100%;
	padding: 8px 10px;
	border: 0;
	border-radius: 8px;
	background: var(--aq-green);
	color: #fff;
	font: inherit;
	font-size: 14px;
	font-weight: 600;
	cursor: pointer;
	transition: background .15s;
}
.aq-upsell-card-btn:hover {
	background: var(--aq-green-dark);
}
.aq-upsell-card-btn[disabled] {
	opacity: .7;
	cursor: default;
}

/* ---------- Плавающая полоса «Оформить заказ» (смартфоны) ---------- */

.aq-sticky-checkout {
	position: fixed;
	left: 0;
	right: 0;
	bottom: 0;
	z-index: 31;
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 10px 16px;
	padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px));
	background: #fff;
	border-top: 1px solid var(--aq-border);
	box-shadow: 0 -4px 16px rgba(15, 23, 42, .08);
}
.aq-sticky-checkout[hidden] {
	display: none;
}
.aq-sticky-checkout-info {
	flex: 1 1 auto;
	min-width: 0;
	line-height: 1.2;
}
.aq-sticky-checkout-label {
	font-size: 12px;
	color: var(--aq-muted);
}
.aq-sticky-checkout-sum {
	font-size: 18px;
	font-weight: 700;
	color: var(--aq-text);
	white-space: nowrap;
}
.aq-sticky-checkout-hint {
	font-size: 12px;
	font-weight: 600;
	color: var(--aq-danger);
}
.aq-sticky-checkout-hint[hidden] {
	display: none;
}
.aq-sticky-checkout-btn {
	flex: 0 0 auto;
	padding: 12px 18px;
	border: 0;
	border-radius: 10px;
	background: var(--aq-green);
	color: #fff;
	font: inherit;
	font-size: 15px;
	font-weight: 700;
	cursor: pointer;
}
.aq-sticky-checkout.is-below-min .aq-sticky-checkout-btn {
	background: #fff;
	color: var(--aq-green);
	box-shadow: inset 0 0 0 2px var(--aq-green);
}
body.aq-sticky-on {
	padding-bottom: 72px;
}
@media (min-width: 769px) {
	body.aq-sticky-on .chat-widget-icon {
		top: auto !important;
		bottom: calc(var(--aq-sticky-offset, 136px) + 12px) !important;
	}
}
@media (max-width: 768px) {
	body.aq-sticky-on .chat-widget-icon {
		bottom: auto !important;
		top: 50% !important;
		right: 12px !important;
		transform: translateY(-50%) !important;
		z-index: 9999 !important;
	}
}

/* ---------- Подсказки DaData ---------- */

.aq-dd-subtext {
	font-size: 12px;
	color: var(--aq-muted);
}

/* ---------- «Повторить прошлый заказ» ---------- */

.aq-repeat-header {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	height: 36px;
	padding: 0 14px;
	border: 1px solid var(--aq-green);
	border-radius: 999px;
	color: var(--aq-green);
	font-size: 14px;
	font-weight: 600;
	line-height: 1;
	white-space: nowrap;
	text-decoration: none;
	transition: background .15s, color .15s;
}
.aq-repeat-header:hover {
	background: var(--aq-green);
	color: #fff;
}
.aq-repeat-header svg {
	flex: 0 0 auto;
}
.user-links-item_repeat {
	display: flex;
	align-items: center;
	margin-right: 8px;
}
@media (max-width: 1023px) {
	.user-links-item_repeat {
		display: none;
	}
}
/* мобильная кнопка «Повторить заказ» — плавающая, внизу (см. aq_ui.css) */

.aq-repeat-card {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 12px 24px;
	margin-bottom: 24px;
	padding: 20px 24px;
	background: var(--aq-green-light);
	border: 1px solid #bbf7d0;
	border-radius: 12px;
}
.aq-repeat-card-title {
	margin-bottom: 4px;
	font-size: 18px;
	font-weight: 700;
	color: var(--aq-text);
}
.aq-repeat-card-text {
	font-size: 14px;
	color: var(--aq-muted);
}
.aq-repeat-card .aq-repeat-header {
	height: 44px;
	padding: 0 22px;
	background: var(--aq-green);
	color: #fff;
	font-size: 15px;
}
.aq-repeat-card .aq-repeat-header:hover {
	background: var(--aq-green-dark);
}

.aq-notice {
	margin: 0 0 16px;
	padding: 12px 16px;
	background: #fffbeb;
	border: 1px solid #fde68a;
	border-radius: 10px;
	font-size: 14px;
	color: var(--aq-text);
}
.aq-notice--error {
	background: #fff1f2;
	border-color: #fecdd3;
}

@media (max-width: 767px) {
	.aq-slots {
		padding: 14px 12px 16px;
	}
	.aq-slots-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 8px;
	}
	.aq-slots-tile {
		padding: 8px 10px;
	}
	.aq-slots-tile-time {
		font-size: 16px;
	}
	.aq-upsell {
		padding: 14px 12px;
	}
	.aq-upsell-nav {
		display: none;
	}
	.aq-upsell-card {
		flex-basis: 150px;
	}
	.aq-repeat-card {
		padding: 16px;
	}
	.aq-repeat-card .aq-repeat-header {
		width: 100%;
		justify-content: center;
	}
}


/* ---------- Компактная мобильная сетка адреса (Подъезд, Этаж, Домофон) ---------- */
@media (max-width: 768px) {
    #cartrow1 {
        display: grid !important;
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 8px !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        max-width: 100% !important;
    }
    #cartrow1 > [class*="col-"] {
        flex: 1 1 0 !important;
        max-width: 100% !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
    }
    #cartrow1 label.form-item {
        font-size: 12px !important;
        margin-bottom: 0 !important;
    }
    #cartrow1 input {
        height: 42px !important;
        font-size: 15px !important;
        text-align: center;
        padding: 4px 8px !important;
    }
    #cartrow2 {
        padding-left: 0 !important;
        display: flex !important;
        flex-direction: row !important;
        gap: 10px !important;
        white-space: normal !important;
    }
    #cartrow2 > [class*="col-"] {
        flex: 1 1 50% !important;
        max-width: 50% !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
    }
}


/* ---------- Подсказка входа для гостей (снижение отказов) ---------- */
.aq-guest-auth-hint {
	display: flex;
	align-items: flex-start;
	gap: 14px;
	background: #f0fdf4;
	border: 1.5px solid #86efac;
	border-radius: 12px;
	padding: 14px 18px;
	margin-bottom: 22px;
	box-shadow: 0 2px 10px rgba(83, 181, 10, 0.08);
	font-size: 14px;
	line-height: 1.45;
	color: #14532d;
}
.aq-guest-auth-icon {
	flex-shrink: 0;
	margin-top: 2px;
}
.aq-guest-auth-text {
	flex: 1;
}
.aq-guest-auth-lead {
	font-weight: 700;
	color: #14532d;
}
.aq-guest-auth-link {
	color: #15803d !important;
	font-weight: 700;
	text-decoration: underline !important;
	transition: color 0.15s ease;
}
.aq-guest-auth-link:hover {
	color: #166534 !important;
	text-decoration: none !important;
}
.aq-guest-auth-sub {
	margin-top: 4px;
	font-size: 12px;
	color: #4b5563;
	line-height: 1.35;
}

/* Компактная мобильная сетка адресных подполей */
@media (max-width: 768px) {
	.aq-guest-auth-hint {
		padding: 12px 14px;
		gap: 10px;
		font-size: 13px;
	}
	.aq-guest-auth-sub {
		font-size: 11px;
	}
}

/* ---------- Улучшения мобильной сетки и инлайн-валидации (снижение отказов) ---------- */
@media (max-width: 768px) {
    .basket-block .addritem {
        min-width: 100% !important;
        max-width: 100% !important;
        margin-right: 0 !important;
        margin-bottom: 14px !important;
    }
    .basket-block .addritem input {
        width: 100% !important;
        height: 44px !important;
        font-size: 16px !important; /* устраняет принудительный зум в iOS Safari */
    }
}

#ORDER_FORM input:focus,
#ORDER_FORM select:focus,
#ORDER_FORM textarea:focus {
    border-color: var(--aq-green) !important;
    box-shadow: 0 0 0 3px rgba(83, 181, 10, 0.18) !important;
    outline: none !important;
}

#ORDER_FORM input.error,
#ORDER_FORM select.error,
#ORDER_FORM textarea.error {
    border-color: #e11d48 !important;
    background-color: #fff1f2 !important;
    box-shadow: 0 0 0 3px rgba(225, 29, 72, 0.12) !important;
}

#ORDER_FORM label.error {
    display: block !important;
    color: #e11d48 !important;
    font-size: 12px !important;
    font-weight: 600 !important;
    margin-top: 4px !important;
    line-height: 1.3 !important;
}

#ORDER_FORM input.valid {
    border-color: #86efac !important;
}
