/* 柬埔寨移动端优化样式 */

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

html {
    font-size: 16px;
}

@media (max-width: 768px) {
    html {
        font-size: 14px;
    }
}

/* 高棉语字体优化 */
body {
    font-family: 'Kantumruy', 'Nokora', 'Hanuman', sans-serif;
    line-height: 1.6;
    color: #333;
    background: #f5f5f5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* 按钮样式优化 */
.btn-kh {
    display: inline-block;
    padding: 12px 24px;
    font-size: 1rem;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    min-height: 44px; /* 最小触摸目标 */
    min-width: 44px;
    user-select: none;
    -webkit-user-select: none;
    touch-action: manipulation;
}

.btn-kh-primary {
    background: linear-gradient(135deg, #0066cc 0%, #004d99 100%);
    color: white;
    box-shadow: 0 4px 6px rgba(0, 102, 204, 0.2);
}

.btn-kh-primary:active {
    transform: translateY(2px);
    box-shadow: 0 2px 4px rgba(0, 102, 204, 0.2);
}

.btn-kh-large {
    padding: 16px 32px;
    font-size: 1.1rem;
    border-radius: 12px;
}

/* 表单优化 */
.form-group-kh {
    margin-bottom: 20px;
}

.form-control-kh {
    width: 100%;
    padding: 16px;
    font-size: 1rem;
    border: 2px solid #ddd;
    border-radius: 8px;
    background: white;
    transition: border-color 0.3s ease;
    font-family: inherit;
}

.form-control-kh:focus {
    outline: none;
    border-color: #0066cc;
    box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1);
}

.form-control-kh::placeholder {
    color: #999;
    opacity: 0.7;
}

/* 手机号输入框特别优化 */
.phone-input-kh {
    position: relative;
}

.phone-input-kh .country-code {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: #666;
    font-weight: 500;
}

.phone-input-kh input {
    padding-left: 60px;
}

/* 导航栏优化 */
.navbar-kh {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 56px;
    background: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    display: flex;
    align-items: center;
    padding: 0 16px;
}

.navbar-kh .nav-brand {
    font-size: 1.2rem;
    font-weight: bold;
    color: #0066cc;
    text-decoration: none;
}

.navbar-kh .nav-menu {
    display: flex;
    margin-left: auto;
    gap: 12px;
}

.navbar-kh .nav-item {
    padding: 8px 12px;
    text-decoration: none;
    color: #333;
    border-radius: 6px;
    transition: background 0.3s ease;
}

.navbar-kh .nav-item:active {
    background: #f0f0f0;
}

/* 底部导航 */
.bottom-nav-kh {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: white;
    border-top: 1px solid #eee;
    display: flex;
    justify-content: space-around;
    align-items: center;
    z-index: 1000;
}

.bottom-nav-kh .nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: #666;
    font-size: 0.8rem;
    padding: 8px;
    flex: 1;
    text-align: center;
}

.bottom-nav-kh .nav-item.active {
    color: #0066cc;
}

.bottom-nav-kh .nav-icon {
    font-size: 1.2rem;
    margin-bottom: 4px;
}

/* 卡片样式优化 */
.card-kh {
    background: white;
    border-radius: 12px;
    padding: 20px;
    margin: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card-kh:active {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

/* 产品卡片 */
.product-card-kh {
    border-radius: 12px;
    overflow: hidden;
    background: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s ease;
}

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

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

.product-card-kh .product-info {
    padding: 16px;
}

.product-card-kh .product-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 8px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-card-kh .product-price {
    color: #e53935;
    font-size: 1.2rem;
    font-weight: bold;
    margin-bottom: 12px;
}

/* 支付方式选择 */
.payment-methods-kh {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin: 20px 0;
}

.payment-method-kh {
    flex: 1;
    min-width: calc(50% - 6px);
    background: white;
    border: 2px solid #eee;
    border-radius: 8px;
    padding: 16px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    user-select: none;
}

.payment-method-kh.active {
    border-color: #0066cc;
    background: rgba(0, 102, 204, 0.05);
}

.payment-method-kh:active {
    transform: scale(0.98);
}

.payment-method-kh img {
    width: 40px;
    height: 40px;
    margin-bottom: 8px;
}

.payment-method-kh .payment-name {
    font-size: 0.9rem;
    font-weight: 500;
}

/* 二维码支付样式 */
.qr-payment-kh {
    text-align: center;
    padding: 24px;
    background: white;
    border-radius: 12px;
    margin: 20px 0;
}

.qr-payment-kh .qr-code {
    width: 200px;
    height: 200px;
    margin: 0 auto 20px;
    padding: 12px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.qr-payment-kh .payment-apps {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
    margin-top: 20px;
}

.qr-payment-kh .payment-app {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: #f8f9fa;
    border-radius: 6px;
    font-size: 0.9rem;
}

.qr-payment-kh .payment-app img {
    width: 24px;
    height: 24px;
    border-radius: 4px;
}

/* 加载动画 */
.loading-kh {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 40px;
}

.loading-spinner-kh {
    width: 40px;
    height: 40px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #0066cc;
    border-radius: 50%;
    animation: spin-kh 1s linear infinite;
}

@keyframes spin-kh {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 弹窗优化 */
.modal-kh {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    padding: 20px;
    animation: fadeIn-kh 0.3s ease;
}

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

.modal-content-kh {
    background: white;
    border-radius: 12px;
    width: 100%;
    max-width: 400px;
    max-height: 80vh;
    overflow-y: auto;
    animation: slideUp-kh 0.3s ease;
}

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

.modal-header-kh {
    padding: 20px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-body-kh {
    padding: 20px;
}

.modal-footer-kh {
    padding: 20px;
    border-top: 1px solid #eee;
    display: flex;
    gap: 12px;
}

/* 深色模式支持 */
@media (prefers-color-scheme: dark) {
    body {
        background: #121212;
        color: #e0e0e0;
    }
    
    .card-kh,
    .product-card-kh,
    .modal-content-kh {
        background: #1e1e1e;
        color: #e0e0e0;
    }
    
    .form-control-kh {
        background: #2d2d2d;
        border-color: #404040;
        color: #e0e0e0;
    }
    
    .navbar-kh,
    .bottom-nav-kh {
        background: #1e1e1e;
        border-color: #404040;
    }
    
    .payment-method-kh {
        background: #2d2d2d;
        border-color: #404040;
    }
}

/* 高性能动画优化 */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* 打印优化 */
@media print {
    .navbar-kh,
    .bottom-nav-kh,
    .btn-kh {
        display: none !important;
    }
}
