/* ============================================
   NEXUS MALL - Mobile CSS
   Refined Business Theme - Mobile First
   ============================================ */

:root {
    color-scheme: light;
    --primary: #5B5FEF;
    --primary-light: #7C7FF8;
    --primary-dark: #4A4DD9;
    --primary-bg: rgba(91, 95, 239, 0.06);
    --primary-ring: rgba(91, 95, 239, 0.15);

    --bg: #F5F6FA;
    --bg-white: #FFFFFF;
    --bg-card: #FFFFFF;
    --bg-elevated: #ECEEF4;
    --bg-glass: rgba(255, 255, 255, 0.82);

    --text-primary: #1A1D2E;
    --text-secondary: #5A5E72;
    --text-muted: #9CA0B0;
    --text-white: #FFFFFF;

    --border: #E2E4EC;
    --border-light: #EEF0F5;

    --success: #22C55E;
    --success-bg: rgba(34, 197, 94, 0.08);
    --warning: #F59E0B;
    --warning-bg: rgba(245, 158, 11, 0.08);
    --danger: #EF4444;
    --danger-bg: rgba(239, 68, 68, 0.06);
    --info: #3B82F6;

    --radius-sm: 10px;
    --radius-md: 14px;
    --radius-lg: 18px;
    --radius-xl: 24px;

    --shadow-xs: 0 1px 2px rgba(0,0,0,0.03);
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.04), 0 1px 2px rgba(0,0,0,0.02);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.05), 0 1px 3px rgba(0,0,0,0.03);
    --shadow-lg: 0 12px 28px rgba(0,0,0,0.07), 0 4px 8px rgba(0,0,0,0.03);
    --shadow-glow: 0 4px 20px rgba(91, 95, 239, 0.18);
    --shadow-card: 0 2px 8px rgba(26, 29, 46, 0.04), 0 0 1px rgba(26, 29, 46, 0.06);

    --bg-primary: var(--bg);
    --bg-secondary: var(--bg-elevated);
    --bg-input: #F7F8FC;
    --bg-hover: #F0F1F6;
    --accent-purple: var(--primary);
    --accent-purple-light: var(--primary-light);
    --accent-cyan: var(--primary-light);
    --accent-cyan-light: #C7D2FE;
    --border-color: var(--border);

    --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-spring: all 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
    --font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
}

*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family);
    background: var(--bg);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a { color: var(--primary); text-decoration: none; }
img { max-width: 100%; height: auto; display: block; }

button {
    border: none;
    outline: none;
    cursor: pointer;
    font-family: inherit;
    font-size: inherit;
    background: none;
}

input, textarea, select {
    border: none;
    outline: none;
    font-family: inherit;
    font-size: inherit;
    background: none;
}

ul, ol { list-style: none; }

.app-container {
    max-width: 480px;
    margin: 0 auto;
    min-height: 100vh;
    position: relative;
    background: var(--bg);
}

/* ============================================
   Top Navigation Bar
   ============================================ */
.top-nav {
    position: fixed;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 480px;
    height: 52px;
    background: var(--bg-glass);
    backdrop-filter: blur(24px) saturate(180%);
    -webkit-backdrop-filter: blur(24px) saturate(180%);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    z-index: 100;
    border-bottom: 1px solid rgba(226, 228, 236, 0.6);
    transition: var(--transition);
}

.top-nav .nav-back {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-primary);
    font-size: 22px;
    border-radius: 10px;
    transition: var(--transition);
}

.top-nav .nav-back:active {
    background: var(--bg-elevated);
    transform: scale(0.92);
}

.top-nav .nav-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: 0.2px;
}

.top-nav .nav-action {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    font-size: 18px;
    border-radius: 10px;
    transition: var(--transition);
}

.top-nav .nav-action:active {
    background: var(--bg-elevated);
}

.top-nav .logo-text {
    font-size: 17px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: 2px;
}

/* ============================================
   Bottom Tab Bar
   ============================================ */
.tab-bar {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 480px;
    height: 60px;
    background: var(--bg-glass);
    backdrop-filter: blur(24px) saturate(180%);
    -webkit-backdrop-filter: blur(24px) saturate(180%);
    display: flex;
    align-items: center;
    justify-content: space-around;
    z-index: 100;
    border-top: 1px solid rgba(226, 228, 236, 0.6);
    padding-bottom: env(safe-area-inset-bottom, 0);
    transition: var(--transition);
}

.tab-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    height: 100%;
    color: var(--text-muted);
    font-size: 10px;
    gap: 3px;
    transition: var(--transition);
    position: relative;
}

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

.tab-item .tab-icon {
    font-size: 22px;
    line-height: 1;
    transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.tab-item.active .tab-icon { transform: translateY(-2px); }

.tab-item .tab-label {
    font-size: 10px;
    font-weight: 500;
    transition: var(--transition);
}

.tab-item .cart-badge {
    position: absolute;
    top: 2px;
    right: 50%;
    margin-right: -18px;
    min-width: 16px;
    height: 16px;
    background: linear-gradient(135deg, var(--danger), #F87171);
    color: #fff;
    font-size: 10px;
    font-weight: 600;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    box-shadow: 0 2px 4px rgba(239, 68, 68, 0.3);
    animation: badgePop 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes badgePop {
    0% { transform: scale(0); }
    100% { transform: scale(1); }
}

.page-content {
    padding-top: 52px;
    padding-bottom: 60px;
    min-height: 100vh;
}

.page-content.no-tab { padding-bottom: 0; }

/* ============================================
   Search Bar
   ============================================ */
.search-bar {
    padding: 12px 16px;
    background: transparent;
}

.search-bar .search-input-wrap {
    display: flex;
    align-items: center;
    background: var(--bg-white);
    border-radius: 12px;
    padding: 10px 16px;
    gap: 10px;
    border: 1.5px solid var(--border);
    box-shadow: var(--shadow-xs);
    transition: var(--transition);
}

.search-bar .search-input-wrap:focus-within {
    border-color: var(--primary-light);
    box-shadow: 0 0 0 4px var(--primary-ring), var(--shadow-sm);
}

.search-bar .search-icon {
    color: var(--text-muted);
    font-size: 16px;
    flex-shrink: 0;
}

.search-bar .search-input {
    flex: 1;
    color: var(--text-primary);
    font-size: 14px;
    background: transparent;
}

.search-bar .search-input::placeholder { color: var(--text-muted); }

/* ============================================
   Banner / Swiper
   ============================================ */
.banner-section { padding: 12px 16px; }

.banner-card {
    width: 100%;
    height: 160px;
    border-radius: var(--radius-lg);
    background: linear-gradient(135deg, var(--primary-dark), var(--primary), var(--primary-light));
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-glow);
}

.banner-card::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -30%;
    width: 220px;
    height: 220px;
    background: rgba(255,255,255,0.08);
    border-radius: 50%;
    animation: float 8s ease-in-out infinite;
}

.banner-card::after {
    content: '';
    position: absolute;
    bottom: -40%;
    left: -20%;
    width: 180px;
    height: 180px;
    background: rgba(255,255,255,0.05);
    border-radius: 50%;
    animation: float 10s ease-in-out infinite reverse;
}

.banner-card .banner-deco {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    pointer-events: none;
}

.banner-card .banner-deco::before {
    content: '';
    position: absolute;
    top: 16px;
    right: 20px;
    width: 40px;
    height: 40px;
    border: 2px solid rgba(255,255,255,0.15);
    border-radius: 8px;
    transform: rotate(15deg);
}

.banner-card .banner-deco::after {
    content: '';
    position: absolute;
    bottom: 20px;
    left: 24px;
    width: 24px;
    height: 24px;
    border: 2px solid rgba(255,255,255,0.1);
    border-radius: 50%;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(10px, -10px) scale(1.05); }
}

.banner-text {
    text-align: center;
    z-index: 1;
}

.banner-text h2 {
    font-size: 24px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 8px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.1);
    letter-spacing: 3px;
}

.banner-text p {
    font-size: 13px;
    color: rgba(255,255,255,0.85);
    letter-spacing: 1px;
}

/* ============================================
   Category Section
   ============================================ */
.category-section { padding: 8px 16px 16px; }

.category-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 12px 8px;
}

.category-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    transition: var(--transition);
}

.category-item:active { transform: scale(0.92); }

.category-icon {
    width: 50px;
    height: 50px;
    border-radius: 14px;
    background: var(--bg-white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    border: none;
    box-shadow: var(--shadow-card);
    transition: var(--transition);
}

.category-item:active .category-icon {
    background: var(--bg-elevated);
    box-shadow: var(--shadow-md);
}

.category-item.active .category-icon {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: #fff;
    box-shadow: var(--shadow-glow);
}

.category-name {
    font-size: 11px;
    color: var(--text-secondary);
    text-align: center;
    white-space: nowrap;
    font-weight: 500;
}

.category-item.active .category-name {
    color: var(--primary);
    font-weight: 600;
}

/* ============================================
   Inline Category Bar (horizontal scroll)
   ============================================ */
.category-bar {
    display: flex;
    gap: 8px;
    padding: 0 16px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.category-bar::-webkit-scrollbar { display: none; }

.category-tag {
    flex-shrink: 0;
    padding: 6px 14px;
    background: var(--bg-white);
    border-radius: 20px;
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 500;
    cursor: pointer;
    border: 1px solid var(--border-light);
    transition: var(--transition);
    white-space: nowrap;
}

.category-tag.active {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: #fff;
    border-color: transparent;
    box-shadow: 0 2px 8px rgba(91, 95, 239, 0.3);
}

.category-tag:active {
    transform: scale(0.95);
}

/* ============================================
   Section Title
   ============================================ */
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 16px 12px;
}

.section-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.section-title::before {
    content: '';
    width: 4px;
    height: 18px;
    background: linear-gradient(180deg, var(--primary), var(--primary-light));
    border-radius: 2px;
}

.section-more {
    font-size: 13px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 2px;
    transition: var(--transition);
}

.section-more:active { color: var(--primary); }

/* ============================================
   Product Grid - Horizontal Card Layout
   ============================================ */
.product-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 0 12px 16px;
}

.product-card {
    display: flex;
    align-items: center;
    background: var(--bg-white);
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-card);
    transition: var(--transition);
    cursor: pointer;
    position: relative;
}

.product-card:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--border);
    transform: translateY(-1px);
}

.product-card:active {
    transform: scale(0.98);
    box-shadow: var(--shadow-xs);
}

.product-card .product-img {
    width: 80px;
    height: 80px;
    flex-shrink: 0;
    background: linear-gradient(135deg, var(--bg-elevated), var(--bg));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    color: var(--text-muted);
    position: relative;
    overflow: hidden;
}

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

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

.product-card .product-tag {
    position: absolute;
    top: 6px;
    left: 6px;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: #fff;
    font-size: 10px;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(91, 95, 239, 0.3);
    z-index: 2;
}

.product-card .product-info {
    flex: 1;
    padding: 6px 10px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
    gap: 2px;
}

.product-card .product-name {
    font-size: 14px;
    color: var(--text-primary);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-weight: 500;
}

.product-card .product-price-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.product-card .product-price {
    font-size: 20px;
    font-weight: 700;
    color: var(--danger);
}

.product-card .product-price .yen { font-size: 13px; }

.product-card .product-sold {
    font-size: 11px;
    color: var(--text-muted);
}

.product-card .product-add-cart {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: var(--primary-bg);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
    transition: var(--transition);
}

.product-card .product-add-cart:active {
    background: var(--primary);
    color: #fff;
    transform: scale(0.9);
}

.product-add-cart-btn {
    position: absolute;
    right: 12px;
    bottom: 12px;
    width: 32px;
    height: 32px;
    border-radius: 10px;
    background: var(--primary-bg);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: var(--transition);
    z-index: 2;
}

.product-add-cart-btn:active {
    background: var(--primary);
    color: #fff;
    transform: scale(0.9);
}

/* ============================================
   Product Detail Page
   ============================================ */
.product-detail-img {
    width: 100%;
    aspect-ratio: 1;
    background: linear-gradient(135deg, var(--bg-white), var(--bg-elevated));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 80px;
    color: var(--text-muted);
}

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

.product-detail-info {
    padding: 16px;
    background: var(--bg-white);
    margin-top: -1px;
}

.product-detail-price {
    font-size: 28px;
    font-weight: 700;
    color: var(--danger);
    margin-bottom: 8px;
}

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

.product-detail-name {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.5;
    margin-bottom: 8px;
}

.product-detail-desc {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.6;
}

.product-detail-section {
    padding: 16px;
    margin-top: 10px;
    background: var(--bg-white);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-card);
}

.product-detail-section .section-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 10px;
}

.product-detail-section .section-text {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.8;
}

/* Quantity Selector */
.qty-selector {
    display: inline-flex;
    align-items: center;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: var(--bg-white);
    box-shadow: var(--shadow-xs);
}

.qty-selector .qty-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-primary);
    font-size: 18px;
    background: var(--bg-input);
    transition: var(--transition);
}

.qty-selector .qty-btn:active {
    background: var(--border);
    transform: scale(0.95);
}

.qty-selector .qty-value {
    width: 40px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    background: var(--bg-white);
    border-left: 1px solid var(--border);
    border-right: 1px solid var(--border);
}

/* Detail Bottom Bar */
.detail-bottom-bar {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 480px;
    height: 60px;
    background: var(--bg-glass);
    backdrop-filter: blur(24px) saturate(180%);
    -webkit-backdrop-filter: blur(24px) saturate(180%);
    display: flex;
    align-items: center;
    padding: 0 16px;
    gap: 10px;
    z-index: 100;
    border-top: 1px solid rgba(226, 228, 236, 0.6);
    box-shadow: 0 -2px 10px rgba(0,0,0,0.03);
}

.detail-bottom-bar .bar-icon-btn {
    width: 44px;
    height: 44px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    font-size: 10px;
    gap: 2px;
    position: relative;
    border-radius: 10px;
    transition: var(--transition);
}

.detail-bottom-bar .bar-icon-btn:active { background: var(--bg-elevated); }
.detail-bottom-bar .bar-icon-btn .icon { font-size: 20px; }

.detail-bottom-bar .btn-add-cart {
    flex: 1;
    height: 42px;
    border-radius: 12px;
    background: var(--primary-bg);
    color: var(--primary);
    font-size: 14px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.detail-bottom-bar .btn-add-cart:active {
    background: var(--primary);
    color: #fff;
    transform: scale(0.97);
}

.detail-bottom-bar .btn-buy-now {
    flex: 1;
    height: 42px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(91, 95, 239, 0.3);
    transition: var(--transition);
}

.detail-bottom-bar .btn-buy-now:active {
    transform: scale(0.97);
    box-shadow: 0 2px 6px rgba(91, 95, 239, 0.2);
}

/* ============================================
   Cart Page
   ============================================ */
.cart-list { padding: 8px 12px; }

.cart-item {
    display: flex;
    gap: 12px;
    padding: 14px;
    background: var(--bg-white);
    border-radius: var(--radius-md);
    margin-bottom: 10px;
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-card);
    position: relative;
    transition: var(--transition);
}

.cart-item:active {
    transform: scale(0.98);
    box-shadow: var(--shadow-md);
}

.cart-item .cart-checkbox {
    position: absolute;
    top: 14px;
    left: -4px;
}

.cart-item .cart-img {
    width: 80px;
    height: 80px;
    border-radius: var(--radius-sm);
    background: linear-gradient(135deg, var(--bg-elevated), var(--bg));
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 30px;
    color: var(--text-muted);
    overflow: hidden;
}

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

.cart-item .cart-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-width: 0;
}

.cart-item .cart-name {
    font-size: 13px;
    color: var(--text-primary);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-weight: 500;
}

.cart-item .cart-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

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

.cart-item .cart-price .yen { font-size: 11px; }

.cart-item .cart-delete {
    color: var(--text-muted);
    font-size: 18px;
    padding: 4px;
    border-radius: 8px;
    transition: var(--transition);
}

.cart-item .cart-delete:active {
    background: var(--danger-bg);
    color: var(--danger);
}

/* Cart Bottom Bar */
.cart-bottom-bar {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 480px;
    height: 60px;
    background: var(--bg-glass);
    backdrop-filter: blur(24px) saturate(180%);
    -webkit-backdrop-filter: blur(24px) saturate(180%);
    display: flex;
    align-items: center;
    padding: 0 16px;
    z-index: 100;
    border-top: 1px solid rgba(226, 228, 236, 0.6);
    box-shadow: 0 -2px 10px rgba(0,0,0,0.03);
}

.cart-bottom-bar .cart-select-all {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary);
    font-size: 13px;
}

.cart-bottom-bar .cart-total {
    flex: 1;
    text-align: right;
    padding-right: 12px;
}

.cart-bottom-bar .cart-total .total-label {
    font-size: 13px;
    color: var(--text-secondary);
}

.cart-bottom-bar .cart-total .total-price {
    font-size: 18px;
    font-weight: 700;
    color: var(--danger);
}

.cart-bottom-bar .cart-total .total-price .yen { font-size: 12px; }

.cart-bottom-bar .btn-checkout {
    height: 42px;
    padding: 0 24px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(91, 95, 239, 0.3);
    transition: var(--transition);
}

.cart-bottom-bar .btn-checkout:disabled {
    opacity: 0.5;
    box-shadow: none;
}

.cart-bottom-bar .btn-checkout:not(:disabled):active {
    transform: scale(0.97);
    box-shadow: 0 2px 6px rgba(91, 95, 239, 0.2);
}

/* Empty State */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    color: var(--text-muted);
    animation: fadeIn 0.5s ease;
}

.empty-state .empty-icon {
    font-size: 60px;
    margin-bottom: 16px;
    opacity: 0.4;
}

.empty-state .empty-text {
    font-size: 14px;
    margin-bottom: 20px;
}

.empty-state .btn-go-shop {
    height: 42px;
    padding: 0 24px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(91, 95, 239, 0.3);
    transition: var(--transition);
}

.empty-state .btn-go-shop:active { transform: scale(0.97); }

/* ============================================
   Checkout Page - Template Selection
   ============================================ */
.order-summary {
    padding: 16px;
    margin: 12px;
    background: var(--bg-white);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-card);
    transition: var(--transition);
}

.order-summary:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--border);
}

.order-summary .summary-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.order-summary .summary-item {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    font-size: 13px;
}

.order-summary .summary-item .label { color: var(--text-secondary); }

.order-summary .summary-item .value {
    color: var(--text-primary);
    font-weight: 500;
}

.order-summary .summary-total {
    display: flex;
    justify-content: space-between;
    padding-top: 10px;
    margin-top: 8px;
    border-top: 1px solid var(--border-light);
}

.order-summary .summary-total .total-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.order-summary .summary-total .total-value {
    font-size: 20px;
    font-weight: 700;
    color: var(--danger);
}

/* Template Grid */
.template-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    padding: 0 12px 16px;
}

.template-card {
    background: var(--bg-white);
    border-radius: var(--radius-md);
    padding: 14px;
    border: 2px solid var(--border-light);
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-card);
}

.template-card.selected {
    border-color: var(--primary);
    box-shadow: var(--shadow-glow);
    transform: translateY(-2px);
}

.template-card:active { transform: scale(0.97); }

.template-card .tpl-brand-bar {
    height: 4px;
    border-radius: 2px;
    margin-bottom: 10px;
    transition: var(--transition);
}

.template-card.selected .tpl-brand-bar { height: 5px; }

.template-card .tpl-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    margin-bottom: 8px;
    color: #fff;
    box-shadow: var(--shadow-xs);
}

.template-card .tpl-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.template-card .tpl-desc {
    font-size: 11px;
    color: var(--text-muted);
    line-height: 1.4;
}

.template-card .tpl-check {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 2px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    color: #fff;
    transition: var(--transition);
    background: var(--bg-white);
}

.template-card.selected .tpl-check {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    border-color: var(--primary);
    box-shadow: 0 2px 8px rgba(91, 95, 239, 0.3);
}

/* Checkout Bottom Bar */
.checkout-bottom-bar {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 480px;
    height: 64px;
    background: var(--bg-glass);
    backdrop-filter: blur(24px) saturate(180%);
    -webkit-backdrop-filter: blur(24px) saturate(180%);
    display: flex;
    align-items: center;
    padding: 0 16px;
    gap: 12px;
    z-index: 100;
    border-top: 1px solid rgba(226, 228, 236, 0.6);
    box-shadow: 0 -2px 10px rgba(0,0,0,0.03);
}

.checkout-bottom-bar .checkout-info { flex: 1; }

.checkout-bottom-bar .checkout-info .pay-label {
    font-size: 12px;
    color: var(--text-secondary);
}

.checkout-bottom-bar .checkout-info .pay-amount {
    font-size: 20px;
    font-weight: 700;
    color: var(--danger);
}

.checkout-bottom-bar .btn-go-pay {
    height: 46px;
    padding: 0 32px;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 16px rgba(91, 95, 239, 0.3);
    transition: var(--transition);
}

.checkout-bottom-bar .btn-go-pay:disabled {
    opacity: 0.5;
    box-shadow: none;
}

.checkout-bottom-bar .btn-go-pay:not(:disabled):active {
    transform: scale(0.97);
    box-shadow: 0 2px 8px rgba(91, 95, 239, 0.2);
}

/* ============================================
   Buttons
   ============================================ */
.btn-primary {
    height: 46px;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 24px;
    transition: var(--transition);
    box-shadow: 0 4px 12px rgba(91, 95, 239, 0.3);
    border: none;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.btn-primary::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.15), transparent);
    transition: left 0.5s ease;
}

.btn-primary:hover::after { left: 100%; }

.btn-primary:active {
    transform: scale(0.97);
    box-shadow: 0 2px 6px rgba(91, 95, 239, 0.2);
}

.btn-secondary {
    height: 46px;
    border-radius: 14px;
    background: var(--bg-white);
    color: var(--text-primary);
    font-size: 15px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 24px;
    border: 1.5px solid var(--border);
    transition: var(--transition);
    cursor: pointer;
}

.btn-secondary:active {
    background: var(--bg-elevated);
    border-color: var(--primary);
    color: var(--primary);
}

/* ============================================
   Toast Notification
   ============================================ */
.toast-container {
    position: fixed;
    top: 80px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    pointer-events: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.toast {
    background: var(--bg-white);
    color: var(--text-primary);
    padding: 12px 24px;
    border-radius: 14px;
    font-size: 13px;
    margin-bottom: 8px;
    animation: toastIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), toastOut 0.3s ease 2.2s forwards;
    border: 1px solid var(--border);
    white-space: nowrap;
    box-shadow: var(--shadow-lg);
    font-weight: 500;
    backdrop-filter: blur(10px);
}

.toast.success {
    border-color: rgba(34, 197, 94, 0.3);
    color: var(--success);
    background: var(--success-bg);
}

.toast.error {
    border-color: rgba(239, 68, 68, 0.3);
    color: var(--danger);
    background: var(--danger-bg);
}

@keyframes toastIn {
    from { opacity: 0; transform: translateY(-20px) scale(0.9); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes toastOut {
    from { opacity: 1; transform: translateY(0) scale(1); }
    to { opacity: 0; transform: translateY(-10px) scale(0.9); }
}

/* ============================================
   Loading Spinner
   ============================================ */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255,255,255,0.9);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    animation: fadeIn 0.3s ease;
}

.spinner {
    width: 36px;
    height: 36px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* ============================================
   Checkbox Custom
   ============================================ */
.checkbox-custom {
    width: 22px;
    height: 22px;
    border-radius: 7px;
    border: 2px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    flex-shrink: 0;
    background: var(--bg-white);
}

.checkbox-custom.checked {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    border-color: var(--primary);
    box-shadow: 0 2px 8px rgba(91, 95, 239, 0.25);
}

.checkbox-custom.checked::after {
    content: '\2713';
    color: #fff;
    font-size: 12px;
    font-weight: 700;
}

/* ============================================
   Utility Classes
   ============================================ */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-purple { color: var(--primary); }
.text-cyan { color: var(--primary-light); }
.text-danger { color: var(--danger); }
.text-muted { color: var(--text-muted); }
.text-secondary { color: var(--text-secondary); }
.mt-8 { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mb-8 { margin-bottom: 8px; }
.mb-12 { margin-bottom: 12px; }
.mb-16 { margin-bottom: 16px; }
.p-16 { padding: 16px; }
.flex { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.flex-col { flex-direction: column; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.flex-1 { flex: 1; }
.hidden { display: none !important; }

/* Skeleton Loading */
.skeleton {
    background: linear-gradient(90deg, var(--bg-elevated) 25%, var(--border-light) 50%, var(--bg-elevated) 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: var(--radius-sm);
}

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

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

/* Safe area */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
    .tab-bar,
    .cart-bottom-bar,
    .detail-bottom-bar,
    .checkout-bottom-bar {
        padding-bottom: env(safe-area-inset-bottom);
    }
}

/* ============================================
   Animations
   ============================================ */
@keyframes slideIn {
    from { opacity: 0; transform: translateX(20px); }
    to { opacity: 1; transform: translateX(0); }
}

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

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

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

.page-transition {
    animation: slideUp 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.animate-entrance {
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 0.45s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                transform 0.45s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.animate-entrance.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.card-lift { transition: var(--transition); }

.card-lift:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.glass {
    background: var(--bg-glass);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.gradient-text {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ============================================
   Page Top Bar (shared across sub-pages)
   ============================================ */
.page-top-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    height: 52px;
    background: var(--bg-glass);
    backdrop-filter: blur(24px) saturate(180%);
    -webkit-backdrop-filter: blur(24px) saturate(180%);
    border-bottom: 1px solid rgba(226, 228, 236, 0.6);
    position: sticky;
    top: 0;
    z-index: 50;
}

.page-top-bar .bar-back {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-primary);
    font-size: 20px;
    cursor: pointer;
    border-radius: 10px;
    transition: var(--transition);
}

.page-top-bar .bar-back:active {
    background: var(--bg-elevated);
}

.page-top-bar .bar-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.page-top-bar .bar-action {
    height: 36px;
    padding: 0 16px;
    border-radius: 10px;
    background: var(--primary-bg);
    color: var(--primary);
    font-size: 13px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    cursor: pointer;
    transition: var(--transition);
}

.page-top-bar .bar-action:active {
    background: var(--primary);
    color: #fff;
}

/* ============================================
   Modal (shared)
   ============================================ */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(26, 29, 46, 0.5);
    backdrop-filter: blur(4px);
    z-index: 1000;
    display: none;
    align-items: flex-end;
    justify-content: center;
}

.modal-overlay.active { display: flex; }

.modal-content {
    width: 100%;
    max-width: 480px;
    background: var(--bg-white);
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    padding: 24px 20px 40px;
    animation: slideUp 0.3s ease;
    max-height: 80vh;
    overflow-y: auto;
}

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

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

.modal-title {
    font-size: 17px;
    font-weight: 700;
    color: var(--text-primary);
}

.modal-close {
    width: 32px;
    height: 32px;
    border-radius: 10px;
    background: var(--bg-elevated);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    font-size: 18px;
    cursor: pointer;
    transition: var(--transition);
}

.modal-close:active { background: var(--border); }

.modal-btn-submit {
    width: 100%;
    height: 46px;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 20px;
    border: none;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.modal-btn-submit::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.15), transparent);
    transition: left 0.5s ease;
}

.modal-btn-submit:hover::after { left: 100%; }

.modal-btn-submit:active {
    opacity: 0.85;
    transform: scale(0.98);
}

.modal-btn-submit:disabled { opacity: 0.5; }

.modal-confirm-text {
    font-size: 15px;
    color: var(--text-secondary);
    line-height: 1.6;
    text-align: center;
    padding: 20px 0;
}

.modal-confirm-actions {
    display: flex;
    gap: 12px;
    margin-top: 16px;
}

.modal-confirm-actions .btn-cancel {
    flex: 1;
    height: 44px;
    border-radius: 12px;
    background: var(--bg-elevated);
    color: var(--text-secondary);
    font-size: 15px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    cursor: pointer;
    transition: var(--transition);
}

.modal-confirm-actions .btn-cancel:active { background: var(--border); }

.modal-confirm-actions .btn-confirm {
    flex: 1;
    height: 44px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    cursor: pointer;
    transition: var(--transition);
}

.modal-confirm-actions .btn-confirm:active {
    opacity: 0.85;
    transform: scale(0.98);
}

/* ============================================
   Form Elements (shared)
   ============================================ */
.form-group {
    margin-bottom: 16px;
    position: relative;
}

.form-label {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 6px;
    display: block;
    font-weight: 500;
}

.form-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.form-input-icon {
    position: absolute;
    left: 14px;
    color: var(--text-muted);
    font-size: 16px;
    z-index: 1;
    transition: var(--transition);
}

.form-input {
    width: 100%;
    height: 48px;
    background: var(--bg-input);
    border: 1.5px solid transparent;
    border-radius: var(--radius-md);
    padding: 0 14px;
    font-size: 15px;
    color: var(--text-primary);
    transition: var(--transition);
    outline: none;
}

.form-input-wrap .form-input { padding-left: 42px; }

.form-input:focus {
    background: var(--bg-white);
    border-color: var(--primary-light);
    box-shadow: 0 0 0 4px var(--primary-ring);
}

.form-input:focus + .form-input-icon,
.form-input-wrap:focus-within .form-input-icon { color: var(--primary); }

.form-input::placeholder {
    color: var(--text-muted);
    font-size: 14px;
}

.form-textarea {
    width: 100%;
    background: var(--bg-input);
    border: 1.5px solid transparent;
    border-radius: var(--radius-md);
    padding: 12px 14px;
    font-size: 15px;
    color: var(--text-primary);
    transition: var(--transition);
    resize: none;
    height: 100px;
}

.form-textarea:focus {
    background: var(--bg-white);
    border-color: var(--primary-light);
    box-shadow: 0 0 0 4px var(--primary-ring);
}

.form-select {
    width: 100%;
    height: 48px;
    background: var(--bg-input);
    border: 1.5px solid transparent;
    border-radius: var(--radius-md);
    padding: 0 14px;
    font-size: 15px;
    color: var(--text-primary);
    transition: var(--transition);
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%235A5E72' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
}

.form-select:focus {
    background-color: var(--bg-white);
    border-color: var(--primary-light);
    box-shadow: 0 0 0 4px var(--primary-ring);
}

.form-input::placeholder, .form-textarea::placeholder { color: var(--text-muted); }

.form-row {
    display: flex;
    gap: 12px;
}

.form-row .form-group { flex: 1; }

/* ============================================
   Status Tags (shared)
   ============================================ */
.status-tag {
    font-size: 10px;
    padding: 2px 8px;
    border-radius: 6px;
    font-weight: 600;
    letter-spacing: 0.3px;
}

.status-tag.pending { background: var(--warning-bg); color: var(--warning); }
.status-tag.paid, .status-tag.approved, .status-tag.on-sale { background: var(--success-bg); color: var(--success); }
.status-tag.expired, .status-tag.rejected, .status-tag.off-sale { background: var(--danger-bg); color: var(--danger); }
.status-tag.transferred { background: var(--primary-bg); color: var(--primary); }

/* ============================================
   Auth Page Styles
   ============================================ */
.auth-page {
    min-height: 100vh;
    background: linear-gradient(160deg, #f5f6fa 0%, #eef0f5 50%, #f0f2f8 100%);
    position: relative;
    overflow: hidden;
}

.auth-page::before {
    content: '';
    position: absolute;
    top: -100px;
    right: -80px;
    width: 300px;
    height: 300px;
    background: linear-gradient(135deg, rgba(91,95,239,0.06), rgba(124,127,248,0.03));
    border-radius: 50%;
    z-index: 0;
}

.auth-page::after {
    content: '';
    position: absolute;
    bottom: -60px;
    left: -60px;
    width: 220px;
    height: 220px;
    background: linear-gradient(135deg, rgba(91,95,239,0.04), rgba(124,127,248,0.02));
    border-radius: 50%;
    z-index: 0;
}

.auth-container {
    padding: 0 24px 40px;
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 100vh;
    box-sizing: border-box;
}

.input-hint {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 6px;
    padding-left: 4px;
    transition: var(--transition);
}

.input-hint.valid { color: var(--success); }
.input-hint.invalid { color: var(--danger); }

.password-strength {
    margin-top: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.strength-bar {
    flex: 1;
    height: 4px;
    background: var(--border-light);
    border-radius: 2px;
    overflow: hidden;
}

.strength-fill {
    height: 100%;
    width: 0;
    border-radius: 2px;
    transition: all 0.3s ease;
}

.strength-fill.weak { width: 33%; background: #ef4444; }
.strength-fill.medium { width: 66%; background: #f59e0b; }
.strength-fill.strong { width: 100%; background: #10b981; }

.strength-text { font-size: 11px; color: var(--text-muted); min-width: 48px; }
.strength-text.weak { color: #ef4444; }
.strength-text.medium { color: #f59e0b; }
.strength-text.strong { color: #10b981; }

.match-hint { font-size: 11px; margin-top: 6px; padding-left: 4px; }
.match-hint.match { color: var(--success); }
.match-hint.mismatch { color: var(--danger); }

.reg-tip {
    text-align: center;
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 20px;
    letter-spacing: 0.5px;
}

.auth-footer {
    text-align: center;
    margin-top: 32px;
    padding-bottom: 24px;
}

.auth-footer p {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.auth-footer-links {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 12px;
}

.auth-footer-links a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: var(--transition);
}

.auth-footer-links a:hover { color: var(--primary); }
.auth-footer-links .dot { color: var(--text-muted); }

.auth-hero {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary), #7c3aed);
    margin: 0 -24px 32px;
    padding: 60px 24px 80px;
    position: relative;
    overflow: hidden;
    border-radius: 0 0 32px 32px;
}

.auth-hero::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 250px;
    height: 250px;
    background: rgba(255,255,255,0.06);
    border-radius: 50%;
}

.auth-hero::after {
    content: '';
    position: absolute;
    bottom: -30%;
    left: -10%;
    width: 180px;
    height: 180px;
    background: rgba(255,255,255,0.04);
    border-radius: 50%;
}

.auth-hero-content {
    position: relative;
    z-index: 1;
    text-align: center;
}

.auth-hero .logo-icon {
    width: 64px;
    height: 64px;
    border-radius: 18px;
    background: rgba(255,255,255,0.12);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    margin: 0 auto 16px;
    border: 1px solid rgba(255,255,255,0.15);
}

.auth-hero .logo-text {
    font-size: 24px;
    font-weight: 700;
    color: #fff;
    letter-spacing: 3px;
    margin-bottom: 6px;
}

.auth-hero .logo-sub {
    font-size: 13px;
    color: rgba(255,255,255,0.65);
    font-weight: 400;
}

.auth-card {
    background: var(--bg-white);
    border-radius: var(--radius-xl);
    padding: 28px 24px;
    margin-top: -50px;
    position: relative;
    z-index: 2;
    box-shadow: 0 8px 32px rgba(0,0,0,0.05), 0 2px 8px rgba(0,0,0,0.03);
    border: 1px solid rgba(226, 228, 236, 0.5);
}

.auth-tabs {
    display: flex;
    margin-bottom: 28px;
    position: relative;
    border-bottom: 2px solid var(--border-light);
}

.auth-tab {
    flex: 1;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    font-weight: 600;
    color: var(--text-muted);
    transition: var(--transition);
    cursor: pointer;
    position: relative;
    background: none;
    border: none;
}

.auth-tab.active { color: var(--primary); }

.auth-tab.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 20%;
    right: 20%;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--primary-light));
    border-radius: 3px 3px 0 0;
}

.auth-form { display: none; }

.auth-form.active {
    display: block;
    animation: formSlideIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.btn-auth {
    width: 100%;
    height: 50px;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 28px;
    transition: var(--transition);
    border: none;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(91, 95, 239, 0.3);
}

.btn-auth::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.15), transparent);
    transition: left 0.5s ease;
}

.btn-auth:hover::before { left: 100%; }

.btn-auth:active {
    transform: translateY(1px);
    box-shadow: 0 2px 8px rgba(91, 95, 239, 0.2);
}

.btn-auth:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.auth-switch {
    text-align: center;
    margin-top: 24px;
    font-size: 14px;
    color: var(--text-secondary);
}

.auth-switch a {
    color: var(--primary);
    cursor: pointer;
    font-weight: 600;
    margin-left: 4px;
    transition: var(--transition);
}

.auth-switch a:hover { color: var(--primary-dark); }

.auth-divider {
    display: flex;
    align-items: center;
    margin: 24px 0;
    color: var(--text-muted);
    font-size: 12px;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border-light);
}

.auth-divider span { padding: 0 16px; }

.auth-agreement {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-top: 16px;
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.5;
}

.auth-agreement input[type="checkbox"] {
    width: 16px;
    height: 16px;
    margin-top: 1px;
    accent-color: var(--primary);
    flex-shrink: 0;
}

.auth-agreement a { color: var(--primary); }

/* ============================================
   Profile Page
   ============================================ */
.profile-header {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary), var(--primary-light));
    padding: 60px 20px 30px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.profile-header::before {
    content: '';
    position: absolute;
    top: -40%;
    right: -20%;
    width: 200px;
    height: 200px;
    background: rgba(255,255,255,0.06);
    border-radius: 50%;
}

.profile-header::after {
    content: '';
    position: absolute;
    bottom: -30%;
    left: -15%;
    width: 150px;
    height: 150px;
    background: rgba(255,255,255,0.04);
    border-radius: 50%;
}

.profile-avatar {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: rgba(255,255,255,0.15);
    border: 3px solid rgba(255,255,255,0.35);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    font-weight: 700;
    color: #fff;
    margin: 0 auto 12px;
    position: relative;
    z-index: 1;
    overflow: hidden;
}

.profile-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-nickname {
    font-size: 18px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 4px;
    position: relative;
    z-index: 1;
}

.profile-username {
    font-size: 13px;
    color: rgba(255,255,255,0.65);
    position: relative;
    z-index: 1;
    margin-bottom: 8px;
}

.merchant-status-tag {
    display: inline-block;
    font-size: 11px;
    padding: 2px 10px;
    border-radius: 6px;
    position: relative;
    z-index: 1;
}

.merchant-status-tag.status-0 { background: rgba(255,255,255,0.15); color: rgba(255,255,255,0.75); }
.merchant-status-tag.status-1 { background: rgba(253,203,110,0.25); color: #fff; }
.merchant-status-tag.status-2 { background: rgba(34,197,94,0.25); color: #fff; }
.merchant-status-tag.status-3 { background: rgba(239,68,68,0.25); color: #fff; }

.group-status-tag {
    display: inline-block;
    font-size: 11px;
    padding: 2px 12px;
    border-radius: 6px;
    position: relative;
    z-index: 1;
    background: rgba(255,255,255,0.15);
    color: #fff;
    font-weight: 500;
}

.balance-card {
    background: var(--bg-white);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-light);
    margin: -20px 16px 12px;
    padding: 20px;
    position: relative;
    z-index: 2;
    box-shadow: var(--shadow-md);
}

.balance-card .balance-label {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.balance-card .balance-amount {
    font-size: 32px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.balance-card .balance-amount .yen { font-size: 18px; }

.balance-card .balance-frozen {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 16px;
}

.balance-card .btn-withdraw {
    height: 38px;
    padding: 0 24px;
    border-radius: 10px;
    background: var(--primary-bg);
    color: var(--primary);
    font-size: 14px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    cursor: pointer;
    transition: var(--transition);
}

.balance-card .btn-withdraw:active {
    background: var(--primary);
    color: #fff;
    transform: scale(0.98);
}

.profile-menu { padding: 0 16px; }

.menu-group {
    background: var(--bg-white);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-light);
    margin-bottom: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-card);
}

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

.menu-item:last-child { border-bottom: none; }
.menu-item:active { background: var(--bg-elevated); }

.menu-item .menu-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    margin-right: 12px;
    flex-shrink: 0;
}

.menu-item .menu-text {
    flex: 1;
    font-size: 14px;
    color: var(--text-primary);
    font-weight: 500;
}

.menu-item .menu-arrow {
    color: var(--text-muted);
    font-size: 14px;
}

.btn-logout {
    width: calc(100% - 32px);
    margin: 16px 16px 24px;
    height: 46px;
    border-radius: 14px;
    background: var(--bg-white);
    color: var(--danger);
    font-size: 15px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1.5px solid var(--border);
    cursor: pointer;
    transition: var(--transition);
    margin-bottom: 80px;
}

.btn-logout:active { background: var(--danger-bg); border-color: var(--danger); }

/* ============================================
   Order Card (shared)
   ============================================ */
.order-list { padding: 12px; }

.order-card {
    background: var(--bg-white);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-light);
    margin-bottom: 10px;
    overflow: hidden;
    box-shadow: var(--shadow-card);
}

.order-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px 8px;
}

.order-card-header .order-time {
    font-size: 12px;
    color: var(--text-muted);
}

.order-card-body {
    display: flex;
    gap: 12px;
    padding: 8px 14px 12px;
}

.order-card-body .order-img {
    width: 64px;
    height: 64px;
    border-radius: var(--radius-sm);
    background: var(--bg-elevated);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: var(--text-muted);
    overflow: hidden;
}

.order-card-body .order-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.order-card-body .order-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-width: 0;
}

.order-card-body .order-name {
    font-size: 14px;
    color: var(--text-primary);
    font-weight: 500;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

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

.order-card-body .order-amount {
    font-size: 16px;
    font-weight: 700;
    color: var(--danger);
}

.order-card-body .order-amount .yen { font-size: 12px; }

.order-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 14px 12px;
    border-top: 1px solid var(--border-light);
}

.order-card-footer .order-tpl {
    font-size: 12px;
    color: var(--text-muted);
}

/* ============================================
   Order Tabs (shared)
   ============================================ */
.order-tabs {
    display: flex;
    background: var(--bg-white);
    border-bottom: 1px solid var(--border);
    padding: 0 16px;
}

.order-tab {
    flex: 1;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-muted);
    cursor: pointer;
    position: relative;
    transition: var(--transition);
}

.order-tab.active {
    color: var(--primary);
    font-weight: 600;
}

.order-tab.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 24px;
    height: 3px;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    border-radius: 2px;
}

/* ============================================
   Withdrawal Card (shared)
   ============================================ */
.withdrawal-list { padding: 12px; }

.withdrawal-card {
    background: var(--bg-white);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-light);
    padding: 16px;
    margin-bottom: 10px;
    box-shadow: var(--shadow-card);
}

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

.withdrawal-card .wd-amount {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
}

.withdrawal-card .wd-amount .yen { font-size: 14px; }

.withdrawal-card .wd-body {
    display: flex;
    gap: 12px;
    margin-bottom: 12px;
}

.withdrawal-card .wd-qrcode {
    width: 60px;
    height: 60px;
    border-radius: var(--radius-sm);
    background: var(--bg-elevated);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: var(--text-muted);
    overflow: hidden;
}

.withdrawal-card .wd-qrcode img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.withdrawal-card .wd-details {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
}

.withdrawal-card .wd-detail-row {
    font-size: 12px;
    color: var(--text-secondary);
}

.withdrawal-card .wd-detail-row span { color: var(--text-muted); }

.withdrawal-card .wd-remark {
    font-size: 12px;
    color: var(--text-muted);
    padding-top: 10px;
    border-top: 1px solid var(--border-light);
}

.withdrawal-card .wd-remark strong {
    color: var(--text-secondary);
    font-weight: 500;
}

/* ============================================
   Group Page
   ============================================ */
.group-page {
    min-height: 100vh;
    background: var(--bg);
    padding-bottom: 100px;
}

.group-header {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary), #7c3aed);
    padding: 52px 20px 28px;
    position: relative;
    overflow: hidden;
}

.group-header::before {
    content: '';
    position: absolute;
    top: -40%;
    right: -20%;
    width: 200px;
    height: 200px;
    background: rgba(255,255,255,0.06);
    border-radius: 50%;
}

.group-header .back-btn {
    position: absolute;
    top: 12px;
    left: 16px;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 20px;
    cursor: pointer;
    border-radius: 10px;
    background: rgba(255,255,255,0.12);
    backdrop-filter: blur(10px);
    z-index: 10;
    text-decoration: none;
}

.group-header h2 {
    color: #fff;
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 4px;
    position: relative;
    z-index: 1;
}

.group-header p {
    color: rgba(255,255,255,0.65);
    font-size: 13px;
    position: relative;
    z-index: 1;
}

.current-group-card {
    background: var(--bg-white);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-light);
    margin: -16px 16px 16px;
    padding: 20px;
    position: relative;
    z-index: 2;
    box-shadow: var(--shadow-md);
}

.current-group-card .label {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.current-group-card .group-name {
    font-size: 22px;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 4px;
}

.current-group-card .group-rate {
    font-size: 13px;
    color: var(--text-secondary);
}

.group-list { padding: 0 16px; }

.group-list h3 {
    font-size: 15px;
    color: var(--text-primary);
    margin-bottom: 12px;
    font-weight: 600;
}

.group-card {
    background: var(--bg-white);
    border-radius: var(--radius-md);
    padding: 16px;
    margin-bottom: 12px;
    box-shadow: var(--shadow-card);
    display: flex;
    align-items: center;
    gap: 14px;
    transition: var(--transition);
    border: 2px solid transparent;
}

.group-card.active {
    border-color: var(--primary);
    background: var(--primary-bg);
}

.group-card .group-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    flex-shrink: 0;
}

.group-card .group-info { flex: 1; }

.group-card .group-info .name {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.group-card .group-info .desc {
    font-size: 12px;
    color: var(--text-secondary);
}

.group-card .group-badge {
    font-size: 11px;
    padding: 4px 10px;
    border-radius: 6px;
    font-weight: 600;
    flex-shrink: 0;
}

.group-card .group-badge.current { background: var(--primary-bg); color: var(--primary); }
.group-card .group-badge.default { background: var(--success-bg); color: var(--success); }

.group-card .btn-buy-group {
    font-size: 12px;
    padding: 6px 14px;
    border-radius: 8px;
    font-weight: 600;
    flex-shrink: 0;
    border: none;
    cursor: pointer;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff;
    transition: var(--transition);
}

.group-card .btn-buy-group:active {
    opacity: 0.8;
    transform: scale(0.96);
}

/* ============================================
   Product Card Item (user-products)
   ============================================ */
.product-card-item {
    display: flex;
    gap: 12px;
    padding: 14px;
    background: var(--bg-white);
    border-radius: var(--radius-md);
    margin-bottom: 10px;
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-card);
}

.product-card-item .item-img {
    width: 80px;
    height: 80px;
    border-radius: var(--radius-sm);
    background: var(--bg-elevated);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 30px;
    color: var(--text-muted);
    overflow: hidden;
}

.product-card-item .item-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-card-item .item-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-width: 0;
}

.product-card-item .item-name {
    font-size: 14px;
    color: var(--text-primary);
    font-weight: 500;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-card-item .item-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.product-card-item .item-price {
    font-size: 16px;
    font-weight: 700;
    color: var(--danger);
}

.product-card-item .item-price .yen { font-size: 12px; }

.product-card-item .item-meta {
    display: flex;
    align-items: center;
    gap: 8px;
}

.product-card-item .item-sold {
    font-size: 11px;
    color: var(--text-muted);
}

.btn-toggle-status {
    height: 30px;
    padding: 0 12px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    cursor: pointer;
    transition: var(--transition);
}

.btn-toggle-status.off { background: var(--danger-bg); color: var(--danger); }
.btn-toggle-status.on { background: var(--success-bg); color: var(--success); }
.btn-toggle-status:active { opacity: 0.7; }

/* ============================================
   Floating Cart Button
   ============================================ */
.floating-cart {
    position: fixed;
    bottom: 80px;
    right: 16px;
    z-index: 200;
    width: 52px;
    height: 52px;
    border-radius: 16px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 20px rgba(91, 95, 239, 0.35);
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
}

.floating-cart:active { transform: scale(0.9); }

.floating-cart-icon {
    font-size: 22px;
    line-height: 1;
}

.floating-cart-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 18px;
    height: 18px;
    background: linear-gradient(135deg, var(--danger), #F87171);
    color: #fff;
    font-size: 10px;
    font-weight: 600;
    border-radius: 9px;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    box-shadow: 0 2px 4px rgba(239, 68, 68, 0.3);
}

@media (min-width: 481px) {
    .floating-cart { right: calc(50% - 240px + 16px); }
}

/* ============================================
   Responsive Design
   ============================================ */
@media (max-width: 360px) {
    .banner-card { height: 130px; }
    .banner-text h2 { font-size: 20px; }
    .category-grid { gap: 8px 4px; }
    .category-icon { width: 44px; height: 44px; font-size: 18px; }
    .category-name { font-size: 10px; }
    .product-card .product-img { width: 70px; height: 70px; }
    .product-card .product-price { font-size: 17px; }
    .auth-hero { padding: 48px 20px 64px; }
    .auth-card { padding: 24px 20px; }
    .template-grid { gap: 8px; }
}

@media (min-width: 420px) {
    .product-card .product-img { width: 90px; height: 90px; }
    .banner-card { height: 180px; }
}

/* ============================================
   Focus Styles (Accessibility)
   ============================================ */
:focus-visible {
    outline: 2px solid var(--primary-light);
    outline-offset: 2px;
}

button:focus-visible,
a:focus-visible {
    outline: 2px solid var(--primary-light);
    outline-offset: 2px;
    border-radius: 4px;
}

/* ============================================
   Print Styles
   ============================================ */
@media print {
    .tab-bar,
    .top-nav,
    .detail-bottom-bar,
    .cart-bottom-bar,
    .checkout-bottom-bar,
    .floating-cart { display: none !important; }
    .page-content { padding-top: 0; padding-bottom: 0; }
}

/* ============================================
   Reduced Motion
   ============================================ */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    .animate-entrance {
        opacity: 1;
        transform: none;
    }
    .page-transition { animation: none; }
}



/* ============================================
   Selection Style
   ============================================ */
::selection {
    background: rgba(91, 95, 239, 0.2);
    color: var(--text-primary);
}
