* { box-sizing: border-box; }

html, body { min-height: 100%; }

body {
    margin: 0;
    background: #f4f5f7;
    color: var(--ink);
    font-family: "Montserrat", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }

.showcase-toolbar {
    width: min(100% - 32px, 900px);
    margin: 20px auto 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    color: #d8e8de;
    font-size: calc(12px + 3px);
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.showcase-toolbar__brand { display: flex; align-items: center; gap: 9px; }
.showcase-toolbar__dot { width: 8px; height: 8px; border-radius: 50%; background: #62c98b; box-shadow: 0 0 0 5px rgba(98, 201, 139, .12); }

.mode-switch { display: inline-flex; padding: 3px; border: 1px solid rgba(213, 239, 222, .12); border-radius: 12px; background: rgba(0, 0, 0, .18); text-transform: none; letter-spacing: 0; }
.mode-switch__button { border: 0; border-radius: 9px; background: transparent; color: #a9bdb0; padding: 7px 11px; cursor: pointer; font-size: calc(12px + 3px); font-weight: 700; }
.mode-switch__button.is-active { background: #fff; color: var(--brand-800); box-shadow: 0 3px 8px rgba(0,0,0,.15); }

.showcase-stage { display: flex; justify-content: center; padding: 8px 16px 28px; }

.device-frame {
    width: min(100%, 414px);
    height: min(860px, calc(100vh - 98px));
    min-height: 700px;
    overflow: hidden;
    position: relative;
    border: 8px solid #202721;
    border-radius: 38px;
    background: var(--surface);
    box-shadow: 0 28px 70px rgba(0, 0, 0, .34), 0 0 0 2px rgba(255,255,255,.14);
}

.device-status-bar { display: none; height: 28px; padding: 7px 16px 2px; align-items: center; justify-content: space-between; background: var(--brand-900); color: #fff; font-size: calc(10px + 3px); font-weight: 700; }
.device-status-bar__island { width: 72px; height: 13px; border-radius: 10px; background: #000; }
.device-status-bar__icons { display: flex; gap: 5px; font-size: calc(9px + 3px); }

.device-frame.is-app .device-status-bar { display: flex; }
.device-frame.is-app { border-radius: 40px; }

.app-header { height: 58px; padding: 0 12px; display: flex; align-items: center; justify-content: space-between; gap: 8px; position: sticky; top: 0; z-index: 10; color: #fff; background: var(--brand-800); box-shadow: 0 4px 12px rgba(8, 28, 21, .13); }
.icon-button, .profile-chip, .favorite-button, .search-card__filter { border: 0; cursor: pointer; }
.icon-button { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 11px; color: #fff; background: transparent; }
.icon-button:hover, .icon-button:focus-visible { background: rgba(255,255,255,.12); outline: none; }
.icon-button--small { width: 32px; height: 32px; font-size: calc(14px + 3px); position: relative; }
.app-brand { display: flex; align-items: center; gap: 8px; margin-right: auto; text-decoration: none; }
.app-brand__logo { width: 135px; display: block; object-fit: contain; }
.app-brand__mark { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 8px; background: #fff; color: var(--brand-800); font-size: calc(17px + 3px); font-weight: 900; }
.app-brand__text { display: flex; flex-direction: column; line-height: 1; }
.app-brand__text strong { font-size: calc(12px + 3px); letter-spacing: .08em; }
.app-brand__text small { margin-top: 4px; color: #c7ddd0; font-size: calc(7px + 3px); letter-spacing: .11em; text-transform: uppercase; }
.app-header__actions { display: flex; align-items: center; gap: 2px; }
.notification-dot { width: 5px; height: 5px; position: absolute; top: 6px; right: 6px; border: 1px solid var(--brand-800); border-radius: 50%; background: var(--warm); }
.profile-chip { width: 35px; height: 35px; padding: 0; border-radius: 10px; color: var(--brand-900); background: var(--warm); font-weight: 900; text-decoration: none; }

.app-content { height: calc(100% - 58px); overflow-y: auto; padding-bottom: 82px; background: #f7faf8; scrollbar-width: none; }
.app-content::-webkit-scrollbar { display: none; }
.device-frame.is-app .app-content { height: calc(100% - 86px); }
.welcome-block { padding: 25px 18px 19px; color: #fff; background: linear-gradient(145deg, var(--brand-800), var(--brand-700)); border-radius: 0 0 25px 25px; }
.eyebrow { display: inline-flex; align-items: center; gap: 6px; color: #bfe0cb; font-size: calc(10px + 3px); font-weight: 800; letter-spacing: .13em; text-transform: uppercase; }
.welcome-block h1 { margin: 13px 0 9px; font-size: calc(26px + 3px); line-height: 1.1; letter-spacing: -.045em; }
.welcome-block h1 em { color: #f4c678; font-style: normal; }
.welcome-block p { max-width: 280px; margin: 0; color: #d6e8dc; font-size: calc(12px + 3px); line-height: 1.5; }

.search-card { margin: -5px 13px 0; padding: 10px; position: relative; z-index: 2; border: 1px solid rgba(255,255,255,.8); border-radius: 16px; background: #fff; box-shadow: 0 10px 25px rgba(25, 64, 44, .13); }
.search-card__input { height: 41px; display: flex; align-items: center; gap: 9px; padding: 0 10px; border-radius: 11px; background: var(--brand-50); color: var(--brand-600); }
.search-card__input input { min-width: 0; flex: 1; border: 0; outline: 0; color: var(--ink); background: transparent; font-size: calc(12px + 3px); }
.search-card__input input::placeholder { color: #8b9990; }
.search-card__filter { width: 27px; height: 27px; border-radius: 8px; color: var(--brand-700); background: #fff; font-size: calc(12px + 3px); }
.search-card__chips { display: flex; gap: 5px; margin: 9px 0; overflow-x: auto; scrollbar-width: none; }
.search-card__chips::-webkit-scrollbar { display: none; }
.category-chip { flex: 0 0 auto; padding: 6px 9px; border: 1px solid var(--line); border-radius: 8px; color: #718078; background: #fff; cursor: pointer; font-size: calc(10px + 3px); font-weight: 700; }
.category-chip.is-active { border-color: var(--brand-600); color: #fff; background: var(--brand-600); }
.primary-button { width: 100%; height: 39px; display: flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: 10px; color: #fff; background: var(--brand-700); cursor: pointer; font-size: calc(12px + 3px); font-weight: 800; }
.primary-button:hover, .primary-button:focus-visible { background: var(--brand-800); outline: none; }

.quick-actions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; padding: 17px 13px 8px; }
.quick-action { min-height: 67px; display: flex; flex-direction: column; align-items: flex-start; justify-content: space-between; padding: 9px; border: 1px solid var(--line); border-radius: 13px; color: var(--ink); background: #fff; cursor: pointer; text-align: left; font-size: calc(10px + 3px); font-weight: 750; line-height: 1.2; }
.quick-action__icon { width: 24px; height: 24px; display: grid; place-items: center; border-radius: 8px; font-size: calc(12px + 3px); }
.quick-action__icon--warm { color: #a86d13; background: #fff1d8; }
.quick-action__icon--soft { color: #b35a6f; background: #fdebf0; }
.quick-action__icon--blue { color: #5279ad; background: #e9f1ff; }
.quick-action:hover, .quick-action:focus-visible { border-color: var(--brand-200); outline: none; transform: translateY(-1px); }

.listings-section { padding: 13px 13px 5px; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 8px; margin-bottom: 11px; }
.section-heading__kicker { color: var(--brand-600); font-size: calc(9px + 3px); font-weight: 900; letter-spacing: .16em; }
.section-heading h2 { margin: 4px 0 0; color: #1b2921; font-size: calc(18px + 3px); letter-spacing: -.035em; }
.text-link { color: var(--brand-600); font-size: calc(10px + 3px); font-weight: 800; white-space: nowrap; }
.text-link i { margin-left: 3px; font-size: calc(9px + 3px); }
.listing-list { display: grid; gap: 10px; }
.listing-card { display: block; overflow: hidden; border: 1px solid var(--card-border); border-radius: var(--card-radius); background: var(--card-background); box-shadow: var(--card-shadow); }
.listing-card:hover { border-color: var(--card-hover-border); }
.listing-card__image-wrap { height: 154px; position: relative; overflow: hidden; background: #e8eee9; }
.listing-card__image-wrap img { width: 100%; height: 100%; display: block; object-fit: cover; }
.listing-card__type, .listing-card__price { position: absolute; color: #fff; font-weight: 800; text-shadow: 0 1px 3px rgba(0,0,0,.2); }
.listing-card__type { top: 10px; left: 10px; padding: 5px 8px; border-radius: 7px; background: rgba(27, 67, 50, .88); font-size: calc(9px + 3px); text-transform: uppercase; }
.listing-card__price { left: 10px; bottom: 10px; font-size: calc(16px + 3px); }
.favorite-button { width: 44px; height: 44px; position: absolute; top: 8px; right: 8px; display: grid; place-items: center; border-radius: 12px; color: #fff; background: rgba(14, 30, 21, .55); font-size: calc(17px + 3px); }
.favorite-button:not(.active), .favorite-button:not(.active) .fa-regular { color: #fff; }
.favorite-button.active, .favorite-button.active .fa-solid { color: #f75e5e; }
.favorite-button:not(.active):hover, .favorite-button:not(.active):focus-visible { color: #fff; background: rgba(14, 30, 21, .75); outline: none; }
.favorite-button.active:hover, .favorite-button.active:focus-visible { color: #f75e5e; background: rgba(14, 30, 21, .75); outline: none; }
.favorite-button.favorite-pop, .favorite-btn.favorite-pop, .mobile-detail__gallery-favorite.favorite-pop, .mobile-detail__quick-action.favorite-pop { animation: favorite-pop .38s cubic-bezier(.2, .8, .25, 1); }
.favorite-burst-host { position: fixed; z-index: 1000; width: 0; height: 0; pointer-events: none; }
.favorite-burst-host::before { content: ''; position: absolute; top: 0; left: 0; width: 58px; height: 58px; border: 2px solid rgba(247, 94, 94, .72); border-radius: 50%; box-shadow: 0 0 0 4px rgba(247, 94, 94, .12), 0 0 18px rgba(247, 94, 94, .28); transform: translate(-50%, -50%) scale(.35); animation: favorite-burst-ring .62s cubic-bezier(.12, .78, .25, 1) forwards; }
.favorite-burst-particle { position: absolute; top: 0; left: 0; width: var(--particle-size); height: var(--particle-size); border: 1px solid rgba(255, 255, 255, .55); border-radius: 50%; background: var(--particle-color); box-shadow: 0 2px 7px rgba(16, 43, 25, .28), 0 0 6px var(--particle-color); transform: translate(-50%, -50%) scale(1); animation: favorite-burst .68s cubic-bezier(.12, .78, .25, 1) forwards; will-change: transform, opacity; }
@keyframes favorite-pop { 0% { transform: scale(1); } 45% { transform: scale(1.26); } 100% { transform: scale(1); } }
@keyframes favorite-burst-ring { 0% { opacity: .9; transform: translate(-50%, -50%) scale(.35); } 100% { opacity: 0; transform: translate(-50%, -50%) scale(1.18); } }
@keyframes favorite-burst { 0% { opacity: 1; transform: translate(-50%, -50%) scale(1); } 100% { opacity: 0; transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) scale(.12); } }
@media (prefers-reduced-motion: reduce) { .favorite-button.favorite-pop, .favorite-btn.favorite-pop, .mobile-detail__gallery-favorite.favorite-pop, .mobile-detail__quick-action.favorite-pop, .favorite-burst-host::before, .favorite-burst-particle { animation: none; } }
.listing-card__body { padding: 11px 11px 12px; }
.listing-card__body h3 { margin: 0 0 6px; overflow: hidden; color: #1b2921; font-size: calc(13px + 3px); line-height: 1.25; text-overflow: ellipsis; white-space: nowrap; }
.listing-card__body p { margin: 0 0 9px; overflow: hidden; color: #565756; font-size: calc(11px + 3px); text-overflow: ellipsis; white-space: nowrap; }
.listing-card__body p i { margin-right: 4px; color: var(--brand-600); }
.listing-card__specs { display: flex; gap: 13px; color: #323533; font-size: calc(10px + 3px); font-weight: 700; }
.listing-card__specs i { margin-right: 4px; color: #99a69e; }
.listing-card__specs span { background: #f1f1f1; padding: 3px 5px; border-radius: 5px; border: 1px solid #d7d7d7; color: #575757; }

.bottom-nav { height: 69px; padding: 8px 14px max(8px, env(safe-area-inset-bottom)); display: grid; grid-template-columns: repeat(5, 1fr); align-items: end; position: absolute; right: 0; bottom: 0; left: 0; z-index: var(--z-bottom-nav); border-top: 1px solid #e4ebe6; background: rgba(255,255,255,.96); backdrop-filter: blur(12px); }
.bottom-nav__item { min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 4px; color: #9aa69f; font-size: calc(10px + 3px); font-weight: 700; }
.bottom-nav__item i { font-size: calc(16px + 3px); }
.bottom-nav__item.is-active { color: var(--brand-700); }
.bottom-nav__add { width: 43px; height: 43px; display: grid; place-items: center; justify-self: center; margin-bottom: 9px; border: 4px solid #fff; border-radius: 15px; color: #fff; background: var(--brand-600); box-shadow: 0 5px 14px rgba(45, 106, 79, .3); font-size: calc(17px + 3px); }
.toast { max-width: min(360px, calc(100% - 28px)); padding: 11px 14px; position: fixed; right: 14px; bottom: 18px; z-index: var(--z-toast); border-radius: 11px; color: #fff; background: #17211c; box-shadow: 0 12px 30px rgba(0,0,0,.25); font-size: calc(12px + 3px); opacity: 0; pointer-events: none; transform: translateY(12px); transition: var(--motion-fast); }
.toast.is-visible { opacity: 1; transform: translateY(0); }

@media (max-width: 540px) {
    .showcase-toolbar { width: calc(100% - 24px); margin-top: 11px; }
    .showcase-toolbar__brand { font-size: calc(11px + 3px); }
    .showcase-stage { padding: 0; }
    .device-frame { width: 100%; height: 100vh; min-height: 0; border: 0; border-radius: 0; box-shadow: none; }
    .device-frame.is-app { border-radius: 0; }
    .device-status-bar { padding-top: max(7px, env(safe-area-inset-top)); }
    .device-frame.is-app .device-status-bar { height: max(28px, calc(22px + env(safe-area-inset-top))); }
}

/* Рабочий app-shell: без демонстрационной панели, рамки устройства и статус-бара макета. */
body.app-page {
    min-width: 0;
    min-height: 100vh;
    overflow-x: hidden;
    padding: var(--mobile-app-page-padding);
    background: #f4f5f7;
    color: #20242a;
    font-family: "Montserrat", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
.app-shell { min-height: 100vh; display: flex; justify-content: center; }
.app-shell .device-frame { width: 100%; max-width: 480px; height: 100vh; min-height: 100vh; border: 0; border-radius: 0; box-shadow: none; }
.app-shell .app-content { height: calc(100vh - 58px); }
.app-shell .device-status-bar { display: none; }

@media (min-width: 541px) {
    .app-shell .device-frame { min-height: calc(100vh - 40px); height: calc(100vh - 40px); border-radius: 26px; box-shadow: 0 18px 50px rgba(8, 28, 21, .18); overflow: hidden; }
    .app-shell .app-content { height: calc(100% - 58px); }
}
