/* ============================================
   EASYWAY DELIVERIES — CUSTOMER APP
   Clean, warm, Uber Eats-inspired design
   ============================================ */

:root {
    --white: #ffffff;
    --bg: #f8f7f4;
    --bg-card: #ffffff;
    --surface: #f1f0ec;
    --border: #e8e6e1;
    --text-primary: #1a1a1a;
    --text-secondary: #6b6b6b;
    --text-muted: #9a9a9a;
    --accent: #e85d2a;
    --accent-light: #fff3ee;
    --accent-dark: #c14d22;
    --success: #22a45d;
    --success-light: #e8f8ef;
    --warning: #f5a623;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
    --shadow-lg: 0 8px 30px rgba(0,0,0,0.12);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 999px;
    --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --nav-height: 70px;
    --header-height: 60px;
}

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

html, body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text-primary);
    height: 100%;
    margin: 0;
    padding: 0;
    overflow: hidden; /* Prevent body scroll, handled by views */
    -webkit-font-smoothing: antialiased;
}

button { cursor: pointer; font-family: var(--font); }
input { font-family: var(--font); }
a { color: var(--accent); text-decoration: none; }

.hidden { display: none !important; }

#appShell {
    height: 100%;
    width: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* ======= AUTH SCREEN ======= */
.screen { 
    display: none; 
    height: 100%; 
    width: 100%;
    overflow-y: auto;
    background: var(--bg);
}

.screen.active-screen { 
    display: flex;
    flex-direction: column;
}

.auth-container {
    width: 100%;
    max-width: 420px;
    margin: 0 auto;
    padding: 3rem 1.5rem;
    display: flex;
    flex-direction: column;
    min-height: 100%;
}

.auth-form {
    padding-bottom: 2rem;
}

.auth-brand {
    text-align: center;
    margin-bottom: 2.5rem;
    margin-top: auto;
}

.brand-icon {
    width: 64px;
    height: 64px;
    background: var(--accent);
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    margin: 0 auto 1rem;
    box-shadow: 0 8px 24px rgba(232, 93, 42, 0.3);
}

.auth-brand h1 {
    font-size: 1.75rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--text-primary);
}

.auth-brand p {
    color: var(--text-secondary);
    margin-top: 0.25rem;
    font-size: 0.9rem;
}

.auth-form h2 {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.auth-subtitle {
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-bottom: 1.25rem;
}

.input-group {
    margin-bottom: 0.85rem;
}

.input-group label {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.35rem;
}

.input-group input, .address-input-wrap input {
    width: 100%;
    padding: 0.85rem 1rem;
    background: var(--surface);
    border: 1.5px solid transparent;
    border-radius: var(--radius-md);
    font-size: 0.95rem;
    color: var(--text-primary);
    outline: none;
    transition: border-color 0.2s, background 0.2s;
}

.input-group input:focus, .address-input-wrap input:focus {
    border-color: var(--accent);
    background: var(--white);
}

.input-group input::placeholder, .address-input-wrap input::placeholder {
    color: var(--text-muted);
}

.register-fields {
    overflow: hidden;
    max-height: 0;
    opacity: 0;
    transition: max-height 0.4s ease, opacity 0.3s ease;
}

.register-fields.show {
    max-height: 250px;
    opacity: 1;
}

.auth-error {
    background: #fef2f2;
    color: #dc2626;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    margin-bottom: 1rem;
}

.auth-toggle {
    text-align: center;
    margin-top: 1.5rem;
    margin-bottom: auto;
    padding-bottom: 2rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.auth-toggle a {
    font-weight: 600;
    margin-left: 0.25rem;
}

/* ======= BUTTONS ======= */
.btn-primary {
    background: var(--accent);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-weight: 700;
    font-size: 1rem;
    transition: opacity 0.3s, transform 0.3s;
}

/* ======= ACCOUNT VIEW ======= */
#viewAccount {
    padding: 1.5rem;
}

.account-header h1 {
    font-size: 1.75rem;
    font-weight: 800;
    margin-bottom: 1.5rem;
}

.account-card {
    background: var(--white);
    border-radius: var(--radius-xl);
    padding: 1.5rem;
    box-shadow: var(--shadow-md);
}

.account-user {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border);
}

.user-avatar {
    width: 64px;
    height: 64px;
    background: var(--accent-light);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
}

.user-info h3 {
    font-size: 1.25rem;
    font-weight: 700;
}

.user-info p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.install-card-premium {
    background: linear-gradient(135deg, var(--accent) 0%, #ff8a65 100%);
    color: white;
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
}

.install-card span {
    font-size: 2rem;
}

.install-card h4 {
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.install-card p {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.ios-hint {
    margin-top: 0.25rem;
    font-size: 0.75rem !important;
    font-weight: 600;
    color: var(--accent) !important;
}

.android-hint {
    font-size: 0.75rem !important;
    font-weight: 600;
    color: #3b82f6 !important;
}

.account-actions {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.account-btn {
    width: 100%;
    padding: 1rem;
    border-radius: var(--radius-lg);
    background: #fff;
    border: 1px solid var(--border);
    text-align: left;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    transition: background 0.2s;
}

.account-btn:active {
    background: var(--bg-body);
}

.btn-primary:active { transform: scale(0.98); }
.btn-primary:disabled { background: #ccc; cursor: not-allowed; }

.btn-lg {
    width: 100%;
    padding: 1rem;
}

/* ======= APP HEADER ======= */
.app-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    background: rgba(248, 247, 244, 0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1rem;
    z-index: 100;
    border-bottom: 1px solid var(--border);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    flex: 1;
    min-width: 0;
}

.header-icon { font-size: 1.25rem; flex-shrink: 0; }

.header-address {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.header-label {
    font-size: 0.65rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.header-value {
    font-size: 0.85rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.header-chevron {
    font-size: 1.2rem;
    color: var(--text-muted);
    flex-shrink: 0;
}

.cart-fab {
    width: 42px;
    height: 42px;
    background: var(--text-primary);
    border: none;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    flex-shrink: 0;
    font-size: 1.1rem;
}

.cart-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: var(--accent);
    color: white;
    font-size: 0.6rem;
    font-weight: 800;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--bg);
}

/* ======= VIEWS ======= */
.view {
    display: none;
    flex: 1;
    width: 100%;
    padding-top: var(--header-height);
    padding-bottom: var(--nav-height);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.view.active-view { display: block; }

/* ======= HOME VIEW ======= */
.home-hero {
    padding: 1.5rem 1rem 0;
}

.home-hero h1 {
    font-size: 1.75rem;
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: -0.02em;
    margin-bottom: 1.25rem;
}

.search-bar {
    display: flex;
    align-items: center;
    background: var(--white);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-full);
    padding: 0 1rem;
    transition: border-color 0.2s;
    box-shadow: var(--shadow-sm);
}

.search-bar:focus-within { border-color: var(--accent); }

.search-icon {
    font-size: 1rem;
    color: var(--text-muted);
    margin-right: 0.5rem;
    flex-shrink: 0;
}

.search-bar input {
    flex: 1;
    border: none;
    background: transparent;
    padding: 0.85rem 0;
    font-size: 0.9rem;
    outline: none;
    color: var(--text-primary);
}

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

/* Categories */
.category-scroll {
    display: flex;
    gap: 0.5rem;
    padding: 1.25rem 1rem;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

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

.cat-chip {
    padding: 0.5rem 1rem;
    background: var(--white);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-full);
    font-size: 0.8rem;
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
    transition: all 0.2s;
    color: var(--text-secondary);
}

.cat-chip.active {
    background: var(--text-primary);
    border-color: var(--text-primary);
    color: var(--white);
}

.cat-chip:hover:not(.active) { border-color: var(--text-secondary); }

/* Section Label */
.section-label {
    padding: 0 1rem 0.75rem;
}

.section-label h2 {
    font-size: 1.1rem;
    font-weight: 700;
}

/* Merchant Grid */
.merchant-grid {
    padding: 0 1rem;
    display: grid;
    gap: 1rem;
}

.merchant-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s;
    border: 1px solid var(--border);
}

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

.merchant-card-img {
    height: 140px;
    background: linear-gradient(135deg, var(--accent-light) 0%, #fde8d8 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    position: relative;
}

.merchant-card-img .merchant-tag {
    position: absolute;
    bottom: 0.75rem;
    left: 0.75rem;
    background: var(--white);
    padding: 0.25rem 0.6rem;
    border-radius: var(--radius-full);
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--text-secondary);
    box-shadow: var(--shadow-sm);
    z-index: 2;
}

.merchant-logo-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.menu-merchant-logo {
    width: 60px;
    height: 60px;
    border-radius: var(--radius-lg);
    object-fit: cover;
    margin-right: 1rem;
    border: 2px solid var(--white);
    box-shadow: var(--shadow-md);
}

.merchant-card-body {
    padding: 0.85rem 1rem;
}

.merchant-card-body h3 {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 0.2rem;
}

.merchant-card-meta {
    font-size: 0.8rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.meta-dot {
    width: 3px;
    height: 3px;
    background: var(--text-muted);
    border-radius: 50%;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 3rem 2rem;
}

.empty-icon {
    font-size: 3rem;
    display: block;
    margin-bottom: 1rem;
}

.empty-state h3 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 0.4rem;
}

.empty-state p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* ======= MENU VIEW ======= */
.menu-merchant-banner {
    padding: 1.5rem 1rem;
    background: var(--white);
    border-bottom: 1px solid var(--border);
    margin-bottom: 1rem;
}

.back-btn-pill {
    background: var(--surface);
    border: none;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-full);
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.back-btn-pill:active { transform: scale(0.95); }

.menu-merchant-info h1 {
    font-size: 1.5rem;
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 0.25rem;
}

.menu-merchant-info p {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.menu-categories {
    padding: 0 1rem 2rem;
}

.menu-category-title {
    font-size: 1rem;
    font-weight: 700;
    padding: 1.25rem 0 0.75rem;
    color: var(--text-primary);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    border-bottom: 1px solid var(--border);
    margin-bottom: 0.75rem;
}

.menu-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.9rem 0;
    border-bottom: 1px solid #f3f2ef;
}

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

.menu-item-info {
    flex: 1;
    min-width: 0;
    padding-right: 1rem;
}

.menu-item-info h4 {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 0.15rem;
}

.menu-item-info .item-desc {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 0.3rem;
}

.menu-item-info .item-price {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--accent);
}

.menu-item-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.menu-item-image {
    width: 64px;
    height: 64px;
    background: var(--surface);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    font-size: 1.5rem;
    flex-shrink: 0;
}

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

.add-item-btn {
    width: 36px;
    height: 36px;
    background: var(--accent);
    border: none;
    border-radius: var(--radius-sm);
    color: white;
    font-size: 1.4rem;
    font-weight: 300;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: transform 0.1s;
}

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

/* ======= TRACKING VIEW ======= */
#viewTracking { padding-top: 0; padding-bottom: 0; display: none; flex-direction: column; }
#viewTracking.active-view { display: flex; }

.tracking-map-container {
    flex: 2;
    position: relative;
    min-height: 350px;
    width: 100%;
}

.tracking-map { position: absolute; inset: 0; width: 100%; height: 100%; }

.tracking-panel {
    background: var(--white);
    border-top-left-radius: var(--radius-xl);
    border-top-right-radius: var(--radius-xl);
    padding: 0.75rem 1.5rem 2rem;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.08);
    position: relative;
    z-index: 500;
}

.panel-handle {
    width: 40px;
    height: 4px;
    background: var(--border);
    border-radius: 2px;
    margin: 0 auto 1rem;
}

.tracking-status-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.5rem;
}

.tracking-status-row h2 {
    font-size: 1.15rem;
    font-weight: 700;
}

.tracking-order-id {
    font-size: 0.75rem;
    color: var(--text-muted);
    letter-spacing: 0.03em;
    margin-top: 0.15rem;
}

.pulse-dot {
    width: 10px;
    height: 10px;
    background: var(--accent);
    border-radius: 50%;
    box-shadow: 0 0 0 0 rgba(232, 93, 42, 0.4);
    animation: pulse-ring 2s infinite;
    flex-shrink: 0;
    margin-top: 0.5rem;
}

@keyframes pulse-ring {
    0% { box-shadow: 0 0 0 0 rgba(232, 93, 42, 0.4); }
    70% { box-shadow: 0 0 0 12px rgba(232, 93, 42, 0); }
    100% { box-shadow: 0 0 0 0 rgba(232, 93, 42, 0); }
}

.tracking-timeline {
    display: flex;
    justify-content: space-between;
    margin: 1.25rem 0;
    position: relative;
}

.tracking-timeline::before {
    content: '';
    position: absolute;
    top: 6px;
    left: 12px;
    right: 12px;
    height: 2px;
    background: var(--border);
}

.timeline-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
    z-index: 1;
    flex: 1;
}

.timeline-dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--border);
    border: 2px solid var(--bg);
    transition: all 0.4s;
}

.timeline-step span {
    font-size: 0.6rem;
    font-weight: 600;
    text-align: center;
    color: var(--text-muted);
    max-width: 60px;
}

.timeline-step.completed .timeline-dot {
    background: var(--success);
    box-shadow: 0 0 8px rgba(34, 164, 93, 0.4);
}

.timeline-step.completed span { color: var(--success); }

.timeline-step.active .timeline-dot {
    background: var(--accent);
    box-shadow: 0 0 8px rgba(232, 93, 42, 0.4);
}

.timeline-step.active span { color: var(--accent); font-weight: 700; }

.driver-card {
    background: var(--surface);
    padding: 0.85rem 1rem;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.driver-avatar {
    width: 44px;
    height: 44px;
    background: var(--white);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    flex-shrink: 0;
}

.driver-info { flex: 1; }
.driver-info strong { display: block; font-size: 0.9rem; }
.driver-info span { font-size: 0.75rem; color: var(--text-secondary); }

.call-btn {
    width: 40px;
    height: 40px;
    background: var(--success);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    text-decoration: none;
    flex-shrink: 0;
}

/* ======= ORDERS VIEW ======= */
.orders-header {
    padding: 1.5rem 1rem 1rem;
}

.orders-header h1 {
    font-size: 1.5rem;
    font-weight: 800;
}

.orders-list {
    padding: 0 1rem;
    display: grid;
    gap: 0.75rem;
}

.order-history-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 1rem;
    cursor: pointer;
    transition: all 0.15s;
}

.order-history-card:active { transform: scale(0.99); }

.order-history-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.5rem;
}

.order-history-top h4 { font-size: 0.95rem; font-weight: 700; }

.order-status-badge {
    padding: 0.2rem 0.6rem;
    border-radius: var(--radius-full);
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
}

.badge-delivered { background: var(--success-light); color: var(--success); }
.badge-active { background: var(--accent-light); color: var(--accent); }
.badge-cancelled { background: #fef2f2; color: #dc2626; }

.order-history-meta {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.order-history-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid #f3f2ef;
}

.order-history-bottom span {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.order-history-bottom strong {
    font-size: 0.95rem;
    font-weight: 700;
}

/* ======= BOTTOM NAV ======= */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--nav-height);
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: space-around;
    align-items: flex-start;
    padding-top: 0.5rem;
    z-index: 200;
}

.nav-item {
    background: none;
    border: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.2rem;
    color: var(--text-muted);
    transition: color 0.2s;
    padding: 0.25rem 0.75rem;
}

.nav-item.active { color: var(--accent); }
.nav-icon { font-size: 1.25rem; }
.nav-label { font-size: 0.65rem; font-weight: 600; }

/* ======= SHEET / MODAL ======= */
.sheet-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    z-index: 1000;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    animation: fadeIn 0.2s;
}

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

.sheet {
    background: var(--white);
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    border-top-left-radius: var(--radius-xl);
    border-top-right-radius: var(--radius-xl);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: slideUp 0.3s ease-out;
}

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

.sheet-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.sheet-header h2 {
    font-size: 1.15rem;
    font-weight: 700;
}

.close-btn {
    width: 32px;
    height: 32px;
    background: var(--surface);
    border: none;
    border-radius: 50%;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
}

/* ======= CART ======= */
.cart-items {
    flex: 1;
    overflow-y: auto;
    padding: 1rem 1.5rem;
}

.cart-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.85rem 0;
    border-bottom: 1px solid #f3f2ef;
}

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

.cart-item-info { flex: 1; }

.cart-item-info h4 {
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 0.15rem;
}

.cart-item-info span {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.qty-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.qty-btn {
    width: 28px;
    height: 28px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-primary);
}

.qty-btn:active { background: var(--border); }

.qty-value {
    font-size: 0.9rem;
    font-weight: 700;
    min-width: 20px;
    text-align: center;
}

.cart-footer {
    border-top: 1px solid var(--border);
    padding: 1.25rem 1.5rem;
    flex-shrink: 0;
}

.cart-summary { margin-bottom: 1.25rem; }

.summary-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 0.4rem;
}

.summary-row.total {
    font-weight: 800;
    font-size: 1.1rem;
    color: var(--text-primary);
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid var(--border);
}

/* Address Input */
.address-section {
    margin-bottom: 1.25rem;
}

.address-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    display: block;
    margin-bottom: 0.4rem;
}

.address-input-wrap {
    display: flex;
    align-items: center;
    background: var(--surface);
    border: 1.5px solid transparent;
    border-radius: var(--radius-md);
    padding: 0 1rem;
    transition: border-color 0.2s;
}

.address-input-wrap:focus-within {
    border-color: var(--accent);
    background: var(--white);
}

.address-pin { font-size: 1rem; margin-right: 0.5rem; flex-shrink: 0; }

.address-input-wrap input {
    border: none !important;
    background: transparent !important;
    padding: 0.85rem 0 !important;
}

.address-dropdown, .address-dropdown-static {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    margin-top: 0.5rem;
    max-height: 200px;
    overflow-y: auto;
    box-shadow: var(--shadow-md);
}

.address-dropdown-static {
    border: none;
    box-shadow: none;
    max-height: 400px;
}

.address-option {
    padding: 0.75rem 1rem;
    font-size: 0.85rem;
    cursor: pointer;
    border-bottom: 1px solid #f3f2ef;
    transition: background 0.15s;
}

.address-option:last-child { border-bottom: none; }
.address-option:hover, .address-option:active { background: var(--accent-light); }

.selected-address {
    font-size: 0.8rem;
    color: var(--success);
    font-weight: 600;
    margin-top: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.checkout-btn {
    font-size: 1rem;
}

/* ======= MAP PICKER MODAL ======= */
.map-sheet {
    height: 90vh !important;
    display: flex;
    flex-direction: column;
    padding: 0 !important;
}

.map-sheet .sheet-header {
    padding: 1.5rem 1.5rem 1rem;
    flex-shrink: 0;
}

.map-search-container {
    padding: 0 1.5rem 1rem;
    position: relative;
    z-index: 1000;
}

.absolute-results {
    position: absolute;
    top: 100%;
    left: 1.5rem;
    right: 1.5rem;
    z-index: 1001;
    background: white;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
    border-radius: var(--radius-md);
    max-height: 250px;
}

.location-picker-map {
    height: 350px;
    width: 100%;
    position: relative;
}

/* Fixed Center Pin */
.location-picker-map::after {
    content: '📍';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -100%);
    font-size: 2.5rem;
    z-index: 1000;
    pointer-events: none;
    filter: drop-shadow(0 4px 6px rgba(0,0,0,0.3));
    animation: dropIn 0.3s ease-out;
}

@keyframes dropIn {
    from { transform: translate(-50%, -200%); opacity: 0; }
    to { transform: translate(-50%, -100%); opacity: 1; }
}

.location-confirm-bar {
    padding: 1.5rem;
    background: var(--white);
    box-shadow: 0 -4px 12px rgba(0,0,0,0.05);
    z-index: 10;
}

/* ======= TOAST ======= */
.toast {
    position: fixed;
    bottom: calc(var(--nav-height) + 16px);
    left: 50%;
    transform: translateX(-50%);
    background: var(--text-primary);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-full);
    font-size: 0.85rem;
    font-weight: 600;
    z-index: 9999;
    box-shadow: var(--shadow-lg);
    animation: toastIn 0.3s ease-out;
    white-space: nowrap;
}

@keyframes toastIn {
    from { transform: translateX(-50%) translateY(20px); opacity: 0; }
    to { transform: translateX(-50%) translateY(0); opacity: 1; }
}

/* ======= RESPONSIVE ======= */
@media (min-width: 768px) {
    .merchant-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.install-card-premium {
    background: linear-gradient(135deg, var(--accent) 0%, #ff8a65 100%);
    color: white;
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(232, 93, 42, 0.3);
    transition: transform 0.2s;
}

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

.install-icon {
    font-size: 1.5rem;
    background: rgba(255,255,255,0.2);
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.install-text {
    flex: 1;
}

.install-text h4 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 700;
}

.install-text p {
    margin: 0;
    font-size: 0.8rem;
    opacity: 0.9;
}

.install-arrow {
    font-size: 1.2rem;
    opacity: 0.8;
}

.guide-box {
    text-align: left;
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 12px;
    margin-bottom: 1rem;
}

.guide-box ol {
    padding-left: 1.5rem;
    line-height: 1.6;
    margin: 0;
}

.guide-box li {
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

/* --- SPLASH SCREEN --- */
.splash-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: linear-gradient(135deg, #1A1A1A 0%, #000000 100%);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    color: #FFFFFF;
    transition: opacity 0.5s ease-in-out;
}
.splash-screen.fade-out {
    opacity: 0;
    pointer-events: none;
}
.splash-content {
    text-align: center;
    animation: fadeInPulse 1.5s ease-out forwards;
}
.splash-logo {
    font-size: 5rem;
    margin-bottom: 1rem;
}
.splash-content h1 {
    font-size: 2.5rem;
    font-weight: 800;
    color: #FF5F00;
    margin: 0;
    letter-spacing: -0.5px;
}
.splash-footer {
    position: absolute;
    bottom: 2.5rem;
    font-size: 0.9rem;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 2px;
    animation: fadeIn 2s ease-out forwards;
}

@keyframes fadeInPulse {
    0% { opacity: 0; transform: scale(0.9); }
    50% { opacity: 1; transform: scale(1.05); }
    100% { opacity: 1; transform: scale(1); }
}
@keyframes fadeIn {
    0% { opacity: 0; }
    100% { opacity: 1; }
}

.splash-logo-img {
    width: 140px;
    height: auto;
    margin-bottom: 1rem;
    filter: drop-shadow(0 4px 16px rgba(255, 95, 0, 0.3));
    border-radius: 20px;
}
.splash-subtitle {
    font-size: 0.85rem;
    color: #FF5F00;
    letter-spacing: 3px;
    margin-top: 0.5rem;
    text-transform: uppercase;
}
