* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #ff6900;
    --primary-dark: #e55f00;
    --primary-light: #fff5f0;
    --secondary: #ff9500;
    --bg: #f5f5f5;
    --card-bg: #ffffff;
    --text: #333333;
    --text-light: #666666;
    --text-lighter: #999999;
    --border: #eeeeee;
    --green: #00b578;
    --red: #ff4d4f;
    --gold: #ffce00;
    --shadow: 0 2px 12px rgba(0,0,0,0.08);
    --shadow-sm: 0 1px 4px rgba(0,0,0,0.06);
}

html, body {
    height: 100%;
    font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Noto Sans JP", "Segoe UI", Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    -webkit-font-smoothing: antialiased;
    -webkit-tap-highlight-color: transparent;
}

#app {
    max-width: 430px;
    min-height: 100vh;
    margin: 0 auto;
    background: var(--bg);
    position: relative;
    overflow-x: hidden;
    box-shadow: 0 0 40px rgba(0,0,0,0.1);
}

@media (min-width: 431px) {
    body {
        background: #e8e8e8;
    }
    #app {
        min-height: calc(100vh - 20px);
        margin: 10px auto;
        border-radius: 20px;
        overflow: hidden;
    }
}

/* Header */
.app-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: linear-gradient(135deg, #ff7a1a 0%, #ff5500 100%);
    padding: 10px 14px;
    color: white;
    transition: all 0.3s ease;
    box-shadow: 0 2px 12px rgba(255,85,0,0.2);
}

.header-search {
    background: rgba(255,255,255,0.2);
    border-radius: 20px;
    padding: 8px 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.header-search input {
    background: transparent;
    border: none;
    outline: none;
    color: white;
    font-size: 14px;
    width: 100%;
}

.header-search input::placeholder {
    color: rgba(255,255,255,0.75);
}

.search-icon {
    width: 14px;
    height: 14px;
    opacity: 0.8;
}

/* Main Content */
.main-content {
    padding-bottom: calc(80px + env(safe-area-inset-bottom));
    min-height: calc(100vh - 120px);
}

.page {
    display: none;
    animation: fadeIn 0.25s ease;
}

.page.active {
    display: block;
}

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

/* Banner */
.banner-section {
    position: relative;
    padding: 10px 10px 0;
}

.banner-carousel {
    position: relative;
    height: 120px;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: var(--shadow);
}

.banner-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    padding: 10px 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    opacity: 0;
    transition: opacity 0.5s ease;
    color: white;
}

.banner-slide.active {
    opacity: 1;
}

.banner-content {
    flex: 1;
    z-index: 2;
}

.banner-tag {
    display: inline-block;
    background: rgba(255,255,255,0.25);
    padding: 1px 5px;
    border-radius: 6px;
    font-size: 8px;
    font-weight: 600;
    margin-bottom: 3px;
    backdrop-filter: blur(4px);
}

.banner-content h2 {
    font-size: 14px;
    line-height: 1.15;
    margin-bottom: 2px;
    font-weight: 800;
    text-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.banner-content p {
    font-size: 9px;
    opacity: 0.9;
    margin-bottom: 5px;
}

.banner-btn {
    background: white;
    color: var(--primary);
    border: none;
    padding: 4px 10px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 700;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    cursor: pointer;
}

.banner-image {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background-size: cover;
    background-position: center;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    animation: float 3s ease-in-out infinite;
}

.gift-package-img {
    background: linear-gradient(135deg, #ffd54f 0%, #ff8f00 100%);
    position: relative;
}

.gift-package-img::before {
    content: "🎁";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 30px;
}

.strawberry-img {
    background: linear-gradient(135deg, #ff8a80 0%, #d32f2f 100%);
}

.strawberry-img::before {
    content: "🍓";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 30px;
}

.melon-img {
    background: linear-gradient(135deg, #a5d6a7 0%, #66bb6a 100%);
}

.melon-img::before {
    content: "🍈";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 30px;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
}

.banner-dots {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-top: 10px;
}

.banner-dot {
    width: 6px;
    height: 6px;
    border-radius: 3px;
    background: #ddd;
    transition: all 0.3s ease;
}

.banner-dot.active {
    width: 16px;
    background: var(--primary);
}

/* Quick Actions */
.service-promises {
    display: flex;
    justify-content: space-between;
    gap: 6px;
    padding: 12px 10px;
    background: var(--card-bg);
    margin: 10px;
    border-radius: 16px;
    box-shadow: var(--shadow-sm);
    flex-wrap: nowrap;
}

.service-item {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 7px 6px;
    border-radius: 18px;
    background: var(--primary-light);
    color: var(--primary);
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
}

.service-item svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

/* Promo Cards */
.checkin-promo {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 10px;
    padding: 16px 18px;
    border-radius: 16px;
    background: linear-gradient(135deg, #ff8a65 0%, #ff5722 100%);
    color: white;
    box-shadow: 0 4px 14px rgba(255,87,34,0.25);
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

.checkin-promo::after {
    content: "";
    position: absolute;
    top: -30px;
    right: -30px;
    width: 100px;
    height: 100px;
    background: rgba(255,255,255,0.08);
    border-radius: 50%;
}

.checkin-promo:active {
    transform: scale(0.98);
}

.checkin-promo-content {
    flex: 1;
    z-index: 1;
}

.checkin-promo-tag {
    display: inline-block;
    background: rgba(255,255,255,0.2);
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 10px;
    font-weight: 700;
    margin-bottom: 8px;
    letter-spacing: 0.5px;
}

.checkin-promo h3 {
    font-size: 17px;
    font-weight: 800;
    margin-bottom: 4px;
}

.checkin-promo p {
    font-size: 12px;
    opacity: 0.95;
    margin-bottom: 4px;
}

.checkin-promo-note {
    font-size: 10px !important;
    opacity: 0.85 !important;
    margin-bottom: 10px !important;
}

.checkin-promo-progress {
    display: flex;
    align-items: center;
    gap: 10px;
}

.checkin-promo-bar {
    flex: 1;
    height: 6px;
    background: rgba(255,255,255,0.2);
    border-radius: 3px;
    overflow: hidden;
    max-width: 160px;
}

.checkin-promo-fill {
    height: 100%;
    background: white;
    border-radius: 3px;
    transition: width 0.3s ease;
}

.checkin-promo-progress span {
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
}

.checkin-promo-gift {
    width: 56px;
    height: 56px;
    font-size: 42px;
    margin-left: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: float 3s ease-in-out infinite;
    z-index: 1;
}

/* Section Header */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 12px 8px;
}

.section-header h3 {
    font-size: 15px;
    font-weight: 800;
}

.section-more {
    font-size: 12px;
    color: var(--text-lighter);
}

.countdown {
    background: var(--primary-light);
    color: var(--primary);
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 700;
    font-family: monospace;
}

/* Product Grid */
.product-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    padding: 0 10px;
}

.product-scroll {
    display: flex;
    gap: 10px;
    padding: 0 10px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
}

.product-scroll::-webkit-scrollbar {
    display: none;
}

.product-scroll .product-card {
    width: 140px;
    flex-shrink: 0;
    scroll-snap-align: start;
}

.product-card {
    background: var(--card-bg);
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    transition: all 0.2s ease;
    cursor: pointer;
    border: 1px solid rgba(0,0,0,0.03);
}

.product-card:active {
    transform: scale(0.98);
}

.product-card:hover {
    box-shadow: 0 6px 16px rgba(0,0,0,0.1);
}

.product-image {
    position: relative;
    width: 100%;
    aspect-ratio: 1;
    background: #f8f8f8;
    overflow: hidden;
    border-radius: 12px 12px 0 0;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.product-card:hover .product-image img {
    transform: scale(1.05);
}

.product-image .emoji-fallback {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 64px;
    background: linear-gradient(135deg, #f5f5f5 0%, #e8e8e8 100%);
}

.product-tag {
    position: absolute;
    top: 6px;
    left: 6px;
    background: var(--red);
    color: white;
    font-size: 9px;
    padding: 2px 5px;
    border-radius: 7px;
    font-weight: 700;
}

.product-info {
    padding: 8px 10px 10px;
}

.product-title {
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 3px;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-subtitle {
    font-size: 11px;
    color: var(--text-lighter);
    margin-bottom: 6px;
}

.product-meta {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
}

.product-price {
    color: var(--red);
    font-weight: 800;
}

.product-price .currency {
    font-size: 10px;
}

.product-price .amount {
    font-size: 16px;
}

.product-original {
    font-size: 10px;
    color: var(--text-lighter);
    text-decoration: line-through;
    margin-left: 3px;
}

.product-sold {
    font-size: 10px;
    color: var(--text-lighter);
}

.add-btn {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    border: none;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(255,105,0,0.35);
}

.add-btn:active {
    transform: scale(0.9);
}

/* Category Page */
.category-layout {
    display: flex;
    min-height: calc(100vh - 200px);
}

.category-sidebar {
    width: 88px;
    background: #f8f8f8;
    flex-shrink: 0;
    overflow-y: auto;
    padding-bottom: 20px;
}

.sidebar-item {
    padding: 16px 8px;
    text-align: center;
    font-size: 12px;
    color: var(--text-light);
    border-left: 3px solid transparent;
    cursor: pointer;
    transition: all 0.2s ease;
}

.sidebar-item.active {
    background: white;
    color: var(--primary);
    border-left-color: var(--primary);
    font-weight: 700;
}

.category-main {
    flex: 1;
    padding: 12px;
    overflow-y: auto;
}

.category-banner {
    height: 90px;
    border-radius: 12px;
    margin-bottom: 12px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    display: flex;
    align-items: center;
    padding: 0 18px;
    color: white;
}

.category-banner h3 {
    font-size: 18px;
    font-weight: 800;
}

.category-banner p {
    font-size: 12px;
    opacity: 0.9;
}

.category-products {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

/* Cart Page */
.cart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    background: var(--card-bg);
    border-bottom: 1px solid var(--border);
}

.cart-header h2 {
    font-size: 18px;
    font-weight: 800;
}

.cart-clear {
    font-size: 13px;
    color: var(--text-lighter);
    cursor: pointer;
}

.cart-content {
    padding: 16px 16px calc(80px + env(safe-area-inset-bottom));
    min-height: 400px;
}

.cart-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
}

.empty-icon {
    font-size: 64px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.cart-empty p {
    color: var(--text-light);
    margin-bottom: 20px;
}

.cart-empty button {
    background: var(--primary);
    color: white;
    border: none;
    padding: 12px 28px;
    border-radius: 22px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
}

.cart-item {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--card-bg);
    padding: 12px;
    border-radius: 14px;
    margin-bottom: 10px;
    box-shadow: var(--shadow-sm);
}

.cart-item-image {
    width: 72px;
    height: 72px;
    border-radius: 10px;
    background: #f8f8f8;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    flex-shrink: 0;
    overflow: hidden;
}

.cart-item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cart-item-info {
    flex: 1;
    min-width: 0;
}

.cart-item-title {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 4px;
}

.cart-item-price {
    color: var(--red);
    font-weight: 700;
    font-size: 15px;
}

.cart-item-actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.cart-item-qty {
    display: flex;
    align-items: center;
    gap: 10px;
}

.cart-item-qty button {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: white;
    color: var(--text);
    font-size: 16px;
    cursor: pointer;
}

.cart-item-delete {
    display: flex;
    align-items: center;
    gap: 3px;
    background: transparent;
    border: none;
    color: #999;
    font-size: 11px;
    cursor: pointer;
    padding: 2px 4px;
    transition: color 0.2s;
}

.cart-item-delete svg {
    width: 14px;
    height: 14px;
}

.cart-item-delete:active {
    color: var(--red);
}

.cart-address {
    background: var(--card-bg);
    margin: 0 12px 12px;
    border-radius: 14px;
    padding: 14px;
    box-shadow: var(--shadow-sm);
}

.cart-address-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    font-size: 13px;
    font-weight: 700;
}

.cart-address-change {
    color: var(--primary);
    cursor: pointer;
}

.cart-address-content {
    font-size: 13px;
    color: var(--text-light);
    line-height: 1.5;
}

.cart-address-content.empty {
    color: var(--text-lighter);
}

.cart-footer {
    position: fixed;
    bottom: calc(64px + env(safe-area-inset-bottom));
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 430px;
    background: var(--card-bg);
    padding: 12px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 -2px 12px rgba(0,0,0,0.08);
    z-index: 90;
}

.cart-total {
    display: flex;
    align-items: baseline;
    gap: 6px;
}

.cart-total span:first-child {
    font-size: 14px;
    color: var(--text-light);
}

.total-price {
    font-size: 22px;
    color: var(--red);
    font-weight: 800;
}

.checkout-btn {
    background: var(--primary);
    color: white;
    border: none;
    padding: 12px 28px;
    border-radius: 22px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
}

/* Orders Page */
.orders-header {
    padding: 16px;
    background: var(--card-bg);
    border-bottom: 1px solid var(--border);
}

.orders-header h2 {
    font-size: 18px;
    font-weight: 800;
}

.orders-content {
    padding: 16px;
}

.orders-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
}

.orders-empty button {
    background: var(--primary);
    color: white;
    border: none;
    padding: 12px 28px;
    border-radius: 22px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
}

.order-card {
    background: var(--card-bg);
    border-radius: 14px;
    padding: 14px;
    margin-bottom: 12px;
    box-shadow: var(--shadow-sm);
}

.order-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border);
}

.order-id {
    font-size: 13px;
    color: var(--text-light);
}

.order-status {
    font-size: 12px;
    color: var(--green);
    font-weight: 700;
}

.order-items {
    display: flex;
    gap: 8px;
    margin-bottom: 10px;
    overflow-x: auto;
}

.order-item-thumb {
    width: 56px;
    height: 56px;
    border-radius: 8px;
    background: #f8f8f8;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    flex-shrink: 0;
}

.order-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.order-total {
    font-size: 14px;
    color: var(--text-light);
}

.order-total strong {
    color: var(--red);
    font-size: 16px;
}

.order-actions {
    display: flex;
    gap: 8px;
}

.order-actions button {
    padding: 6px 14px;
    border-radius: 14px;
    border: 1px solid var(--border);
    background: white;
    font-size: 12px;
    cursor: pointer;
}

.order-actions button.primary {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.order-actions button.danger {
    background: #ffebee;
    color: var(--red);
    border-color: #ffcdd2;
}

/* Profile Page */
.profile-header {
    background: var(--primary);
    color: white;
    padding: 30px 20px;
    display: flex;
    align-items: center;
    gap: 16px;
}

.profile-avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: rgba(255,255,255,0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
}

.profile-info h3 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 4px;
}

.profile-info p {
    font-size: 13px;
    opacity: 0.85;
}

.profile-settings {
    margin-left: auto;
    font-size: 22px;
    opacity: 0.9;
    cursor: pointer;
}

.profile-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    background: var(--card-bg);
    margin: 12px;
    border-radius: 14px;
    padding: 16px 0;
    box-shadow: var(--shadow-sm);
}

.stat-item {
    text-align: center;
    border-right: 1px solid var(--border);
}

.stat-item:last-child {
    border-right: none;
}

.stat-value {
    display: block;
    font-size: 20px;
    font-weight: 800;
    color: var(--text);
    margin-bottom: 2px;
}

.stat-label {
    font-size: 12px;
    color: var(--text-light);
}

.profile-menu {
    background: var(--card-bg);
    margin: 12px;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.menu-item {
    display: flex;
    align-items: center;
    padding: 16px;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    transition: background 0.2s ease;
}

.menu-item:last-child {
    border-bottom: none;
}

.menu-item:active {
    background: #f9f9f9;
}

.menu-icon {
    font-size: 20px;
    margin-right: 12px;
}

.menu-text {
    flex: 1;
    font-size: 14px;
}

.menu-badge {
    background: var(--primary-light);
    color: var(--primary);
    font-size: 11px;
    padding: 3px 8px;
    border-radius: 10px;
    margin-right: 8px;
    font-weight: 600;
}

.menu-arrow {
    color: var(--text-lighter);
    font-size: 13px;
}

.check-in-widget {
    background: linear-gradient(135deg, #fff3e0 0%, #ffe0b2 100%);
    margin: 12px;
    border-radius: 16px;
    padding: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
}

.check-in-widget h4 {
    font-size: 15px;
    color: var(--text);
    margin-bottom: 4px;
}

.check-in-widget p {
    font-size: 12px;
    color: var(--text-light);
    margin-bottom: 10px;
}

.check-in-widget .progress-bar {
    width: 160px;
    height: 6px;
    background: rgba(255,105,0,0.15);
    border-radius: 3px;
    overflow: hidden;
}

.check-in-widget .progress-fill {
    height: 100%;
    background: var(--primary);
    border-radius: 3px;
    transition: width 0.3s ease;
}

.widget-right {
    font-size: 48px;
}

/* Address Section */
.address-section {
    background: var(--card-bg);
    margin: 12px;
    border-radius: 16px;
    padding: 16px;
    box-shadow: var(--shadow-sm);
}

.address-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.address-header h3 {
    font-size: 15px;
    font-weight: 800;
}

.address-header button {
    background: var(--primary-light);
    color: var(--primary);
    border: none;
    padding: 6px 14px;
    border-radius: 14px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
}

.address-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.address-empty {
    text-align: center;
    padding: 20px;
    color: var(--text-lighter);
    font-size: 13px;
}

.address-card {
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 12px;
    position: relative;
}

.address-card.default {
    border-color: var(--primary);
    background: var(--primary-light);
}

.address-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.address-card-name {
    font-weight: 700;
    font-size: 14px;
}

.address-card-phone {
    font-size: 12px;
    color: var(--text-lighter);
}

.address-card-detail {
    font-size: 13px;
    color: var(--text-light);
    line-height: 1.4;
}

.address-card-actions {
    display: flex;
    gap: 8px;
    margin-top: 10px;
}

.address-card-actions button {
    flex: 1;
    padding: 6px 0;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: white;
    font-size: 12px;
    cursor: pointer;
}

.address-card-actions button.primary {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.address-tag {
    display: inline-block;
    font-size: 10px;
    background: var(--primary);
    color: white;
    padding: 1px 6px;
    border-radius: 8px;
    margin-left: 6px;
}

/* Address Modal */
.address-modal, .address-select-modal {
    padding: 20px 20px calc(20px + env(safe-area-inset-bottom));
    max-height: 85vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.address-modal-header {
    margin-bottom: 16px;
    flex-shrink: 0;
}

.address-modal-header h2 {
    font-size: 18px;
    font-weight: 800;
}

.address-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex: 1;
}

.form-row {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.form-row label {
    font-size: 12px;
    color: var(--text-light);
    font-weight: 500;
}

.form-row input[type="text"],
.form-row input[type="tel"],
.form-row input[type="password"] {
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 10px;
    font-size: 14px;
    outline: none;
}

.form-row input:focus {
    border-color: var(--primary);
}

.checkbox-row {
    flex-direction: row;
    align-items: center;
    gap: 8px;
}

.checkbox-row input {
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
}

.checkbox-row label {
    margin: 0;
}

.address-save-btn {
    background: var(--primary);
    color: white;
    border: none;
    padding: 12px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    margin-top: 8px;
    flex-shrink: 0;
}

.address-select-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 12px;
    flex: 1;
    overflow-y: auto;
}

.address-select-item {
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.address-select-item:hover,
.address-select-item.selected {
    border-color: var(--primary);
    background: var(--primary-light);
}

.address-select-item .radio {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 6px;
    font-weight: 700;
}

.address-select-item .radio input {
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
}

.address-add-btn {
    width: 100%;
    background: white;
    color: var(--primary);
    border: 1px dashed var(--primary);
    padding: 14px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
}

/* Settings Modal */
.settings-modal {
    padding: 24px 20px calc(28px + env(safe-area-inset-bottom));
    display: flex;
    flex-direction: column;
}

.settings-header {
    margin-bottom: 20px;
    padding-right: 40px;
}

.settings-header h2 {
    font-size: 18px;
    font-weight: 800;
}

.settings-desc {
    font-size: 13px;
    color: var(--text-light);
    margin-bottom: 20px;
    line-height: 1.5;
}

.settings-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.settings-btn {
    width: 100%;
    background: var(--primary);
    color: white;
    border: none;
    padding: 14px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    margin-top: 10px;
}

.settings-btn.danger {
    background: var(--red);
}

/* Bottom Nav */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 430px;
    background: var(--card-bg);
    display: flex;
    justify-content: space-around;
    padding: 8px 0 calc(8px + env(safe-area-inset-bottom));
    box-shadow: 0 -2px 12px rgba(0,0,0,0.08);
    z-index: 100;
}

.nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    cursor: pointer;
    position: relative;
    color: var(--text-lighter);
    transition: color 0.2s ease;
    padding-top: 6px;
}

.nav-item.active {
    color: var(--primary);
}

.nav-item.active::before {
    content: "";
    position: absolute;
    top: 0;
    width: 20px;
    height: 3px;
    background: var(--primary);
    border-radius: 0 0 2px 2px;
}

.nav-icon {
    width: 22px;
    height: 22px;
}

.nav-label {
    font-size: 10px;
    font-weight: 500;
}

.cart-badge {
    position: absolute;
    top: -2px;
    right: calc(50% - 18px);
    background: var(--red);
    color: white;
    font-size: 10px;
    min-width: 16px;
    height: 16px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    font-weight: 700;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 200;
    align-items: flex-end;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
}

.modal-content {
    position: relative;
    background: var(--card-bg);
    width: 100%;
    max-width: 430px;
    border-radius: 24px 24px 0 0;
    max-height: 85vh;
    overflow-y: auto;
    animation: slideUp 0.3s ease;
    z-index: 1;
    display: flex;
    flex-direction: column;
}

.modal-content.product-modal {
    max-height: 82vh;
}

@keyframes slideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

.modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(0,0,0,0.4);
    color: white;
    border: none;
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
}

/* Product Modal */
.product-modal-image {
    width: 100%;
    max-height: 260px;
    aspect-ratio: 4 / 3;
    background: #f8f8f8;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 100px;
    overflow: hidden;
    flex-shrink: 0;
}

.product-modal-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-modal-info {
    padding: 16px 16px calc(16px + env(safe-area-inset-bottom));
}

.product-modal-info h3 {
    font-size: 18px;
    font-weight: 800;
    margin-bottom: 6px;
}

.modal-desc {
    font-size: 13px;
    color: var(--text-light);
    line-height: 1.5;
    margin-bottom: 10px;
}

.modal-tags {
    display: flex;
    gap: 6px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.modal-tag {
    font-size: 11px;
    padding: 3px 10px;
    border-radius: 10px;
    background: var(--primary-light);
    color: var(--primary);
    font-weight: 600;
}

.modal-price-row {
    display: flex;
    align-items: baseline;
    margin-bottom: 14px;
}

.modal-price {
    color: var(--red);
    font-size: 26px;
    font-weight: 800;
}

.modal-price::before {
    content: "¥";
    font-size: 16px;
}

.modal-original {
    color: var(--text-lighter);
    text-decoration: line-through;
    margin-left: 10px;
    font-size: 14px;
}

.modal-actions {
    position: sticky;
    bottom: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-top: 1px solid var(--border);
    background: var(--card-bg);
}

.quantity-control {
    display: flex;
    align-items: center;
    gap: 12px;
}

.quantity-control button {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: white;
    font-size: 18px;
    cursor: pointer;
}

.quantity-control span {
    font-size: 15px;
    font-weight: 700;
    min-width: 24px;
    text-align: center;
}

.add-to-cart-btn {
    background: var(--primary);
    color: white;
    border: none;
    padding: 12px 28px;
    border-radius: 22px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(255,105,0,0.35);
    white-space: nowrap;
}

/* Check-in Modal */
.checkin-modal {
    padding: 24px 20px calc(32px + env(safe-area-inset-bottom));
    text-align: center;
}

.checkin-header {
    margin-bottom: 20px;
}

.checkin-gift {
    font-size: 72px;
    margin-bottom: 8px;
    animation: bounce 1.5s ease infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.checkin-header h2 {
    font-size: 22px;
    font-weight: 800;
    margin-bottom: 8px;
}

.checkin-header p {
    font-size: 13px;
    color: var(--text-light);
    line-height: 1.5;
}

.checkin-progress {
    margin-bottom: 20px;
}

.progress-text {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    margin-bottom: 8px;
}

.progress-bar {
    width: 100%;
    height: 10px;
    background: #eeeeee;
    border-radius: 5px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary) 0%, var(--secondary) 100%);
    border-radius: 5px;
    transition: width 0.5s ease;
}

.checkin-calendar {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 8px;
    margin-bottom: 24px;
}

.calendar-day {
    aspect-ratio: 1;
    border-radius: 12px;
    background: #f8f8f8;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    font-size: 11px;
    color: var(--text-light);
    position: relative;
}

.calendar-day.checked {
    background: var(--primary-light);
    color: var(--primary);
    font-weight: 700;
}

.calendar-day.checked::after {
    content: "✓";
    position: absolute;
    top: 2px;
    right: 4px;
    font-size: 10px;
}

.calendar-day.reward {
    background: linear-gradient(135deg, #fff3e0 0%, #ffe0b2 100%);
    color: var(--primary-dark);
    font-weight: 700;
}

.calendar-day .day-icon {
    font-size: 20px;
}

.checkin-btn {
    width: 100%;
    background: var(--primary);
    color: white;
    border: none;
    padding: 16px;
    border-radius: 26px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(255,105,0,0.35);
    transition: all 0.2s ease;
}

.checkin-btn:disabled {
    background: #cccccc;
    box-shadow: none;
    cursor: not-allowed;
}

.checkin-note {
    margin-top: 14px;
    font-size: 11px;
    color: var(--text-lighter);
}

/* Reward Modal */
.reward-modal {
    padding: 32px 24px calc(32px + env(safe-area-inset-bottom));
    text-align: center;
    border-radius: 24px;
    margin: auto 20px calc(40px + env(safe-area-inset-bottom));
    width: auto;
    max-width: 390px;
}

.reward-animation {
    font-size: 64px;
    margin-bottom: 12px;
    animation: pulse 0.8s ease infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.reward-modal h2 {
    font-size: 22px;
    font-weight: 800;
    margin-bottom: 6px;
}

.reward-modal > p {
    color: var(--text-light);
    margin-bottom: 20px;
}

.reward-box {
    background: linear-gradient(135deg, #fff3e0 0%, #ffe0b2 100%);
    border-radius: 20px;
    padding: 24px;
    margin-bottom: 24px;
}

.reward-img {
    font-size: 80px;
    margin-bottom: 12px;
}

.reward-box h3 {
    font-size: 18px;
    font-weight: 800;
    color: var(--primary-dark);
    margin-bottom: 6px;
}

.reward-box p {
    font-size: 13px;
    color: var(--text-light);
}

.reward-btn {
    width: 100%;
    background: var(--primary);
    color: white;
    border: none;
    padding: 16px;
    border-radius: 26px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
}

/* Toast */
.toast {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    background: rgba(0,0,0,0.8);
    color: white;
    padding: 14px 24px;
    border-radius: 24px;
    font-size: 14px;
    z-index: 300;
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s ease;
    text-align: center;
}

.toast.active {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

/* Loading states */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Scrollbar hide */
::-webkit-scrollbar {
    width: 0;
    height: 0;
}
