/* ========================================================
   A2Z Cleaning Service - Mobile App Style Design System (PWA/Native App Feel)
   Modern App Shell, Bottom Navigation, Story Categories, Bottom Sheet Modal
   ======================================================== */

:root {
    --app-primary: #0284c7;
    --app-primary-dark: #0369a1;
    --app-primary-light: #e0f2fe;
    --app-accent: #10b981;
    --app-bg: #f8fafc;
    --app-surface: #ffffff;
    --app-card-border: #f1f5f9;
    --app-text: #0f172a;
    --app-muted: #64748b;
    --app-bottom-nav-height: 68px;
    --app-safe-area-bottom: env(safe-area-inset-bottom, 0px);
    --app-radius: 18px;
    --app-radius-sm: 12px;
}

body.app-mode {
    background-color: #f1f5f9;
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    color: var(--app-text);
    -webkit-tap-highlight-color: transparent;
    padding-bottom: calc(var(--app-bottom-nav-height) + var(--app-safe-area-bottom) + 20px) !important;
    overflow-x: hidden;
}

/* App Header */
.app-top-header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(226, 232, 240, 0.8);
    position: sticky;
    top: 0;
    z-index: 1020;
    padding: 12px 16px 8px;
}

.app-location-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--app-primary-light);
    color: var(--app-primary-dark);
    padding: 4px 12px;
    border-radius: 9999px;
    font-size: 0.78rem;
    font-weight: 700;
}

.app-search-wrap {
    margin-top: 10px;
    position: relative;
    display: flex;
    align-items: center;
}

.app-search-input {
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 9999px;
    padding: 10px 80px 10px 42px;
    font-size: 0.9rem;
    width: 100%;
    color: var(--app-text);
    transition: all 0.2s ease;
}

.app-search-input:focus {
    background: #ffffff;
    border-color: var(--app-primary);
    box-shadow: 0 0 0 4px rgba(2, 132, 199, 0.12);
    outline: none;
}

.app-search-icon {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    font-size: 0.95rem;
    pointer-events: none;
}

.app-search-clear-btn {
    position: absolute;
    right: 44px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    color: #94a3b8;
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    cursor: pointer;
    padding: 0;
    transition: color 0.15s ease;
}

.app-search-clear-btn:hover {
    color: #ef4444;
}

.app-search-submit-btn {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    background: linear-gradient(135deg, #0284c7, #0d9488);
    border: none;
    color: #ffffff;
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 0.85rem;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(2, 132, 199, 0.3);
    transition: all 0.2s ease;
}

.app-search-submit-btn:hover,
.app-search-submit-btn:active {
    transform: translateY(-50%) scale(1.06);
    background: #0284c7;
    color: #ffffff;
}

/* Horizontal Story Categories */
.app-category-bar {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding: 14px 4px 6px;
    margin: 0;
    list-style: none;
    scrollbar-width: none;
    -ms-overflow-style: none;
    scroll-snap-type: x mandatory;
}

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

.app-category-item {
    flex: 0 0 auto;
    scroll-snap-align: start;
    text-align: center;
    cursor: pointer;
}

.app-category-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    background: transparent;
    border: none;
    padding: 0;
    outline: none;
}

.app-category-bubble {
    width: 60px;
    height: 60px;
    border-radius: 20px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    color: var(--app-primary);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.app-category-btn.active .app-category-bubble,
.app-category-btn:hover .app-category-bubble {
    background: linear-gradient(135deg, #0284c7 0%, #0d9488 100%);
    color: #ffffff;
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 8px 20px rgba(2, 132, 199, 0.35);
    border-color: transparent;
}

.app-category-name {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--app-text);
    margin-top: 4px;
    max-width: 70px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: color 0.2s;
}

.app-category-btn.active .app-category-name {
    color: var(--app-primary);
}

/* App Service Cards */
.app-service-card {
    background: #ffffff;
    border-radius: var(--app-radius);
    border: 1px solid #e2e8f0;
    box-shadow: 0 6px 20px rgba(15, 23, 42, 0.04);
    padding: 16px;
    display: flex;
    gap: 14px;
    margin-bottom: 16px;
    transition: all 0.25s ease;
    position: relative;
}

.app-service-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 28px rgba(2, 132, 199, 0.12);
    border-color: rgba(2, 132, 199, 0.25);
}

.app-service-info {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.app-service-title {
    font-family: 'Outfit', sans-serif;
    font-size: 1.15rem;
    font-weight: 700;
    margin: 0 0 4px;
    color: var(--app-text);
    line-height: 1.3;
}

.app-service-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.78rem;
    margin-bottom: 8px;
}

.app-rating-badge {
    background: #fef3c7;
    color: #b45309;
    padding: 2px 8px;
    border-radius: 9999px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 3px;
}

.app-service-desc {
    font-size: 0.82rem;
    color: var(--app-muted);
    line-height: 1.45;
    margin-bottom: 12px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.app-service-pricing {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-top: auto;
}

.app-price-current {
    font-family: 'Outfit', sans-serif;
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--app-primary-dark);
}

.app-price-old {
    font-size: 0.85rem;
    color: #94a3b8;
    text-decoration: line-through;
}

.app-service-action-wrap {
    width: 110px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

.app-service-img {
    width: 100px;
    height: 90px;
    border-radius: var(--app-radius-sm);
    object-fit: cover;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
}

.app-btn-book {
    background: #ffffff;
    border: 1.5px solid var(--app-primary);
    color: var(--app-primary);
    font-weight: 800;
    font-size: 0.85rem;
    padding: 6px 18px;
    border-radius: 9999px;
    box-shadow: 0 4px 12px rgba(2, 132, 199, 0.15);
    margin-top: -16px;
    position: relative;
    z-index: 2;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.app-btn-book:hover,
.app-btn-book:active {
    background: linear-gradient(135deg, #0284c7 0%, #0d9488 100%);
    color: #ffffff;
    border-color: transparent;
    transform: scale(1.05);
}

/* App Bottom Navigation Bar */
.app-bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid rgba(226, 232, 240, 0.9);
    height: calc(var(--app-bottom-nav-height) + var(--app-safe-area-bottom));
    padding: 6px 12px var(--app-safe-area-bottom);
    display: flex;
    align-items: center;
    justify-content: space-around;
    z-index: 1050;
    box-shadow: 0 -4px 25px rgba(15, 23, 42, 0.08);
}

.app-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #64748b;
    font-size: 0.7rem;
    font-weight: 600;
    text-decoration: none;
    position: relative;
    padding: 4px 8px;
    transition: all 0.2s ease;
    border: none;
    background: transparent;
}

.app-nav-item i {
    font-size: 1.25rem;
    margin-bottom: 3px;
    transition: transform 0.2s ease;
}

.app-nav-item:hover,
.app-nav-item.active {
    color: var(--app-primary);
}

.app-nav-item.active i {
    transform: scale(1.15);
}

.app-nav-item.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    width: 16px;
    height: 3px;
    background: var(--app-primary);
    border-radius: 9999px;
}

.app-nav-book-center {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: linear-gradient(135deg, #0284c7 0%, #0d9488 100%);
    color: #ffffff !important;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    margin-top: -22px;
    box-shadow: 0 8px 20px rgba(2, 132, 199, 0.45);
    border: 3px solid #ffffff;
    transition: transform 0.2s ease;
}

.app-nav-book-center:hover,
.app-nav-book-center:active {
    transform: scale(1.1) translateY(-2px);
    color: #ffffff;
}

/* App Bottom Sheet Modal */
.app-bottom-sheet .modal-dialog {
    margin: 0;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    max-width: 100%;
}

.app-bottom-sheet .modal-content {
    border-radius: 24px 24px 0 0 !important;
    border: none;
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.2);
    padding: 10px 20px 24px;
    background: #ffffff;
    max-height: 90vh;
    overflow-y: auto;
}

.app-sheet-handle {
    width: 44px;
    height: 5px;
    border-radius: 9999px;
    background: #cbd5e1;
    margin: 6px auto 16px;
}

/* App Slot Chips */
.app-slot-group {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 14px;
}

.app-slot-chip {
    padding: 8px 14px;
    border-radius: 9999px;
    border: 1px solid #cbd5e1;
    background: #f8fafc;
    font-size: 0.82rem;
    font-weight: 600;
    color: #334155;
    cursor: pointer;
    transition: all 0.2s;
}

.app-slot-chip.active,
.app-slot-chip:hover {
    background: var(--app-primary-light);
    border-color: var(--app-primary);
    color: var(--app-primary-dark);
}

/* App Offcanvas Drawer */
.app-offcanvas {
    border-radius: 0 24px 24px 0 !important;
    border: none;
    background: #ffffff;
}

/* ========================================================
   QUANTITY STEPPER (+ / -) & CART CONTROLS
   ======================================================== */
.app-qty-stepper {
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    background: #0284c7;
    color: #ffffff;
    border-radius: 9999px;
    padding: 3px 8px;
    min-width: 90px;
    height: 34px;
    box-shadow: 0 4px 12px rgba(2, 132, 199, 0.28);
    user-select: none;
    transition: all 0.2s ease;
}

.app-qty-btn {
    background: transparent;
    border: none;
    color: #ffffff;
    width: 26px;
    height: 26px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 0.95rem;
    font-weight: 800;
    cursor: pointer;
    padding: 0;
    transition: background 0.15s ease, transform 0.1s;
}

.app-qty-btn:active {
    background: rgba(255, 255, 255, 0.25);
    transform: scale(0.92);
}

.app-qty-val {
    font-size: 0.88rem;
    font-weight: 800;
    min-width: 22px;
    text-align: center;
    color: #ffffff;
}

/* Add / Book Button */
.app-btn-add {
    background: #ffffff;
    border: 1.5px solid #0284c7;
    color: #0284c7;
    border-radius: 9999px;
    padding: 5px 14px;
    font-size: 0.82rem;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(2, 132, 199, 0.15);
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.app-btn-add:hover,
.app-btn-add:active {
    background: #0284c7;
    color: #ffffff;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(2, 132, 199, 0.3);
}

/* ========================================================
   FLOATING CART BOTTOM PILL (Zomato / Urban Company style)
   ======================================================== */
.app-floating-cart-bar {
    position: fixed;
    bottom: calc(var(--app-bottom-nav-height) + 12px);
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - 24px);
    max-width: 520px;
    z-index: 1040;
    background: linear-gradient(135deg, #0284c7, #0d9488);
    color: #ffffff;
    border-radius: 9999px;
    padding: 10px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 10px 25px rgba(2, 132, 199, 0.4), 0 2px 6px rgba(0, 0, 0, 0.08);
    text-decoration: none;
    animation: slideUpCart 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    transition: transform 0.2s, opacity 0.2s;
}

.app-floating-cart-bar:hover {
    color: #ffffff;
    box-shadow: 0 14px 30px rgba(2, 132, 199, 0.5);
}

@keyframes slideUpCart {
    from {
        opacity: 0;
        transform: translate(-50%, 20px);
    }
    to {
        opacity: 1;
        transform: translate(-50%, 0);
    }
}

.app-floating-cart-badge {
    background: rgba(255, 255, 255, 0.22);
    border-radius: 9999px;
    padding: 4px 10px;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.3px;
}

/* Restrict floating cart bar strictly to Home page */
body[data-page="checkout.php"] #appFloatingCartBar,
body[data-page="checkout"] #appFloatingCartBar,
body:not([data-is-home="1"]) #appFloatingCartBar {
    display: none !important;
}

/* ========================================================
   PWA INSTALL BANNER / PROMPT
   ======================================================== */
.app-pwa-install-banner {
    background: linear-gradient(135deg, #0f172a, #1e293b);
    color: #ffffff;
    border-radius: 16px;
    padding: 14px 16px;
    margin-bottom: 16px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

/* Restrict PWA install banner and drawer button strictly to Home page */
body:not([data-is-home="1"]) #appInstallBanner,
body:not([data-is-home="1"]) #drawerInstallBtn {
    display: none !important;
}

.app-pwa-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: linear-gradient(135deg, #0284c7, #0d9488);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-size: 1.25rem;
    flex-shrink: 0;
    box-shadow: 0 4px 10px rgba(2, 132, 199, 0.3);
}

.app-btn-install {
    background: #0284c7;
    color: #ffffff;
    border: none;
    padding: 7px 16px;
    border-radius: 9999px;
    font-size: 0.8rem;
    font-weight: 700;
    white-space: nowrap;
    transition: all 0.2s;
}

.app-btn-install:hover,
.app-btn-install:active {
    background: #0369a1;
    color: #ffffff;
}

/* ========================================================
   CHECKOUT PAGE STYLING
   ======================================================== */
.checkout-card {
    background: #ffffff;
    border-radius: 18px;
    border: 1px solid #e2e8f0;
    padding: 18px;
    margin-bottom: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.checkout-service-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px dashed #e2e8f0;
}

.checkout-service-row:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.checkout-service-img {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    object-fit: cover;
    background: #f1f5f9;
    flex-shrink: 0;
}

.bill-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    font-size: 0.88rem;
    color: #64748b;
}

.bill-row.total {
    border-top: 1px solid #e2e8f0;
    padding-top: 10px;
    margin-top: 10px;
    font-size: 1.05rem;
    font-weight: 800;
    color: #0f172a;
}

