/*
 * Myforoshgah Web App Shell — Phase139 opt-in frontend CSS.
 * Scope: .myf-app-shell and body.myf-app-shell-page only.
 * Tokens are copied from core/src/main/kotlin/af/myforoshgah/core/design/MyfTokens.kt:
 * green #1B6B45, dark green #114630, sand #F7F4ED, white #FFFFFF, ink #1B1F1D.
 * No global WooCommerce/Dokan/admin selectors are modified.
 */

body.myf-app-shell-page {
    background: #F7F4ED;
    color: #1B1F1D;
}

/* Chromeless, opt-in pages only. Admin bar, seller admin, cart, checkout stay untouched. */
body.myf-app-shell-page .wp-site-blocks > header.wp-block-template-part,
body.myf-app-shell-page .wp-site-blocks > footer.wp-block-template-part,
body.myf-app-shell-page .wp-block-post-title {
    display: none !important;
}

body.myf-app-shell-page .wp-site-blocks > main {
    margin-block-start: 0;
    padding-block-start: 0;
}

body.myf-app-shell-page #wpadminbar {
    /* Intentionally visible for privileged users; only layout offset is handled below. */
    display: block;
}

.myf-app-shell {
    --myf-green: #1B6B45;
    --myf-green-dark: #114630;
    --myf-sand: #F7F4ED;
    --myf-white: #FFFFFF;
    --myf-ink: #1B1F1D;
    --myf-ink-soft: #5C6360;
    --myf-outline: #C9CFCB;
    --myf-green-soft: #D6EDE0;
    --myf-shadow: 0 10px 30px rgba(17, 70, 48, .10);
    --myf-shell-max: 760px;
    --myf-radius: 16px;
    --myf-safe-bottom: env(safe-area-inset-bottom, 0px);
    box-sizing: border-box;
    width: 100%;
    min-height: 100vh;
    min-height: 100dvh;
    margin: 0 auto;
    background: var(--myf-sand);
    color: var(--myf-ink);
    direction: rtl;
    text-align: right;
    font-family: Vazirmatn, "Segoe UI", Tahoma, "Iranian Sans", system-ui, -apple-system, sans-serif;
    font-size: 15px;
    line-height: 1.8;
    overflow-x: hidden;
    overflow-x: clip;
    -webkit-text-size-adjust: 100%;
}

.myf-app-shell *,
.myf-app-shell *::before,
.myf-app-shell *::after {
    box-sizing: border-box;
}

.myf-app-shell a {
    text-decoration: none;
}

/*
 * Standalone Phase141 screen wrapper. It is also safe when nested inside the shell:
 * it inherits the same tokens and never adds a second viewport-height block.
 */
.myf-app-shell__screen {
    --myf-green: #1B6B45;
    --myf-green-dark: #114630;
    --myf-sand: #F7F4ED;
    --myf-white: #FFFFFF;
    --myf-ink: #1B1F1D;
    --myf-ink-soft: #5C6360;
    --myf-outline: #C9CFCB;
    --myf-green-soft: #D6EDE0;
    --myf-shadow: 0 10px 30px rgba(17, 70, 48, .10);
    --myf-shell-max: 760px;
    --myf-radius: 16px;
    box-sizing: border-box;
    width: 100%;
    max-width: var(--myf-shell-max);
    margin: 0 auto;
    direction: rtl;
    text-align: right;
    color: var(--myf-ink);
    font-family: Vazirmatn, "Segoe UI", Tahoma, "Iranian Sans", system-ui, -apple-system, sans-serif;
    font-size: 15px;
    line-height: 1.8;
    overflow-wrap: anywhere;
}

.myf-app-shell__screen *,
.myf-app-shell__screen *::before,
.myf-app-shell__screen *::after {
    box-sizing: border-box;
}

.myf-app-shell__screen a {
    text-decoration: none;
    color: var(--myf-green-dark);
}

.myf-app-shell__screen a:focus-visible,
.myf-app-shell__screen button:focus-visible,
.myf-app-shell__screen input:focus-visible {
    outline: 3px solid #B8860B;
    outline-offset: 3px;
    border-radius: 8px;
}

.myf-app-shell__sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}


.myf-app-shell a:focus-visible,
.myf-app-shell button:focus-visible {
    outline: 3px solid #B8860B;
    outline-offset: 3px;
    border-radius: 8px;
}

.myf-app-shell__skip {
    position: absolute;
    inset-inline-start: 12px;
    top: -80px;
    z-index: 1000;
    padding: 10px 16px;
    border-radius: 10px;
    background: var(--myf-green-dark);
    color: var(--myf-white);
}

.myf-app-shell__skip:focus {
    top: 12px;
}

/* ---------- Top bar ---------- */
.myf-app-shell__topbar {
    position: sticky;
    top: 0;
    z-index: 90;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    width: 100%;
    min-height: 60px;
    padding: 8px 14px;
    padding-top: max(8px, env(safe-area-inset-top, 0px));
    background: var(--myf-green);
    color: var(--myf-white);
    box-shadow: 0 2px 10px rgba(17, 70, 48, .18);
}

body.admin-bar .myf-app-shell__topbar {
    top: 32px;
}

.myf-app-shell__brand {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    color: var(--myf-white);
    font-weight: 800;
}

.myf-app-shell__brand-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 34px;
    width: 34px;
    height: 34px;
    border-radius: 11px;
    background: var(--myf-white);
    color: var(--myf-green);
    font-size: 18px;
    font-weight: 900;
    line-height: 1;
}

.myf-app-shell__brand-copy {
    display: flex;
    flex-direction: column;
    min-width: 0;
    line-height: 1.35;
}

.myf-app-shell__brand-name {
    display: block;
    max-width: 42vw;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 16px;
    font-weight: 800;
}

.myf-app-shell__store-name {
    display: block;
    max-width: 44vw;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #D6EDE0;
    font-size: 11px;
    font-weight: 500;
}

.myf-app-shell__top-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex: 0 0 auto;
}

.myf-app-shell__cart,
.myf-app-shell__profile {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    min-height: 44px;
    border-radius: 12px;
    color: var(--myf-white);
}

.myf-app-shell__cart:hover,
.myf-app-shell__profile:hover,
.myf-app-shell__cart:focus-visible,
.myf-app-shell__profile:focus-visible {
    background: rgba(255, 255, 255, .14);
}

.myf-app-shell__cart-count {
    position: absolute;
    top: 1px;
    inset-inline-start: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 4px;
    border: 2px solid var(--myf-green);
    border-radius: 999px;
    background: #B8860B;
    color: #FFFFFF;
    font-size: 10px;
    font-weight: 800;
    line-height: 1;
}

.myf-app-shell__store-link {
    display: none;
    max-width: 150px;
    overflow: hidden;
    color: #D6EDE0;
    font-size: 11px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.myf-app-shell__icon {
    display: block;
    flex: 0 0 auto;
}

/* ---------- Content ---------- */
.myf-app-shell__content {
    width: 100%;
    max-width: var(--myf-shell-max);
    min-height: calc(100dvh - 138px);
    margin: 0 auto;
    padding: 18px 16px calc(92px + var(--myf-safe-bottom));
}

.myf-app-shell__page-title {
    margin: 0 0 14px;
    color: var(--myf-ink);
    font-size: 22px;
    font-weight: 800;
    line-height: 1.5;
}

.myf-app-shell__hero {
    padding: 20px 18px;
    border: 1px solid rgba(27, 107, 69, .14);
    border-radius: var(--myf-radius);
    background: var(--myf-green-dark);
    color: var(--myf-white);
    box-shadow: var(--myf-shadow);
}

.myf-app-shell__hero h2 {
    margin: 0 0 6px;
    color: inherit;
    font-size: 19px;
    line-height: 1.6;
}

.myf-app-shell__hero p {
    margin: 0 0 14px;
    max-width: 46ch;
    color: #D6EDE0;
    font-size: 13px;
    line-height: 1.9;
}

.myf-app-shell__cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    padding: 10px 20px;
    border: 0;
    border-radius: 12px;
    background: var(--myf-white);
    color: var(--myf-green-dark);
    font-weight: 800;
    font-size: 14px;
}

.myf-app-shell__cta:hover,
.myf-app-shell__cta:focus-visible {
    background: #D6EDE0;
    color: var(--myf-green-dark);
}

.myf-app-shell__slot {
    min-width: 0;
    overflow-wrap: anywhere;
}

.myf-app-shell__slot img {
    max-width: 100%;
    height: auto;
}

.myf-app-shell__slot table {
    display: block;
    max-width: 100%;
    overflow-x: auto;
}

.myf-app-shell__section-title {
    margin: 22px 0 10px;
    color: var(--myf-ink);
    font-size: 16px;
    font-weight: 800;
}

.myf-app-shell__quick-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.myf-app-shell__quick-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    min-width: 0;
    min-height: 56px;
    padding: 12px 14px;
    border: 1px solid #DED9CE;
    border-radius: 14px;
    background: var(--myf-white);
    color: var(--myf-ink);
    font-size: 13px;
    font-weight: 700;
    box-shadow: 0 2px 8px rgba(27, 31, 29, .04);
}

.myf-app-shell__quick-link > span:first-child {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.myf-app-shell__quick-link:hover,
.myf-app-shell__quick-link:focus-visible {
    border-color: var(--myf-green);
    background: #F3FAF6;
}

/* ---------- Phase141 customer pages: search, sections, products ---------- */
.myf-app-shell__screen-title {
    margin: 0 0 12px;
    color: var(--myf-ink);
    font-size: 20px;
    font-weight: 800;
    line-height: 1.5;
}

.myf-app-shell__search {
    display: flex;
    align-items: stretch;
    gap: 8px;
    width: 100%;
    margin: 0 0 20px;
}

.myf-app-shell__search-field {
    flex: 1 1 auto;
    min-width: 0;
    min-height: 48px;
    padding: 10px 14px;
    border: 1px solid #DED9CE;
    border-radius: 14px;
    background: var(--myf-white);
    color: var(--myf-ink);
    font: inherit;
    font-size: 14px;
    line-height: 1.4;
    appearance: none;
}

.myf-app-shell__search-field::placeholder {
    color: #7A817D;
    opacity: 1;
}

.myf-app-shell__search-submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    flex: 0 0 auto;
    min-height: 48px;
    padding: 0 16px;
    border: 0;
    border-radius: 14px;
    background: var(--myf-green);
    color: var(--myf-white);
    font-family: inherit;
    font-size: 13px;
    font-weight: 800;
    cursor: pointer;
}

.myf-app-shell__search-submit:hover,
.myf-app-shell__search-submit:focus-visible {
    background: var(--myf-green-dark);
}

.myf-app-shell__search-submit .myf-app-shell__icon {
    width: 18px;
    height: 18px;
}

.myf-app-shell__section {
    min-width: 0;
    margin: 0 0 22px;
}

.myf-app-shell__section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    min-width: 0;
    margin: 0 0 10px;
}

.myf-app-shell__section-title {
    min-width: 0;
    margin: 0;
    color: var(--myf-ink);
    font-size: 16px;
    font-weight: 800;
    line-height: 1.5;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.myf-app-shell__section-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    min-height: 44px;
    padding: 0 4px;
    color: var(--myf-green) !important;
    font-size: 12.5px;
    font-weight: 800;
    white-space: nowrap;
}

.myf-app-shell__section-foot {
    margin: 14px 0 0;
    text-align: center;
}

.myf-app-shell__result-count {
    margin: 0 0 10px;
    color: var(--myf-ink-soft);
    font-size: 12px;
    line-height: 1.6;
}

/* Horizontal app rails: real cards, native touch scroll, no page overflow. */
.myf-app-shell__rail,
.myf-app-shell__shortcut-row {
    display: grid;
    grid-auto-flow: column;
    gap: 10px;
    margin: 0;
    padding: 2px 2px 8px;
    list-style: none;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    scroll-snap-type: x mandatory;
    scrollbar-width: thin;
    -webkit-overflow-scrolling: touch;
}

.myf-app-shell__rail {
    grid-auto-columns: minmax(150px, 45%);
}

.myf-app-shell__shortcut-row {
    grid-auto-columns: minmax(158px, 44%);
}

.myf-app-shell__rail-item,
.myf-app-shell__shortcut-item {
    min-width: 0;
    display: flex;
    scroll-snap-align: start;
}

/* Category cards. */
.myf-app-shell__category-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.myf-app-shell__category-grid-item {
    min-width: 0;
    display: flex;
}

.myf-app-shell__category-card {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    min-width: 0;
    min-height: 64px;
    height: 100%;
    padding: 10px 12px;
    border: 1px solid #DED9CE;
    border-radius: 14px;
    background: var(--myf-white);
    color: var(--myf-ink) !important;
    box-shadow: 0 2px 8px rgba(27, 31, 29, .04);
}

.myf-app-shell__category-card:hover,
.myf-app-shell__category-card:focus-visible {
    border-color: var(--myf-green);
    background: #F3FAF6;
}

.myf-app-shell__category-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 34px;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: var(--myf-green-soft);
    color: var(--myf-green-dark);
}

.myf-app-shell__category-icon .myf-app-shell__icon {
    width: 18px;
    height: 18px;
}

.myf-app-shell__category-copy {
    display: flex;
    flex-direction: column;
    min-width: 0;
    flex: 1 1 auto;
    line-height: 1.45;
}

.myf-app-shell__category-name {
    display: block;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 13px;
    font-weight: 700;
}

.myf-app-shell__category-count {
    display: block;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--myf-ink-soft);
    font-size: 11px;
}

.myf-app-shell__chevron {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    color: #7A817D;
}

.myf-app-shell__chevron .myf-app-shell__icon {
    width: 16px;
    height: 16px;
}

/* Updated categories: legible in two columns, responsive on narrow devices. */
.myf-app-shell__category-card {
    min-height: 98px;
    border-radius: 18px;
    flex-wrap: wrap;
    padding: 14px 10px;
}
.myf-app-shell__category-name {
    white-space: normal;
    overflow-wrap: anywhere;
    text-overflow: clip;
    font-size: 14px;
    line-height: 1.55;
}
.myf-app-shell__category-count {
    white-space: normal;
    font-size: 12px;
}
.myf-app-shell__category-card--all .myf-app-shell__category-name {
    white-space: normal;
}
/* Product cards: equal height in a row, bottom-aligned price/action. */
.myf-app-shell__product-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.myf-app-shell__product-grid-item {
    min-width: 0;
    display: flex;
}

.myf-app-shell__rail-item {
    display: flex;
}

.myf-app-shell__product-card {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
    min-width: 0;
    overflow: hidden;
    border: 1px solid #E2DDD2;
    border-radius: 14px;
    background: var(--myf-white);
    box-shadow: 0 2px 10px rgba(27, 31, 29, .05);
}

.myf-app-shell__product-media {
    display: block;
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    background: #EFECE4;
}

.myf-app-shell__product-media img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.myf-app-shell__product-img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.myf-app-shell__product-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    width: 100%;
    height: 100%;
    background: #F1EEE7;
    color: var(--myf-ink-soft);
    font-size: 10px;
    font-weight: 600;
}

.myf-app-shell__product-placeholder .myf-app-shell__icon {
    width: 22px;
    height: 22px;
    opacity: .7;
}

.myf-app-shell__product-body {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1 1 auto;
    min-width: 0;
    padding: 9px;
}

.myf-app-shell__product-name {
    display: -webkit-box;
    min-width: 0;
    min-height: 2.9em;
    overflow: hidden;
    color: var(--myf-ink) !important;
    font-size: 12.5px;
    font-weight: 700;
    line-height: 1.45;
    overflow-wrap: anywhere;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.myf-app-shell__product-price {
    margin-top: auto;
    color: var(--myf-green-dark);
    font-size: 13px;
    font-weight: 800;
    line-height: 1.5;
    overflow-wrap: anywhere;
}

.myf-app-shell__product-price .woocommerce-Price-amount {
    color: inherit;
    font-weight: inherit;
}

.myf-app-shell__product-price del {
    color: var(--myf-ink-soft);
    font-size: 11px;
    font-weight: 500;
}

.myf-app-shell__product-price ins {
    text-decoration: none;
}

.myf-app-shell__product-price--empty {
    color: var(--myf-ink-soft);
    font-size: 11px;
    font-weight: 600;
}

.myf-app-shell__product-actions {
    margin-top: 2px;
}

.myf-app-shell__product-action {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    width: 100%;
    min-height: 44px;
    padding: 8px 10px;
    border: 1px solid var(--myf-green);
    border-radius: 10px;
    background: var(--myf-white);
    color: var(--myf-green-dark) !important;
    font-size: 12px;
    font-weight: 800;
    line-height: 1.35;
    text-align: center;
}

.myf-app-shell__product-action--cart {
    border-color: var(--myf-green);
    background: var(--myf-green);
    color: var(--myf-white) !important;
}

.myf-app-shell__product-action--cart .myf-app-shell__icon {
    width: 16px;
    height: 16px;
}

.myf-app-shell__product-action:hover,
.myf-app-shell__product-action:focus-visible {
    border-color: var(--myf-green-dark);
    background: var(--myf-green-soft);
    color: var(--myf-green-dark) !important;
}

.myf-app-shell__product-action--cart:hover,
.myf-app-shell__product-action--cart:focus-visible {
    background: var(--myf-green-dark);
    color: var(--myf-white) !important;
}

.myf-app-shell__product-action--muted {
    border-color: #DED9CE;
    background: #EFECE4;
    color: var(--myf-ink-soft) !important;
}

/* Store discovery: mobile-first 2-up grid; real Dokan names/locations/logos.
   Preserve complete vendor names and a visible shop CTA, never a one-line train. */
.myf-app-shell__store-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: stretch;
    gap: 12px;
    margin: 0;
    padding: 0;
    list-style: none;
}
.myf-app-shell__store-list-item { min-width: 0; }
.myf-app-shell__store-card {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    width: 100%;
    height: 100%;
    min-width: 0;
    min-height: 228px;
    padding: 16px 12px 12px;
    border: 1px solid #DED9CE;
    border-radius: 20px;
    background: var(--myf-white);
    color: var(--myf-ink) !important;
    box-shadow: 0 5px 18px rgba(27,31,29,.07);
    overflow-wrap: anywhere;
    transition: border-color .15s, box-shadow .15s, transform .15s;
}
.myf-app-shell__store-card:hover,
.myf-app-shell__store-card:focus-visible {
    border-color: var(--myf-green);
    background: #F6FCF8;
    box-shadow: 0 8px 22px rgba(17,70,48,.13);
}
.myf-app-shell__store-card-head {
    display: flex;
    width: 100%;
    gap: 6px;
    flex-direction: column;
    align-items: center;
}
.myf-app-shell__store-logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 70px;
    width: 70px;
    height: 70px;
    overflow: hidden;
    border-radius: 20px;
    background: var(--myf-green-soft);
    border: 1px solid rgba(17,70,48,.12);
}
.myf-app-shell__store-logo-img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.myf-app-shell__store-initial {
    color: var(--myf-green-dark);
    font-size: 26px;
    font-weight: 900;
    line-height: 1;
}
.myf-app-shell__store-kind {
    color: var(--myf-ink-soft);
    font-size: 11px;
    font-weight: 600;
}
.myf-app-shell__store-body {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    align-items: center;
    width: 100%;
    min-width: 0;
    text-align: center;
    line-height: 1.55;
}
.myf-app-shell__store-name {
    display: block;
    width: 100%;
    min-width: 0;
    overflow-wrap: anywhere;
    white-space: normal;
    color: var(--myf-ink);
    font-size: 14px;
    font-weight: 800;
    line-height: 1.65;
}
.myf-app-shell__store-meta {
    display: block;
    max-width: 100%;
    margin-top: 6px;
    color: var(--myf-ink-soft);
    font-size: 12px;
    overflow-wrap: anywhere;
    white-space: normal;
}
.myf-app-shell__store-cta {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 5px;
    width: 100%;
    min-height: 44px;
    margin-top: auto;
    padding: 9px 6px;
    border-radius: 12px;
    background: var(--myf-green);
    color: #FFFFFF;
    font-size: 12px;
    font-weight: 700;
    text-align: center;
}
.myf-app-shell__store-cta .myf-app-shell__icon {
    width: 15px;
    height: 15px;
}
/* Empty/error state and pagination. */
.myf-app-shell__empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 26px 18px;
    border: 1px dashed #C9CFCB;
    border-radius: 16px;
    background: var(--myf-white);
    text-align: center;
}

.myf-app-shell__empty-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: var(--myf-green-soft);
    color: var(--myf-green-dark);
}

.myf-app-shell__empty-icon .myf-app-shell__icon {
    width: 22px;
    height: 22px;
}

.myf-app-shell__empty-text {
    margin: 0;
    color: var(--myf-ink);
    font-size: 14px;
    font-weight: 700;
    line-height: 1.6;
}

.myf-app-shell__empty-hint {
    margin: 0;
    max-width: 42ch;
    color: var(--myf-ink-soft);
    font-size: 12px;
    line-height: 1.7;
}

.myf-app-shell__pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin: 16px 0 0;
}

.myf-app-shell__page-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 64px;
    min-height: 44px;
    padding: 0 12px;
    border: 1px solid #DED9CE;
    border-radius: 10px;
    background: var(--myf-white);
    color: var(--myf-green-dark) !important;
    font-size: 12.5px;
    font-weight: 800;
    white-space: nowrap;
}

.myf-app-shell__page-link:hover,
.myf-app-shell__page-link:focus-visible {
    border-color: var(--myf-green);
    background: #F3FAF6;
}

.myf-app-shell__page-link.is-disabled {
    color: var(--myf-ink-soft) !important;
    opacity: .55;
}

.myf-app-shell__page-status {
    color: var(--myf-ink-soft);
    font-size: 12px;
    white-space: nowrap;
}


/* ---------- Bottom navigation ---------- */
.myf-app-shell__nav {
    position: fixed;
    inset-inline: 0;
    bottom: 0;
    z-index: 95;
    width: 100%;
    max-width: var(--myf-shell-max);
    margin-inline: auto;
    padding: 6px 4px calc(6px + var(--myf-safe-bottom));
    border-top: 1px solid #DED9CE;
    border-radius: 18px 18px 0 0;
    background: var(--myf-white);
    box-shadow: 0 -8px 28px rgba(17, 70, 48, .12);
}

.myf-app-shell__nav-list {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 2px;
    align-items: stretch;
    margin: 0;
    padding: 0;
    list-style: none;
}

.myf-app-shell__nav--seller .myf-app-shell__nav-list {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.myf-app-shell__nav-item {
    min-width: 0;
    margin: 0;
}

.myf-app-shell__nav-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    min-width: 0;
    min-height: 52px;
    padding: 4px 2px;
    border-radius: 12px;
    color: #5C6360;
    font-size: 10px;
    line-height: 1.25;
    text-align: center;
    -webkit-tap-highlight-color: transparent;
}

.myf-app-shell__nav-link .myf-app-shell__icon {
    width: 21px;
    height: 21px;
    flex: 0 0 21px;
}

.myf-app-shell__nav-label {
    display: block;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 10px;
    line-height: 1.35;
}

.myf-app-shell__nav-link.is-active {
    color: var(--myf-green-dark);
    background: #E8F4EE;
    font-weight: 800;
}

.myf-app-shell__nav-link.is-active .myf-app-shell__nav-label {
    color: var(--myf-green-dark);
    font-weight: 800;
}

.myf-app-shell__nav-link:hover,
.myf-app-shell__nav-link:focus-visible {
    background: #F3FAF6;
    color: var(--myf-green-dark);
}

/* ---------- Seller gate ---------- */
.myf-app-shell--gate {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100dvh;
    padding: 24px 16px;
    background: var(--myf-sand);
}

.myf-app-shell__gate-card {
    width: 100%;
    max-width: 420px;
    padding: 24px 20px;
    border: 1px solid #DED9CE;
    border-radius: 18px;
    background: var(--myf-white);
    box-shadow: var(--myf-shadow);
}

.myf-app-shell__gate-card h1 {
    margin: 0 0 8px;
    color: var(--myf-ink);
    font-size: 20px;
}

.myf-app-shell__gate-card p {
    margin: 0 0 16px;
    color: var(--myf-ink-soft);
    font-size: 14px;
}

.myf-app-shell__gate-card .myf-app-shell__cta {
    background: var(--myf-green);
    color: var(--myf-white);
}

/* ---------- Viewports ---------- */
@media (max-width: 359px) {
    .myf-app-shell {
        font-size: 14px;
    }

    .myf-app-shell__topbar {
        padding-inline: 10px;
    }

    .myf-app-shell__brand-name {
        max-width: 36vw;
        font-size: 14px;
    }

    .myf-app-shell__content {
        padding-inline: 12px;
    }

    .myf-app-shell__nav-link,
    .myf-app-shell__nav-label {
        font-size: 9px;
    }

    .myf-app-shell__nav-link {
        min-height: 50px;
        padding-inline: 1px;
    }

    .myf-app-shell__quick-grid {
        grid-template-columns: 1fr;
    }

    .myf-app-shell__screen-title {
        font-size: 18px;
    }

    .myf-app-shell__search {
        gap: 6px;
    }

    .myf-app-shell__search-submit {
        padding-inline: 12px;
    }

    .myf-app-shell__section-title {
        font-size: 15px;
    }

    .myf-app-shell__category-grid {
        grid-template-columns: 1fr;
    }

    .myf-app-shell__shortcut-row {
        grid-auto-columns: minmax(170px, 78%);
    }

    .myf-app-shell__product-grid {
        gap: 8px;
    }

    .myf-app-shell__product-name {
        font-size: 11.5px;
    }

    .myf-app-shell__product-action {
        font-size: 11px;
        padding-inline: 6px;
    }

    .myf-app-shell__page-link {
        min-width: 56px;
        padding-inline: 9px;
    }
}

@media (min-width: 390px) {
    .myf-app-shell__nav-link,
    .myf-app-shell__nav-label {
        font-size: 10.5px;
    }

    .myf-app-shell__content {
        padding-inline: 18px;
    }

    .myf-app-shell__product-grid {
        gap: 12px;
    }

    .myf-app-shell__search-field {
        font-size: 14.5px;
    }
}

@media (min-width: 768px) {
    body.myf-app-shell-page {
        background: #EFECE4;
    }

    .myf-app-shell {
        max-width: var(--myf-shell-max);
        min-height: 100dvh;
        border-inline: 1px solid #E2DDD2;
        background: var(--myf-sand);
        box-shadow: 0 0 44px rgba(17, 70, 48, .08);
    }

    .myf-app-shell__topbar {
        min-height: 66px;
        padding-inline: 22px;
    }

    .myf-app-shell__brand-name {
        max-width: 220px;
    }

    .myf-app-shell__store-name {
        max-width: 230px;
    }

    .myf-app-shell__store-link {
        display: inline-block;
    }

    .myf-app-shell__content {
        padding: 24px 24px calc(104px + var(--myf-safe-bottom));
    }

    .myf-app-shell__page-title {
        font-size: 26px;
    }

    .myf-app-shell__quick-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .myf-app-shell__nav {
        padding-inline: 12px;
    }

    .myf-app-shell__nav-link,
    .myf-app-shell__nav-label {
        font-size: 11px;
    }

    .myf-app-shell__screen-title {
        font-size: 24px;
    }

    .myf-app-shell__section-title {
        font-size: 18px;
    }

    .myf-app-shell__product-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 14px;
    }

    .myf-app-shell__category-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 12px;
    }

    .myf-app-shell__rail {
        grid-auto-columns: minmax(180px, 30%);
    }

    .myf-app-shell__shortcut-row {
        grid-auto-columns: minmax(180px, 28%);
    }

    .myf-app-shell__store-list {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
    }

    .myf-app-shell__search {
        max-width: 560px;
    }
}

@media (max-width: 782px) {
    body.admin-bar .myf-app-shell__topbar {
        top: 46px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .myf-app-shell *,
    .myf-app-shell *::before,
    .myf-app-shell *::after {
        scroll-behavior: auto !important;
        transition: none !important;
        animation: none !important;
    }

    .myf-app-shell__rail,
    .myf-app-shell__shortcut-row {
        scroll-snap-type: none;
    }
}


/* Phase151 opt-in: remove the default block-theme top spacing around app pages.
   Applied ONLY to pages with the app shell shortcode, never to sitewide checkout
   or the real Cloudways storefront. */
body.myf-app-shell-page .wp-site-blocks > main,
body.myf-app-shell-page .wp-site-blocks > main > .wp-block-group,
body.myf-app-shell-page .wp-site-blocks .wp-block-post-content {
    margin-block-start: 0 !important;
    margin-block-end: 0 !important;
    padding-block-start: 0 !important;
    padding-block-end: 0 !important;
    max-width: none !important;
}
body.myf-app-shell-page .wp-block-post-content > .myf-app-shell {
    margin-block-start: 0 !important;
}
.myf-app-shell__empty {
    background: var(--myf-white);
    border: 1px solid var(--myf-outline);
    border-radius: 18px;
    padding: 22px 18px;
    text-align: center;
    color: var(--myf-ink);
    overflow-wrap: anywhere;
}
.myf-app-shell__empty h2 {font-size: 20px; margin: 8px 0;}
.myf-app-shell__empty p {font-size: 14px; margin: 10px 0 18px;}
.myf-app-shell__empty .myf-app-shell__cta {
    display: inline-flex;
    justify-content: center;
    max-width: 100%;
    border-radius: 12px;
    padding: 10px 20px;
    background: var(--myf-green);
    color: var(--myf-white);
}
.myf-app-shell__woo-cart,
.myf-app-shell__woo-orders,
.myf-app-shell__woo-checkout {
    min-width: 0;
    max-width: 100%;
    overflow-wrap: anywhere;
    direction: rtl;
}
.myf-app-shell__woo-cart .woocommerce,
.myf-app-shell__woo-orders .woocommerce,
.myf-app-shell__woo-checkout .woocommerce {
    max-width: 100%;
    min-width: 0;
}
.myf-app-shell__woo-cart .woocommerce table.shop_table,
.myf-app-shell__woo-orders .woocommerce table.shop_table {
    display: block;
    max-width: 100%;
    overflow-x: auto;
}
.myf-app-shell__woo-cart input,
.myf-app-shell__woo-cart button,
.myf-app-shell__woo-cart .button,
.myf-app-shell__woo-orders input,
.myf-app-shell__woo-orders button {
    max-width: 100%;
}

/* Opt-in classic WooCommerce checkout, preserving native validation and payment. */
.myf-app-shell__woo-checkout .woocommerce-checkout,
.myf-app-shell__woo-checkout .col2-set,
.myf-app-shell__woo-checkout .woocommerce-billing-fields,
.myf-app-shell__woo-checkout #order_review {
    width: 100%;
    max-width: 100%;
    min-width: 0;
}
.myf-app-shell__woo-checkout .col-1,
.myf-app-shell__woo-checkout .col-2 {
    width: 100%;
    float: none;
}
.myf-app-shell__woo-checkout input.input-text,
.myf-app-shell__woo-checkout select,
.myf-app-shell__woo-checkout textarea {
    max-width: 100%;
    width: 100%;
}
.myf-app-shell__woo-checkout #place_order {
    width: 100%;
    border-radius: 12px;
    background: var(--myf-green);
    color: var(--myf-white);
}

/* Guest onboarding lives in the actual customer home, not a fake login form. */
.myf-app-shell__welcome {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 18px;
    border: 1px solid rgba(27,107,69,.18);
    border-radius: 20px;
    background: #E7F2EB;
    color: #114630;
}
.myf-app-shell__welcome-copy h2 {
    margin: 0 0 6px;
    font-size: 18px;
    font-weight: 800;
    line-height: 1.5;
}
.myf-app-shell__welcome-copy p {
    margin: 0;
    font-size: 12.5px;
    color: #365B47;
    line-height: 1.7;
}
.myf-app-shell__welcome-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.myf-app-shell__welcome-link {
    display: inline-flex;
    flex: 1 1 135px;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 10px 12px;
    border: 1px solid #1B6B45;
    border-radius: 12px;
    color: #114630 !important;
    background: #FFFFFF;
    font-size: 13px;
    font-weight: 750;
    text-align: center;
}
.myf-app-shell__welcome-link.is-primary {
    color: #FFFFFF !important;
    background: #1B6B45;
}
.myf-app-shell__welcome-link.is-seller {
    border-color: #A3BBAA;
    background: #F5FAF7;
}

/* Extremely narrow phones use a single generous store card. */
@media (max-width: 359px) {
    .myf-app-shell__store-list { grid-template-columns: 1fr; }
    .myf-app-shell__store-card { min-height: 190px; }
}


/* Full-card rails: no cut-off leftmost card or distracting horizontal bars. */
.myf-app-shell__rail,
.myf-app-shell__shortcut-row {
    display: grid;
    grid-auto-flow: row;
    grid-auto-columns: auto;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    overflow-x: visible;
    scroll-snap-type: none;
    padding: 2px 0 8px;
}
.myf-app-shell__rail-item,
.myf-app-shell__shortcut-item { scroll-snap-align: none; }
@media (min-width: 768px) {
    .myf-app-shell__rail,
    .myf-app-shell__shortcut-row {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}
@media (max-width: 359px) {
    .myf-app-shell__rail,
    .myf-app-shell__shortcut-row {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }
}
/* Server-rendered store search, clear focus and progressive auto-scroll. */
.myf-app-shell__store-search {
    margin: 0 0 18px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.myf-app-shell__store-search label {
    color: var(--myf-ink);
    font-weight: 800;
    font-size: 14px;
}
.myf-app-shell__store-search-row {
    display: flex;
    gap: 8px;
    min-width: 0;
}
.myf-app-shell__store-search-row input {
    flex: 1 1 auto;
    min-width: 0;
    border: 1px solid #C2CFC6;
    border-radius: 12px;
    color: var(--myf-ink);
    background: #FFFFFF;
    padding: 11px;
    font-size: 14px;
}
.myf-app-shell__store-search-row button {
    min-height: 48px;
    flex: 0 0 auto;
    border: 0;
    border-radius: 12px;
    background: var(--myf-green);
    color: #FFFFFF;
    padding: 0 16px;
    font-weight: 800;
}
.myf-app-shell__stores-sentinel {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 48px;
    margin: 12px auto 20px;
    padding: 8px;
    text-align: center;
    color: var(--myf-ink-soft);
    font-size: 13px;
}
.myf-app-shell__stores-sentinel[role="button"] {cursor: pointer;}
.myf-app-shell__search-reset {margin: 12px 0; text-align: center;}

/* Dedicated customer login / registration / vendor application screens. */
.myf-app-shell__auth {
    width: 100%;
    min-width: 0;
    color: var(--myf-ink);
}
.myf-app-shell__auth-intro {
    padding: 18px 16px;
    border: 1px solid #E0E9E2;
    border-radius: 18px;
    background: #E7F2EB;
    margin-bottom: 16px;
}
.myf-app-shell__auth-intro h2 {margin: 0 0 6px; font-size: 23px; color: #114630;}
.myf-app-shell__auth-intro p {margin: 0; font-size: 13px; line-height: 1.8;}
.myf-app-shell__auth-core,
.myf-app-shell__auth-card {
    width: 100%;
    min-width: 0;
    border: 1px solid #D7E2DA;
    border-radius: 18px;
    background: #FFFFFF;
    color: #1B1F1D;
    padding: 16px;
}
.myf-app-shell__auth--login .u-column2,
.myf-app-shell__auth--register .u-column1,
.myf-app-shell__auth--login .woocommerce-form-register,
.myf-app-shell__auth--register .woocommerce-form-login {
    display: none !important;
}
.myf-app-shell__auth .woocommerce .u-columns,
.myf-app-shell__auth .woocommerce .u-column1,
.myf-app-shell__auth .woocommerce .u-column2 {
    display: block;
    float: none;
    width: 100%;
    max-width: none;
    margin: 0;
}
.myf-app-shell__auth .woocommerce form,
.myf-app-shell__auth .dokan-vendor-register,
.myf-app-shell__auth .dokan-vendor-onboarding {
    width: 100%;
    max-width: 100%;
    min-width: 0;
}
.myf-app-shell__auth .woocommerce input:not([type="radio"]):not([type="checkbox"]),
.myf-app-shell__auth .dokan-vendor-register input:not([type="radio"]):not([type="checkbox"]),
.myf-app-shell__auth .woocommerce select {
    width: 100%;
    max-width: 100%;
    min-height: 45px;
    padding: 10px;
    border-radius: 10px;
    border: 1px solid #BFCFC4;
}
.myf-app-shell__auth .woocommerce button[type="submit"],
.myf-app-shell__auth .dokan-vendor-register input[type="submit"] {
    min-height: 48px;
    width: 100%;
    background: #1B6B45;
    color: #FFFFFF;
    border: 0;
    border-radius: 12px;
    font-weight: 800;
}
.myf-app-shell__auth label,
.myf-app-shell__auth .woocommerce h2 {
    color: #1B1F1D;
    font-weight: 700;
}
.myf-app-shell__auth-switch {margin: 20px 0; text-align: center;}
.myf-app-shell__auth-switch a {color: #1B6B45; font-weight: 700;}
.myf-app-shell__auth--vendor .dokan-registration-section,
.myf-app-shell__auth--vendor .dokan-onboarding-container {
    width: 100%;
    max-width: 100%;
}
.myf-app-shell__auth--vendor .dokan-registration-section h2 {font-size: 18px;}

/*
 * Production conflict fix: legacy WordPress/WPCode bottom navigation links
 * to /, /categories/ and /cart/. On preview pages they overlay our genuine
 * app-like five-tab navigation and eject users to the old theme.
 * Hide the legacy footer nav only within opted-in shell pages. Do not touch
 * the original public home or regular Dokan/WooCommerce screens.
 */
body.myf-app-shell-page .myf-bottomnav {
    display: none !important;
    visibility: hidden !important;
    pointer-events: none !important;
}
body.myf-app-shell-page .myf-app-shell__nav {
    display: block !important;
    visibility: visible !important;
    pointer-events: auto !important;
}

/* Seller onboarding has its OWN layout, not the five-tab customer shell. */
body.myf-vendor-onboarding-page {background:#F5F8F6;color:#18271F;}
body.myf-vendor-onboarding-page .myf-bottomnav,
body.myf-vendor-onboarding-page .wp-site-blocks > header.wp-block-template-part,
body.myf-vendor-onboarding-page .wp-site-blocks > footer.wp-block-template-part,
body.myf-vendor-onboarding-page .wp-block-post-title,
body.myf-vendor-onboarding-page .myf-app-shell__nav {display:none!important;}
body.myf-vendor-onboarding-page .wp-site-blocks > main {max-width:850px;margin:0 auto;padding:20px 14px 64px;}
body.myf-vendor-onboarding-page .wp-block-post-content {max-width:100%;margin:0;}
.myf-vendor-portal {max-width:670px;margin:auto;width:100%;min-width:0;--myf-green:#1B6B45;--myf-ink:#1B1F1D;}
.myf-vendor-portal__brand {font-size:20px;font-weight:800;color:#114630;margin:12px 0 24px;padding:14px;background:#E9F3EC;border-radius:12px;}
.myf-vendor-portal .myf-app-shell__auth {display:block;}
.myf-vendor-portal .dokan-onboarding-container,.myf-vendor-portal .dokan-registration-section {width:100%;max-width:100%;display:block;}
.myf-vendor-portal .dokan-registration-section .split-row {display:grid;grid-template-columns:1fr;gap:8px;}
.myf-vendor-portal .dokan-vendor-register input:not([type="radio"]):not([type="checkbox"]):not([type="hidden"]) {width:100%;max-width:100%;min-height:48px;padding:10px;border:1px solid #CBD9CE;border-radius:10px;background:#FFF;color:#16251C;}
.myf-vendor-portal .dokan-vendor-register label {color:#16251C;font-size:15px;font-weight:700;}
.myf-vendor-portal .dokan-vendor-register .woocommerce-Button {background:#1B6B45!important;color:#FFF!important;min-height:50px;width:100%;font-weight:800;border-radius:12px;}
.myf-vendor-portal .dokan-vendor-register strong,.myf-vendor-portal .dokan-vendor-register small {overflow-wrap:anywhere;word-break:break-word;}
.myf-customer-only-registration .woocommerce-form-row {width:100%;float:none;display:block;margin:0 0 18px;}
.myf-customer-only-registration input:not([type="hidden"]) {font-size:16px;}
.myf-app-shell__auth-consent {font-size:13px;line-height:1.75;color:#506257;}
.myf-app-shell__auth-consent a {color:#17633F;text-decoration:underline;}

/* Professional single-column customer login even with Woo/Dokan floated rows. */
body.myf-app-shell-page .myf-app-shell__auth--login .woocommerce-form-login,
body.myf-app-shell-page .myf-app-shell__auth--login .woocommerce-form-login .form-row {
    display:block !important;width:100%!important;float:none!important;clear:both!important;
}
body.myf-app-shell-page .myf-app-shell__auth--login .woocommerce-form-login label {
    display:block!important;float:none!important;margin:0 0 8px!important;
    font-size:15px;line-height:1.5;
}
body.myf-app-shell-page .myf-app-shell__auth--login .woocommerce-form-login .input-text {
    width:100%!important;min-width:0;min-height:48px;border-radius:12px;
    border:1px solid #C5D5C9;background:#fff;color:#1B1F1D;
    padding:10px 12px;box-sizing:border-box;
}
body.myf-app-shell-page .myf-app-shell__auth--login .woocommerce-form-login .password-input {display:block;width:100%;}
body.myf-app-shell-page .myf-app-shell__auth--login .woocommerce-form-login button[type=submit] {
    width:100%;min-height:48px;background:#1B6B45;color:white;border-radius:12px;
}
body.myf-app-shell-page .myf-app-shell__auth--login .woocommerce-form-login .woocommerce-form-login__rememberme {
    display:inline-flex!important;gap:8px;align-items:center;margin:12px 0;font-weight:500;
}
body.myf-app-shell-page .myf-app-shell__auth--login .woocommerce-form-login .woocommerce-form-login__rememberme input {width:19px!important;height:19px!important;min-height:19px;}
