/* ============================================
   BAGS FACTORY - NATIVE MOBILE APP
   ============================================ */

:root {
    --primary: #1a3a5c;
    --primary-light: #2c5f8a;
    --accent: #e67e22;
    --accent-dark: #c45e00;
    --bg: #f5f7fa;
    --surface: #ffffff;
    --text: #1a1a2e;
    --text-secondary: #888;
    --success: #27ae60;
    --danger: #e74c3c;
    --warning: #f39c12;
    --radius: 20px;
    --radius-sm: 12px;
    --shadow: 0 2px 12px rgba(0,0,0,0.08);
    --shadow-lg: 0 8px 32px rgba(0,0,0,0.12);
}

* { margin:0; padding:0; box-sizing:border-box; -webkit-tap-highlight-color:transparent; }
html, body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--primary);
    color: var(--text);
    overflow: hidden;
    overscroll-behavior-y: none;
    touch-action: manipulation;
    -webkit-font-smoothing: antialiased;
    height: 100vh;
    height: 100dvh;
}

/* ============================================
   SPLASH SCREEN - Clean & Professional
   ============================================ */
#splash {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: var(--primary);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: opacity 0.5s ease, transform 0.5s ease;
}
#splash.hide {
    opacity: 0;
    transform: scale(1.05);
    pointer-events: none;
}
#splash .splash-logo {
    width: 100px;
    height: 100px;
    border-radius: 24px;
    object-fit: cover;
    margin-bottom: 20px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.3);
}
#splash .splash-title {
    font-size: 1.5rem;
    font-weight: 900;
    color: #fff;
    margin-bottom: 6px;
    text-align: center;
}
#splash .splash-subtitle {
    font-size: 0.85rem;
    color: rgba(255,255,255,0.6);
    text-align: center;
    margin-bottom: 32px;
    font-weight: 500;
}
#splash .splash-loader {
    width: 36px;
    height: 36px;
    border: 3px solid rgba(255,255,255,0.15);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ============================================
   APP CONTAINER
   ============================================ */
#app {
    max-width: 480px;
    margin: 0 auto;
    height: 100vh;
    height: 100dvh;
    position: relative;
    background: var(--bg);
    overflow: hidden;
    display: none;
}
#app.ready { display: block; }

/* ============================================
   HEADER - Minimal
   ============================================ */
.app-header {
    background: var(--surface);
    color: var(--text);
    padding: 10px 16px;
    padding-top: calc(10px + env(safe-area-inset-top));
    display: flex;
    align-items: center;
    gap: 10px;
    position: relative;
    z-index: 50;
    border-bottom: 1px solid rgba(0,0,0,0.05);
}
.app-header .logo {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    object-fit: cover;
}
.app-header .title {
    flex: 1;
    font-size: 1rem;
    font-weight: 800;
    color: var(--primary);
}
.app-header .phone-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--bg);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent);
    text-decoration: none;
    font-size: 1rem;
}

/* ============================================
   SCREEN SYSTEM
   ============================================ */
.screen-container {
    height: calc(100vh - 52px - env(safe-area-inset-top) - 56px - env(safe-area-inset-bottom));
    height: calc(100dvh - 52px - env(safe-area-inset-top) - 56px - env(safe-area-inset-bottom));
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    position: relative;
    background: var(--bg);
}
.screen-container::-webkit-scrollbar { display: none; }

.screen {
    display: none;
    animation: screenIn 0.25s ease;
    min-height: 100%;
}
.screen.active { display: block; }
@keyframes screenIn {
    from { opacity: 0; transform: translateX(8px); }
    to { opacity: 1; transform: translateX(0); }
}

/* ============================================
   HOME SCREEN
   ============================================ */
.hero {
    position: relative;
    height: 220px;
    overflow: hidden;
    margin: 12px;
    border-radius: var(--radius);
}
.hero img {
    width: 100%; height: 100%;
    object-fit: cover;
}
.hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(26,58,92,0.1) 0%, rgba(26,58,92,0.9) 100%);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 18px;
    color: #fff;
}
.hero-overlay h1 {
    font-size: 1.2rem;
    font-weight: 900;
    margin-bottom: 4px;
    line-height: 1.3;
}
.hero-overlay p {
    font-size: 0.8rem;
    opacity: 0.85;
    margin-bottom: 12px;
}
.hero-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--accent);
    color: #fff;
    padding: 10px 18px;
    border-radius: 50px;
    font-weight: 700;
    font-size: 0.85rem;
    text-decoration: none;
    width: fit-content;
    border: none;
    cursor: pointer;
}
.hero-btn:active { transform: scale(0.95); }

.section-title {
    padding: 16px 16px 8px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.section-title h2 {
    font-size: 0.95rem;
    font-weight: 800;
    color: var(--text);
}
.section-title .see-all {
    color: var(--accent);
    font-size: 0.75rem;
    font-weight: 700;
    text-decoration: none;
}

/* Horizontal Scroll */
.scroll-row {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding: 0 16px 12px;
}
.scroll-row::-webkit-scrollbar { display: none; }
.scroll-card {
    scroll-snap-align: start;
    flex: 0 0 240px;
    background: var(--surface);
    border-radius: var(--radius-sm);
    overflow: hidden;
    box-shadow: var(--shadow);
}
.scroll-card .card-img {
    height: 130px;
    position: relative;
    overflow: hidden;
}
.scroll-card .card-img img {
    width: 100%; height: 100%;
    object-fit: cover;
}
.scroll-card .card-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    background: var(--accent);
    color: #fff;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 800;
}
.scroll-card .card-body {
    padding: 12px;
}
.scroll-card .card-body h3 {
    font-size: 0.9rem;
    font-weight: 700;
    margin-bottom: 3px;
}
.scroll-card .card-body p {
    font-size: 0.72rem;
    color: var(--text-secondary);
    margin-bottom: 8px;
}
.scroll-card .card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.scroll-card .price {
    font-size: 0.95rem;
    font-weight: 800;
    color: var(--accent-dark);
}
.scroll-card .order-btn {
    background: var(--success);
    color: #fff;
    border: none;
    width: 30px; height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.8rem;
}
.scroll-card .order-btn:active { transform: scale(0.9); }

/* Grid */
.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    padding: 0 16px 12px;
}
.grid-card {
    background: var(--surface);
    border-radius: var(--radius-sm);
    overflow: hidden;
    box-shadow: var(--shadow);
}
.grid-card .grid-img {
    height: 85px;
    position: relative;
}
.grid-card .grid-img img {
    width: 100%; height: 100%;
    object-fit: cover;
}
.grid-card .grid-icon {
    position: absolute;
    bottom: -12px;
    right: 10px;
    width: 28px; height: 28px;
    background: var(--surface);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    box-shadow: var(--shadow);
}
.grid-card .grid-body {
    padding: 16px 10px 10px;
    text-align: center;
}
.grid-card .grid-body h3 {
    font-size: 0.8rem;
    font-weight: 700;
    margin-bottom: 2px;
}
.grid-card .grid-body p {
    font-size: 0.68rem;
    color: var(--text-secondary);
    margin-bottom: 5px;
}
.grid-card .grid-price {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--accent-dark);
}

/* ============================================
   ORDER SCREEN
   ============================================ */
.form-screen { padding: 12px; }
.form-card {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 18px;
    box-shadow: var(--shadow);
}
.form-group {
    margin-bottom: 12px;
}
.form-group label {
    display: block;
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--text-secondary);
    margin-bottom: 4px;
}
.form-group label .required { color: var(--danger); }
.form-input {
    width: 100%;
    padding: 12px 14px;
    border: 1.5px solid #e8e8e8;
    border-radius: var(--radius-sm);
    font-size: 1rem;
    font-family: inherit;
    background: var(--bg);
    transition: all 0.2s;
}
.form-input:focus {
    outline: none;
    border-color: var(--accent);
    background: var(--surface);
}
select.form-input {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: left 12px center;
    background-size: 16px;
    padding-left: 40px;
}

.color-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
.color-dot {
    width: 32px; height: 32px;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.2s;
    position: relative;
}
.color-dot.active {
    border-color: var(--accent);
    transform: scale(1.1);
}
.color-dot.active::after {
    content: '✓';
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    color: #fff;
    font-size: 0.8rem;
    font-weight: bold;
    text-shadow: 0 1px 3px rgba(0,0,0,0.5);
}

.price-box {
    background: linear-gradient(135deg, rgba(26,58,92,0.04) 0%, rgba(230,126,34,0.08) 100%);
    border: 1.5px dashed var(--accent);
    border-radius: var(--radius-sm);
    padding: 16px;
    text-align: center;
    margin: 14px 0;
}
.price-box .label {
    font-size: 0.78rem;
    color: var(--text-secondary);
    margin-bottom: 3px;
}
.price-box .value {
    font-size: 1.5rem;
    font-weight: 900;
    color: var(--accent-dark);
}
.price-box .note {
    font-size: 0.68rem;
    color: var(--text-secondary);
    margin-top: 3px;
}

.btn-main {
    width: 100%;
    padding: 14px;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 1rem;
    font-weight: 800;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s;
}
.btn-main:active { transform: scale(0.98); opacity: 0.9; }
.btn-main:disabled { background: #ccc; }

/* ============================================
   TRACK SCREEN
   ============================================ */
.track-box { padding: 12px; }
.track-input-group {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}
.track-input {
    flex: 1;
    padding: 12px 14px;
    border: 1.5px solid #e8e8e8;
    border-radius: var(--radius-sm);
    font-size: 1rem;
    background: var(--surface);
}
.track-btn {
    padding: 12px 18px;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: var(--radius-sm);
    font-weight: 700;
    cursor: pointer;
}

/* ============================================
   CONTACT SCREEN
   ============================================ */
.contact-list { padding: 0 12px; }
.contact-item {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--surface);
    padding: 12px;
    border-radius: var(--radius-sm);
    margin-bottom: 8px;
    box-shadow: var(--shadow);
    text-decoration: none;
    color: inherit;
}
.contact-item:active { transform: scale(0.98); }
.contact-item .icon {
    width: 40px; height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: #fff;
    flex-shrink: 0;
}
.contact-item.whatsapp .icon { background: #25d366; }
.contact-item.phone .icon { background: var(--accent); }
.contact-item.email .icon { background: #3498db; }
.contact-item .info { flex: 1; }
.contact-item .info h3 {
    font-size: 0.9rem;
    font-weight: 700;
    margin-bottom: 1px;
}
.contact-item .info p {
    font-size: 0.72rem;
    color: var(--text-secondary);
}
.contact-item .arrow {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

/* ============================================
   TAB BAR - Clean & Minimal
   ============================================ */
.tab-bar {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 480px;
    background: var(--surface);
    border-top: 1px solid rgba(0,0,0,0.04);
    display: flex;
    justify-content: space-around;
    padding-bottom: env(safe-area-inset-bottom);
    z-index: 100;
}
.tab-bar .tab {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    padding: 6px 8px;
    color: var(--text-secondary);
    font-size: 0.58rem;
    font-weight: 700;
    min-width: 52px;
    transition: all 0.2s;
    border: none;
    background: none;
    cursor: pointer;
}
.tab-bar .tab i {
    font-size: 1.2rem;
    transition: all 0.2s;
}
.tab-bar .tab.active {
    color: var(--accent);
}
.tab-bar .tab.active i {
    transform: translateY(-1px);
}
.tab-bar .tab:active { transform: scale(0.92); }

/* ============================================
   MODAL
   ============================================ */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    backdrop-filter: blur(6px);
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.modal-overlay.show { display: flex; }
.modal-box {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 24px 20px;
    max-width: 300px;
    width: 100%;
    text-align: center;
    box-shadow: var(--shadow-lg);
    animation: scaleIn 0.25s ease;
}
@keyframes scaleIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}
.modal-icon {
    width: 56px; height: 56px;
    border-radius: 50%;
    background: rgba(39,174,96,0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 12px;
    font-size: 1.6rem;
    color: var(--success);
}
.modal-box h3 {
    font-size: 1.05rem;
    font-weight: 800;
    margin-bottom: 6px;
}
.modal-box p {
    color: var(--text-secondary);
    font-size: 0.82rem;
    margin-bottom: 16px;
}
.modal-btn {
    width: 100%;
    padding: 12px;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
}

/* Spinner */
.spinner {
    display: inline-block;
    width: 18px; height: 18px;
    border: 2px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 0.8s linear infinite;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 32px 20px;
    color: var(--text-secondary);
}
.empty-state i {
    font-size: 2.5rem;
    margin-bottom: 10px;
    opacity: 0.4;
}

/* Utilities */
.p-16 { padding: 16px; }
.mb-12 { margin-bottom: 12px; }
.text-center { text-align: center; }
.hidden { display: none !important; }
