@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800;900&display=swap');

:root {
  --bg-color: #0c0d10;
  --surface-color: #1a1c24;
  --primary-color: #246bfd;
  --accent-color: #0088cc;
  --text-primary: #ffffff;
  --text-secondary: #8c8f94;
  --font-family: 'Outfit', sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
body { font-family: var(--font-family); background-color: var(--bg-color); color: var(--text-primary); overflow-x: hidden; touch-action: pan-y; }

.app-container { 
  padding: 100px 16px env(safe-area-inset-bottom, 20px) 16px; 
  min-height: 100vh;
}

/* Top Header */
.top-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 25px; }
.user-block { display: flex; align-items: center; gap: 12px; }
.user-avatar { width: 44px; height: 44px; border-radius: 12px; object-fit: cover; }
.user-nickname { font-weight: 800; font-size: 1.1rem; }
.user-status { color: var(--text-secondary); font-size: 0.8rem; }

.balance-block-merged {
    background: rgba(44, 46, 54, 0.8); backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.08); height: 32px;
    border-radius: 16px; padding: 0 4px 0 10px; display: flex; align-items: center; gap: 6px; font-weight: 800;
}
.star-icon { color: #ffa41c; }
.plus-mini {
    width: 24px; height: 24px; background: var(--primary-color);
    border-radius: 50%; display: flex; align-items: center; justify-content: center; color: white;
}

/* Gift Grid */
.gift-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; padding-bottom: 100px; }
.gift-card { display: flex; flex-direction: column; animation: fadeIn 0.4s; cursor: pointer; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

.gift-img-box {
    width: 100%; aspect-ratio: 1/1; background: linear-gradient(135deg, rgba(255,255,255,0.05) 0%, rgba(255,255,255,0.02) 100%);
    border-radius: 28px; position: relative; overflow: hidden; display: flex; align-items: center; justify-content: center;
    border: 1px solid rgba(255,255,255,0.08); box-shadow: 0 8px 25px rgba(0,0,0,0.5);
}
.gift-img-box img { width: 100%; height: 100%; object-fit: cover; }

.gift-price-tag {
    position: absolute; bottom: 0; left: 0; right: 0; background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(10px); padding: 8px 0; text-align: center; color: var(--accent-color);
    font-weight: 900; font-size: 0.85rem; border-top: 1px solid rgba(255,255,255,0.05);
}

.gift-info-block { margin-top: 12px; text-align: center; }
.gift-name { font-weight: 700; font-size: 0.95rem; color: #fff; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gift-id { font-size: 0.75rem; color: var(--text-secondary); margin-top: 2px; }

/* MODALS */
.modal-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.85); backdrop-filter: blur(10px);
    z-index: 10000; display: none; align-items: center; justify-content: center;
    opacity: 0; transition: opacity 0.3s;
}
.modal-overlay.active { display: flex; opacity: 1; }

.modal-card {
    background: #1c1e24; width: 90%; max-width: 340px;
    padding: 25px; border-radius: 32px; border: 1px solid rgba(255,255,255,0.1);
}

/* Bottom Sheet Style */
.bottom-sheet { align-items: flex-end; }
.modal-overlay.active .details-card { transform: translateY(0); }

.details-card {
    background: #1c1e24;
    width: 100%;
    max-width: 100%;
    border-radius: 32px 32px 0 0;
    padding: 20px 25px calc(30px + env(safe-area-inset-bottom)) 25px;
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.1, 0, 0.1, 1);
}

.drag-handle {
    width: 36px;
    height: 4px;
    background: rgba(255,255,255,0.15);
    border-radius: 2px;
    margin: -5px auto 20px auto;
}

.d-img-box {
    width: 120px; /* Smaller, focused image */
    height: 120px;
    margin: 0 auto 15px auto;
    border-radius: 20px;
    overflow: hidden;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.05);
}

.d-img-box img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.d-info {
    text-align: center;
}

.d-info h2 {
    font-size: 1.4rem;
    color: #fff;
    margin-bottom: 2px;
    font-weight: 800;
}

.d-subtext {
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-bottom: 15px;
    font-weight: 600;
}

.d-price-row {
    display: flex;
    justify-content: center;
    gap: 8px;
    align-items: center;
    margin-bottom: 20px;
}

.d-price-val {
    font-size: 1.25rem;
    font-weight: 900;
    color: var(--accent-color);
}

.modal-actions.full-width button { width: 100%; padding: 18px; font-size: 1.1rem; border-radius: 20px; border: none; font-weight: 800; cursor: pointer; }
.order-btn { background: var(--primary-color); color: white; box-shadow: 0 8px 30px rgba(36, 107, 253, 0.4); }

.close-sheet {
    display: block; width: 100%; margin-top: 15px; background: none; border: none;
    color: var(--text-secondary); font-weight: 700; font-size: 0.95rem; cursor: pointer;
}

/* ... existing FAB and other styles ... */
.fab-btn {
    position: fixed; right: 20px; bottom: calc(20px + env(safe-area-inset-bottom));
    width: 60px; height: 60px; background: var(--primary-color);
    border-radius: 50%; display: flex; align-items: center; justify-content: center;
    color: white; z-index: 1000; box-shadow: 0 8px 30px rgba(36, 107, 253, 0.5);
}

.input-wrapper { display: flex; flex-direction: column; gap: 10px; margin-top: 20px; }
.file-input-box label {
    display: block; width: 100%; background: rgba(255,255,255,0.05); border: 1px dashed rgba(255,255,255,0.2);
    border-radius: 14px; padding: 20px; text-align: center; color: var(--text-secondary); font-weight: 700;
}
.file-input-box input { display: none; }
.input-wrapper input {
    background: #0c0d10; border: 1px solid rgba(255,255,255,0.06);
    border-radius: 14px; padding: 14px; color: white; font-family: inherit;
}
.modal-actions { display: flex; gap: 12px; margin-top: 20px; }
.modal-actions button { flex: 1; padding: 14px; border-radius: 16px; border: none; font-weight: 800; }
.cancel-btn { background: #2c2e36; color: white; }
.confirm-btn { background: var(--primary-color); color: white; }
