/* ============================================================================
 * PREMIUM UNIVERSAL WHATSAPP STORE SAAS - MOBILE-FIRST DESIGN SYSTEM
 * Tested across 320px, 360px, 375px, 390px, 414px, 430px, 768px, 1024px, 1280px, 1440px, 1920px
 * Enforces >=44px touch targets, zero horizontal overflow, 2-column mobile product grids,
 * glassmorphic cards, and light/dark mode support.
 * ============================================================================ */

:root {
    --saas-primary: #0F172A;
    --saas-accent: #2563EB;
    --saas-emerald: #10B981;
    --saas-whatsapp: #25D366;
    --saas-crimson: #DC2626;
    --saas-gold: #D97706;
    --saas-surface: #FFFFFF;
    --saas-bg: #F8FAFC;
    --saas-border: #E2E8F0;
    --saas-text: #0F172A;
    --saas-muted: #64748B;
    --saas-radius: 12px;
    --touch-min: 44px;
}

[data-bs-theme="dark"] {
    --saas-primary: #F8FAFC;
    --saas-surface: #0F172A;
    --saas-bg: #020617;
    --saas-border: #1E293B;
    --saas-text: #F8FAFC;
    --saas-muted: #94A3B8;
}

*, *::before, *::after {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    width: 100%;
    max-width: 100vw;
    overflow-x: clip;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: var(--saas-bg);
    color: var(--saas-text);
    -webkit-font-smoothing: antialiased;
}

/* Mandatory 44px Minimum Touch Target for Mobile First */
.btn,
.form-control,
.form-select,
.nav-link,
.page-link,
.touch-target {
    min-height: var(--touch-min);
    display: inline-flex;
    align-items: center;
}

input.form-control,
select.form-select,
textarea.form-control {
    display: block;
    font-size: 16px; /* Prevents iOS Safari auto-zoom on focus */
    border-radius: 10px;
}

/* 2-Column Mobile Product & Card Grid (User Preference: 2 items per row on mobile screens) */
.mobile-product-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
    width: 100%;
}

@media (min-width: 768px) {
    .mobile-product-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 1.25rem;
    }
}

@media (min-width: 1200px) {
    .mobile-product-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 1.5rem;
    }
}

/* Extra-compact 320px adjustments */
@media (max-width: 359px) {
    .mobile-product-grid {
        gap: 0.5rem;
    }
    .product-card-body {
        padding: 0.5rem !important;
    }
    .product-card-title {
        font-size: 0.82rem !important;
    }
}

/* Dashboard Layout & Collapsible Offcanvas Sidebar */
.admin-shell {
    display: flex;
    min-height: 100vh;
    width: 100%;
}

.admin-sidebar {
    width: 270px;
    background: #0F172A;
    color: #F8FAFC;
    flex-shrink: 0;
    transition: transform 0.25s ease;
    z-index: 1040;
}

.admin-sidebar .nav-link {
    color: #CBD5E1;
    border-radius: 8px;
    margin: 2px 10px;
    padding: 10px 14px;
    font-size: 0.9rem;
    font-weight: 500;
}

.admin-sidebar .nav-link:hover,
.admin-sidebar .nav-link.active {
    background: rgba(37, 99, 235, 0.22);
    color: #FFFFFF;
}

.admin-main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

@media (max-width: 991.98px) {
    .admin-sidebar {
        position: fixed;
        top: 0;
        bottom: 0;
        left: 0;
        transform: translateX(-100%);
        overflow-y: auto;
    }
    .admin-sidebar.show {
        transform: translateX(0);
    }
}

/* KPI Cards & Glassmorphism */
.kpi-card {
    background: var(--saas-surface);
    border: 1px solid var(--saas-border);
    border-radius: var(--saas-radius);
    padding: 1.15rem;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.kpi-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
}

/* Verified Store Checkmark Badge */
.verified-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    background: #2563EB;
    color: #FFFFFF;
    border-radius: 50%;
    font-size: 11px;
    margin-left: 5px;
    vertical-align: middle;
}

/* Floating WhatsApp Widget */
.wa-floating-btn {
    position: fixed;
    bottom: 76px;
    right: 18px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background-color: #25D366;
    color: #FFFFFF;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 24px rgba(37, 211, 102, 0.4);
    z-index: 1050;
    text-decoration: none;
    transition: transform 0.2s ease;
}

.wa-floating-btn.left {
    right: auto;
    left: 18px;
}

.wa-floating-btn:hover {
    transform: scale(1.07);
    color: #FFFFFF;
}

/* Mobile Bottom Sticky Bar */
.mobile-bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: var(--saas-surface);
    border-top: 1px solid var(--saas-border);
    display: flex;
    justify-content: space-around;
    align-items: center;
    z-index: 1035;
}

@media (min-width: 992px) {
    .mobile-bottom-nav {
        display: none;
    }
    .wa-floating-btn {
        bottom: 24px;
    }
}

/* Animated Multi-Slide Hero Banner Carousel (Mobile-First Responsive) */
.saas-hero-carousel {
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 14px 36px rgba(15, 23, 42, 0.14);
}
.saas-hero-slide {
    min-height: 360px;
    display: flex;
    align-items: center;
    position: relative;
    background-size: cover;
    background-position: center;
    animation: saasSlideFade 0.65s ease;
}
@media (max-width: 767.98px) {
    .saas-hero-slide {
        min-height: 290px;
    }
    .saas-hero-slide h1 {
        font-size: 1.6rem !important;
    }
}
@keyframes saasSlideFade {
    from { opacity: 0.72; transform: translateY(8px); }
    to   { opacity: 1;    transform: translateY(0); }
}
.verified-blue-tick-img {
    aspect-ratio: 1 / 1;
    object-fit: contain;
    vertical-align: -3px;
    pointer-events: none;
    user-select: none;
}


/* ============================================================================
 * ADMIN PANEL DESKTOP STICKY SIDEBAR + FROSTED GLASS UI/UX UPGRADE
 * ============================================================================ */
@media (min-width: 992px) {
    .admin-sidebar {
        background: linear-gradient(180deg, #0B1120 0%, #111827 100%) !important;
        border-right: 1px solid rgba(255, 255, 255, 0.08);
    }
}

.admin-main > header {
    background: rgba(255, 255, 255, 0.82) !important;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: 0 2px 14px rgba(15, 23, 42, 0.04);
}

[data-bs-theme="dark"] .admin-main > header {
    background: rgba(15, 23, 42, 0.82) !important;
}

.kpi-card {
    background: rgba(255, 255, 255, 0.88);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(226, 232, 240, 0.9);
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(15, 23, 42, 0.04);
}

[data-bs-theme="dark"] .kpi-card {
    background: rgba(15, 23, 42, 0.78);
    border-color: rgba(148, 163, 184, 0.16);
}

/* Global Storefront Glassmorphism Enhancements */
header.sticky-top {
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}
.theme-product-card {
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}


/* ============================================================================
 * FIXED FULL-HEIGHT ADMIN SIDEBAR & SLEEK INVISIBLE-TRACK SCROLLBAR
 * ============================================================================ */
@media (min-width: 992px) {
    .admin-sidebar {
        position: fixed !important;
        top: 0;
        left: 0;
        bottom: 0;
        width: 268px !important;
        height: 100vh !important;
        overflow-y: auto !important;
        overflow-x: clip;
        scrollbar-width: thin;
        scrollbar-color: rgba(148, 163, 184, 0.25) transparent;
    }
    .admin-main {
        margin-left: 268px !important;
        width: calc(100% - 268px);
    }
}
.admin-sidebar::-webkit-scrollbar {
    width: 5px;
}
.admin-sidebar::-webkit-scrollbar-track {
    background: transparent;
}
.admin-sidebar::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, 0.25);
    border-radius: 10px;
}
.admin-sidebar:hover::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, 0.45);
}

/* ============================================================================
 * CUSTOM ADS & ADSENSE MONETIZATION POLISH
 * ============================================================================ */
.saas-custom-ad-slot {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.saas-custom-ad-slot:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 26px rgba(15, 23, 42, 0.12) !important;
}
.saas-adsense-wrapper ins.adsbygoogle {
    min-height: 60px;
}
#adminSidebarSearch::placeholder {
    color: #94A3B8;
}

/* ============================================================================
 * LOCKED FULL-HEIGHT FIXED SIDEBAR (STABLE, INDEPENDENT SCROLL ONLY) + PWA BAR
 * ============================================================================ */
@media (min-width: 992px) {
    html, body {
        overflow-x: clip !important;
    }
    .admin-shell {
        display: block !important;
        min-height: 100vh;
    }
    #adminSidebar.admin-sidebar {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        bottom: 0 !important;
        width: 268px !important;
        height: 100vh !important;
        height: 100dvh !important;
        max-height: none !important;
        overflow-y: auto !important;
        overflow-x: hidden !important;
        overscroll-behavior: contain !important;
        z-index: 1040 !important;
        transform: none !important;
    }
    .admin-main {
        margin-left: 268px !important;
        width: calc(100% - 268px) !important;
        max-width: calc(100% - 268px) !important;
        min-height: 100vh;
    }
}
.pwa-install-bar {
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: 68px;
    z-index: 1048;
    border-radius: 14px;
    box-shadow: 0 12px 32px rgba(15, 23, 42, 0.22);
}
@media (min-width: 992px) {
    .pwa-install-bar {
        left: auto;
        right: 24px;
        bottom: 90px;
        max-width: 440px; width: auto;
    }
}

/* ============================================================================
 * V3 MOBILE-FIRST UI/UX POLISH (ALL SCREENS 320px - 1920px)
 * Fixes: Mobile Carousel Padding, Admin Topbar Title Spacing, PWA Bar vs WA Button
 * ============================================================================ */
.saas-hero-carousel .carousel-indicators {
    margin-bottom: 0.6rem;
    z-index: 4;
}
.saas-hero-slide {
    padding-bottom: 3.25rem !important;
}
.saas-hero-img-only {
    max-height: 440px;
    object-fit: cover;
}
@media (max-width: 767.98px) {
    .saas-hero-slide {
        padding: 1.5rem 1.25rem 3.25rem 1.25rem !important;
        min-height: 270px !important;
    }
    .saas-hero-img-only {
        max-height: 230px;
    }
    .admin-topbar-title {
        font-size: 0.98rem !important;
        max-width: 48vw;
    }
    /* Clear floating WhatsApp button completely on mobile (no overlap!) */
    .pwa-install-bar {
        bottom: 144px !important;
        left: 12px !important;
        right: 12px !important;
        z-index: 1046 !important;
    }
}

/* ============================================================================
 * V5 PREMIUM HEADER & FULL-WEBSITE MOBILE-FIRST UI/UX DESIGN SYSTEM
 * Single-row glass header, swipeable category pills, crisp spacing & cards
 * ============================================================================ */
.saas-announcement-bar {
    background: linear-gradient(90deg, #0F172A 0%, #1E293B 50%, #0F172A 100%);
    font-size: 0.8rem;
    line-height: 1.35;
}
.saas-glass-nav {
    background: rgba(255, 255, 255, 0.88) !important;
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    box-shadow: 0 2px 18px rgba(15, 23, 42, 0.05);
}
[data-bs-theme="dark"] .saas-glass-nav {
    background: rgba(15, 23, 42, 0.88) !important;
}
.saas-brand-icon {
    width: 36px;
    height: 36px;
    font-size: 1.15rem;
}
.saas-brand-text {
    font-size: 1.08rem;
    letter-spacing: -0.015em;
}
.saas-icon-btn {
    width: 38px;
    height: 38px;
    min-height: 38px !important;
    padding: 0 !important;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    border-radius: 10px !important;
}
.saas-menu-toggle {
    width: 40px;
    height: 40px;
    min-height: 40px !important;
    padding: 0 !important;
    align-items: center;
    justify-content: center;
    border-radius: 10px !important;
    background: rgba(100, 116, 139, 0.1) !important;
    color: var(--saas-text) !important;
}
@media (max-width: 991.98px) {
    .saas-menu-toggle {
        display: inline-flex !important;
    }
    .saas-glass-nav .navbar-collapse {
        flex-basis: 100%;
    }
}
@media (min-width: 992px) {
    .saas-menu-toggle {
        display: none !important;
    }
    .saas-glass-nav .navbar-nav {
        flex-direction: row !important;
        white-space: nowrap;
    }
    .saas-glass-nav .nav-link {
        min-height: 38px !important;
        padding-top: 0.35rem !important;
        padding-bottom: 0.35rem !important;
        font-size: 0.92rem;
    }
}
.saas-glass-nav .nav-link {
    font-weight: 500;
    color: var(--saas-text);
    transition: background-color 0.18s ease, color 0.18s ease;
}
.saas-glass-nav .nav-link:hover {
    color: var(--saas-accent);
    background-color: rgba(37, 99, 235, 0.08);
}

/* Swipeable single-row storefront category strip on mobile */
.storefront-cat-strip {
    overflow-x: auto;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
.storefront-cat-strip::-webkit-scrollbar {
    display: none;
}
.storefront-cat-strip > a {
    flex-shrink: 0;
    white-space: nowrap;
}
@media (min-width: 992px) {
    .storefront-cat-strip {
        flex-wrap: wrap;
        overflow-x: visible;
    }
}

/* Mobile-specific refinements (320px - 767px) */
@media (max-width: 767.98px) {
    .saas-announcement-bar {
        font-size: 0.74rem;
        padding-top: 0.4rem !important;
        padding-bottom: 0.4rem !important;
    }
    .saas-brand-icon {
        width: 32px;
        height: 32px;
        font-size: 1rem;
    }
    .saas-brand-text {
        font-size: 0.94rem;
        max-width: 54vw;
    }
    .saas-glass-nav .container {
        flex-wrap: wrap !important;
    }
    .saas-glass-nav .navbar-brand {
        max-width: calc(100% - 104px);
    }
    .saas-hero-slide .lead {
        font-size: 0.96rem !important;
        line-height: 1.5;
    }
    .saas-hero-slide .btn-lg {
        font-size: 0.95rem !important;
        padding: 0.65rem 1.25rem !important;
    }
    .kpi-card {
        padding: 0.95rem !important;
        border-radius: 14px !important;
    }
    h2.fw-bold {
        font-size: 1.45rem !important;
    }
}

/* Modern Polish for All Cards, Tables, Badges & Buttons */
.card, .theme-product-card {
    border-radius: 16px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.theme-product-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.08);
}
.table-responsive {
    -webkit-overflow-scrolling: touch;
}

/* ============================================================================
 * V9 EXECUTIVE ROYAL-NAVY & ICE-CANVAS DASHBOARD THEME (SUPER ADMIN & STORE ADMIN)
 * ============================================================================ */
.admin-main {
    background: #EEF3F9;
}
[data-bs-theme="dark"] .admin-main {
    background: #020617;
}
.admin-sidebar {
    background: linear-gradient(180deg, #083B7A 0%, #052957 100%) !important;
}
.admin-sidebar .nav-link {
    color: rgba(255, 255, 255, 0.78) !important;
    border-radius: 10px !important;
    transition: all 0.16s ease;
}
.admin-sidebar .nav-link:hover {
    background: rgba(255, 255, 255, 0.12) !important;
    color: #FFFFFF !important;
}
.admin-sidebar .nav-link.active {
    background: rgba(255, 255, 255, 0.2) !important;
    color: #FFFFFF !important;
    font-weight: 600;
    box-shadow: inset 3px 0 0 #60A5FA;
}
.kpi-card {
    border-radius: 18px !important;
    border: 1px solid rgba(226, 232, 240, 0.85) !important;
    box-shadow: 0 6px 24px rgba(15, 23, 42, 0.045) !important;
}
.exec-kpi-card {
    padding: 1.2rem 1.25rem !important;
}
.btn-navy {
    background: #0B4284 !important;
    border-color: #0B4284 !important;
    color: #FFFFFF !important;
    font-weight: 600;
}
.btn-navy:hover {
    background: #083367 !important;
    border-color: #083367 !important;
    color: #FFFFFF !important;
}
.saas-pill {
    display: inline-flex;
    align-items: center;
    padding: 3px 9px;
    border-radius: 999px;
    font-size: 11.5px;
    font-weight: 700;
}
.saas-pill-up {
    background: #DCFCE7;
    color: #15803D;
}
.saas-pill-blue {
    background: #DBEAFE;
    color: #1D4ED8;
}
.pointer-events-none {
    pointer-events: none;
}

/* ============================================================================
 * V10 DARK BLUE & PURE WHITE THEME + ZERO-CLIPPING CARD ALIGNMENT FIX
 * ============================================================================ */
:root {
    --saas-navy: #072B5F;
    --saas-navy-deep: #041D42;
    --saas-navy-soft: #E8F0FA;
}
.admin-sidebar {
    background: linear-gradient(180deg, #072B5F 0%, #041D42 100%) !important;
    color: #FFFFFF !important;
}
.admin-sidebar .admin-nav-group-label {
    color: rgba(255, 255, 255, 0.5) !important;
}
.saas-sidebar-search-icon,
.saas-sidebar-search-input {
    background: rgba(255, 255, 255, 0.12) !important;
    color: #FFFFFF !important;
}
.saas-sidebar-search-input::placeholder {
    color: rgba(255, 255, 255, 0.65) !important;
}
.admin-main {
    background: #F4F7FB !important;
    overflow-x: hidden;
}
[data-bs-theme="dark"] .admin-main {
    background: #020617 !important;
}
.admin-main > header {
    background: #FFFFFF !important;
    border-bottom: 1px solid #E2E8F0 !important;
}
[data-bs-theme="dark"] .admin-main > header {
    background: rgba(15, 23, 42, 0.92) !important;
}
.kpi-card {
    background: #FFFFFF !important;
    border: 1px solid #E5ECF5 !important;
    border-radius: 16px !important;
    box-shadow: 0 4px 18px rgba(7, 43, 95, 0.045) !important;
    overflow: hidden;
}
[data-bs-theme="dark"] .kpi-card {
    background: rgba(15, 23, 42, 0.85) !important;
    border-color: rgba(148, 163, 184, 0.16) !important;
}
.btn-navy,
.admin-main .btn-primary {
    background: #072B5F !important;
    border-color: #072B5F !important;
    color: #FFFFFF !important;
}
.btn-navy:hover,
.admin-main .btn-primary:hover {
    background: #041D42 !important;
    border-color: #041D42 !important;
    color: #FFFFFF !important;
}
.text-navy {
    color: #072B5F !important;
}
[data-bs-theme="dark"] .text-navy {
    color: #93C5FD !important;
}
.exec-list-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    width: 100%;
    min-width: 0;
}
.exec-list-left {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1 1 0;
    min-width: 0;
    overflow: hidden;
}
.exec-list-title {
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ============================================================================
 * V11 100% ZOOM LAPTOP FIT (244px SIDEBAR ON 992px-1440px + COMPACT TABLES)
 * ============================================================================ */
@media (min-width: 992px) and (max-width: 1440px) {
    #adminSidebar.admin-sidebar {
        width: 244px !important;
    }
    .admin-main {
        margin-left: 244px !important;
        width: calc(100% - 244px) !important;
        max-width: calc(100% - 244px) !important;
    }
}
.stores-compact-table td,
.stores-compact-table th {
    padding: 0.6rem 0.5rem !important;
}
