/**
 * Nofnika storefront polish.
 *
 * Brand tokens match style.css (orange #ff6b00, ink #0f172a / #1A1A2E,
 * yellow #FFD600, violet #7B2FBE, paper #FAFBFF).
 *
 * The homepage composition is frozen. Rules below do not target
 * .nof-homepage-root, .nof-hero-modern, or the hero slider.
 */

.nof-sr-only {
    position: absolute !important;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ── Cart + checkout, both breakpoints ─────────────────────────── */
.nof-cart-v2,
.nof-co-v2 {
    --co-ink: #0f172a;
    --co-muted: #64748b;
    --co-line: #e8eef5;
    --co-soft: #f8fafc;
    --co-accent: #ff6b00;
    --co-accent-2: #f59e0b;
    direction: rtl;
    overflow-x: clip;
}

.nof-cart-v2 .shop_table,
.nof-co-v2 .shop_table {
    width: 100%;
}

.nof-cart-v2 .shop_table tbody tr.cart_item {
    display: grid !important;
    grid-template-columns: 88px minmax(0, 1.4fr) 168px minmax(110px, 0.7fr) 44px;
    gap: 12px 16px;
    align-items: center;
    padding: 16px !important;
    margin: 0 0 12px !important;
    background: #fff !important;
    border: 1px solid var(--co-line) !important;
    border-radius: 22px !important;
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.04) !important;
}

.nof-cart-v2 .shop_table td {
    display: block;
    min-width: 0;
    border: 0 !important;
    padding: 0 !important;
}

.nof-cart-v2 .product-name,
.nof-cart-v2 .product-thumbnail,
.nof-cart-v2 .product-quantity,
.nof-cart-v2 .product-subtotal,
.nof-cart-v2 .product-remove {
    width: auto;
}

.nof-cart-v2 .product-thumbnail {
    width: 88px;
    height: 88px;
    margin: 0;
    border-radius: 18px;
    background: #f8fafc;
}

.nof-cart-v2 .product-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.nof-cart-item-title,
.nof-cart-v2 .product-name a {
    color: var(--co-ink);
    font-weight: 800;
    line-height: 1.6;
    text-decoration: none;
}

.nof-cart-unit-price {
    display: block;
    margin-top: 4px;
    color: var(--co-muted);
    font-size: 0.82rem;
    font-weight: 600;
}

.nof-qty {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px;
    border-radius: 16px;
    background: #f8fafc;
    border: 1px solid var(--co-line);
}

.nof-qty-btn {
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 12px;
    background: #fff;
    color: var(--co-ink);
    font-size: 1.35rem;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
}

.nof-qty-btn:hover,
.nof-qty-btn:focus-visible {
    background: #fff7ed;
    color: var(--co-accent);
    outline: 2px solid var(--co-accent);
    outline-offset: 2px;
}

.nof-qty .quantity {
    display: flex;
}

.nof-qty input.qty {
    width: 52px !important;
    height: 44px !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
    text-align: center !important;
    font-weight: 800 !important;
    font-size: 1rem !important;
    color: var(--co-ink) !important;
    box-shadow: none !important;
}

.nof-qty input.qty::-webkit-outer-spin-button,
.nof-qty input.qty::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.nof-cart-v2 .product-subtotal {
    color: var(--co-accent) !important;
    font-weight: 900;
    text-align: left;
}

.nof-cart-v2 .product-remove {
    justify-self: end;
}

.nof-cart-v2 .product-remove .remove,
.nof-app-remove-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 14px;
    background: #fff1f2;
}

.nof-cart-v2 tr.actions-row,
.nof-cart-v2 td.actions {
    display: block !important;
    padding-top: 8px !important;
}

.nof-cart-update-btn {
    min-height: 48px;
    border-radius: 14px !important;
}

.nof-ws-cart-note {
    margin: 0 0 16px;
    padding: 12px 16px;
    border-radius: 16px;
    background: #fff7ed;
    color: #9a3412;
    border: 1px solid #ffedd5;
    font-weight: 700;
}

body.nof-cart-busy .nof-cart-v2 {
    cursor: progress;
}

.nof-co-error {
    margin: 0 0 14px;
    padding: 12px 14px;
    border-radius: 14px;
    background: #fff1f2;
    color: #9f1239;
    font-weight: 700;
}

.nof-co-v2 .nof-wizard-step:not(.active) {
    white-space: normal !important;
    clip-path: inset(50%);
}

.nof-co-v2 input.input-text,
.nof-co-v2 textarea,
.nof-co-v2 select,
.woocommerce-account input.input-text,
.woocommerce-account textarea,
.woocommerce-account select {
    min-height: 52px;
    border-radius: 14px;
    font-size: 1rem;
}

.nof-sp-price-regular,
.nof-shop-price-regular {
    display: block;
    color: #94a3b8;
    font-size: 0.92rem;
    font-weight: 700;
    text-decoration: line-through;
}

.nof-shop-card-price {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
}

/* ── Mobile app chrome, every page except the frozen homepage ── */
@media (max-width: 782px) {
    body:not(.home) {
        padding-bottom: calc(84px + env(safe-area-inset-bottom));
        background: #fafbff;
    }

    body:not(.home) .mobile-app-bottom-bar {
        height: calc(68px + env(safe-area-inset-bottom));
        padding-bottom: env(safe-area-inset-bottom);
        border-top: 1px solid rgba(15, 23, 42, 0.06);
        box-shadow: 0 -8px 30px rgba(15, 23, 42, 0.06);
    }

    body:not(.home) .mobile-app-bottom-bar .mab-item {
        min-width: 56px;
        min-height: 48px;
    }

    .nof-cart-v2 .shop_table thead {
        display: none !important;
    }

    .nof-cart-v2 .shop_table tbody tr.cart_item {
        grid-template-columns: 72px minmax(0, 1fr) 44px;
        grid-template-areas:
            "thumb name remove"
            "qty qty sub";
    }

    .nof-cart-v2 .product-thumbnail { grid-area: thumb; width: 72px; height: 72px; }
    .nof-cart-v2 .product-name { grid-area: name; }
    .nof-cart-v2 .product-remove { grid-area: remove; }
    .nof-cart-v2 .product-quantity { grid-area: qty; }
    .nof-cart-v2 .product-subtotal {
        grid-area: sub;
        text-align: left;
        align-self: center;
    }

    .nof-cart-layout,
    .nof-co-v2 .nof-wizard-step.active .nof-co-card {
        display: block;
    }

    .nof-cart-totals-card,
    .nof-co-card {
        margin-top: 16px;
    }

    .nof-step-fields,
    .nof-co-v2 .woocommerce-billing-fields__field-wrapper {
        display: block;
    }

    .nof-co-v2 .form-row,
    .nof-co-v2 .form-row-first,
    .nof-co-v2 .form-row-last {
        width: 100% !important;
        float: none !important;
    }

    .nof-app-sticky-buy-bar {
        bottom: calc(68px + env(safe-area-inset-bottom));
        z-index: 40;
    }

    .nof-sheet-open {
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
}

@media (min-width: 783px) {
    .nof-sheet-open {
        display: none;
    }

    .nof-cart-v2,
    .nof-checkout-wrapper.nof-co-v2 {
        max-width: 1120px;
        margin: 28px auto 64px;
        padding: 0 20px 48px;
    }

    .nof-cart-layout {
        display: grid;
        grid-template-columns: minmax(0, 1fr) 340px;
        gap: 24px;
        align-items: start;
    }

    .nof-cart-totals-card {
        position: sticky;
        top: 96px;
    }

    .nof-app-sp-topbar,
    .nof-cart-v2 .nof-app-sticky-buy-bar {
        display: none;
    }
}

/* ── Shop cards, account, search, 404 ──────────────────────────── */
.nof-shop-card,
.nof-arch-card,
.woocommerce-account .woocommerce-MyAccount-content,
.woocommerce-account form.login,
.woocommerce-account form.register,
.nof-empty-cart-card,
.nof-404-card {
    border-radius: 22px;
}

.nof-shop-card-btn,
.nof-ec-btn,
.nof-btn-primary,
.woocommerce-account .button,
.nof-wiz-btn {
    min-height: 48px;
    border-radius: 14px;
}

.nof-sheet[hidden] {
    display: none;
}

.nof-sheet.is-open {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 80;
}

.nof-sheet-backdrop {
    position: absolute;
    inset: 0;
    border: 0;
    background: rgba(15, 23, 42, 0.46);
}

.nof-sheet-panel {
    position: absolute;
    right: 0;
    left: 0;
    bottom: 0;
    max-height: min(78vh, 640px);
    overflow: auto;
    padding: 12px 16px calc(20px + env(safe-area-inset-bottom));
    border-radius: 24px 24px 0 0;
    background: #fff;
    box-shadow: 0 -16px 50px rgba(15, 23, 42, 0.18);
}

.nof-sheet-grab {
    width: 42px;
    height: 4px;
    margin: 4px auto 12px;
    border-radius: 99px;
    background: #e2e8f0;
}

.nof-sheet-panel h2 {
    margin: 0 0 12px;
    color: #0f172a;
    font-size: 1.05rem;
}

.nof-sheet-cats {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 12px;
}

.nof-sheet-cats a,
.nof-sheet-close,
.nof-sheet-open {
    min-height: 48px;
    padding: 12px 14px;
    border-radius: 14px;
    border: 1px solid #e8eef5;
    background: #fff;
    color: #0f172a;
    font-weight: 800;
    text-decoration: none;
    text-align: right;
}

.nof-sheet-open,
.nof-sheet-close {
    background: #ff6b00;
    color: #fff;
    border-color: transparent;
    cursor: pointer;
}

.nof-sheet-close {
    width: 100%;
    margin-top: 14px;
}

body.nof-sheet-lock {
    overflow: hidden;
}

.woocommerce-account .woocommerce-MyAccount-navigation ul {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 8px;
}

.woocommerce-account .woocommerce-MyAccount-navigation li {
    list-style: none;
}

.woocommerce-account .woocommerce-MyAccount-navigation a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding: 8px 14px;
    border-radius: 999px;
    background: #fff;
    border: 1px solid #e8eef5;
    color: #0f172a;
    font-weight: 800;
    text-decoration: none;
    white-space: nowrap;
}

.woocommerce-account .woocommerce-MyAccount-navigation .is-active a {
    background: #0f172a;
    color: #ffd600;
}

@media (max-width: 782px) {
    .nof-archive-grid,
    .nof-shop-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }

    .nof-shop,
    .nof-archive-root,
    .woocommerce-account,
    .nof-404-root {
        padding-inline: 14px;
    }
}
