<template>
  <view class="page-shell store-detail-page">
    <view class="page-blur"></view>
    <view class="page-blur-secondary"></view>
    <view class="page-blur-tertiary"></view>

    <view class="page-content subpage-content">
      <view class="subpage-nav">
        <view class="subpage-back" @tap="goBack">‹</view>
        <view class="subpage-title-wrap">
          <text class="subpage-title">门店详情</text>
          <text class="subpage-subtitle">空间、交通与到店提醒，都为你提前准备好</text>
        </view>
      </view>

      <view class="detail-hero glass-card">
        <image class="hero-image" :src="store.cover" mode="aspectFill" />
        <view class="hero-overlay"></view>
        <view class="hero-content">
          <text class="hero-kicker">{{ store.tag }}</text>
          <text class="hero-title">{{ store.name }}</text>
          <text class="hero-desc">{{ store.intro }}</text>
        </view>
      </view>

      <view class="subpage-card">
        <view class="info-list">
          <view class="info-row">
            <text class="info-label">地址</text>
            <text class="info-value">{{ store.address }}</text>
          </view>
          <view class="info-row">
            <text class="info-label">营业时间</text>
            <text class="info-value">{{ store.hours }}</text>
          </view>
          <view class="info-row">
            <text class="info-label">联系电话</text>
            <text class="info-value">{{ store.phone }}</text>
          </view>
          <view class="info-row">
            <text class="info-label">交通提示</text>
            <text class="info-value">{{ store.traffic }}</text>
          </view>
        </view>
      </view>

      <view class="subpage-card">
        <view class="section-head">
          <text class="section-title">门店亮点</text>
          <text class="section-link">会员礼遇</text>
        </view>
        <view class="meta-grid">
          <text v-for="item in store.features" :key="item" class="meta-pill">{{ item }}</text>
        </view>
        <view class="soft-panel note-panel">
          <text class="note-title">到店提醒</text>
          <text class="note-desc">{{ store.serviceNote }}</text>
        </view>
      </view>

      <view class="cta-row">
        <view class="secondary-button" @tap="callStore">联系门店</view>
        <view class="primary-button" @tap="bookStore">预约到店</view>
      </view>
    </view>
  </view>
</template>

<script>
import { findStoreById } from '@/data/mock'

export default {
  data() {
    return {
      store: findStoreById(1)
    }
  },
  onLoad(options) {
    this.store = findStoreById(options.id)
  },
  methods: {
    goBack() {
      uni.navigateBack({
        fail: () => {
          uni.redirectTo({ url: '/pages/store-list/store-list' })
        }
      })
    },
    callStore() {
      uni.makePhoneCall({ phoneNumber: this.store.phone })
    },
    bookStore() {
      uni.redirectTo({ url: `/pages/booking/booking?storeId=${this.store.id}` })
    }
  }
}
</script>

<style lang="scss" scoped>
@import '@/styles/mixins.scss';
@import '@/styles/subpage.scss';

.detail-hero {
  position: relative;
  overflow: hidden;
  min-height: 360rpx;
  margin-bottom: 28rpx;
}

.hero-image,
.hero-overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.hero-overlay {
  background: linear-gradient(180deg, rgba(36, 74, 61, 0.08), rgba(36, 74, 61, 0.34));
}

.hero-content {
  position: relative;
  z-index: 2;
  padding: 210rpx 34rpx 34rpx;
}

.hero-kicker {
  color: rgba(255, 255, 255, 0.86);
}

.hero-title {
  color: #fff;
}

.hero-desc {
  color: rgba(255, 255, 255, 0.82);
}

.note-panel {
  margin-top: 26rpx;
}

.note-title {
  display: block;
  font-size: 28rpx;
  font-weight: 600;
  color: $brand-primary-deep;
}

.note-desc {
  display: block;
  margin-top: 12rpx;
  font-size: 24rpx;
  line-height: 1.8;
  color: $text-secondary;
}
</style>
