/* ===== RESTAURANTS PAGE ===== */

:root {
    --bubble-delay: 600ms;
}

/* Hero */
.rest-hero {
    padding-top: 80px;
    padding-bottom: 56px;
    background: linear-gradient(160deg, #f0faf1 0%, #ffffff 60%);
    text-align: center;
}

.hero-map-wrap {
    position: relative;
    width: 100%;
    max-width: 800px;
    margin: 0 auto 40px;
    border-radius: 24px;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(76,175,80,0.12), 0 2px 8px rgba(0,0,0,0.06);
}

.hero-map {
    display: block;
    width: 100%;
    height: auto;
    transform: scale(1.1);
    transform-origin: center 20%;
}

.hero-map-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    text-align: center;
    width: 90%;
}

.rest-badge-wrap {
    display: inline-flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 24px;
}

.badge-plate {
    height: 80px;
    width: auto;
    flex-shrink: 0;
    will-change: transform;
}

.hero-map-overlay .rest-hero-title {
    font-size: clamp(36px, 6vw, 64px);
    text-shadow: 0 1px 4px rgba(255,255,255,0.8);
    margin-bottom: 0;
}

.hero-map-overlay .gradient-text {
    background: none;
    -webkit-background-clip: unset;
    -webkit-text-fill-color: var(--primary-dark);
    background-clip: unset;
    color: var(--primary-dark);
}

.rest-hero-text {
    padding: 0 24px;
}

.rest-badge {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: var(--primary-light);
    color: var(--primary-dark);
    font-size: 13px;
    font-weight: 600;
    padding: 6px 14px;
    border-radius: 100px 100px 100px 0;
    min-width: 160px;
    opacity: 0;
    transform: scale(0.9);
    transform-origin: bottom left;
    animation: heroPop 0.5s cubic-bezier(0.22, 1, 0.36, 1) var(--bubble-delay) forwards;
}

.rest-badge::before {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 0;
    width: 14px;
    height: 8px;
    background: var(--primary-light);
    clip-path: polygon(0% 0%, 100% 0%, 0% 100%);
}

.rest-hero-title {
    font-size: clamp(40px, 7vw, 72px);
    font-weight: 800;
    line-height: 1.1;
    color: var(--text);
    margin-bottom: 20px;
}

.rest-hero-subtitle {
    font-size: clamp(16px, 2vw, 20px);
    color: var(--text-secondary);
    max-width: 580px;
    margin: 0 auto;
    line-height: 1.7;
}

@keyframes heroPop {
    from { opacity: 0; transform: scale(0.9); }
    to   { opacity: 1; transform: scale(1); }
}

@keyframes heroSlideUp {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Feature sections */
.rest-section {
    padding: 48px 0;
}

.rest-section-alt {
    background: #f0faf1;
}

.rest-section-inner {
    display: flex;
    align-items: center;
    gap: 64px;
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 24px;
}

.rest-section-inner.reverse {
    flex-direction: row-reverse;
}

.rest-section-text {
    flex: 1;
    min-width: 0;
}

.rest-section-visual {
    flex: 1;
    min-width: 0;
    display: flex;
    justify-content: center;
}

.rest-tag {
    display: inline-block;
    font-size: 13px;
    font-weight: 600;
    color: var(--primary-dark);
    background: var(--primary-light);
    padding: 4px 12px;
    border-radius: 100px;
    margin-bottom: 16px;
}

.rest-section-title {
    font-size: clamp(26px, 4vw, 38px);
    font-weight: 800;
    line-height: 1.2;
    color: var(--text);
    margin-bottom: 16px;
}

.rest-section-text p {
    font-size: 17px;
    line-height: 1.8;
    color: var(--text-secondary);
}

/* Cycle callout */
.rest-cycle {
    padding: 24px 24px 48px;
}

.cycle-intro-label {
    text-align: center;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-secondary);
    margin-bottom: 14px;
}

.rest-cycle-inner {
    max-width: 860px;
    margin: 0 auto;
    background: #fff;
    border: 1.5px solid #A5D6A7;
    border-radius: 16px;
    padding: 28px 28px;
    display: flex;
    align-items: stretch;
    gap: 0;
}

.cycle-half {
    flex: 1;
    background: #F7FBF7;
    border-radius: 12px;
    padding: 20px;
}

.cycle-half-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}

.cycle-half-icon {
    font-size: 20px;
    line-height: 1;
}

.cycle-half-label {
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--primary-dark);
}

.cycle-half p {
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-secondary);
    margin: 0 0 16px;
}

.cycle-flow {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.cycle-flow-item {
    display: flex;
    align-items: center;
    gap: 10px;
}

.cycle-flow-num {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #C8E6C9;
    color: var(--primary-dark);
    font-size: 11px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.cycle-flow-step {
    font-size: 13px;
    color: var(--text);
    font-weight: 500;
    line-height: 1.4;
}

.cycle-flow-line {
    width: 1.5px;
    height: 10px;
    background: #C8E6C9;
    margin-left: 9px;
}

.cycle-connector {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    color: var(--primary);
    font-size: 22px;
    font-weight: 700;
    padding: 0 8px;
}

.cycle-connector-line {
    width: 1.5px;
    height: 32px;
    background: #A5D6A7;
}

/* Mock UI: allergen chips */
.mock-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    border: 1.5px solid #4CAF50;
    background: #E8F5E9;
    color: #2E7D32;
    font-size: 12px;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 100px;
}

.mock-chips-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

/* Mock UI: avatar */
.mock-avatar {
    width: 40px;
    height: 40px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 700;
    font-size: 16px;
    flex-shrink: 0;
}

/* Mock UI: user cards */
.mock-users {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
    max-width: 320px;
}

.mock-user-card {
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    padding: 14px 16px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.mock-user-info {
    min-width: 0;
}

.mock-user-name {
    font-weight: 700;
    font-size: 14px;
    color: var(--text);
    margin-bottom: 8px;
}

/* Mock UI: review card */
.mock-review-card {
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.1);
    padding: 20px;
    width: 100%;
    max-width: 320px;
}

.mock-restaurant-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 14px;
}

.mock-review-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.mock-review-meta {
    min-width: 0;
}

.mock-author {
    font-weight: 700;
    font-size: 14px;
    color: var(--text);
}

.mock-stars {
    font-size: 13px;
    color: #FFC107;
    letter-spacing: 1px;
}

.mock-review-text {
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-secondary);
    font-style: italic;
    margin-bottom: 14px;
}

/* Mock UI: restaurant cards */
.mock-restaurants {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
    max-width: 340px;
}

.mock-filter-bar {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    margin-bottom: 12px;
}

.mock-filter-chips {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.mock-filter-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.mock-filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: var(--primary);
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 100px;
}

.mock-restaurant-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 0;
    cursor: pointer;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    outline: none;
}

.mock-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
}

.mock-card-chevron {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    margin-left: 4px;
    position: relative;
}

.mock-card-chevron::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 8px;
    height: 8px;
    border-right: 2px solid #BDBDBD;
    border-bottom: 2px solid #BDBDBD;
    transform: translate(-50%, -65%) rotate(45deg);
    transition: transform 0.25s cubic-bezier(0.22, 1, 0.36, 1),
                border-color 0.2s ease;
}

.mock-restaurant-card:hover .mock-card-chevron::before {
    border-color: var(--primary-dark);
}

.mock-restaurant-card.expanded .mock-card-chevron::before {
    transform: translate(-50%, -35%) rotate(-135deg);
    border-color: var(--primary-dark);
}

.mock-card-detail {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows 0.3s cubic-bezier(0.22, 1, 0.36, 1);
    overflow: hidden;
}

.mock-card-detail > div {
    overflow: hidden;
}

.mock-restaurant-card.expanded .mock-card-detail {
    grid-template-rows: 1fr;
}

.mock-card-detail-inner {
    padding-top: 12px;
    margin-top: 12px;
    border-top: 1px solid #F0F0F0;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.mock-need-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 100px;
}

.mock-need-pill.covered {
    background: #E8F5E9;
    color: #2E7D32;
}

.mock-need-pill.missing {
    background: #F5F5F5;
    color: #BDBDBD;
}

.mock-card-detail-note {
    width: 100%;
    font-size: 11px;
    color: var(--text-secondary);
    margin-top: 4px;
}

.mock-restaurant-card.highlighted {
    border: 1.5px solid #A5D6A7;
}

@keyframes pulseGlow {
    0%, 100% { box-shadow: 0 4px 20px rgba(76, 175, 80, 0.18); }
    50%       { box-shadow: 0 6px 32px rgba(76, 175, 80, 0.42); }
}

.mock-restaurant-card.highlighted.anim-done {
    animation: pulseGlow 2.6s ease-in-out infinite;
}

.mock-thumb {
    width: 44px;
    height: 44px;
    border-radius: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}

.mock-rest-info {
    flex: 1;
    min-width: 0;
}

.mock-rest-name {
    font-weight: 700;
    font-size: 14px;
    color: var(--text);
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mock-rest-meta {
    font-size: 12px;
    color: var(--text-secondary);
}

.mock-badge {
    font-size: 12px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 100px;
    white-space: nowrap;
    flex-shrink: 0;
}

.match-full {
    background: #E8F5E9;
    color: #2E7D32;
}

.match-partial {
    background: #FFF8E1;
    color: #F57F17;
}

/* Intro */
.rest-intro {
    padding: 32px 24px 48px;
    text-align: center;
}

.rest-intro-text {
    max-width: 620px;
    margin: 0 auto;
    font-size: clamp(17px, 2.2vw, 21px);
    line-height: 1.7;
    color: var(--text);
}

/* Final CTA */
.rest-final-cta {
    background: #f0faf1;
    padding: 56px 24px;
    text-align: center;
}

.rest-final-cta-title {
    font-size: clamp(24px, 4vw, 38px);
    font-weight: 800;
    line-height: 1.25;
    color: var(--text);
    max-width: 640px;
    margin: 0 auto 16px;
}

.rest-final-cta-sub {
    font-size: clamp(15px, 1.8vw, 18px);
    line-height: 1.7;
    color: var(--text-secondary);
    max-width: 520px;
    margin: 0 auto 32px;
}

.rest-final-cta-plate {
    display: block;
    width: 96px;
    height: auto;
    margin: 0 auto 24px;
}

/* Scroll animations */
.anim-ready {
    opacity: 0;
    transform: translateY(28px);
    transition: opacity 0.55s cubic-bezier(0.22, 1, 0.36, 1),
                transform 0.55s cubic-bezier(0.22, 1, 0.36, 1);
}

.anim-ready.anim-done {
    opacity: 1;
    transform: translateY(0);
}

.anim-ready.anim-from-right {
    transform: translateX(48px);
}

.anim-ready.anim-from-right.anim-done {
    transform: translateX(0);
    transition: opacity 0.65s cubic-bezier(0.22, 1, 0.36, 1),
                transform 0.65s cubic-bezier(0.22, 1, 0.36, 1);
}

.anim-d1 { transition-delay: 130ms; }
.anim-d2 { transition-delay: 260ms; }

/* How it works */
.rest-hiw {
    padding: 48px 0;
    background: #f0faf1;
    overflow: hidden;
}

.rest-hiw-inner {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 24px;
    text-align: center;
}

.rest-hiw-label {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-secondary);
    margin-bottom: 40px;
}

.rest-hiw-steps {
    display: flex;
    align-items: stretch;
    gap: 0;
}

.rest-hiw-step {
    flex: 1;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.07);
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    text-align: left;
}

.rest-hiw-step-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}

.rest-hiw-num {
    font-size: 11px;
    font-weight: 700;
    color: var(--primary-dark);
    background: var(--primary-light);
    padding: 2px 9px;
    border-radius: 100px;
}

.rest-hiw-icon {
    font-size: 26px;
    line-height: 1;
}

.rest-hiw-icon img {
    width: 28px;
    height: auto;
    display: block;
}

.rest-hiw-step-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--text);
}

.rest-hiw-step-text {
    font-size: 13px;
    line-height: 1.65;
    color: var(--text-secondary);
}

.rest-hiw-arrow {
    flex-shrink: 0;
    align-self: center;
    width: 28px;
    height: 2px;
    background: #C8E6C9;
    position: relative;
    margin: 0 6px;
}

.rest-hiw-arrow::after {
    content: '';
    position: absolute;
    right: -6px;
    top: 50%;
    transform: translateY(-50%);
    border-top: 5px solid transparent;
    border-bottom: 5px solid transparent;
    border-left: 7px solid #C8E6C9;
}

.rest-hiw-dots {
    display: none;
}

/* Plate narrator */
.plate-narrator {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    gap: 10px;
    max-width: 560px;
    margin: 28px auto 24px;
    padding: 0 24px;
}


.plate-narrator-img {
    height: 80px;
    width: auto;
    flex-shrink: 0;
}

.plate-narrator-bubble {
    position: relative;
    background: var(--primary-light);
    color: var(--primary-dark);
    font-size: 13px;
    font-weight: 600;
    line-height: 1.5;
    padding: 6px 14px;
    border-radius: 100px 100px 100px 0;
    min-width: 160px;
}

.plate-narrator-bubble::before {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 0;
    width: 14px;
    height: 8px;
    background: var(--primary-light);
    clip-path: polygon(0% 0%, 100% 0%, 0% 100%);
}

.anim-ready.anim-pop {
    transform: scale(0.88);
}

.anim-ready.anim-pop.anim-done {
    transform: scale(1);
}

.anim-narrator-delay {
    transition-delay: var(--bubble-delay);
}

/* Mobile */
@media (max-width: 800px) {
    .rest-hero {
        padding-top: 70px;
        padding-bottom: 40px;
    }

    .hero-map-wrap {
        max-width: none;
        border-radius: 0;
        box-shadow: none;
        margin-bottom: 32px;
    }

    .hero-map-overlay .rest-hero-title {
        font-size: clamp(28px, 8vw, 40px);
    }

    .rest-section {
        padding: 36px 0;
    }

    .rest-section-inner,
    .rest-section-inner.reverse {
        flex-direction: column;
        gap: 36px;
    }

    .rest-section-visual {
        width: 100%;
    }

    .mock-users,
    .mock-review-card,
    .mock-restaurants {
        max-width: 100%;
    }

    .rest-cycle {
        padding: 20px 16px 40px;
    }

    .rest-cycle-inner {
        flex-direction: column;
        gap: 12px;
        padding: 20px 16px;
    }

    .cycle-connector {
        flex-direction: row;
        gap: 6px;
        padding: 4px 0;
    }

    .cycle-connector-line {
        width: 32px;
        height: 1.5px;
    }

    .rest-hiw-inner {
        padding: 0;
    }

    .rest-hiw-label {
        padding: 0 24px;
    }

    .rest-hiw-steps {
        flex-direction: row;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        gap: 0;
        align-items: stretch;
    }

    .rest-hiw-steps::-webkit-scrollbar {
        display: none;
    }

    .rest-hiw-step {
        min-width: calc(100% - 32px);
        max-width: calc(100% - 32px);
        flex-shrink: 0;
        scroll-snap-align: center;
        margin: 0 8px;
        box-sizing: border-box;
    }

    .rest-hiw-step:first-child {
        margin-left: 16px;
    }

    .rest-hiw-step:last-child {
        margin-right: 16px;
    }

    .rest-hiw-arrow {
        display: none;
    }

    .rest-hiw-dots {
        display: flex;
        justify-content: center;
        gap: 6px;
        margin-top: 20px;
    }

    .rest-hiw-dot {
        width: 6px;
        height: 6px;
        border-radius: 50%;
        background: #C8E6C9;
        transition: background 0.2s, transform 0.2s;
    }

    .rest-hiw-dot.active {
        background: var(--primary);
        transform: scale(1.3);
    }

    .plate-narrator {
        margin: 22px auto 20px;
    }

    .plate-narrator-img {
        height: 80px;
        width: auto;
    }
}
