:root {
    --app-bg: #f4f6f8;
    --app-surface: #ffffff;
    --app-surface-soft: #f8fafc;
    --app-line: #e5e7eb;
    --app-line-strong: #d1d5db;
    --app-ink: #0f172a;
    --app-muted: #64748b;
    --app-accent: #0f766e;
    --app-accent-soft: #ecfeff;
    --app-shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
    --app-shadow-soft: 0 6px 18px rgba(15, 23, 42, 0.04);
    --app-radius-lg: 24px;
    --app-radius-md: 18px;
    --app-radius-sm: 14px;
}

body {
    background: linear-gradient(180deg, #f8fafc 0%, #f3f6f8 100%);
    color: var(--app-ink);
}

.site-header {
    background: rgba(255, 255, 255, 0.92);
    border-bottom: 1px solid rgba(15, 23, 42, 0.06);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.04);
}

.header-main {
    padding: 0.8rem 0;
}

.logo {
    display: inline-flex;
    align-items: center;
    gap: 0.7rem;
}

.logo-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    padding: 2px;
    border-radius: 14px;
    background: linear-gradient(145deg, rgba(15, 23, 42, 0.12), rgba(5, 150, 105, 0.24));
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.14);
    overflow: hidden;
}

.logo-image {
    width: 100%;
    height: 100%;
    border-radius: 12px;
    background: #111827;
    object-fit: cover;
    object-position: center 18%;
    transform: scale(1.16);
    transform-origin: top center;
}

.logo-title {
    font-size: 1.2rem;
    font-weight: 800;
    letter-spacing: -0.04em;
}

.logo-tagline {
    font-size: 0.72rem;
}

.nav-links {
    background: #f1f5f9;
    border: 1px solid rgba(15, 23, 42, 0.05);
}

.nav-links a.is-active,
.nav-links a:hover {
    background: #ffffff;
    box-shadow: none;
}

.page-content {
    padding: 1rem 0 calc(5.5rem + env(safe-area-inset-bottom));
}

.app-page {
    padding: 0.25rem 0 1.5rem;
}

.app-page-header,
.app-card,
.app-section-card,
.app-empty-state,
.auth-panel,
.storefront-hero-copy,
.storefront-hero-panel,
.catalog-hero,
.subcategory-section,
.storefront-empty-state,
.storefront-cta,
.storefront-wallet-panel,
.order-detail-shell,
.product-detail-shell,
.info-page-shell,
.info-page-card,
.contact-card {
    background: var(--app-surface);
    border: 1px solid var(--app-line);
    border-radius: var(--app-radius-lg);
    box-shadow: var(--app-shadow);
}

.app-page-header,
.catalog-hero,
.product-detail-shell,
.order-detail-shell,
.storefront-wallet-hero,
.auth-panel,
.info-page-shell {
    padding: 1.25rem;
}

.app-page-header {
    display: grid;
    gap: 1rem;
    margin-bottom: 1rem;
}

.app-page-header__eyebrow,
.storefront-kicker,
.section-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    width: fit-content;
    min-height: 30px;
    padding: 0.35rem 0.7rem;
    border-radius: 999px;
    background: var(--app-accent-soft);
    color: var(--app-accent);
    font-size: 0.76rem;
    font-weight: 800;
}

.app-page-header__title,
.storefront-display,
.storefront-section__title,
.product-toolbar-title,
.section-title,
.info-page-title,
.contact-title {
    margin: 0;
    color: var(--app-ink);
    font-family: var(--font-display);
    font-size: clamp(1.55rem, 3vw, 2.35rem);
    line-height: 1.15;
}

.app-page-header__subtitle,
.storefront-lead,
.storefront-section__subtitle,
.catalog-hero__summary,
.section-subtitle,
.info-page-intro,
.contact-subtitle,
.text-muted {
    color: var(--app-muted) !important;
}

.app-page-header__actions,
.storefront-cta__actions,
.catalog-hero__actions,
.storefront-hero-actions,
.subcategory-section-actions,
.topup-action-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.app-section {
    margin-top: 1rem;
}

.app-section__head,
.storefront-section__header,
.order-detail-items-header,
.subcategory-section-head,
.section-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 0.85rem;
    margin-bottom: 0.9rem;
}

.app-chip-row,
.catalog-chip-row {
    display: flex;
    gap: 0.65rem;
    overflow-x: auto;
    padding-bottom: 0.25rem;
    scrollbar-width: none;
}

.app-chip-row::-webkit-scrollbar,
.catalog-chip-row::-webkit-scrollbar {
    display: none;
}

.app-chip,
.catalog-chip {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    min-height: 42px;
    padding: 0.65rem 0.9rem;
    border-radius: 999px;
    border: 1px solid var(--app-line);
    background: var(--app-surface-soft);
    color: var(--app-ink);
    font-weight: 700;
}

.app-chip.is-active,
.catalog-chip.is-active {
    background: var(--app-accent-soft);
    border-color: rgba(15, 118, 110, 0.18);
    color: var(--app-accent);
}

.app-search,
.storefront-search {
    display: flex;
    gap: 0.75rem;
    width: 100%;
}

.app-search .form-control,
.storefront-search .form-control,
.auth-panel .form-control,
.topup-section .form-control,
.topup-section .form-select,
.profile-card .form-input,
.filter-select {
    min-height: 52px;
    border-radius: 16px;
    border: 1px solid var(--app-line);
    background: #fff;
    box-shadow: none;
}

.app-search .btn,
.storefront-search .btn,
.topup-action-bar .btn,
.auth-panel .btn,
.store-product-card__button,
.product-detail-submit {
    min-height: 52px;
    border-radius: 16px;
    font-weight: 800;
}

.btn {
    border-radius: 14px;
}

.btn-primary {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    border-color: #047857;
}

.btn-outline,
.btn-outline-primary,
.btn-outline-secondary,
.btn-outline-light,
.btn-outline-danger {
    background: #fff;
}

.storefront-page {
    background: transparent;
    padding: 0.25rem 0 1.5rem;
}

.catalog-hero {
    margin-bottom: 1rem;
}

.catalog-hero__top {
    display: grid;
    gap: 0.85rem;
    align-items: start;
    margin-bottom: 0.9rem;
}

.storefront-layout {
    display: block;
}

.catalog-sidebar {
    display: none;
}

.storefront-section,
.store-category-shelf,
.subcategory-section,
.pending-topups-section,
.transactions-card,
.filter-card,
.topup-flow-card,
.profile-card,
.card.transactions-card,
.card.filter-card,
.card {
    margin-top: 1rem;
}

.products-grid.storefront-products-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.9rem;
}

.store-product-card {
    border-radius: 20px;
    box-shadow: var(--app-shadow-soft);
}

.store-product-card__media {
    min-height: 168px;
}

.store-product-card__body {
    padding: 0.95rem;
    gap: 0.7rem;
}

.store-product-card__title {
    min-height: auto;
    font-size: 0.98rem;
    line-height: 1.45;
}

.store-product-card .card-price {
    font-size: 1rem;
}

.store-product-card__signal,
.store-product-card__secondary-price,
.store-product-card__meta {
    font-size: 0.78rem;
}

.subcategories-grid {
    grid-template-columns: 1fr;
    gap: 0.75rem;
}

.subcategory-card {
    padding: 0.9rem;
}

.product-detail-breadcrumb {
    margin-bottom: 1rem;
}

.product-detail-grid {
    display: grid;
    gap: 1rem;
}

.product-detail-gallery-notes,
.product-detail-trust-rail {
    display: none;
}

.product-detail-header {
    display: grid;
    gap: 0.5rem;
}

.product-detail-description {
    font-size: 0.98rem;
}

.product-detail-purchase-panel {
    margin-top: 1rem;
}

.product-detail-summary-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.75rem;
}

.storefront-wallet-hero .storefront-section__title,
.order-detail-shell .storefront-section__title {
    font-size: clamp(1.45rem, 2.6vw, 2rem);
}

.wallet-stats-grid,
.storefront-wallet-grid,
.profile-grid,
.contact-grid,
.info-page-grid,
.order-detail-summary-grid {
    display: grid;
    gap: 1rem;
}

.wallet-stats-grid,
.storefront-wallet-grid,
.profile-grid {
    grid-template-columns: 1fr;
}

.wallet-balance-card,
.pending-topups-section,
.profile-card,
.transaction-item,
.topup-item,
.order-item,
.order-history-card,
.topup-history-card,
.wallet-record-card {
    background: #fff;
    border: 1px solid var(--app-line);
    border-radius: 20px;
    box-shadow: var(--app-shadow-soft);
}

.pending-topups-section,
.profile-card,
.order-history-card,
.topup-history-card,
.wallet-record-card {
    padding: 1rem;
}

.profile-card--full {
    grid-column: 1 / -1;
}

.profile-card-header {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    margin-bottom: 0.9rem;
    color: var(--app-ink);
}

.profile-card-header i {
    color: var(--app-accent);
}

.info-list {
    display: grid;
    gap: 0.8rem;
}

.info-item {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: center;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--app-line);
}

.info-item:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}

.info-item .label {
    color: var(--app-muted);
    font-size: 0.9rem;
}

.info-item .value {
    color: var(--app-ink);
    font-weight: 700;
    text-align: left;
}

.profile-currency-stack,
.password-form,
.topup-intent-copy {
    display: grid;
    gap: 0.85rem;
}

.profile-password-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
}

.form-help {
    margin-top: 0.35rem;
    font-size: 0.85rem;
    color: var(--app-muted);
}

.form-help ul,
.form-help .password-help-list {
    margin: 0.35rem 0 0;
    padding-inline-start: 1.1rem;
}

.form-error {
    margin-top: 0.35rem;
    font-size: 0.84rem;
    color: #b91c1c;
}

.exchange-rate-status--inline {
    min-width: 0;
}

.transactions-list,
.topups-list,
.order-history-list,
.wallet-records-list {
    display: grid;
    gap: 0.85rem;
}

.transaction-item,
.topup-item,
.order-item {
    padding: 1rem;
}

.topup-item,
.transaction-item,
.order-item {
    border-bottom: 0 !important;
}

.topup-item:hover,
.transaction-item:hover {
    background: #fff;
}

.topup-main,
.topup-meta,
.tx-meta,
.order-history-card__meta,
.order-history-card__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 0.75rem;
}

.order-history-card__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
}

.order-history-card__title,
.topup-number,
.item-name,
.tx-description {
    color: var(--app-ink);
    font-weight: 800;
}

.order-history-card__meta,
.order-item-meta,
.tx-date,
.tx-ref,
.topup-date,
.topup-method,
.order-detail-summary-label,
.balance-label,
.stat-label {
    color: var(--app-muted);
}

.order-status-pill,
.topup-status-pill,
.item-status,
.order-status-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: fit-content;
    min-height: 34px;
    padding: 0.35rem 0.8rem;
    border-radius: 999px;
    font-weight: 800;
    font-size: 0.8rem;
    border: 1px solid transparent;
}

.status-pending,
.status-processing,
.order-status-badge.status-pending,
.order-status-badge.status-processing,
.item-status.status-pending {
    background: #fff7ed;
    color: #b45309;
    border-color: #fed7aa;
}

.status-completed,
.status-delivered,
.status-refunded,
.order-status-badge.status-completed,
.order-status-badge.status-refunded,
.item-status.status-delivered {
    background: #ecfdf5;
    color: #047857;
    border-color: #a7f3d0;
}

.status-failed,
.order-status-badge.status-failed,
.item-status.status-failed {
    background: #fef2f2;
    color: #b91c1c;
    border-color: #fecaca;
}

.order-detail-summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.order-detail-summary-card {
    padding: 0.95rem;
    border-radius: 18px;
    background: var(--app-surface-soft);
    border: 1px solid var(--app-line);
}

.order-items {
    display: grid;
    gap: 0.9rem;
}

.temp-number-panel {
    margin-top: 0.9rem;
    padding: 0.9rem;
    border-radius: 18px;
    border: 1px solid var(--app-line);
    background: #f8fafc;
}

.order-detail-state-message {
    margin-top: 1rem;
    border-radius: 18px;
    padding: 0.95rem 1rem;
    font-weight: 700;
    border: 1px solid transparent;
}

.order-detail-state-message--info {
    background: #eff6ff;
    border-color: #bfdbfe;
    color: #1d4ed8;
}

.order-detail-state-message--warning {
    background: #fff7ed;
    border-color: #fdba74;
    color: #b45309;
}

.order-detail-state-message--success {
    background: #ecfdf5;
    border-color: #86efac;
    color: #047857;
}

.auth-page {
    padding: 1rem 0 2rem;
}

.auth-panel {
    max-width: 520px;
    margin: 0 auto;
}

.auth-panel__header {
    text-align: center;
    margin-bottom: 1.25rem;
}

.auth-divider {
    display: flex;
    align-items: center;
    text-align: center;
    color: var(--app-muted);
    margin: 1rem 0 1.25rem;
}

.auth-divider::before,
.auth-divider::after {
    content: "";
    flex: 1;
    border-bottom: 1px solid var(--app-line);
}

.auth-divider span {
    padding: 0 1rem;
    font-size: 0.84rem;
}

.auth-shell-page .site-footer,
.auth-shell-page .mobile-bottom-nav {
    display: none !important;
}

.auth-shell-page .page-content {
    padding-bottom: 2rem;
}

.info-page-shell,
.contact-card,
.info-page-card {
    padding: 1.25rem;
}

.topup-flow-page,
.profile-section,
.wallet-section {
    padding: 0.25rem 0 1.5rem;
}

.topup-flow-page .row,
.topup-flow-page .col-lg-4,
.topup-flow-page .col-lg-8 {
    margin: 0;
}

.topup-flow-page .card,
.topup-flow-sidebar .topup-flow-card {
    border-radius: 22px;
    border: 1px solid var(--app-line);
    box-shadow: var(--app-shadow);
}

.topup-flow-page .card-header {
    background: #fff !important;
    color: var(--app-ink) !important;
    border-bottom: 1px solid var(--app-line);
}

.topup-flow-page .card-header p {
    color: var(--app-muted) !important;
}

.topup-intent-banner,
.topup-quick-amount,
.payment-option label,
.stat-chip {
    border-radius: 18px;
    border-color: var(--app-line) !important;
    box-shadow: none !important;
}

.site-footer {
    background: #0f172a;
    padding: 2.5rem 0 2rem;
}

.footer-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.5rem;
}

.footer-brand p,
.footer-links a {
    color: #94a3b8;
}

.footer-bottom {
    justify-content: center;
    color: #64748b;
}

.mobile-bottom-nav {
    display: flex;
    align-items: center;
    justify-content: space-around;
    height: 78px;
    background: rgba(255, 255, 255, 0.92);
    border-top: 1px solid rgba(15, 23, 42, 0.06);
    box-shadow: 0 -12px 30px rgba(15, 23, 42, 0.1);
    padding-bottom: env(safe-area-inset-bottom);
    backdrop-filter: blur(18px) saturate(180%);
    -webkit-backdrop-filter: blur(18px) saturate(180%);
}

.mobile-bottom-nav .nav-item {
    position: relative;
    flex: 1;
    min-width: 0;
    min-height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #64748b;
    gap: 0.18rem;
    text-decoration: none;
    transition: transform 0.18s ease, color 0.18s ease;
}

.mobile-bottom-nav .nav-item__icon {
    width: 2rem;
    height: 2rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    transition: background 0.18s ease, color 0.18s ease;
}

.mobile-bottom-nav .nav-item i {
    font-size: 1.15rem;
    margin-bottom: 0;
}

.mobile-bottom-nav .nav-item__label {
    font-size: 0.69rem;
    font-weight: 700;
    white-space: nowrap;
}

.mobile-bottom-nav .nav-item.active {
    color: #0f766e;
    font-weight: 800;
}

.mobile-bottom-nav .nav-item.active .nav-item__icon {
    background: rgba(15, 118, 110, 0.1);
}

.mobile-bottom-nav .nav-item:not(.nav-item--primary):active {
    transform: translateY(1px) scale(0.98);
}

.mobile-bottom-nav .nav-item--primary {
    margin-top: -10px;
    height: calc(100% - 10px);
    max-width: 96px;
    border-radius: 24px;
    background: #fff;
    border: 1px solid rgba(15, 118, 110, 0.14);
    color: var(--app-accent);
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
}

.mobile-bottom-nav .nav-item--primary .nav-item__icon {
    background: rgba(15, 118, 110, 0.1);
}

.mobile-bottom-nav .nav-item--primary.active,
.mobile-bottom-nav .nav-item--primary:hover {
    background: linear-gradient(180deg, #14b8a6 0%, #0f766e 100%);
    border-color: #0f766e;
    color: #fff;
    box-shadow: 0 14px 32px rgba(15, 118, 110, 0.28);
}

.mobile-bottom-nav .nav-item--primary.active .nav-item__icon,
.mobile-bottom-nav .nav-item--primary:hover .nav-item__icon {
    background: transparent;
}

.mobile-bottom-nav .nav-item--primary:active {
    transform: translateY(1px) scale(0.98);
}

@media (max-width: 991px) {
    .header-top,
    .nav-links,
    .site-footer,
    .desktop-only,
    .product-detail-breadcrumb {
        display: none !important;
    }

    .header-content {
        justify-content: center;
    }

    .logo-text {
        align-items: center;
        text-align: center;
    }

    .logo-tagline {
        display: none;
    }

    .page-content {
        padding-top: 0.75rem;
    }

    .container {
        padding-inline: 0.9rem;
    }

    .app-page-header,
    .catalog-hero,
    .product-detail-shell,
    .order-detail-shell,
    .storefront-wallet-hero,
    .auth-panel,
    .info-page-shell,
    .topup-flow-page .card-body,
    .topup-flow-page .card-header {
        padding: 1rem;
    }

    .app-page-header__actions,
    .storefront-cta__actions,
    .catalog-hero__actions,
    .storefront-hero-actions,
    .subcategory-section-actions,
    .topup-action-bar,
    .storefront-search {
        flex-direction: column;
    }

    .app-page-header__actions .btn,
    .storefront-cta__actions .btn,
    .storefront-search .btn,
    .topup-action-bar .btn,
    .topup-action-bar a {
        width: 100%;
    }

    .wallet-quick-stats,
    .storefront-stat-grid,
    .wallet-stats-grid,
    .order-detail-summary-grid,
    .info-page-grid,
    .contact-grid,
    .subcategories-grid {
        grid-template-columns: 1fr !important;
    }

    .topup-item,
    .transaction-item,
    .order-item {
        display: grid;
        gap: 0.75rem;
    }

    .tx-right {
        align-items: flex-start !important;
    }

    .topup-actions,
    .temp-number-actions {
        width: 100%;
        display: grid;
        gap: 0.6rem;
    }

    .topup-actions .btn,
    .temp-number-actions .btn,
    .temp-number-actions form,
    .temp-number-actions form button {
        width: 100%;
    }

    .profile-card[style],
    .password-form .form-row[style] {
        grid-column: auto !important;
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: 1rem !important;
    }

    .profile-password-grid,
    .order-history-card__head,
    .info-item {
        display: grid;
        grid-template-columns: 1fr;
        align-items: flex-start;
    }
}

@media (min-width: 992px) {
    .page-content {
        padding-bottom: 2.5rem;
    }

    .mobile-bottom-nav {
        display: none;
    }

    .storefront-layout {
        display: grid;
        grid-template-columns: 280px minmax(0, 1fr);
        gap: 1.25rem;
    }

    .catalog-sidebar {
        display: block;
        position: sticky;
        top: 110px;
    }

    .app-search,
    .storefront-search {
        flex-direction: row;
    }

    .products-grid.storefront-products-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .storefront-wallet-grid {
        grid-template-columns: minmax(0, 1.6fr) minmax(300px, 0.8fr);
        align-items: start;
    }

    .wallet-stats-grid {
        grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
        align-items: stretch;
    }

    .profile-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .order-detail-summary-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .auth-shell-page .site-header {
        position: static;
        box-shadow: none;
        background: transparent;
        border-bottom: 0;
    }

    .auth-shell-page .header-main {
        padding-bottom: 0;
    }
}
