@font-face { font-family: 'Tajawal'; src: url('../AlManar/assets/fonts/Tajawal/Tajawal-Regular.ttf') format('truetype'); font-weight: 400 500; font-style: normal; font-display: swap; }
@font-face { font-family: 'Tajawal'; src: url('../AlManar/assets/fonts/Tajawal/Tajawal-Bold.ttf') format('truetype'); font-weight: 700 900; font-style: normal; font-display: swap; }

:root {
    --primary: #0f3057;
    /* Darker navy blue to match screenshot */
    --primary-light: #e8f0fe;
    --teal: #17a2b8;
    --bg: #f4f6fb;
    --white: #fff;
    --text: #1f2937;
    --muted: #6b7280;
    --danger: #ef4444;
    --green: #22c55e;
    --header-h: 96px;
    --nav-h: 68px;
}

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

body {
    background: var(--bg);
    color: var(--text);
    font-family: 'Tajawal', Tahoma, Arial, sans-serif;
}

a {
    text-decoration: none;
    color: inherit;
}

/* ===== HEADER ===== */
.app-header {
    background: var(--primary);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.header-top {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
}

.logo-img {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255, 255, 255, 0.4);
    flex-shrink: 0;
}

.search-bar {
    flex: 1;
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    overflow: hidden;
    height: 38px;
}

.search-bar input {
    flex: 1;
    border: none;
    background: transparent;
    color: white;
    padding: 0 10px;
    font-size: 0.9rem;
    font-family: Tajawal;
    outline: none;
}

.search-bar input::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

.search-bar button {
    background: none;
    border: none;
    color: white;
    padding: 0 12px;
    cursor: pointer;
    font-size: 1rem;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

.hbtn {
    background: transparent;
    border: none;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.4);
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 0.95rem;
    cursor: pointer;
    position: relative;
}

.cart-hbtn {
    background: transparent;
}

.hbadge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: var(--danger);
    color: white;
    font-size: 0.6rem;
    border-radius: 10px;
    padding: 1px 4px;
    border: 2px solid var(--primary);
    font-weight: bold;
}

/* Sections nav with thumbnails */
.sections-nav {
    display: flex;
    overflow-x: auto;
    scrollbar-width: none;
    padding: 0 8px 8px;
    gap: 6px;
    align-items: center;
}

.sections-nav::-webkit-scrollbar {
    display: none;
}

.section-tab {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    flex-shrink: 0;
    padding: 6px 12px;
    border-radius: 6px;
    background: rgba(0, 0, 0, 0.15);
    /* Slightly dark background like screenshot */
    transition: 0.2s;
}

.section-tab .stab-img {
    width: 22px;
    height: 22px;
    border-radius: 4px;
    object-fit: cover;
    background: white;
}

.section-tab .stab-txt {
    font-size: 0.8rem;
    color: white;
    font-weight: 700;
    white-space: nowrap;
}

.section-tab.active {
    background: rgba(255, 255, 255, 0.15);
}

.section-tab-text {
    /* text-only tab for Home */
    background: transparent;
    padding: 6px 12px;
    color: rgba(255, 255, 255, 0.8);
    font-size: 1rem;
    font-weight: 800;
    cursor: pointer;
    flex-shrink: 0;
    position: relative;
}

.section-tab-text.active {
    background: transparent;
    color: white;
}

.section-tab-text.active::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 10px;
    right: 10px;
    height: 3px;
    background: white;
    border-radius: 2px;
}

/* ===== MAIN ===== */
main#app-container {
    padding-top: var(--header-h);
    padding-bottom: var(--nav-h);
    min-height: 100vh;
}

.loading-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 40vh;
    color: var(--primary);
}

.spinner {
    width: 30px;
    height: 30px;
    border: 3px solid var(--primary-light);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    100% {
        transform: rotate(360deg);
    }
}

.screen {
    display: none;
    animation: fadeIn 0.2s ease;
}

.screen.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0
    }

    to {
        opacity: 1
    }
}

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

    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0)
    }
}

/* ===== SLIDER ===== */
.slider-wrapper {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
}

.slider-wrapper::-webkit-scrollbar {
    display: none;
}

.slide-item {
    flex: 0 0 100%;
    scroll-snap-align: center;
    height: 170px;
    overflow: hidden;
}

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

.slider-dots {
    display: flex;
    justify-content: center;
    gap: 6px;
    padding: 6px 0;
}

.dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #ccc;
    transition: 0.3s;
}

.dot.active {
    background: var(--primary);
    width: 20px;
    border-radius: 4px;
}

/* Ads scroll row */
.ads-scroll-row {
    display: flex;
    overflow-x: auto;
    scrollbar-width: none;
    padding: 8px 10px;
    gap: 10px;
}

.ads-scroll-row::-webkit-scrollbar {
    display: none;
}

.ad-card {
    flex: 0 0 100%;
    height: 140px;
    overflow: hidden;
    margin-bottom: 10px;
    width: 100%;
}

.ad-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Marquee notice */
}

/* ===== CATEGORIES PAGES (4x3 grids with swipe) ===== */
.cat-pages-wrapper {
    display: flex;
    flex-wrap: nowrap !important;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    direction: rtl;
    width: 100%;
    box-sizing: border-box;
    user-select: none;
    -webkit-user-select: none;
}

.cat-pages-wrapper::-webkit-scrollbar {
    display: none;
}

.cat-pages-wrapper img,
.slider-wrapper img {
    -webkit-user-drag: none;
    pointer-events: none;
}

.cat-page {
    flex: 0 0 100% !important;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    scroll-snap-align: start;
    display: grid;
    grid-template-columns: repeat(4, 1fr) !important;
    grid-auto-rows: min-content;
    gap: 12px 5px;
    padding: 10px 10px;
}

/* Simple grid for subcategories */
.cat-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px 5px;
    padding: 15px;
    box-sizing: border-box;
    width: 100%;
}

.pcard-body {
    padding: 12px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.list-item-hover:hover {
    background: #f1f5f9 !important;
    color: var(--primary) !important;
    font-weight: bold;
}

.cat-circle {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    cursor: pointer;
}

.cat-circle-img {
    width: 66px;
    height: 66px;
    border-radius: 50%;
    border: 2px solid #e5e7eb;
    overflow: hidden;
    background: #f3f4f6;
    transition: transform 0.2s;
}

.cat-circle-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cat-circle:active .cat-circle-img {
    transform: scale(0.95);
}

.cat-circle span {
    font-size: 0.68rem;
    font-weight: 700;
    text-align: center;
    color: var(--text);
    line-height: 1.3;
    max-width: 72px;
    word-break: break-word;
}

/* Categories Dots (Dashes) */
.cat-page-dots {
    display: flex;
    justify-content: center;
    gap: 6px;
    padding: 6px 0 16px;
}

.cat-dot {
    width: 16px;
    height: 4px;
    border-radius: 4px;
    background: #d1d5db;
    transition: 0.3s;
}

.cat-dot.active {
    background: #0f2d5c;
    width: 22px;
}

/* ===== PRODUCTS GRID ===== */
.products-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    padding: 10px;
}

.pcard {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
    position: relative;
}

.pcard-img {
    width: 100%;
    height: 150px;
    object-fit: cover;
    background: #f3f4f6;
}

.pcard-fav {
    position: absolute;
    top: 8px;
    right: 8px;
    background: white;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    cursor: pointer;
}

.pcard-body {
    padding: 8px;
}

.pcard-title {
    font-size: 0.82rem;
    font-weight: 700;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pcard-price {
    font-size: 0.75rem;
    color: var(--green);
    font-weight: 800;
    margin-bottom: 8px;
}

.pcard-price strike {
    color: #aaa;
    font-weight: 400;
    margin-right: 4px;
}

.pcard-btns {
    display: flex;
    gap: 6px;
}

.btn-add {
    flex: 1;
    background: #1f2937;
    color: white;
    border: none;
    border-radius: 8px;
    padding: 7px;
    font-size: 0.75rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    font-family: Tajawal;
}

.btn-buy {
    flex: 1;
    background: var(--green);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 7px;
    font-size: 0.75rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    font-family: Tajawal;
}

/* Section Header Banner */
.section-header-banner {
    background: var(--primary);
    color: white;
    padding: 12px 15px;
    font-weight: bold;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ===== BOTTOM NAV ===== */
.bottom-nav {
    background: white;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--nav-h);
    display: flex;
    justify-content: space-around;
    align-items: center;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.06);
    border-radius: 16px 16px 0 0;
    z-index: 50;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    color: var(--muted);
    font-size: 0.7rem;
    font-weight: 700;
    flex: 1;
    height: 100%;
    position: relative;
    cursor: pointer;
    transition: 0.2s;
}

.nav-item i {
    font-size: 1.2rem;
    transition: 0.2s;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.nav-item.active {
    color: #0f3057;
}

.nav-item.active i {
    background: #0f3057;
    color: white;
}

.badge-nav {
    position: absolute;
    top: 2px;
    right: 5px;
    background: var(--danger);
    color: white;
    font-size: 0.6rem;
    border-radius: 10px;
    padding: 1px 4px;
    display: none;
    border: 2px solid white;
    font-weight: bold;
}

/* ===== SIDE MENU ===== */
.side-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 200;
    display: none;
}

.side-overlay.show {
    display: block;
}

.side-menu {
    position: fixed;
    top: 0;
    right: -320px;
    bottom: 0;
    width: 300px;
    background: white;
    z-index: 201;
    transition: right 0.3s ease;
    display: flex;
    flex-direction: column;
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.15);
}

.side-menu.open {
    right: 0;
}

.side-menu-header {
    background: var(--primary);
    color: white;
    padding: 20px 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.side-menu-header h3 {
    font-size: 1.1rem;
    font-weight: 800;
}

.side-menu-header button {
    background: none;
    border: none;
    color: white;
    font-size: 1.3rem;
    cursor: pointer;
}

.side-menu-body {
    flex: 1;
    overflow-y: auto;
    padding: 10px 0;
}

.side-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    border-bottom: 1px solid #f5f5f5;
    transition: 0.2s;
}

.side-item:hover {
    background: var(--primary-light);
    color: var(--primary);
}

.side-item i {
    color: var(--primary);
    width: 20px;
    text-align: center;
}

.side-section-title {
    padding: 12px 20px 6px;
    font-size: 0.8rem;
    color: #aaa;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.side-section-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 20px;
    border-bottom: 1px solid #f9f9f9;
    cursor: pointer;
    font-size: 0.9rem;
}

.side-section-item i {
    color: var(--primary);
}

/* ===== CART & OTHER ===== */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #aaa;
}

.empty-state i {
    font-size: 4rem;
    color: #ddd;
    display: block;
    margin-bottom: 15px;
}

/* Purchases / orders */
.purchases-screen {
    min-height: 100vh;
    padding-bottom: 100px;
    background: #eef1f5;
}

.purchases-header {
    position: sticky;
    top: 0;
    z-index: 20;
    display: grid;
    grid-template-columns: 40px 1fr 40px;
    align-items: center;
    min-height: 52px;
    padding: 0 8px;
    color: #fff;
    background: var(--primary);
    font-size: 1.25rem;
    text-align: center;
}

.purchases-header button {
    width: 40px;
    height: 40px;
    border: 0;
    color: #fff;
    background: transparent;
    font-size: 1.2rem;
    cursor: pointer;
}

.purchases-list {
    padding: 10px;
}

.purchase-card {
    margin-bottom: 12px;
    overflow: hidden;
    border-radius: 30px;
    background: #fff;
    box-shadow: 0 5px 15px rgba(15, 23, 42, .18);
}

.purchase-card-top {
    display: grid;
    grid-template-columns: 1fr 118px 1fr;
    gap: 6px;
    min-height: 140px;
    padding: 10px 12px 6px;
    align-items: start;
    text-align: center;
}

.purchase-top-info {
    color: #161616;
    font-size: .82rem;
    line-height: 1.35;
}

.purchase-top-info strong,
.purchase-top-info span {
    display: block;
}

.purchase-top-info span {
    margin-top: 3px;
    color: #0895f6;
    font-weight: 800;
}

.purchase-status {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 0;
    color: #333;
    font-size: .8rem;
}

.purchase-status-icon {
    display: grid;
    place-items: center;
    width: 68px;
    height: 58px;
    margin-bottom: 4px;
    border-radius: 4px;
    color: var(--status-color);
    background: var(--status-bg);
    font-size: 2.45rem;
}

.purchase-status>span {
    min-height: 20px;
    line-height: 1.25;
}

.purchase-status button {
    margin-top: 5px;
    padding: 7px 12px;
    border: 0;
    border-radius: 10px;
    color: #fff;
    background: var(--primary);
    font-family: inherit;
    font-size: .76rem;
    font-weight: 800;
    white-space: nowrap;
    cursor: pointer;
}

.purchase-store-row {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    padding: 7px 12px;
    color: #333;
    background: #e0f7fb;
    font-size: .82rem;
}

.purchase-store-row span:last-child {
    color: #078fff;
}

.purchase-data-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 9px 28px;
    padding: 8px 16px 5px;
    font-size: .82rem;
}

.purchase-data-grid>div {
    min-width: 0;
}

.purchase-data-grid label,
.purchase-data-grid span,
.purchase-data-grid strong {
    display: block;
}

.purchase-data-grid label {
    margin-bottom: 2px;
    color: #333;
}

.purchase-data-grid strong,
.purchase-data-grid>div>span {
    color: #078fff;
    font-weight: 500;
}

.purchase-link {
    max-width: 100%;
    padding: 0;
    border: 0;
    color: #078fff;
    background: transparent;
    font-family: inherit;
    cursor: pointer;
}

.purchase-link span {
    display: inline;
}

.purchase-address {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.purchase-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 6px;
    padding: 6px 12px 12px;
}

.purchase-btn {
    min-width: 78px;
    padding: 9px 11px;
    border: 0;
    border-radius: 10px;
    color: #fff;
    font-family: inherit;
    font-size: .82rem;
    font-weight: 800;
    cursor: pointer;
}

.purchase-btn.details {
    background: var(--primary);
}

.purchase-btn.repeat {
    background: #48b254;
}

.purchase-btn.cancel {
    background: #f23e38;
}

.purchase-share {
    width: 36px;
    height: 36px;
    border: 0;
    color: #0b96f5;
    background: transparent;
    font-size: 1.35rem;
    cursor: pointer;
}

@media (max-width: 380px) {
    .purchase-card-top {
        grid-template-columns: 1fr 104px 1fr;
        padding-inline: 8px;
    }

    .purchase-data-grid {
        gap: 8px 14px;
        padding-inline: 12px;
    }

    .purchase-btn {
        min-width: 70px;
        padding-inline: 8px;
    }
}

/* Order invoice details */
.order-invoice-screen {
    min-height: 100vh;
    padding-bottom: 105px;
    background: #f4f5fb;
    color: #222;
}

.invoice-page-header {
    position: sticky;
    top: 0;
    z-index: 20;
    display: grid;
    grid-template-columns: 42px 1fr 42px;
    align-items: center;
    min-height: 52px;
    color: #fff;
    background: var(--primary);
    text-align: center;
    font-size: 1.1rem;
    font-weight: 800;
}

.invoice-page-header button {
    width: 42px;
    height: 42px;
    border: 0;
    color: #fff;
    background: transparent;
    font-size: 1.15rem;
    cursor: pointer;
}

.invoice-share-bar {
    display: flex;
    justify-content: center;
    gap: 10px;
    padding: 7px 12px;
    border-top: 3px solid var(--primary);
    background: #fff;
}

.invoice-share-bar button {
    padding: 2px 0;
    border: 0;
    color: #0796ff;
    background: transparent;
    font-family: inherit;
    font-size: .9rem;
    cursor: pointer;
}

.invoice-number-card {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
    margin: 10px;
    padding: 16px 18px;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 3px 12px rgba(15, 23, 42, .16);
}

.invoice-number-card>div {
    display: flex;
    flex-direction: column;
    gap: 12px;
    text-align: center;
    font-size: .9rem;
}

.invoice-number-card button {
    padding: 0;
    border: 0;
    color: #222;
    background: transparent;
    font-family: inherit;
    font-size: .9rem;
    cursor: pointer;
}

.invoice-section-title {
    margin: 8px 0 5px;
    padding: 9px 12px;
    border-block: 1px solid #e3e7ef;
    background: #fff;
    font-size: 1rem;
}

.invoice-basic-card,
.invoice-items-card {
    margin: 0 8px 10px;
    overflow: hidden;
    border-radius: 13px;
    background: #fff;
    box-shadow: 0 1px 4px rgba(15, 23, 42, .08);
}

.invoice-info-row {
    display: grid;
    grid-template-columns: 102px 1fr;
    min-height: 42px;
    border-bottom: 1px solid #d9dee7;
}

.invoice-info-row:last-child {
    border-bottom: 0;
}

.invoice-info-row>strong {
    display: flex;
    align-items: center;
    padding: 8px 10px;
    background: #e2edf8;
    font-size: .84rem;
}

.invoice-info-row>span,
.invoice-info-row>.invoice-status {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    color: #666;
    font-size: .84rem;
}

.invoice-address {
    color: #078fff !important;
    text-decoration: underline;
}

.invoice-info-row.status-row {
    min-height: 135px;
}

.invoice-status {
    flex-direction: column;
    justify-content: center;
    text-align: center;
}

.invoice-status>div {
    display: grid;
    place-items: center;
    width: 52px;
    height: 48px;
    border-radius: 8px;
    color: var(--status-color);
    background: var(--status-bg);
    font-size: 2rem;
}

.invoice-status>span {
    margin: 4px 0;
    color: #555;
}

.invoice-status>button {
    padding: 7px 15px;
    border: 0;
    border-radius: 9px;
    color: #fff;
    background: var(--primary);
    font-family: inherit;
    font-size: .78rem;
    font-weight: 800;
    cursor: pointer;
}

.invoice-table-scroll {
    width: 100%;
    overflow-x: auto;
}

.invoice-items-table {
    width: 100%;
    min-width: 570px;
    border-collapse: collapse;
    table-layout: fixed;
    text-align: center;
    font-size: .78rem;
}

.invoice-items-table th,
.invoice-items-table td {
    padding: 8px 5px;
    border: 1px solid #d4d9e2;
    vertical-align: top;
}

.invoice-items-table th {
    background: #dfe7f7;
    font-weight: 700;
}

.invoice-items-table th:first-child {
    width: 150px;
}

.invoice-items-table th:nth-child(2) {
    width: 60px;
}

.invoice-items-table th:nth-child(3),
.invoice-items-table th:nth-child(4) {
    width: 110px;
}

.invoice-product-cell img {
    display: block;
    width: 52px;
    height: 52px;
    margin: 0 auto 4px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid #e2e8f0;
}

.invoice-product-cell span,
.invoice-product-cell small {
    display: block;
    line-height: 1.3;
}

.invoice-product-cell small {
    color: #777;
}

.invoice-no-items {
    padding: 30px !important;
    color: #888;
}

.invoice-total-card {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px 25px;
    margin: 10px;
    padding: 14px 18px;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 1px 5px rgba(15, 23, 42, .09);
}

.invoice-total-card>div {
    display: flex;
    flex-direction: column;
    gap: 5px;
    text-align: center;
    font-size: .84rem;
}

.invoice-total-card span {
    color: #333;
}

.tracking-dialog-overlay {
    position: fixed;
    inset: 0;
    z-index: 12000;
    display: grid;
    place-items: center;
    padding: 18px;
    background: rgba(15, 23, 42, .65);
}

.tracking-dialog {
    width: min(390px, 100%);
    max-height: 85vh;
    overflow: auto;
    padding: 20px;
    border-radius: 18px;
    background: #fff;
}

.tracking-dialog h3 {
    margin: 0 0 16px;
    color: var(--primary);
}

.tracking-step {
    display: flex;
    gap: 10px;
    padding: 10px 0;
    border-bottom: 1px solid #e5e7eb;
    color: #9ca3af;
}

.tracking-step.done {
    color: #16a34a;
}

.tracking-step div {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.tracking-step small {
    color: #64748b;
}

.tracking-dialog>button {
    width: 100%;
    margin-top: 15px;
    padding: 11px;
    border: 0;
    border-radius: 10px;
    color: #fff;
    background: var(--primary);
    font-family: inherit;
    font-weight: 800;
}

@media print {

    .app-header,
    .bottom-nav,
    .fab-container,
    #pwa-install-container,
    .invoice-page-header,
    .invoice-share-bar {
        display: none !important;
    }

    .order-invoice-screen {
        padding: 0;
        background: #fff;
    }

    .invoice-basic-card,
    .invoice-items-card,
    .invoice-number-card,
    .invoice-total-card {
        box-shadow: none;
        break-inside: avoid;
    }
}

/* Account statement report */
.statement-screen {
    min-height: 100vh;
    padding-bottom: 105px;
    background: #f3f5fb;
}

.statement-header {
    position: sticky;
    top: 0;
    z-index: 30;
    display: grid;
    grid-template-columns: 80px 1fr 80px;
    align-items: center;
    min-height: 48px;
    color: #fff;
    background: var(--primary);
    font-size: 1.25rem;
    text-align: center;
}

.statement-header>button,
.statement-header-actions button {
    width: 38px;
    height: 38px;
    border: 0;
    color: #fff;
    background: transparent;
    font-size: 1.1rem;
    cursor: pointer;
}

.statement-header>button {
    justify-self: start;
}

.statement-header-actions {
    display: flex;
    justify-content: flex-end;
}

.statement-filters {
    display: grid;
    grid-template-columns: 84px 1fr 1fr 66px;
    gap: 9px;
    align-items: start;
    padding: 10px 12px 8px;
    background: #eef0fb;
    border-bottom: 1px solid #d9deea;
}

.statement-filter-field {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    min-width: 0;
    color: #222;
    font-size: .8rem;
    font-weight: 800;
}

.statement-filter-field input[type="date"] {
    width: 100%;
    min-width: 0;
    padding: 3px 2px;
    border: 0;
    color: #656b78;
    background: transparent;
    font-family: inherit;
    font-size: .76rem;
    text-align: center;
}

.statement-unit-field {
    gap: 6px;
}

.statement-switch {
    position: relative;
    display: block;
    width: 48px;
    height: 27px;
}

.statement-switch input {
    position: absolute;
    opacity: 0;
}

.statement-switch span {
    position: absolute;
    inset: 0;
    border: 2px solid #7c7480;
    border-radius: 18px;
    background: #ded9e1;
    cursor: pointer;
}

.statement-switch span::after {
    content: '';
    position: absolute;
    top: 4px;
    right: 5px;
    width: 15px;
    height: 15px;
    border-radius: 50%;
    background: #7c7480;
    transition: transform .2s;
}

.statement-switch input:checked+span {
    border-color: var(--primary);
    background: #dbeafe;
}

.statement-switch input:checked+span::after {
    background: var(--primary);
    transform: translateX(-20px);
}

.statement-run-button {
    align-self: center;
    margin-top: 7px;
    padding: 8px 12px;
    border: 0;
    border-radius: 18px;
    color: #fff;
    background: var(--primary);
    font-family: inherit;
    font-weight: 800;
    cursor: pointer;
}

.statement-currency-pills {
    grid-column: 1 / -1;
    display: flex;
    justify-content: center;
    gap: 6px;
    overflow-x: auto;
    padding: 2px 0;
}

.statement-currency-pill {
    flex: 0 0 auto;
    padding: 6px 9px;
    border: 0;
    border-radius: 10px;
    color: #4b5563;
    background: #dfe7e7;
    font-family: inherit;
    font-size: .78rem;
    cursor: pointer;
}

.statement-currency-pill.active {
    color: #fff;
    background: var(--primary);
}

.statement-empty-report {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 270px;
    padding: 35px 20px;
    color: #7c8798;
    text-align: center;
}

.statement-empty-report i {
    margin-bottom: 12px;
    color: #b9c3d0;
    font-size: 3rem;
}

.statement-report-note {
    padding: 9px 12px;
    color: #333;
    background: #fff;
    font-size: .78rem;
    line-height: 1.55;
    text-align: center;
}

.statement-table-scroll {
    width: 100%;
    overflow-x: auto;
}

.statement-report-table {
    width: 100%;
    min-width: 620px;
    border-collapse: collapse;
    table-layout: fixed;
    background: #fff;
    text-align: center;
    font-size: .78rem;
}

.statement-report-table th,
.statement-report-table td {
    padding: 9px 5px;
    border: 1px solid #bdc6d0;
    vertical-align: middle;
}

.statement-report-table th {
    color: #26323d;
    background: #91a9bd;
    font-size: .82rem;
}

.statement-report-table td small {
    display: block;
    margin-top: 4px;
    color: #64748b;
    font-size: .7rem;
}

.statement-report-table .debit {
    color: #ef4444;
}

.statement-report-table .credit {
    color: #0ea5e9;
}

.statement-report-table .zero {
    color: #16a34a;
}

.statement-currency-row td {
    padding: 7px;
    color: #222;
    background: #f8fafc;
    font-weight: 800;
}

.statement-document-link {
    padding: 0;
    border: 0;
    color: #078fff;
    background: transparent;
    font-family: inherit;
    font-size: inherit;
    text-decoration: underline;
    cursor: pointer;
}

.statement-report-table tfoot td {
    color: #222;
    background: #ffe934;
    font-weight: 800;
}

.statement-no-data {
    padding: 28px !important;
    color: #7c8798;
}

@media (max-width: 390px) {
    .statement-filters {
        grid-template-columns: 70px 1fr 1fr 58px;
        gap: 5px;
        padding-inline: 7px;
    }

    .statement-run-button {
        padding-inline: 9px;
    }
}

@media print {

    .statement-header,
    .statement-filters,
    .statement-report-note,
    .app-header,
    .bottom-nav,
    .fab-container,
    #pwa-install-container {
        display: none !important;
    }

    .statement-screen {
        padding: 0;
        background: #fff;
    }

    .statement-report-table {
        min-width: 0;
        font-size: 10pt;
    }
}

/* Store information pages */
.store-info-screen {
    background: #f4f6fb;
    min-height: 100vh;
    padding-bottom: 90px
}

.store-info-header {
    height: 56px;
    background: var(--primary);
    color: #fff;
    display: grid;
    grid-template-columns: 42px 1fr 42px;
    align-items: center;
    text-align: center;
    padding: 0 10px;
    position: sticky;
    top: 0;
    z-index: 5
}

.store-info-header button {
    width: 38px;
    height: 38px;
    border: 0;
    background: transparent;
    color: #fff;
    font-size: 1.15rem;
    cursor: pointer
}

.store-info-header strong {
    font-size: 1.05rem
}

.store-info-body {
    padding: 16px
}

.store-about-card {
    background: #fff;
    border-radius: 18px;
    padding: 24px 18px;
    text-align: center;
    box-shadow: 0 5px 18px rgba(15, 23, 42, .07)
}

.store-about-card img {
    width: 88px;
    height: 88px;
    border-radius: 22px;
    object-fit: contain;
    border: 1px solid #e5e7eb;
    background: #fff;
    padding: 5px
}

.store-about-card h2 {
    margin: 13px 0 10px;
    color: #172033;
    font-size: 1.3rem
}

.store-about-card p {
    margin: 0;
    color: #526071;
    line-height: 1.9;
    white-space: pre-line
}

.store-about-address {
    margin-top: 18px;
    padding: 12px;
    background: #f3f7ff;
    color: var(--primary);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px
}

.store-info-row {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #fff;
    color: #172033;
    text-decoration: none;
    padding: 14px;
    border-radius: 14px;
    margin-bottom: 11px;
    box-shadow: 0 3px 12px rgba(15, 23, 42, .06)
}

.store-info-row.static {
    cursor: default
}

.store-info-row>div {
    flex: 1;
    min-width: 0
}

.store-info-row strong,
.store-info-row small {
    display: block
}

.store-info-row small {
    color: #667085;
    margin-top: 4px;
    overflow-wrap: anywhere
}

.store-info-row>i {
    color: #a7b0bf;
    font-size: .8rem
}

.store-info-icon {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: #edf3ff;
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    flex-shrink: 0
}

.store-info-icon.whatsapp {
    background: #e9fbef;
    color: #16a34a
}

.store-info-empty {
    text-align: center;
    background: #fff;
    border-radius: 16px;
    padding: 45px 20px;
    color: #7b8797
}

.store-info-empty i {
    font-size: 2.8rem;
    color: #cad2df;
    margin-bottom: 13px
}

.store-info-empty p {
    line-height: 1.7
}

.account-quick-contact {
    background: #fff;
    margin: 22px 10px 0;
    border-radius: 18px;
    padding: 17px 16px;
    box-shadow: 0 5px 18px rgba(15, 23, 42, .08)
}

.account-quick-contact h3 {
    margin: 0 0 14px;
    color: #15213a;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 8px
}

.account-quick-contact h3 i {
    color: var(--primary)
}

.account-contact-list {
    display: flex;
    flex-direction: column;
    gap: 5px
}

.account-contact-row {
    display: grid;
    grid-template-columns: 40px minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    padding: 7px 0
}

.account-contact-symbol {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem
}

.account-contact-symbol.whatsapp {
    background: #e7f9ee;
    color: #20b964
}

.account-contact-symbol.phone {
    background: #e8f6fd;
    color: #25a9e8
}

.account-contact-symbol.email {
    background: #fdeaf4;
    color: #ef5aa5
}

.account-contact-row small,
.account-contact-row strong {
    display: block
}

.account-contact-row small {
    color: #8a94a6;
    font-size: .72rem;
    margin-bottom: 3px
}

.account-contact-row strong {
    color: #13213a;
    font-size: .85rem;
    overflow-wrap: anywhere
}

.account-contact-action {
    color: #fff;
    text-decoration: none;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: .75rem;
    font-weight: 800
}

.account-contact-action.whatsapp {
    background: #22c76b
}

.account-contact-action.phone {
    background: #2db4ed
}

.account-contact-action.email {
    background: #ed64aa
}

.account-social-divider {
    height: 1px;
    background: #9aa5b5;
    margin: 14px 4px
}

.account-social-icons {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 18px;
    padding: 4px 7px;
    overflow-x: auto;
    scrollbar-width: none;
    direction: rtl
}

.account-social-icons::-webkit-scrollbar {
    display: none
}

.account-social-icons :is(a, span) {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #172033;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    font-size: 1.3rem;
    box-shadow: 0 3px 8px rgba(15, 23, 42, .15);
    flex: 0 0 44px
}

.account-social-icons .social-facebook {
    background: #1877f2
}

.account-social-icons .social-tiktok {
    background: #050505
}

.account-social-icons .social-instagram {
    background: linear-gradient(135deg, #833ab4, #fd1d1d, #fcb045)
}

.account-social-icons .social-snapchat {
    background: #ffdf00;
    color: #111
}

.account-social-icons .social-youtube {
    background: #ff0000
}

.account-social-icons .social-twitter {
    background: #1d9bf0
}

.account-social-icons .social-telegram {
    background: #229ed9
}

.account-social-icons .social-whatsapp {
    background: #25d366
}

.account-social-icons .disabled {
    filter: saturate(.65);
    opacity: .72;
    cursor: default
}

.account-social-empty {
    text-align: center;
    color: #929cab;
    font-size: .78rem;
    padding: 8px
}

/* MOBILE APP EMULATOR VIEW FOR DESKTOP */
@media (min-width: 600px) {
    html {
        background-color: #57606f;
    }

    body {
        max-width: 450px !important;
        margin: 0 auto !important;
        min-height: 100vh;
        box-shadow: 0 0 50px rgba(0, 0, 0, 0.4);
        position: relative;
        background-color: #f9f9f9;
        overflow-x: hidden;
    }

    .app-header,
    .bottom-nav,
    .fab-container,
    #pwa-install-container,
    #ios-install-overlay,
    .product-bottom-action {
        max-width: 450px !important;
        left: 50% !important;
        right: auto !important;
        transform: translateX(-50%) !important;
        width: 100% !important;
        margin: 0 !important;
    }
}
/* Store legal pages: readable on mobile and suitable for app-store review. */
.store-policy-card { background: #fff; border: 1px solid #e5eaf2; border-radius: 16px; padding: 18px; margin: 12px 0; box-shadow: 0 4px 14px rgba(15, 39, 71, .06); }
.store-policy-content { color: #26364a; line-height: 1.95; text-align: right; white-space: normal; overflow-wrap: anywhere; }
.store-policy-content h3 { color: var(--primary, #123b67); margin: 0 0 8px; font-size: 1.05rem; }
.store-policy-content p { margin: 0 0 14px; }
