/* 重庆益阁堂 移动端商品列表与药品详情页全局样式表 */

:root {
    --primary-color: #0bc175;
    --primary-hover: #09a865;
    --primary-light: #e6f9f0;
    --accent-orange: #ff6026;
    --bg-gray: #f7f8fa;
    --bg-white: #ffffff;
    --text-dark: #1a1c20;
    --text-medium: #626773;
    --text-light: #9ea4b0;
    --border-color: #eef1f6;
    --border-radius-sm: 8px;
    --border-radius-md: 12px;
    --box-shadow-soft: 0 4px 12px rgba(11, 193, 117, 0.05);
    --box-shadow-medium: 0 10px 30px rgba(0, 0, 0, 0.06);
    --transition-fast: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 基础重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Inter', 'Noto Sans SC', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: #eef2f5;
    color: var(--text-dark);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    overflow: hidden;
}

/* 视口外层包裹：PC端限制在 480px 居中 */
.app-wrapper {
    width: 100%;
    max-width: 480px;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

/* 应用主容器 */
.app-container {
    width: 100%;
    height: 100%;
    background-color: var(--bg-gray);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
    box-shadow: var(--box-shadow-medium);
}

/* 1. Header (店名 & 搜索框) */
.app-header {
    background-color: var(--bg-white);
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
    z-index: 10;
}

.store-nav {
    padding: 18px 16px 8px 16px;
    text-align: center;
}
.store-name {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-dark);
    letter-spacing: 0.5px;
}

/* 搜索栏样式 */
.search-section {
    padding: 8px 16px 14px 16px;
}
.search-bar-inner {
    background-color: var(--bg-gray);
    border-radius: 50px;
    display: flex;
    align-items: center;
    padding: 0 16px;
    height: 40px;
    border: 1px solid transparent;
    transition: var(--transition-fast);
}
.search-bar-inner:focus-within {
    background-color: #fff;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(11, 193, 117, 0.12);
}
.search-icon {
    color: var(--text-light);
    margin-right: 8px;
    flex-shrink: 0;
}
.search-bar-inner input {
    border: none;
    outline: none;
    background: transparent;
    width: 100%;
    height: 100%;
    font-size: 13px;
    color: var(--text-dark);
}
.search-bar-inner input:focus {
    outline: none;
    box-shadow: none;
}
.btn-clear-search {
    border: none;
    background: transparent;
    color: var(--text-light);
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
}

/* 2. 双栏主要内容布局 */
.shop-flow-container {
    display: flex;
    flex-grow: 1;
    overflow: hidden;
}

/* 左侧分类侧边栏 */
.sidebar-categories {
    width: 86px;
    background-color: #f1f3f6;
    overflow-y: auto;
    flex-shrink: 0;
}
.sidebar-categories::-webkit-scrollbar {
    width: 0;
}
.category-item {
    padding: 18px 8px;
    font-size: 12px;
    color: var(--text-medium);
    text-align: center;
    cursor: pointer;
    position: relative;
    transition: var(--transition-fast);
    line-height: 1.4;
}
.category-item.active {
    background-color: var(--bg-white);
    color: var(--primary-color);
    font-weight: 700;
}
.category-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 16px;
    background-color: var(--primary-color);
    border-radius: 0 4px 4px 0;
}

/* 右侧药品展示区 */
.products-container {
    flex-grow: 1;
    background-color: var(--bg-white);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.product-list {
    flex-grow: 1;
    overflow-y: auto;
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.product-list::-webkit-scrollbar {
    width: 0px;
}

/* 药品卡片 */
.product-card {
    display: flex;
    gap: 12px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--border-color);
    position: relative;
    cursor: pointer;
}
.product-card:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

/* 药品实物图底座 */
.product-img-box {
    width: 76px;
    height: 76px;
    border-radius: var(--border-radius-sm);
    background: linear-gradient(135deg, #fdfdfd 0%, #f4f6f9 100%);
    border: 1px solid #eef1f6;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    flex-shrink: 0;
    overflow: hidden;
}

.product-svg-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: inherit;
    transition: transform 0.25s ease;
}
.product-card:hover .product-svg-img {
    transform: scale(1.04);
}

.badge-rx {
    position: absolute;
    top: 2px;
    left: 2px;
    background-color: var(--accent-orange);
    color: #fff;
    font-size: 8px;
    padding: 1px 3px;
    border-radius: 3px;
    zoom: 0.8;
    z-index: 5;
    font-weight: 600;
}

/* 药品信息排版 */
.product-info {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-width: 0;
}
.product-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-dark);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.product-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 4px;
}
.tag-item {
    font-size: 10px;
    color: var(--text-medium);
    background-color: var(--bg-gray);
    padding: 1px 5px;
    border-radius: 4px;
}
.product-desc-text {
    font-size: 11px;
    color: var(--text-medium);
    margin-top: 6px;
    line-height: 1.45;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-break: break-all;
}

.product-action-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-top: 6px;
}
.price-box {
    display: flex;
    align-items: baseline;
}
.currency-symbol {
    font-size: 11px;
    color: var(--accent-orange);
    font-weight: 600;
}
.price-val {
    font-size: 16px;
    color: var(--accent-orange);
    font-weight: 700;
}

/* 3. 全屏详情页容器 (默认在最右侧隐藏，定位在 .app-container 内部) */
.detail-page-container {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--bg-gray);
    z-index: 120;
    transform: translateX(100%);
    transition: transform 0.35s cubic-bezier(0.1, 0.76, 0.55, 0.94);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.detail-page-container.active {
    transform: translateX(0);
}

/* 详情页导航条 */
.detail-header {
    height: 50px;
    background-color: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    padding: 0 16px;
    position: relative;
    flex-shrink: 0;
    z-index: 10;
}
.btn-detail-back {
    border: none;
    background: transparent;
    color: var(--text-dark);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6px;
    border-radius: 50%;
    transition: var(--transition-fast);
}
.btn-detail-back:active {
    background-color: var(--bg-gray);
    transform: scale(0.9);
}
.detail-header-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-dark);
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}

/* 详情页滚动内容区 */
.detail-page-content {
    flex-grow: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.detail-page-content::-webkit-scrollbar {
    width: 0px;
}

/* 实物大图展示卡片 */
.detail-img-showcase {
    background: linear-gradient(180deg, #ffffff 0%, #f0f4f2 100%);
    border-radius: var(--border-radius-md);
    padding: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--box-shadow-soft);
    border: 1px solid var(--border-color);
}
.detail-img-showcase img {
    width: 140px;
    height: 140px;
    object-fit: contain;
    filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.08));
    animation: zoomIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.15);
}
@keyframes zoomIn {
    from { transform: scale(0.92); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

/* 核心基本信息卡 */
.detail-info-card {
    background-color: var(--bg-white);
    border-radius: var(--border-radius-md);
    padding: 18px;
    box-shadow: var(--box-shadow-soft);
    border: 1px solid var(--border-color);
}
.detail-price-line {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
}
.detail-currency {
    font-size: 13px;
    color: var(--accent-orange);
    font-weight: 700;
}
.detail-price {
    font-size: 22px;
    color: var(--accent-orange);
    font-weight: 700;
    flex-grow: 1;
    margin-left: 2px;
}
.detail-rx-badge {
    background-color: var(--accent-orange);
    color: #ffffff;
    font-size: 10px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 4px;
    letter-spacing: 0.5px;
}
.detail-rx-badge.otc {
    background-color: var(--primary-color);
}
.detail-med-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-dark);
    line-height: 1.45;
}
.detail-med-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 10px;
}

/* 说明书规格参数卡 */
.detail-desc-card {
    background-color: var(--bg-white);
    border-radius: var(--border-radius-md);
    padding: 18px;
    box-shadow: var(--box-shadow-soft);
    border: 1px solid var(--border-color);
}
.detail-section-title {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-dark);
    border-left: 3px solid var(--primary-color);
    padding-left: 8px;
    margin-bottom: 8px;
    margin-top: 14px;
}
.detail-section-title:first-of-type {
    margin-top: 0;
}
.detail-desc-body {
    font-size: 12px;
    color: var(--text-medium);
    line-height: 1.6;
}

/* 用药安全温馨提示 */
.detail-safety-tips {
    display: flex;
    gap: 8px;
    padding: 12px 14px;
    background-color: #fff0ea;
    border-radius: var(--border-radius-sm);
    border: 1.5px dashed rgba(255, 96, 38, 0.15);
    margin-top: 6px;
}
.safety-icon {
    font-size: 14px;
    flex-shrink: 0;
}
.safety-text {
    font-size: 10.5px;
    color: var(--accent-orange);
    line-height: 1.5;
}

/* 滚动分页加载与已加载完毕的提示 */
.no-more-msg {
    text-align: center;
    padding: 16px 0 8px 0;
    color: var(--text-light);
    font-size: 11px;
    letter-spacing: 0.5px;
}
.scroll-loading-msg {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 12px 0;
}

/* 适配真机移动端 */
@media (max-width: 480px) {
    .app-wrapper {
        padding: 0;
    }
    .app-container {
        box-shadow: none;
    }
}
