:root {
        --store-gradient: linear-gradient(135deg, var(--store-button-start) 0%, var(--store-button-end) 100%);
        --store-gradient-hover: linear-gradient(135deg, var(--store-primary-dark) 0%, var(--store-button-start) 52%, var(--store-button-end) 100%);

        --color-primary: var(--store-primary);
        --color-primary-light: var(--store-primary-light);
        --color-primary-dark: var(--store-primary-dark);
        --color-primary-deep: var(--store-primary-dark);
        --color-primary-soft: var(--store-surface-soft);
        --color-accent: var(--store-accent);
        --bg-body: var(--store-bg);
        --bg-card: var(--store-surface);
        --bg-white: var(--store-surface);
        --bg-soft: var(--store-surface-soft);
        --bg-soft-2: color-mix(in srgb, var(--store-primary) 9%, var(--store-bg));
        --text-dark: var(--store-text);
        --text-medium: var(--store-text-soft);
        --text-muted: var(--store-muted);
        --text-light: var(--store-muted);
        --border-light: var(--store-border);
        --border-medium: color-mix(in srgb, var(--store-border) 78%, var(--store-text));
        --border-soft: var(--store-border);
        --shadow-sm: 0 8px 24px color-mix(in srgb, var(--store-text) 7%, transparent);
        --shadow-md: 0 18px 50px color-mix(in srgb, var(--store-primary) 11%, transparent);
        --shadow-lg: 0 25px 60px color-mix(in srgb, var(--store-primary) 16%, transparent);

        --vx-primary: var(--store-primary);
        --vx-primary-dark: var(--store-primary-dark);
        --vx-secondary: var(--store-accent);
        --vx-bg: var(--store-bg);
        --vx-card: var(--store-surface);
        --vx-card-soft: var(--store-surface-soft);
        --vx-text: var(--store-text);
        --vx-text-soft: var(--store-text-soft);
        --vx-text-muted: var(--store-muted);
        --vx-border: var(--store-border);
        --vx-border-soft: var(--store-border);
        --vx-shadow: 0 22px 46px color-mix(in srgb, var(--store-primary) 11%, transparent);
        --vx-shadow-soft: 0 10px 24px color-mix(in srgb, var(--store-primary) 8%, transparent);
    }

    html[data-store-theme] body {
        background:
            radial-gradient(circle at 92% 4%, color-mix(in srgb, var(--store-primary) 12%, transparent), transparent 28%),
            radial-gradient(circle at 6% 96%, color-mix(in srgb, var(--store-accent) 10%, transparent), transparent 26%),
            var(--store-bg) !important;
        color: var(--store-text);
    }

    html[data-store-theme] .store-footer {
        color: var(--store-muted);
    }

    html[data-store-theme] .store-footer a {
        color: var(--store-primary) !important;
    }

    html[data-store-theme] .soft-bg {
        background:
            radial-gradient(circle at 10% 15%, color-mix(in srgb, var(--store-primary) 9%, transparent) 0%, transparent 25%),
            radial-gradient(circle at 90% 18%, color-mix(in srgb, var(--store-accent) 10%, transparent) 0%, transparent 22%),
            radial-gradient(circle at 80% 85%, color-mix(in srgb, var(--store-primary) 7%, transparent) 0%, transparent 22%);
    }

    html[data-store-theme] .main-nav {
        background: linear-gradient(118deg, var(--store-nav-start) 0%, var(--store-nav-end) 100%) !important;
        border-color: color-mix(in srgb, var(--store-on-primary) 24%, transparent) !important;
        box-shadow: 0 14px 40px color-mix(in srgb, var(--store-nav-start) 28%, transparent) !important;
        color: var(--store-on-primary) !important;
    }

    html[data-store-theme] .main-nav .brand-info h1,
    html[data-store-theme] .main-nav .brand-info span,
    html[data-store-theme] .main-nav .nav-title,
    html[data-store-theme] .main-nav a,
    html[data-store-theme] .main-nav i {
        color: var(--store-on-primary) !important;
    }

    html[data-store-theme] .main-nav :is(.lookup-btn, .back-btn, .ticket-back-btn) {
        background: color-mix(in srgb, var(--store-on-primary) 14%, transparent) !important;
        border-color: color-mix(in srgb, var(--store-on-primary) 38%, transparent) !important;
        color: var(--store-on-primary) !important;
        box-shadow: none !important;
    }

    html[data-store-theme] .main-nav :is(.lookup-btn, .back-btn, .ticket-back-btn):hover {
        background: color-mix(in srgb, var(--store-on-primary) 24%, transparent) !important;
        transform: translateY(-1px);
    }

    html[data-store-theme] .category-chip {
        background: var(--store-surface);
        border-color: var(--store-border);
    }

    /* Category cards: one coherent palette with varied theme gradients. */
    html[data-store-theme] .product-card {
        background: var(--store-surface) !important;
        border-color: var(--store-border) !important;
        box-shadow: 0 16px 38px color-mix(in srgb, var(--store-text) 8%, transparent) !important;
    }

    html[data-store-theme] .product-card:hover {
        border-color: color-mix(in srgb, var(--store-primary) 55%, var(--store-border)) !important;
        box-shadow: 0 24px 54px color-mix(in srgb, var(--store-primary) 18%, transparent) !important;
    }

    html[data-store-theme] .products-wrap .row > div:nth-child(6n + 1) .price-box {
        background: linear-gradient(135deg, var(--store-button-start), var(--store-button-end)) !important;
    }

    html[data-store-theme] .products-wrap .row > div:nth-child(6n + 2) .price-box {
        background: linear-gradient(145deg, var(--store-nav-start), var(--store-button-start)) !important;
    }

    html[data-store-theme] .products-wrap .row > div:nth-child(6n + 3) .price-box {
        background: linear-gradient(120deg, var(--store-nav-start), var(--store-accent)) !important;
    }

    html[data-store-theme] .products-wrap .row > div:nth-child(6n + 4) .price-box {
        background: linear-gradient(150deg, var(--store-accent), var(--store-primary-dark)) !important;
    }

    html[data-store-theme] .products-wrap .row > div:nth-child(6n + 5) .price-box {
        background: linear-gradient(125deg, var(--store-button-end), var(--store-button-start)) !important;
    }

    html[data-store-theme] .products-wrap .row > div:nth-child(6n) .price-box {
        background: linear-gradient(140deg, var(--store-nav-end), var(--store-primary)) !important;
    }

    html[data-store-theme] .price-box {
        color: var(--store-on-primary) !important;
        box-shadow: 0 14px 28px color-mix(in srgb, var(--store-primary) 24%, transparent) !important;
    }

    /* Primary actions. Payment-provider cards are deliberately not included. */
    html[data-store-theme] :is(
        .lookup-btn,
        .go-mobile-btn,
        .pay-btn,
        .modal-btn.primary,
        .modal-link-btn,
        .order-action-btn.primary,
        .popup-btn,
        .submit-btn,
        .action-btn.ticket,
        .support-popup-btn,
        .success-btn,
        .btn-refresh,
        .btn-hotspot,
        .copy-reference-btn,
        .delivered-login-btn,
        .support-fab,
        .action-btn.resolve,
        .btn-primary,
        .btn-success,
        .btn-info,
        .btn-warning,
        .btn-danger
    ) {
        background: var(--store-gradient) !important;
        --store-on-primary: var(--store-on-button);
        border-color: color-mix(in srgb, var(--store-button-start) 82%, #000) !important;
        color: var(--store-on-primary) !important;
        box-shadow: 0 12px 28px color-mix(in srgb, var(--store-button-start) 25%, transparent) !important;
    }

    html[data-store-theme] :is(
        .lookup-btn,
        .go-mobile-btn,
        .pay-btn,
        .modal-btn.primary,
        .modal-link-btn,
        .order-action-btn.primary,
        .popup-btn,
        .submit-btn,
        .action-btn.ticket,
        .support-popup-btn,
        .success-btn,
        .btn-refresh,
        .btn-hotspot,
        .copy-reference-btn,
        .delivered-login-btn,
        .support-fab,
        .action-btn.resolve,
        .btn-primary,
        .btn-success,
        .btn-info,
        .btn-warning,
        .btn-danger
    ):hover:not(:disabled) {
        background: var(--store-gradient-hover) !important;
        color: var(--store-on-primary) !important;
        box-shadow: 0 16px 34px color-mix(in srgb, var(--store-button-start) 34%, transparent) !important;
        transform: translateY(-2px);
    }

    /* Secondary and compact actions use a softer version of the same theme. */
    html[data-store-theme] :is(
        .qty-btn,
        .cart-action-btn,
        .modal-btn.secondary,
        .order-action-btn.secondary,
        .order-action-btn.warning,
        .order-action-btn.success,
        .back-btn,
        .ticket-back-btn,
        .choice-btn,
        .success-btn-secondary,
        .pay-btn-light
    ) {
        background: color-mix(in srgb, var(--store-primary) 10%, var(--store-surface)) !important;
        border-color: color-mix(in srgb, var(--store-primary) 38%, var(--store-border)) !important;
        color: var(--store-primary-dark) !important;
        box-shadow: none !important;
    }

    html[data-store-theme] :is(
        .qty-btn,
        .cart-action-btn,
        .modal-btn.secondary,
        .order-action-btn.secondary,
        .order-action-btn.warning,
        .order-action-btn.success,
        .back-btn,
        .ticket-back-btn,
        .choice-btn,
        .success-btn-secondary,
        .pay-btn-light
    ):hover:not(:disabled),
    html[data-store-theme] .choice-btn.is-active {
        background: color-mix(in srgb, var(--store-primary) 19%, var(--store-surface)) !important;
        border-color: var(--store-primary) !important;
        color: var(--store-primary-dark) !important;
        transform: translateY(-1px);
    }

    html[data-store-theme] :is(button, .btn, [class$="-btn"]):disabled {
        opacity: .52;
        box-shadow: none !important;
        transform: none !important;
    }

    /* Consistent card surfaces across the customer journey. */
    html[data-store-theme] :is(
        .summary-card,
        .payment-checkout-card,
        .lookup-card,
        .result-card,
        .results-card,
        .order-card,
        .loyalty-card,
        .recent-orders-card,
        .delivery-card,
        .delivered-card-item,
        .content-card,
        .timeline-card,
        .side-card,
        .chat-card,
        .solution-card,
        .support-popup-card,
        .maintenance-card,
        .failed-card,
        .success-card,
        .pay-card,
        .popup-card,
        .modal-content
    ) {
        background-color: var(--store-surface) !important;
        border-color: var(--store-border) !important;
        color: var(--store-text);
    }

    html[data-store-theme] :is(
        .cart-empty,
        .info-box,
        .pay-hero,
        .otp-box,
        .phone-input,
        .chat-body,
        .details-grid,
        .qty-wrap,
        .qty-input
    ) {
        background: var(--store-surface-soft) !important;
        border-color: var(--store-border) !important;
        color: var(--store-text) !important;
    }

    html[data-store-theme] :is(.summary-head h3, .cart-item-name, .info-box strong, .pay-title, .input-label) {
        color: var(--store-text) !important;
    }

    html[data-store-theme] .detail-item {
        border-color: var(--store-border) !important;
    }

    html[data-store-theme] .detail-item:hover {
        background: color-mix(in srgb, var(--store-primary) 7%, var(--store-surface-soft)) !important;
    }

    html[data-store-theme] .detail-item :is(label, label i) {
        color: var(--store-primary) !important;
    }

    html[data-store-theme] .detail-item value,
    html[data-store-theme] .qty-input {
        color: var(--store-text) !important;
    }

    html[data-store-theme] :is(.phone-input, .form-control):focus {
        border-color: var(--store-primary) !important;
        box-shadow: 0 0 0 4px color-mix(in srgb, var(--store-primary) 16%, transparent) !important;
    }

    html[data-store-theme] :is(.summary-card, .lookup-card, .order-card, .content-card, .chat-card, .pay-card)::before {
        background: linear-gradient(90deg, var(--store-button-start), var(--store-button-end)) !important;
    }

    /* Keep official provider identities untouched. */
    html[data-store-theme] .payment-method-card,
    html[data-store-theme] .payment-method-card--jawwal_pay,
    html[data-store-theme] .payment-method-card--palpay,
    html[data-store-theme] .payment-method-indicator,
    html[data-store-theme] .payment-method-name,
    html[data-store-theme] .payment-method-status {
        forced-color-adjust: none;
    }

    html[data-store-dark="1"] .form-control,
    html[data-store-dark="1"] .custom-select,
    html[data-store-dark="1"] select,
    html[data-store-dark="1"] textarea {
        background-color: var(--store-surface-soft);
        border-color: var(--store-border);
        color: var(--store-text);
    }

    html[data-store-dark="1"] :is(
        .product-card,
        .summary-card,
        .payment-checkout-card,
        .lookup-card,
        .result-card,
        .results-card,
        .order-card,
        .loyalty-card,
        .recent-orders-card,
        .delivery-card,
        .delivered-card-item,
        .content-card,
        .timeline-card,
        .side-card,
        .chat-card,
        .solution-card,
        .support-popup-card,
        .maintenance-card,
        .failed-card,
        .success-card,
        .pay-card,
        .popup-card,
        .modal-content,
        .bubble.bot
    ) {
        background: var(--store-surface) !important;
        border-color: var(--store-border) !important;
        color: var(--store-text) !important;
        box-shadow: 0 18px 44px rgba(0, 0, 0, .24) !important;
    }

    html[data-store-dark="1"] :is(.cart-empty, .info-box, .pay-hero, .otp-box, .phone-input, .details-grid, .qty-wrap, .qty-input) {
        background: var(--store-surface-soft) !important;
        border-color: var(--store-border) !important;
        color: var(--store-text) !important;
    }

    /* Payment confirmation surfaces must not retain their light-page gradients. */
    html[data-store-dark="1"] :is(.pay-section, .countdown-box) {
        background: var(--store-surface-soft) !important;
        background-color: var(--store-surface-soft) !important;
        border-color: var(--store-border) !important;
        color: var(--store-text) !important;
        box-shadow: 0 10px 28px rgba(0, 0, 0, .16) !important;
    }

    html[data-store-dark="1"] :is(.pay-section, .countdown-box) :is(label, span, small) {
        color: var(--store-muted) !important;
    }

    html[data-store-dark="1"] .countdown-box strong {
        color: var(--store-primary-light) !important;
    }

    html[data-store-dark="1"] .pay-section .otp-box {
        background: var(--store-surface) !important;
        border-color: var(--store-border) !important;
    }

    html[data-store-dark="1"] .pay-section .otp-field.is-focused .otp-box {
        background: var(--store-surface) !important;
        border-color: var(--store-primary) !important;
    }

    html[data-store-dark="1"] :is(.alert-success, .pay-status.success) {
        background: color-mix(in srgb, #16a34a 18%, var(--store-surface)) !important;
        border-color: color-mix(in srgb, #22c55e 38%, var(--store-border)) !important;
        color: #4ade80 !important;
    }

    html[data-store-dark="1"] :is(.alert-danger, .pay-status.expired) {
        background: color-mix(in srgb, #dc2626 17%, var(--store-surface)) !important;
        border-color: color-mix(in srgb, #ef4444 38%, var(--store-border)) !important;
        color: #f87171 !important;
    }

    /* Full dark-mode surface audit across every storefront page. */
    html[data-store-dark="1"] :is(
        .failed-info-box,
        .network-box,
        .lookup-card,
        .result-card,
        .results-card,
        .order-info-grid,
        .order-info-box,
        .recent-orders-card,
        .recent-order-item,
        .delivered-card-item,
        .popup-card,
        .lookup-form-wrap,
        .otp-guide-image-wrap,
        .cards-table-wrap,
        .order-info,
        .success-card,
        .success-info-box,
        .loyalty-preview-box,
        .decision-panel,
        .empty-state,
        .support-popup-card,
        .ticket-header,
        .side-card,
        .content-card,
        .side-info-box,
        .detail-box,
        .message-item,
        .reply-box,
        .card:not(.payment-method-card)
    ) {
        background: var(--store-surface) !important;
        background-color: var(--store-surface) !important;
        border-color: var(--store-border) !important;
        color: var(--store-text) !important;
    }

    html[data-store-dark="1"] :is(
        .failed-back-link,
        .failed-brand-chip,
        .lookup-brand-chip,
        .lookup-back-link,
        .order-back-link,
        .order-brand-chip,
        .pay-back-link,
        .pay-brand-chip,
        .success-brand-chip,
        .ticket-chip,
        .meta-pill,
        .lookup-logo-box,
        .order-logo-box,
        .ticket-logo-box,
        .lookup-note,
        .quick-result,
        .popup-loyalty-note,
        .popup-tier-progress,
        .success-note,
        .loyalty-preview,
        .chat-card-head,
        .side-head,
        .content-head,
        .help-note,
        .timeline-card,
        .message-item.customer,
        .message-item.staff,
        .support-popup-icon
    ) {
        background: var(--store-surface-soft) !important;
        background-color: var(--store-surface-soft) !important;
        border-color: var(--store-border) !important;
        color: var(--store-text) !important;
    }

    html[data-store-dark="1"] :is(
        .failed-info-box,
        .network-box,
        .lookup-card,
        .result-card,
        .results-card,
        .order-info-grid,
        .order-info-box,
        .recent-order-item,
        .delivered-card-item,
        .popup-card,
        .lookup-form-wrap,
        .cards-table-wrap,
        .success-info-box,
        .loyalty-preview-box,
        .decision-panel,
        .ticket-header,
        .side-info-box,
        .detail-box,
        .message-item,
        .reply-box
    ) :is(h1, h2, h3, h4, h5, h6, strong, value, label, p, span) {
        color: inherit;
    }

    html[data-store-dark="1"] :is(
        .lookup-logo-box,
        .order-logo-box,
        .ticket-logo-box,
        .otp-guide-image-wrap
    ) img {
        border-radius: inherit;
    }

    html[data-store-dark="1"] :is(
        .decision-panel textarea,
        .reply-box textarea,
        .qty-input,
        .otp-box
    ) {
        background: var(--store-surface-soft) !important;
        border-color: var(--store-border) !important;
        color: var(--store-text) !important;
    }

    html[data-store-dark="1"] .otp-field.is-focused .otp-box {
        background: var(--store-surface-soft) !important;
        border-color: var(--store-primary) !important;
    }

    html[data-store-dark="1"] :is(.cards-table, .table) {
        color: var(--store-text) !important;
    }

    html[data-store-dark="1"] :is(.cards-table, .table) :is(th, td) {
        border-color: var(--store-border) !important;
    }

    html[data-store-dark="1"] :is(.cards-table, .table) tbody tr:hover {
        background: color-mix(in srgb, var(--store-primary) 8%, var(--store-surface)) !important;
    }

    html[data-store-dark="1"] :is(.info-icon, .delivered-card-number) {
        background: color-mix(in srgb, var(--store-primary) 17%, var(--store-surface)) !important;
        border-color: color-mix(in srgb, var(--store-primary) 35%, var(--store-border)) !important;
        color: var(--store-primary-light) !important;
    }

    html[data-store-dark="1"] .transaction-reference-note {
        background: color-mix(in srgb, #f59e0b 14%, var(--store-surface)) !important;
        border-color: color-mix(in srgb, #f59e0b 35%, var(--store-border)) !important;
        color: #fbbf24 !important;
    }

    html[data-store-dark="1"] :is(.success-status, .payment-paid, .status-paid, .status-resolved) {
        background: color-mix(in srgb, #16a34a 18%, var(--store-surface)) !important;
        border-color: color-mix(in srgb, #22c55e 38%, var(--store-border)) !important;
        color: #4ade80 !important;
    }

    html[data-store-dark="1"] :is(.payment-pending, .status-pending, .maintenance-card .status-badge) {
        background: color-mix(in srgb, #d97706 18%, var(--store-surface)) !important;
        border-color: color-mix(in srgb, #f59e0b 38%, var(--store-border)) !important;
        color: #fbbf24 !important;
    }

    html[data-store-dark="1"] :is(.payment-failed, .payment-cancelled, .status-failed, .status-closed) {
        background: color-mix(in srgb, #dc2626 17%, var(--store-surface)) !important;
        border-color: color-mix(in srgb, #ef4444 38%, var(--store-border)) !important;
        color: #f87171 !important;
    }

    html[data-store-dark="1"] .status-open {
        background: color-mix(in srgb, var(--store-accent) 17%, var(--store-surface)) !important;
        border-color: color-mix(in srgb, var(--store-accent) 38%, var(--store-border)) !important;
        color: var(--store-primary-light) !important;
    }

    html[data-store-dark="1"] .payment-default {
        background: var(--store-surface-soft) !important;
        border-color: var(--store-border) !important;
        color: var(--store-muted) !important;
    }

    html[data-store-dark="1"] .popup-tier-step:not(.is-current) .popup-tier-dot {
        background: var(--store-surface-soft) !important;
        border-color: var(--store-border) !important;
    }

    html[data-store-dark="1"] :is(
        .chat-body,
        .delivered-card-field,
        .cards-table-wrap,
        .cards-table tbody td,
        .order-info-row,
        .detail-row,
        .info-row
    ) {
        background-color: var(--store-surface-soft) !important;
        border-color: var(--store-border) !important;
        color: var(--store-text) !important;
    }

    html[data-store-dark="1"] :is(
        .product-card,
        .summary-card,
        .lookup-card,
        .order-card,
        .content-card,
        .timeline-card,
        .chat-card,
        .pay-card,
        .modal-content
    ) :is(h1, h2, h3, h4, h5, h6, strong, .title) {
        color: var(--store-text);
    }

    html[data-store-dark="1"] :is(.text-muted, .input-label, .field-label),
    html[data-store-dark="1"] small:not(.payment-method-status) {
        color: var(--store-muted) !important;
    }

    html[data-store-dark="1"] .form-control::placeholder,
    html[data-store-dark="1"] textarea::placeholder {
        color: var(--store-muted);
    }
