/* 医药外卖风格前台（模板 9 / 10） */
.pharmacy-view { min-height: 100vh; background: var(--alt, #e8ecf1); display: flex; justify-content: center; }
.pharmacy-view[hidden], #classicView[hidden] { display: none !important; }

.ph-phone {
  width: min(100%, 480px);
  min-height: 100vh;
  background: #f5f6f8;
  position: relative;
  display: flex;
  flex-direction: column;
  box-shadow: 0 0 40px rgba(0,0,0,.1);
  --ph-primary: #1e6fd9;
  --ph-primary-dark: #0d5bb8;
  --ph-primary-soft: #e8f1ff;
}

body.layout-10 .ph-phone {
  --ph-primary: #a9713e;
  --ph-primary-dark: #8a5a2e;
  --ph-primary-soft: #f7eee2;
}
body.layout-10 .ph-item-img { border-radius: 12px; }
body.layout-10 .ph-banner { border-color: #d9b68f; background: #fdf7ef; }
body.layout-10 .ph-shop-head { border-radius: 0 0 16px 16px; }

/* 顶部栏 */
.ph-topbar { height: 56px; flex: none; background: linear-gradient(135deg, var(--ph-primary), var(--ph-primary-dark)); display: flex; align-items: center; gap: 6px; padding: 0 10px; color: #fff; position: sticky; top: 0; z-index: 20; }
.ph-icon-btn { width: 30px; height: 30px; flex: none; border: none; background: transparent; color: #fff; font-size: 24px; line-height: 1; display: grid; place-items: center; padding: 0; }
.ph-search { flex: 1; min-width: 0; height: 34px; background: rgba(255,255,255,.96); border-radius: 17px; color: #8b929b; display: flex; align-items: center; gap: 7px; padding: 0 12px; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ph-search-icon { font-size: 19px; color: var(--ph-primary); line-height: 1; }

/* 店头 */
.ph-shop-head { background: #fff; padding: 16px 14px 14px; display: flex; gap: 12px; flex: none; }
.ph-logo { width: 64px; height: 64px; flex: none; border-radius: 10px; background: linear-gradient(135deg, var(--ph-primary), var(--ph-primary-dark)); color: #fff; font-family: var(--serif, serif); font-size: 30px; display: grid; place-items: center; box-shadow: inset 0 0 0 1px rgba(255,255,255,.25); }
.ph-shop-meta { flex: 1; min-width: 0; }
.ph-shop-meta h1 { font-size: 18px; line-height: 1.3; margin: 0 0 4px; color: #222; }
.ph-remark { font-size: 11px; color: #e8722e; margin: 0 0 8px; line-height: 1.5; }
.ph-tags { display: flex; flex-wrap: wrap; gap: 5px; }
.ph-tags span { font-size: 10px; color: #666; background: #f2f4f6; border-radius: 3px; padding: 2px 6px; }
.ph-tags span.hot { color: #e8722e; background: #fff2e8; }

/* Tab */
.ph-tabs { display: flex; background: #fff; border-top: 1px solid #f4f4f4; border-bottom: 1px solid #ececec; flex: none; }
.ph-tabs button { flex: 1; border: none; background: transparent; padding: 12px 0; font-size: 15px; color: #555; position: relative; }
.ph-tabs button.active { color: #222; font-weight: 700; }
.ph-tabs button.active::after { content: ''; position: absolute; bottom: 0; left: 32%; right: 32%; height: 3px; border-radius: 2px; background: var(--ph-primary); }

/* 主体 */
.ph-body { flex: 1; display: flex; min-height: 0; overflow: hidden; }
.ph-cats { width: 88px; flex: none; background: #f0f2f5; overflow-y: auto; }
.ph-cat { width: 100%; border: none; background: transparent; padding: 14px 4px; font-size: 12px; color: #666; display: flex; flex-direction: column; align-items: center; gap: 5px; }
.ph-cat i { font-style: normal; width: 26px; height: 26px; border-radius: 50%; background: #e1e5ea; color: #7a828c; display: grid; place-items: center; font-size: 12px; }
.ph-cat.active { background: #fff; color: var(--ph-primary); font-weight: 700; }
.ph-cat.active i { background: var(--ph-primary); color: #fff; }
.ph-content { flex: 1; min-width: 0; background: #fff; overflow-y: auto; padding-bottom: 74px; }

/* 提示 banner 与商家信息 */
.ph-banner { margin: 10px; border: 1px solid #8bb4f0; border-radius: 6px; background: #f1f7ff; overflow: hidden; }
.ph-banner-title { background: var(--ph-primary); color: #fff; font-size: 12px; padding: 6px 10px; font-weight: 600; }
.ph-banner p { margin: 0; padding: 8px 10px; font-size: 10px; color: #5a6672; line-height: 1.6; }
.ph-shop-info { padding: 18px 16px; font-size: 13px; line-height: 1.9; color: #555; }
.ph-shop-info h2 { font-size: 17px; color: #222; margin: 0 0 8px; }
.ph-shop-info p { margin: 0 0 6px; white-space: pre-wrap; }
.ph-shop-info b { color: #333; }

/* 商品列表 */
.ph-section-title { padding: 14px 12px 6px; font-size: 17px; font-weight: 700; display: flex; justify-content: space-between; align-items: baseline; color: #222; }
.ph-section-title small { font-size: 11px; color: #999; font-weight: 400; }
.ph-sort { display: flex; gap: 18px; padding: 0 12px 8px; border-bottom: 1px solid #f0f0f0; }
.ph-sort button { border: none; background: transparent; font-size: 12px; color: #888; padding: 4px 0; }
.ph-sort button.active { color: var(--ph-primary); font-weight: 600; }
.ph-sort button span { font-size: 13px; }
.ph-products { padding: 0 12px; }
.ph-item { display: flex; gap: 10px; padding: 14px 0; border-bottom: 1px solid #f2f2f2; cursor: pointer; }
.ph-item:last-child { border-bottom: none; }
.ph-item-img { width: 86px; height: 86px; flex: none; border-radius: 6px; background: #f3f5f7; overflow: hidden; display: grid; place-items: center; }
.ph-item-img img { width: 100%; height: 100%; object-fit: cover; }
.ph-item-img .ph-ph { font-family: var(--serif, serif); color: #b8c6bd; font-size: 26px; }
.ph-item-info { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.ph-item-info h3 { font-size: 13px; line-height: 1.45; margin: 0 0 5px; color: #222; }
.ph-item-desc { font-size: 11px; color: #888; margin: 0 0 4px; }
.ph-item-meta { font-size: 10px; color: #aaa; }
.ph-item-bottom { display: flex; justify-content: space-between; align-items: flex-end; margin-top: auto; padding-top: 6px; }
.ph-price { color: #e33; font-size: 18px; font-weight: 700; line-height: 1.2; }
.ph-price small { font-size: 12px; margin-right: 1px; }
.ph-price del { color: #bbb; font-size: 11px; font-weight: 400; margin-left: 5px; }
.ph-add { width: 25px; height: 25px; flex: none; border-radius: 50%; border: none; background: var(--ph-primary); color: #fff; font-size: 18px; display: grid; place-items: center; line-height: 1; padding: 0; }
.ph-empty { text-align: center; color: #999; font-size: 13px; padding: 60px 0; }

/* 底部栏 */
.ph-bottom { position: absolute; bottom: 0; left: 0; right: 0; height: 60px; background: #fff; border-top: 1px solid #eee; display: flex; align-items: center; gap: 10px; padding: 0 12px; box-shadow: 0 -2px 12px rgba(0,0,0,.05); z-index: 10; }
.ph-service, .ph-cart-btn { border: none; background: transparent; color: #666; font-size: 10px; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 0; white-space: nowrap; }
.ph-service { max-width: 108px; overflow: hidden; }
.ph-service::before, .ph-cart-btn::before { width: 26px; height: 26px; border-radius: 50%; background: var(--ph-primary-soft); color: var(--ph-primary); display: grid; place-items: center; font-size: 12px; }
.ph-service::before { content: '电'; }
.ph-cart-btn::before { content: '车'; }
#phCartCount { color: var(--ph-primary); font-weight: 700; }
.ph-delivery { font-size: 10px; color: #999; flex: 1; text-align: center; white-space: nowrap; }
.ph-checkout { background: var(--ph-primary); color: #fff; border: none; border-radius: 18px; padding: 10px 18px; font-size: 13px; white-space: nowrap; }
.ph-checkout:disabled { opacity: .5; }

@media (max-width: 420px) {
  .ph-shop-meta h1 { font-size: 16px; }
  .ph-cats { width: 78px; }
  .ph-item-info h3 { font-size: 12px; }
}
