.hidden { display: none !important; }

:root {
	--bg: #fff5f0;
	--bg-pattern: #ffe8df;
	--card: #ffffff;
	--accent: #d84315;
	--accent-hover: #bf360c;
	--accent-light: #ffccbc;
	--text: #1a1a1a;
	--text-soft: #5d4037;
	--border: #f5d5cc;
	--shadow: 0 6px 24px rgba(216, 67, 21, 0.12);
	--shadow-card: 0 4px 20px rgba(0,0,0,0.08);
	--radius: 20px;
	--radius-sm: 14px;
}

* {
	box-sizing: border-box;
	margin: 0;
	padding: 0;
}

body {
	font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, sans-serif;
	background: var(--bg);
	background-image: radial-gradient(ellipse 120% 80% at 50% -20%, var(--bg-pattern), var(--bg));
	color: var(--text);
	min-height: 100vh;
	line-height: 1.4;
	-webkit-font-smoothing: antialiased;
}

#app {
	max-width: 480px;
	margin: 0 auto;
	min-height: 100vh;
}

/* Header */
.header {
	background: linear-gradient(160deg, #c62828 0%, #e64a19 40%, #ff6f00 100%);
	color: #fff;
	text-align: center;
	padding: 0.9rem 1rem;
	margin: 0.75rem 1rem 0;
	border-radius: 18px;
	box-shadow: 0 4px 20px rgba(198, 40, 40, 0.3);
}
.header-inner {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 0.6rem;
	flex-wrap: wrap;
}
.logo {
	font-size: 1.2rem;
	font-weight: 800;
	letter-spacing: -0.01em;
	white-space: nowrap;
}
.tagline {
	font-size: 0.85rem;
	opacity: 0.95;
	font-weight: 500;
	white-space: nowrap;
}
.tagline::before {
	content: '·';
	margin-right: 0.4rem;
	opacity: 0.6;
}
.header-desc {
	width: 100%;
	font-size: 0.8rem;
	opacity: 0.85;
	margin-top: 0.2rem;
	line-height: 1.4;
}

/* Feed */
#feed {
	padding: 1rem;
	padding-bottom: 2rem;
}

.post-card {
	background: var(--card);
	border-radius: var(--radius);
	box-shadow: var(--shadow-card);
	border: 1px solid var(--border);
	margin-bottom: 1.5rem;
	overflow: hidden;
}

/* Ползунок остатка метража */
.post-stock {
	margin-top: 0.5rem;
	width: 100%;
}
.post-stock-label {
	font-size: 0.72rem;
	color: #6d4c41;
	font-weight: 600;
	margin-bottom: 4px;
}
.post-stock-track {
	height: 13px;
	background: #ffe0cc;
	border-radius: 20px;
	overflow: hidden;
	box-shadow: inset 0 1px 3px rgba(0,0,0,0.1);
}
.post-stock-fill {
	height: 100%;
	border-radius: 20px;
	background: linear-gradient(90deg, #ff6f00, #ff3d00);
	transition: width 1.4s cubic-bezier(.4,0,.2,1);
	position: relative;
	overflow: hidden;
}
.post-stock-fill::after {
	content: '';
	position: absolute;
	right: -1px; top: 0; bottom: 0;
	width: 8px;
	background: rgba(255,255,255,0.55);
	border-radius: 20px;
	animation: stock-pulse 1.4s ease-in-out infinite;
}
.post-stock-fill::before {
	content: '';
	position: absolute;
	top: 0; left: -100%; width: 60%; height: 100%;
	background: linear-gradient(90deg, transparent, rgba(255,255,255,0.35), transparent);
	animation: stock-shine 2.5s ease-in-out infinite;
}
@keyframes stock-pulse {
	0%, 100% { opacity: 0.35; }
	50% { opacity: 1; }
}
@keyframes stock-shine {
	0% { left: -60%; }
	60%, 100% { left: 120%; }
}
.post-stock-fill.stock-wink {
	animation: stock-wink 0.6s ease;
}
@keyframes stock-wink {
	0%   { filter: brightness(1); box-shadow: none; }
	25%  { filter: brightness(1.5); box-shadow: 0 0 12px rgba(255,80,0,0.7); }
	60%  { filter: brightness(1.3); box-shadow: 0 0 6px rgba(255,80,0,0.4); }
	100% { filter: brightness(1); box-shadow: none; }
}

/* Ghost order bubble */
.ghost-bubble {
	position: absolute;
	bottom: 12px;
	left: 10px;
	z-index: 15;
	background: rgba(255, 255, 255, 0.88);
	backdrop-filter: blur(10px);
	-webkit-backdrop-filter: blur(10px);
	border-radius: 14px 14px 14px 4px;
	padding: 7px 12px;
	box-shadow: 0 4px 18px rgba(0,0,0,0.13);
	font-size: 0.78rem;
	color: #333;
	pointer-events: none;
	display: flex;
	align-items: center;
	gap: 6px;
	max-width: 220px;
	animation: ghost-in 0.4s cubic-bezier(.34,1.56,.64,1) both;
}
.ghost-bubble.ghost-out {
	animation: ghost-out 0.35s ease forwards;
}
@keyframes ghost-in {
	from { opacity: 0; transform: translateY(12px) scale(0.88); }
	to   { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes ghost-out {
	from { opacity: 1; transform: translateY(0) scale(1); }
	to   { opacity: 0; transform: translateY(-8px) scale(0.9); }
}

/* Бейдж «тесьма в подарок» */
.post-gift-badge {
	position: absolute;
	top: 10px;
	left: 0;
	z-index: 10;
	background: linear-gradient(135deg, #ff6f00, #ff3d00);
	color: #fff;
	font-size: 0.72rem;
	font-weight: 700;
	padding: 5px 12px 5px 10px;
	border-radius: 0 20px 20px 0;
	box-shadow: 0 2px 10px rgba(255,61,0,0.4);
	display: flex;
	align-items: center;
	gap: 5px;
	letter-spacing: 0.01em;
	pointer-events: none;
	animation: badge-pop 0.35s cubic-bezier(.34,1.56,.64,1) both;
}
@keyframes badge-pop {
	from { opacity: 0; transform: scale(0.7) translateX(-10px); }
	to   { opacity: 1; transform: scale(1) translateX(0); }
}

.post-images {
	position: relative;
	width: 100%;
	overflow: hidden;
	background: #ece8e4;
	transition: height 0.3s cubic-bezier(0.4, 0, 0.2, 1);
	touch-action: pan-y;
}
.post-images-inner {
	display: flex;
	height: 100%;
	align-items: stretch;
	transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
	will-change: transform;
	touch-action: pan-y;
}
.post-images-inner img {
	width: 100%;
	min-width: 100%;
	height: 100%;
	display: block;
	flex-shrink: 0;
	object-fit: cover;
	object-position: center 50%;
	user-select: none;
	-webkit-user-drag: none;
	-webkit-touch-callout: none;
	touch-action: pan-y;
}
.carousel-counter {
	position: absolute;
	top: 10px;
	right: 12px;
	background: rgba(0,0,0,0.45);
	color: #fff;
	font-size: 0.78rem;
	font-weight: 600;
	padding: 3px 8px;
	border-radius: 20px;
	z-index: 3;
	pointer-events: none;
}
.carousel-dots {
	position: absolute;
	bottom: 10px;
	left: 0;
	right: 0;
	display: flex;
	justify-content: center;
	gap: 6px;
	z-index: 2;
}
.carousel-dot {
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: rgba(255,255,255,0.6);
	border: none;
	cursor: pointer;
	padding: 0;
}
.carousel-dot.active {
	background: var(--accent);
	transform: scale(1.2);
	box-shadow: 0 0 0 2px #fff;
}
.carousel-arrow {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	width: 40px;
	height: 40px;
	border-radius: 50%;
	background: rgba(255,255,255,0.95);
	color: var(--accent);
	border: none;
	font-size: 1.4rem;
	font-weight: bold;
	cursor: pointer;
	z-index: 2;
	display: flex;
	align-items: center;
	justify-content: center;
	line-height: 1;
	box-shadow: 0 2px 12px rgba(0,0,0,0.15);
}
.carousel-arrow.prev { left: 8px; }
.carousel-arrow.next { right: 8px; }
.carousel-arrow:disabled { opacity: 0.4; cursor: default; }

/* Блок цены */
.post-price-block {
	margin: 0.4rem 0 0.6rem;
	padding: 0.45rem 0.75rem;
	background: linear-gradient(135deg, #fff8f0, #fff0e6);
	border: 1.5px solid #ffd0b0;
	border-radius: 10px;
	display: flex;
	align-items: center;
	gap: 0.75rem;
	flex-wrap: wrap;
}
.post-price-row {
	display: flex;
	align-items: baseline;
	gap: 0.4rem;
	flex-wrap: wrap;
}
.post-price-label {
	font-size: 0.68rem;
	font-weight: 700;
	color: #e65100;
	text-transform: uppercase;
	letter-spacing: 0.03em;
}
.post-price-current {
	font-size: 1.2rem;
	font-weight: 800;
	color: #d84315;
	line-height: 1;
}
.post-price-unit {
	font-size: 0.78rem;
	color: #bf360c;
	font-weight: 600;
}
.post-price-old {
	font-size: 0.82rem;
	color: #bbb;
	text-decoration: line-through;
	font-weight: 500;
}
.post-price-save {
	font-size: 0.7rem;
	background: #d84315;
	color: #fff;
	padding: 1px 6px;
	border-radius: 20px;
	font-weight: 700;
}
.post-price-timer {
	display: flex;
	align-items: center;
	gap: 0.25rem;
	font-size: 0.75rem;
	color: #6d4c41;
}
.post-price-timer-label {
	font-weight: 600;
}
.post-price-countdown {
	display: inline-flex;
	gap: 2px;
	font-weight: 700;
	font-size: 0.78rem;
}
.countdown-seg {
	background: #d84315;
	color: #fff;
	padding: 1px 5px;
	border-radius: 4px;
	min-width: 22px;
	text-align: center;
}
.countdown-sep {
	color: #d84315;
	font-weight: 700;
	align-self: center;
}

/* Отдельное окно подтверждения заказа */
.success-modal-box {
	text-align: center;
	padding: 2rem 1.5rem 1.5rem;
	max-width: 340px;
}
.success-hint {
	font-size: 0.9rem;
	color: #666;
	margin: 0.5rem 0 0.75rem;
	line-height: 1.5;
}
.success-manager {
	font-size: 0.88rem;
	color: #555;
	line-height: 1.5;
	margin-top: 0.5rem;
}
.success-icon {
	font-size: 3.5rem;
	line-height: 1;
	margin-bottom: 0.5rem;
	animation: pop-in 0.4s cubic-bezier(.34,1.56,.64,1) both;
}
.success-title {
	font-size: 1.6rem;
	font-weight: 800;
	color: #222;
	margin-bottom: 0.3rem;
}
.success-order-num {
	font-size: 3.2rem;
	font-weight: 900;
	color: #d84315;
	letter-spacing: 0.06em;
	line-height: 1.1;
	margin: 0.4rem 0 0.7rem;
	font-variant-numeric: tabular-nums;
}
.success-subtitle {
	font-size: 1rem;
	color: #555;
	line-height: 1.6;
}
.success-pickup-addr {
	background: #fff8f0;
	border: 1.5px solid #ffd0b0;
	border-radius: 12px;
	padding: 0.75rem 1rem;
	margin: 0.8rem 0 0.5rem;
	text-align: left;
}
.success-addr-label {
	font-size: 0.8rem;
	font-weight: 700;
	color: #e65100;
	margin-bottom: 0.3rem;
}
.success-addr-text {
	font-size: 1rem;
	font-weight: 600;
	color: #222;
	line-height: 1.5;
}
.success-wait {
	font-size: 1rem;
	font-weight: 700;
	color: #555;
	margin-top: 0.9rem;
}
.success-time {
	font-size: 1.3rem;
	font-weight: 800;
	color: #d84315;
	margin-top: 0.25rem;
	line-height: 1.4;
}
@keyframes pop-in {
	from { transform: scale(0.5); opacity: 0; }
	to   { transform: scale(1);   opacity: 1; }
}

.post-body {
	padding: 1rem;
}
.post-title {
	font-size: 1.15rem;
	font-weight: 700;
	margin-bottom: 0.4rem;
	color: var(--text);
}
.post-desc {
	white-space: pre-wrap;
	font-size: 0.95rem;
	color: var(--text-soft);
	margin-bottom: 0.85rem;
	line-height: 1.6;
	text-align: justify;
	hyphens: auto;
	-webkit-hyphens: auto;
	word-break: break-word;
	overflow-wrap: break-word;
}
.post-actions {
	display: flex;
	align-items: center;
	gap: 1rem;
	margin-bottom: 1rem;
	font-size: 0.85rem;
	color: var(--text-soft);
}
.post-actions button {
	background: none;
	border: none;
	color: inherit;
	cursor: pointer;
	display: flex;
	align-items: center;
	gap: 4px;
	padding: 4px 0;
	transition: transform 0.15s;
}
.post-actions button.like:active {
	transform: scale(1.25);
}
.post-actions button.like.liked {
	color: #e53935;
}
.post-actions .views-count {
	display: flex;
	align-items: center;
	gap: 4px;
	font-size: 0.85rem;
	color: var(--text-soft);
}
.post-actions .share-wrap {
	display: inline-flex;
	align-items: center;
	gap: 0.35rem;
	margin-left: auto;
}
.post-actions .share-count {
	font-size: 0.9rem;
	color: var(--text-soft);
}

.post-buttons {
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
}
.post-buttons .btn {
	width: 100%;
	padding: 0.85rem 1rem;
	border-radius: var(--radius-sm);
	font-size: 1rem;
	font-weight: 600;
	border: none;
	cursor: pointer;
	text-align: center;
	transition: background 0.2s;
}
.btn-primary {
	background: linear-gradient(180deg, var(--accent) 0%, var(--accent-hover) 100%);
	color: #fff;
	box-shadow: 0 4px 14px rgba(216, 67, 21, 0.35);
}
.btn-primary:hover {
	background: var(--accent-hover);
	box-shadow: 0 6px 20px rgba(216, 67, 21, 0.4);
}
.btn-outline {
	background: #fff;
	color: var(--accent);
	border: 2px solid var(--accent);
	font-weight: 600;
}
.btn-outline:hover {
	background: var(--accent-light);
}

/* Modal */
.modal {
	position: fixed;
	inset: 0;
	z-index: 100;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 1rem;
}
.modal.hidden {
	display: none;
}
.modal-backdrop {
	position: absolute;
	inset: 0;
	background: rgba(0,0,0,0.5);
}
.modal-box {
	position: relative;
	background: var(--card);
	border-radius: var(--radius);
	padding: 1.5rem;
	width: 100%;
	max-width: 360px;
	box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}
.modal-close {
	position: absolute;
	top: 0.75rem;
	right: 0.75rem;
	width: 44px;
	height: 44px;
	display: flex;
	align-items: center;
	justify-content: center;
	border: none;
	border-radius: 50%;
	background: var(--bg);
	color: var(--text-soft);
	font-size: 1.5rem;
	line-height: 1;
	cursor: pointer;
	transition: background 0.2s, color 0.2s;
}
.modal-close:hover {
	background: var(--border);
	color: var(--text);
}
.modal-title {
	font-size: 1.25rem;
	margin-bottom: 0.25rem;
}
.modal-min {
	font-size: 0.85rem;
	color: var(--text-soft);
	margin-bottom: 1rem;
}
.modal-box label {
	display: block;
	margin-bottom: 0.75rem;
	font-size: 0.9rem;
	font-weight: 500;
}
.modal-box input {
	width: 100%;
	padding: 0.75rem;
	border: 1px solid var(--border);
	border-radius: 8px;
	font-size: 1rem;
	margin-top: 0.25rem;
}
.modal-box .btn {
	margin-top: 0.5rem;
}
/* Кнопки в модалках — крупные, сильно скруглённые */
.btn-modal {
	width: 100% !important;
	display: block !important;
	padding: 1.1rem 1.5rem !important;
	font-size: 1.15rem !important;
	font-weight: 600 !important;
	border-radius: 24px !important;
	margin-top: 1rem !important;
	min-height: 56px !important;
	line-height: 1.3 !important;
	box-shadow: 0 4px 14px rgba(216, 67, 21, 0.3) !important;
	border: none !important;
	cursor: pointer !important;
}
#order-form .btn-modal {
	margin-top: 0.75rem;
}
#success-close-btn {
	margin-top: 1.25rem !important;
}
.success-msg {
	color: #2e7d32;
	font-weight: 600;
	margin-bottom: 0.5rem;
}
.order-number {
	font-size: 1rem;
	font-weight: 600;
	margin-bottom: 0.4rem;
}
.order-msg {
	font-size: 0.9rem;
	color: var(--text-soft);
	line-height: 1.5;
}
#order-success.hidden {
	display: none;
}

.pickup-info {
	display: flex;
	align-items: flex-start;
	gap: 0.6rem;
	background: #fff5f0;
	border: 1px solid var(--accent-light);
	border-radius: 10px;
	padding: 0.75rem 0.9rem;
	margin-bottom: 1rem;
}
.pickup-info.hidden { display: none; }
.pickup-info-icon { font-size: 1.4rem; line-height: 1; }
.pickup-info-title { font-weight: 700; font-size: 0.95rem; color: var(--accent); margin-bottom: 0.15rem; }
.pickup-info-addr { font-size: 0.95rem; font-weight: 600; color: var(--text); }
.pickup-info-hint { font-size: 0.8rem; color: var(--text-soft); margin-top: 0.1rem; }

/* Пикер дня/времени самовывоза */
.pickup-schedule { margin-bottom: 0.75rem; }
.pickup-schedule.hidden { display: none; }
.schedule-section-label {
	font-size: 0.82rem;
	font-weight: 600;
	color: var(--text-soft);
	text-transform: uppercase;
	letter-spacing: 0.04em;
	margin-bottom: 0.5rem;
	margin-top: 0.75rem;
}
.day-picker {
	display: flex;
	gap: 0.4rem;
	overflow-x: scroll;
	-webkit-overflow-scrolling: touch;
	touch-action: pan-x;
	padding-bottom: 4px;
	scrollbar-width: none;
}
.day-picker::-webkit-scrollbar { display: none; }
.day-btn {
	flex-shrink: 0;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 2px;
	padding: 0.45rem 0.5rem;
	border: 1.5px solid var(--border);
	border-radius: 10px;
	background: #fff;
	cursor: pointer;
	min-width: 52px;
	transition: all 0.15s;
}
.day-btn:hover { border-color: var(--accent); background: #fff5f0; }
.day-btn.active {
	border-color: var(--accent);
	background: linear-gradient(160deg, var(--accent), #e64a19);
	color: #fff;
}
.day-name { font-size: 0.8rem; font-weight: 700; }
.day-date { font-size: 0.72rem; opacity: 0.8; }
.day-hours { font-size: 0.65rem; opacity: 0.7; }
.time-section { margin-top: 0.25rem; }
.time-section.hidden { display: none; }
.time-picker {
	display: flex;
	flex-wrap: wrap;
	gap: 0.4rem;
}
.time-btn {
	padding: 0.4rem 0.7rem;
	border: 1.5px solid var(--border);
	border-radius: 8px;
	background: #fff;
	font-size: 0.9rem;
	font-weight: 600;
	cursor: pointer;
	transition: all 0.15s;
	color: var(--text);
}
.time-btn:hover { border-color: var(--accent); background: #fff5f0; }
.time-btn.active {
	border-color: var(--accent);
	background: linear-gradient(160deg, var(--accent), #e64a19);
	color: #fff;
}

.loading {
	text-align: center;
	padding: 2rem 1rem;
	color: var(--text-soft);
	font-size: 1rem;
}
.loading-error {
	color: var(--text);
	line-height: 1.5;
	max-width: 320px;
	margin: 0 auto;
}
.loading-error strong {
	color: var(--accent);
}
