:root {
    --ink: #18231f;
    --muted: #66746f;
    --line: #dfe7e2;
    --surface: #ffffff;
    --paper: #f5f7f3;
    --primary: #126c5b;
    --primary-dark: #0d4d42;
    --accent: #d69f45;
    --danger: #b42318;
    --info: #2f5d8c;
    --shadow: 0 16px 40px rgba(24, 35, 31, .08);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "Tajawal", "Segoe UI", Arial, sans-serif;
    background: var(--paper);
    color: var(--ink);
}

a {
    color: var(--primary);
    text-decoration: none;
}

a:hover {
    color: var(--primary-dark);
}

.btn {
    border-radius: 8px;
    border: 1px solid transparent;
    padding: .65rem 1rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .4rem;
    min-height: 40px;
}

.btn-sm {
    min-height: 32px;
    padding: .35rem .7rem;
    font-size: .86rem;
}

.btn-primary {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

.btn-primary:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
    color: #fff;
}

.btn-light {
    background: #fff;
    color: var(--primary-dark);
}

.btn-outline-primary {
    border-color: var(--primary);
    color: var(--primary);
    background: transparent;
}

.btn-outline-secondary {
    border-color: #98a7a1;
    color: #32423d;
    background: transparent;
}

.btn-outline-danger {
    border-color: #e3aaa3;
    color: var(--danger);
    background: transparent;
}

.btn-outline-light {
    border-color: rgba(255, 255, 255, .45);
    color: #fff;
    background: transparent;
}

.w-100 {
    width: 100%;
}

.form-control,
.form-select {
    display: block;
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 8px;
    min-height: 42px;
    padding: .58rem .75rem;
    background: #fff;
    color: var(--ink);
}

.form-control:focus,
.form-select:focus {
    outline: 3px solid rgba(18, 108, 91, .15);
    border-color: var(--primary);
}

.form-control-color {
    max-width: 86px;
    padding: .25rem;
}

.form-check-input {
    width: 1rem;
    height: 1rem;
}

.table {
    width: 100%;
    border-collapse: collapse;
}

.table th,
.table td {
    padding: .9rem .7rem;
    border-bottom: 1px solid var(--line);
    vertical-align: middle;
}

.table th {
    color: #42514b;
    font-size: .88rem;
    background: #f8faf7;
}

.table-responsive {
    overflow-x: auto;
}

.alert {
    border-radius: 8px;
    padding: .85rem 1rem;
    margin-bottom: 1rem;
    border: 1px solid transparent;
}

.alert-success {
    background: #e9f7ef;
    color: #11623f;
    border-color: #b9e2ca;
}

.alert-danger {
    background: #fff0ee;
    color: var(--danger);
    border-color: #f0c7c1;
}

.guest-body {
    min-height: 100vh;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, #edf5ef, #f8f3e7 52%, #eef2f6);
    padding: 1rem;
}

.guest-shell {
    width: min(100%, 760px);
}

.auth-card {
    width: min(100%, 460px);
    margin: 0 auto;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 2rem;
    box-shadow: var(--shadow);
}

.auth-card.wide {
    width: min(100%, 760px);
}

.system-logo {
    display: inline-flex;
    align-items: center;
    min-height: 38px;
    padding: .4rem .75rem;
    border: 1px solid var(--line);
    border-radius: 8px;
    color: var(--primary-dark);
    font-weight: 800;
    background: #f9fbf8;
    margin-bottom: 1rem;
}

.auth-card h1,
.page-heading h1,
.panel h2 {
    margin: 0 0 .5rem;
    letter-spacing: 0;
}

.auth-card p,
.page-heading p,
.muted {
    color: var(--muted);
}

.stack-form {
    display: grid;
    gap: 1rem;
}

.actions-row,
.form-actions,
.cart-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    flex-wrap: wrap;
}

.app-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 260px 1fr;
}

.sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    gap: 1.4rem;
    padding: 1.1rem;
    background: #10231f;
    color: #fff;
}

.merchant-sidebar {
    background: #1f2530;
}

.brand {
    display: flex;
    align-items: center;
    gap: .75rem;
    color: #fff;
    line-height: 1.3;
}

.brand:hover {
    color: #fff;
}

.brand small {
    color: rgba(255, 255, 255, .65);
}

.brand-mark {
    width: 42px;
    height: 42px;
    border-radius: 8px;
    display: grid;
    place-items: center;
    background: var(--accent);
    color: #231b0e;
    font-weight: 900;
}

.nav-list {
    display: grid;
    flex: 1;
    gap: .4rem;
    min-height: 0;
    overflow-y: auto;
    padding-inline-end: .15rem;
}

.nav-list a {
    color: rgba(255, 255, 255, .84);
    padding: .75rem .85rem;
    border-radius: 8px;
}

.nav-list a:hover {
    background: rgba(255, 255, 255, .08);
    color: #fff;
}

.workspace {
    padding: 1.6rem;
    min-width: 0;
}

.page-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.panel {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: 0 10px 28px rgba(24, 35, 31, .05);
    padding: 1.1rem;
    margin-bottom: 1rem;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.stat-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 1rem;
}

.stat-card span {
    display: block;
    color: var(--muted);
    margin-bottom: .4rem;
}

.stat-card strong {
    font-size: 1.45rem;
}

.section-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-bottom: .75rem;
}

.section-title h2 {
    margin: 0;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    border-radius: 999px;
    background: #eef2f0;
    color: #33433d;
    padding: .25rem .7rem;
    font-size: .85rem;
}

.status-active {
    background: #e6f5ed;
    color: #14633f;
}

.status-paused {
    background: #fff0ee;
    color: #a73529;
}

.status-trial {
    background: #eef4ff;
    color: var(--info);
}

.table-actions,
.inline-form {
    display: flex;
    gap: .45rem;
    align-items: center;
    flex-wrap: wrap;
}

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

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

.span-2 {
    grid-column: span 2;
}

.compact-input {
    max-width: 110px;
}

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

.two-columns.wide-left {
    grid-template-columns: minmax(0, 1.7fr) minmax(320px, .8fr);
}

.metric-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: .7rem 0;
    border-bottom: 1px solid var(--line);
}

.metric-row.total {
    font-size: 1.08rem;
    border-bottom: 0;
}

.code-area {
    direction: ltr;
    font-family: Consolas, "Courier New", monospace;
    font-size: .9rem;
}

.check-line,
.check-group,
.switch-line {
    display: flex;
    gap: .55rem;
    align-items: center;
}

.check-group {
    flex-wrap: wrap;
}

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

.plugin-card {
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 1rem;
    background: #fbfcfa;
}

.plugin-card p {
    color: var(--muted);
    min-height: 42px;
}

.language-admin-box {
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: .75rem;
    background: #fbfcfa;
    display: grid;
    gap: .45rem;
}

.language-admin-box > span {
    font-weight: 900;
    color: var(--ink);
}

.settings-subpanel {
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 1rem;
    background: #fbfcfa;
}

.settings-subpanel h3,
.notifications-events-card h3,
.notification-log-preview h3 {
    margin: 0;
    font-size: 1.05rem;
}

.settings-subpanel .section-title {
    align-items: center;
}

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

.notifications-settings-grid .plugin-card {
    background: #fbfcfa;
}

.notifications-settings-grid .notifications-events-card,
.notifications-settings-grid .form-actions {
    grid-column: 1 / -1;
}

.notifications-events-card {
    display: grid;
    gap: .65rem;
}

.notification-log-preview {
    margin-top: 1rem;
}

.feature-table th,
.feature-table td {
    min-width: 130px;
}

.mini-toggle {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    white-space: nowrap;
}

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

.theme-card-admin,
.media-card {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    overflow: hidden;
    display: grid;
    grid-template-columns: 150px minmax(0, 1fr);
}

.theme-card-admin img,
.media-card img {
    width: 100%;
    height: 100%;
    min-height: 130px;
    object-fit: cover;
}

.theme-card-admin > div,
.media-card > div {
    padding: .85rem;
    display: grid;
    gap: .45rem;
}

.media-library-card code {
    display: block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    direction: ltr;
    color: var(--muted);
}

.media-card-actions {
    display: flex;
    align-items: center;
    gap: .45rem;
    flex-wrap: wrap;
}

.media-video-preview {
    min-height: 160px;
    display: grid;
    place-items: center;
    background: #17231f;
    color: #fff;
    font-weight: 900;
}

.swatch-row {
    display: flex;
    gap: .35rem;
}

.swatch-row span {
    width: 24px;
    height: 24px;
    border-radius: 999px;
    border: 1px solid var(--line);
}

.theme-preview-page {
    background: #f8faf7;
    min-height: 100vh;
    font-family: var(--store-font);
}

.preview-topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    background: #fff;
    border-bottom: 1px solid var(--line);
}

.preview-hero {
    min-height: 440px;
    display: flex;
    align-items: center;
    color: #fff;
    background-size: cover;
    background-position: center;
    padding: 2rem;
}

.preview-hero > div {
    max-width: 720px;
}

.preview-hero h1 {
    font-size: clamp(2.2rem, 5vw, 4.8rem);
    letter-spacing: 0;
}

.preview-products {
    width: min(1100px, calc(100% - 2rem));
    margin: 1.5rem auto;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
}

.compact-crm-form {
    gap: .35rem;
}

.role-box,
.section-builder-item {
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: .8rem;
    background: #fbfcfa;
}

.empty-state {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
    text-align: center;
    padding: 2rem;
}

.full-width {
    grid-column: 1 / -1;
}

.storefront {
    background: #faf8f3;
    font-family: var(--store-font);
}

.store-header {
    background: rgba(255, 255, 255, .94);
    border-bottom: 1px solid var(--line);
    position: sticky;
    top: 0;
    z-index: 10;
}

.container {
    width: min(1180px, calc(100% - 2rem));
    margin-inline: auto;
}

.store-header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    min-height: 74px;
}

.store-brand {
    display: inline-flex;
    align-items: center;
    gap: .7rem;
    color: var(--ink);
}

.store-brand img,
.store-brand span {
    width: 42px;
    height: 42px;
    border-radius: 8px;
    object-fit: cover;
    display: grid;
    place-items: center;
    background: var(--store-primary);
    color: #fff;
    font-weight: 900;
}

.store-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.store-nav a {
    color: #34443f;
}

.cart-link {
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: .55rem .8rem;
    color: var(--ink);
}

.cart-link span {
    background: var(--store-secondary);
    color: #1f1708;
    border-radius: 999px;
    padding: .05rem .45rem;
    margin-inline-start: .35rem;
}

.store-hero {
    min-height: 430px;
    display: flex;
    align-items: center;
    color: #fff;
    background-size: cover;
    background-position: center;
}

.store-hero h1 {
    font-size: clamp(2rem, 5vw, 4.8rem);
    margin: 0 0 .75rem;
    letter-spacing: 0;
}

.store-hero p {
    font-size: 1.15rem;
    max-width: 620px;
}

.store-search {
    display: grid;
    grid-template-columns: 1fr 140px 140px auto;
    gap: .6rem;
    max-width: 820px;
    margin-top: 1.4rem;
}

.store-main {
    padding: 1.4rem 0 2.4rem;
}

.store-main.narrow {
    width: min(900px, calc(100% - 2rem));
}

.category-strip {
    display: flex;
    gap: .6rem;
    overflow-x: auto;
    padding: .35rem 0 1rem;
}

.category-pill {
    white-space: nowrap;
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: .45rem .85rem;
    background: #fff;
    color: #32423d;
}

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

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

.product-card {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.product-card img {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    display: block;
}

.product-card > div {
    padding: .85rem;
    display: grid;
    gap: .55rem;
}

.product-card small {
    color: var(--muted);
}

.product-card h2 {
    font-size: 1.02rem;
    margin: 0;
    line-height: 1.5;
}

.product-card h2 a {
    color: var(--ink);
}

.price-line {
    display: flex;
    align-items: center;
    gap: .6rem;
    flex-wrap: wrap;
}

.price-line strong {
    color: var(--store-primary);
}

.price-line.large strong {
    font-size: 1.7rem;
}

.price-line del {
    color: var(--muted);
}

.product-detail {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(320px, .85fr);
    gap: 1.5rem;
    align-items: start;
}

.product-media,
.product-info,
.checkout-summary {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 1rem;
}

.product-media img {
    width: 100%;
    border-radius: 8px;
    aspect-ratio: 1 / 1;
    object-fit: cover;
}

.sku {
    color: var(--muted);
}

.variant-list {
    display: grid;
    gap: .35rem;
    border-block: 1px solid var(--line);
    padding: .8rem 0;
    margin: .8rem 0;
}

.add-cart-box {
    display: flex;
    align-items: end;
    gap: .7rem;
}

.store-section-title {
    margin: 1.5rem 0 .8rem;
}

.store-page-heading {
    margin-top: .5rem;
}

.checkout-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 1rem;
}

.track-form {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: .7rem;
    margin: 1rem 0;
}

.order-status-box,
.contact-lines {
    background: #f8faf7;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 1rem;
    margin: 1rem 0;
}

.content-page .page-image {
    width: 100%;
    max-height: 320px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.rich-content {
    line-height: 1.9;
}

.store-footer {
    background: #15231f;
    color: #fff;
    padding: 2rem 0;
}

.footer-grid {
    display: grid;
    grid-template-columns: 1.4fr 1fr 1fr;
    gap: 1rem;
}

.store-footer a,
.store-footer p {
    display: block;
    color: rgba(255, 255, 255, .76);
    margin-bottom: .4rem;
}

.theme-perfumes {
    --store-primary: #6c315f;
    --store-secondary: #c7a96a;
}

.theme-sweets {
    --store-primary: #8a3f54;
    --store-secondary: #f0b766;
}

.theme-homeware {
    --store-primary: #2f5d62;
    --store-secondary: #b99362;
}

.theme-electronics {
    --store-primary: #1f4f8f;
    --store-secondary: #f2b544;
}

.card-compact .product-card > div {
    padding: .65rem;
}

.card-luxury .product-card {
    border-color: rgba(199, 169, 106, .65);
    box-shadow: 0 18px 38px rgba(20, 13, 20, .08);
}

.card-soft .product-card {
    background: #fffaf8;
}

.header-centered .store-header-inner {
    justify-content: center;
}

.header-wide .container.store-header-inner {
    width: min(1400px, calc(100% - 2rem));
}

.footer-minimal .footer-grid {
    grid-template-columns: 1fr;
}

.dynamic-page-section {
    border-top: 1px solid var(--line);
    padding: 1.2rem 0;
}

.dynamic-page-section img {
    width: 100%;
    max-height: 300px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: .9rem;
}

@media (max-width: 1100px) {
    .stats-grid,
    .products-grid,
    .products-grid.compact {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .two-columns,
    .two-columns.wide-left,
    .checkout-form,
    .product-detail {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 820px) {
    .app-shell {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: static;
        height: auto;
    }

    .workspace {
        padding: 1rem;
    }

    .page-heading,
    .store-header-inner,
    .cart-summary {
        flex-direction: column;
        align-items: stretch;
    }

    .store-nav {
        justify-content: flex-start;
    }

    .form-grid,
    .plugin-grid,
    .notifications-settings-grid,
    .theme-grid,
    .media-grid,
    .preview-products,
    .store-search,
    .footer-grid,
    .track-form {
        grid-template-columns: 1fr;
    }

    .theme-card-admin,
    .media-card {
        grid-template-columns: 1fr;
    }

    .span-2 {
        grid-column: span 1;
    }

    .products-grid,
    .products-grid.compact {
        grid-template-columns: 1fr;
    }

    .store-hero {
        min-height: 380px;
    }
}

.setup-overview {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(180px, 360px) auto;
    gap: 1rem;
    align-items: center;
}

.setup-overview h2,
.setup-dashboard-banner h2 {
    margin: .45rem 0 .25rem;
}

.setup-progress {
    height: 12px;
    border-radius: 999px;
    background: #e7eee9;
    overflow: hidden;
}

.setup-progress span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--primary), var(--accent));
}

.setup-step-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.setup-step-card {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 1rem;
    display: grid;
    gap: .65rem;
}

.setup-step-card.done {
    border-color: #b7dec7;
    background: #fbfffc;
}

.setup-step-head {
    display: flex;
    justify-content: space-between;
    gap: .75rem;
    align-items: center;
}

.setup-step-head span {
    border-radius: 999px;
    background: #eef2f0;
    color: #3d4b46;
    padding: .2rem .6rem;
    font-size: .82rem;
    font-weight: 800;
}

.setup-step-card.done .setup-step-head span {
    background: #e6f5ed;
    color: #14633f;
}

.setup-step-card p {
    color: var(--muted);
    margin: 0;
}

.setup-step-card ul {
    display: grid;
    gap: .35rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.setup-step-card li {
    color: #7a4a42;
    font-size: .92rem;
}

.setup-step-card li.done {
    color: #24684a;
}

.setup-step-card li::before {
    content: "•";
    margin-inline-end: .4rem;
}

.setup-form-panel {
    scroll-margin-top: 1rem;
}

.setup-choice-list {
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 1rem;
    background: #fbfcfa;
    display: grid;
    gap: .75rem;
}

.setup-choice-list h3 {
    margin: 0;
    font-size: 1.05rem;
}

.setup-dashboard-banner {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(180px, 320px) auto;
    gap: 1rem;
    align-items: center;
}

.product-admin-cell {
    display: grid;
    grid-template-columns: 58px minmax(0, 1fr);
    gap: .7rem;
    align-items: center;
    min-width: 220px;
}

.product-admin-cell img {
    width: 58px;
    height: 58px;
    border-radius: 8px;
    object-fit: cover;
    border: 1px solid var(--line);
}

.product-admin-cell small {
    display: block;
    color: var(--muted);
}

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

.import-products-panel .section-title {
    align-items: flex-start;
}

.import-products-panel p {
    margin: .25rem 0 0;
}

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

.import-help-grid div {
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: .75rem;
    background: #fbfcfa;
    display: grid;
    gap: .25rem;
}

.import-help-grid span {
    color: var(--muted);
}

.merchant-tabs {
    display: flex;
    gap: .5rem;
    overflow-x: auto;
    padding-bottom: .2rem;
}

.merchant-tabs a {
    white-space: nowrap;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: .45rem .75rem;
    background: #fbfcfa;
    color: #33433d;
    font-weight: 800;
}

.product-editor-section {
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 1rem;
    background: #fbfcfa;
    scroll-margin-top: 1rem;
}

.product-editor-section h3 {
    margin: 0 0 .8rem;
    font-size: 1.08rem;
}

.product-repeat-table {
    display: grid;
    gap: .55rem;
}

.repeat-head,
.repeat-row {
    display: grid;
    grid-template-columns: 70px minmax(220px, 1.5fr) minmax(140px, 1fr) 90px;
    gap: .5rem;
    align-items: center;
}

.product-repeat-table.variants .repeat-head,
.product-repeat-table.variants .repeat-row {
    grid-template-columns: repeat(2, minmax(110px, 1fr)) minmax(100px, 1fr) 90px 90px minmax(140px, 1fr) minmax(120px, 1fr);
}

.media-picker-strip {
    display: grid;
    gap: .6rem;
    margin: .85rem 0;
    padding: .85rem;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fbfcfa;
}

.media-picker-strip > div {
    display: flex;
    gap: .5rem;
    overflow-x: auto;
    padding-bottom: .2rem;
}

.media-pick-button {
    flex: 0 0 72px;
    width: 72px;
    height: 72px;
    border: 2px solid transparent;
    border-radius: 8px;
    padding: 0;
    overflow: hidden;
    background: #fff;
    cursor: pointer;
}

.media-pick-button:hover {
    border-color: var(--primary);
}

.media-pick-button img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.repeat-head {
    color: var(--muted);
    font-size: .86rem;
    font-weight: 800;
}

.repeat-row {
    padding: .55rem;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
}

.order-detail-grid {
    display: grid;
    grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr);
    gap: 1rem;
}

.order-note-box {
    margin-top: .9rem;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: .8rem;
    background: #fbfcfa;
}

.order-note-box p {
    color: var(--muted);
    margin: .35rem 0 0;
}

.order-total-grid {
    width: min(100%, 420px);
    margin-inline-start: auto;
    margin-top: 1rem;
}

.timeline-list {
    display: grid;
    gap: .75rem;
}

.timeline-list article {
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: .85rem;
    background: #fbfcfa;
    display: grid;
    gap: .25rem;
}

.timeline-list span,
.timeline-list small,
.timeline-list p {
    color: var(--muted);
}

.timeline-list p {
    margin: 0;
}

.print-body {
    background: #eef2f0;
    color: #1c2723;
    font-family: "Tajawal", "Segoe UI", Arial, sans-serif;
    padding: 1rem;
}

.invoice-page {
    width: min(960px, 100%);
    margin: 0 auto;
}

.invoice-actions {
    display: flex;
    justify-content: flex-end;
    margin-bottom: .8rem;
}

.invoice-sheet {
    background: #fff;
    border: 1px solid #dfe7e2;
    border-radius: 8px;
    padding: 1.4rem;
}

.invoice-header,
.invoice-parties {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
    border-bottom: 1px solid #dfe7e2;
    padding-bottom: 1rem;
    margin-bottom: 1rem;
}

.invoice-header h1 {
    margin: 0;
    font-size: 2rem;
}

.invoice-header span,
.invoice-header strong {
    display: block;
}

.invoice-parties h2 {
    font-size: 1rem;
}

.invoice-parties p {
    margin: .25rem 0;
    color: #53615c;
}

.invoice-table {
    width: 100%;
    border-collapse: collapse;
}

.invoice-table th,
.invoice-table td {
    padding: .8rem .6rem;
    border-bottom: 1px solid #dfe7e2;
    text-align: right;
}

.invoice-table th {
    background: #f7faf8;
}

.invoice-totals {
    width: min(100%, 360px);
    margin: 1rem 0 0 auto;
    display: grid;
    gap: .4rem;
}

.invoice-totals div {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
}

.invoice-total {
    border-top: 1px solid #dfe7e2;
    padding-top: .6rem;
    font-size: 1.15rem;
}

.invoice-footer {
    margin-top: 1.4rem;
    color: #53615c;
}

.plan-feature-switches {
    padding: .65rem;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fbfcfa;
}

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

.settings-admin-grid label {
    display: grid;
    gap: .35rem;
}

.admin-mini-metrics {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: .75rem;
}

.admin-mini-metrics div {
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: .85rem;
    background: #fbfcfa;
}

/* Motjari Super Admin */
.admin-body {
    --primary: var(--admin-primary);
    --accent: var(--admin-secondary);
    --paper: var(--admin-bg);
    --surface: var(--admin-card);
    --ink: var(--admin-text);
    --muted: var(--admin-muted);
    font-family: "Cairo", "Segoe UI", Arial, sans-serif;
    background: var(--admin-bg);
    color: var(--admin-text);
}

.admin-body .admin-shell {
    grid-template-columns: 280px minmax(0, 1fr);
}

.admin-body .admin-sidebar {
    position: sticky;
    top: 0;
    z-index: 20;
    background: var(--admin-sidebar);
    border-inline-end: 1px solid rgba(255, 255, 255, .08);
    box-shadow: 18px 0 38px rgba(12, 24, 21, .08);
}

.admin-body .brand {
    padding: .35rem .2rem .8rem;
    border-bottom: 1px solid rgba(255, 255, 255, .12);
}

.admin-body .brand-mark,
.admin-body .brand-logo {
    width: 44px;
    height: 44px;
    border-radius: var(--admin-radius);
    flex: 0 0 44px;
}

.admin-body .brand-mark {
    background: var(--admin-secondary);
    color: #1f1708;
}

.admin-body .brand-logo {
    object-fit: cover;
    background: #fff;
    border: 1px solid rgba(255, 255, 255, .2);
}

.admin-body .nav-list a {
    display: flex;
    align-items: center;
    min-height: 42px;
    border-radius: var(--admin-radius);
    font-weight: 700;
}

.admin-body .nav-list a.active {
    color: #fff;
    background: rgba(255, 255, 255, .14);
    box-shadow: inset 3px 0 0 var(--admin-secondary);
}

[dir="ltr"] .admin-body .nav-list a.active {
    box-shadow: inset -3px 0 0 var(--admin-secondary);
}

.admin-body .workspace {
    padding: 1.4rem;
}

.admin-body .page-heading h1 {
    font-size: 1.55rem;
    font-weight: 900;
}

.admin-body .page-heading p {
    margin-bottom: 0;
}

.admin-body .btn,
.admin-body .form-control,
.admin-body .form-select,
.admin-body .panel,
.admin-body .stat-card,
.admin-body .status-badge,
.admin-body .alert,
.admin-body .admin-kpi-card,
.admin-body .admin-quick-card,
.admin-body .settings-group-code {
    border-radius: var(--admin-radius);
}

.admin-body .btn-primary {
    background: var(--admin-button);
    border-color: var(--admin-button);
    color: #fff;
}

.admin-body .btn-primary:hover {
    filter: brightness(.92);
    background: var(--admin-button);
    border-color: var(--admin-button);
}

.admin-body .panel,
.admin-body .stat-card {
    background: var(--admin-card);
    box-shadow: 0 14px 34px rgba(24, 35, 31, .06);
}

.admin-dashboard-heading {
    align-items: center;
}

.admin-sticky-board {
    position: sticky;
    top: 0;
    z-index: 12;
    margin: -.35rem -.35rem 1rem;
    padding: .35rem .35rem .55rem;
    background: color-mix(in srgb, var(--admin-bg) 88%, transparent);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
}

.admin-sticky-board .admin-dashboard-heading {
    margin-bottom: 1rem;
}

.admin-sticky-board .admin-kpi-grid {
    margin-bottom: 0;
}

.admin-kpi-grid,
.admin-home-grid {
    display: grid;
    gap: 1rem;
    margin-bottom: 1rem;
}

.admin-kpi-grid {
    grid-template-columns: repeat(6, minmax(0, 1fr));
}

.admin-home-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.admin-kpi-card,
.admin-quick-card {
    background: var(--admin-card);
    border: 1px solid var(--line);
    padding: 1rem;
    min-width: 0;
    box-shadow: 0 14px 34px rgba(24, 35, 31, .06);
}

.admin-kpi-card {
    display: grid;
    gap: .25rem;
    min-height: 130px;
    align-content: space-between;
}

.admin-kpi-card span,
.admin-quick-card span,
.admin-ops-list span {
    color: var(--admin-muted);
    font-weight: 700;
}

.admin-kpi-card strong {
    color: var(--admin-text);
    font-size: 1.35rem;
    line-height: 1.2;
}

.admin-kpi-card small {
    color: var(--admin-muted);
}

.admin-quick-card {
    display: grid;
    gap: .35rem;
    min-height: 160px;
    color: var(--admin-text);
    transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}

.admin-quick-card:hover {
    color: var(--admin-text);
    border-color: color-mix(in srgb, var(--admin-primary) 35%, var(--line));
    box-shadow: 0 18px 42px rgba(24, 35, 31, .1);
    transform: translateY(-2px);
}

.admin-quick-card strong {
    color: var(--admin-primary);
    font-size: 1.6rem;
    line-height: 1.2;
    word-break: break-word;
}

.admin-quick-card small {
    color: var(--admin-muted);
    min-height: 24px;
}

.admin-quick-card em {
    align-self: end;
    color: var(--admin-primary);
    font-style: normal;
    font-weight: 900;
}

.admin-workbench-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.55fr) minmax(280px, .75fr);
    gap: 1rem;
    align-items: start;
}

.admin-table-panel {
    min-width: 0;
}

.admin-ops-panel {
    position: sticky;
    top: 1rem;
}

.admin-ops-list {
    display: grid;
    gap: .6rem;
}

.admin-ops-list a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    min-height: 58px;
    padding: .75rem;
    border: 1px solid var(--line);
    border-radius: var(--admin-radius);
    background: color-mix(in srgb, var(--admin-card) 92%, var(--admin-bg));
    color: var(--admin-text);
}

.admin-ops-list a:hover {
    border-color: color-mix(in srgb, var(--admin-primary) 35%, var(--line));
}

.admin-ops-list strong {
    color: var(--admin-primary);
    white-space: nowrap;
}

.settings-admin-form {
    display: grid;
    gap: 1rem;
}

.settings-admin-layout {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.settings-group-panel {
    margin-bottom: 0;
}

.settings-group-panel .section-title {
    align-items: center;
}

.settings-group-code {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: .2rem .55rem;
    background: #eef2f0;
    color: var(--admin-muted);
    font-size: .78rem;
    font-weight: 800;
}

.settings-admin-grid label > span {
    color: var(--admin-text);
    font-weight: 800;
}

.admin-color-input {
    min-width: 86px;
    min-height: 44px;
}

.settings-save-panel {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    position: sticky;
    bottom: 1rem;
    z-index: 2;
}

.settings-save-panel p {
    margin: .25rem 0 0;
}

@media (max-width: 1240px) {
    .admin-kpi-grid,
    .admin-home-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .settings-admin-layout {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 920px) {
    .admin-workbench-grid {
        grid-template-columns: 1fr;
    }

    .admin-ops-panel,
    .settings-save-panel {
        position: static;
    }

    .admin-sticky-board {
        position: static;
        margin: 0 0 1rem;
        padding: 0;
        background: transparent;
        border-bottom: 0;
        backdrop-filter: none;
    }
}

@media (max-width: 820px) {
    .admin-body .admin-shell {
        grid-template-columns: 1fr;
    }

    .admin-body .admin-sidebar {
        position: sticky;
        top: 0;
        z-index: 30;
        height: auto;
        min-height: auto;
        gap: .75rem;
        padding: .85rem;
    }

    .admin-body .admin-sidebar .brand {
        padding-bottom: .65rem;
    }

    .admin-body .admin-sidebar .nav-list {
        display: flex;
        flex: 0 0 auto;
        overflow-x: auto;
        gap: .45rem;
        padding-bottom: .2rem;
        scroll-snap-type: x proximity;
    }

    .admin-body .admin-sidebar .nav-list a {
        flex: 0 0 auto;
        min-height: 38px;
        white-space: nowrap;
        scroll-snap-align: start;
    }

    .admin-body .admin-sidebar .mt-auto {
        margin-top: 0 !important;
    }

    .admin-kpi-grid,
    .admin-home-grid {
        grid-template-columns: 1fr;
    }

    .admin-dashboard-heading,
    .settings-save-panel {
        align-items: stretch;
    }

    .settings-save-panel {
        flex-direction: column;
    }
}

/* Merchant Admin */
.merchant-body {
    font-family: "Cairo", "Segoe UI", Arial, sans-serif;
}

.merchant-body .merchant-shell {
    grid-template-columns: 270px minmax(0, 1fr);
}

.merchant-body .merchant-sidebar {
    overflow: hidden;
}

.merchant-body .brand {
    padding-bottom: .75rem;
    border-bottom: 1px solid rgba(255, 255, 255, .1);
}

.merchant-body .merchant-nav-list {
    scrollbar-width: thin;
}

.merchant-body .merchant-nav-list a {
    display: flex;
    align-items: center;
    min-height: 42px;
    font-weight: 800;
    line-height: 1.4;
}

.merchant-body .merchant-nav-list a.active {
    background: rgba(255, 255, 255, .14);
    color: #fff;
    box-shadow: inset 3px 0 0 var(--accent);
}

.merchant-body .merchant-logout-form {
    flex: 0 0 auto;
    padding-top: .75rem;
    border-top: 1px solid rgba(255, 255, 255, .1);
}

.merchant-body .page-heading h1,
.merchant-body .panel h2 {
    font-weight: 900;
}

.merchant-body .table-responsive {
    border-radius: 8px;
}

@media (max-width: 820px) {
    .merchant-body .merchant-shell {
        grid-template-columns: 1fr;
    }

    .merchant-body .merchant-sidebar {
        position: sticky;
        top: 0;
        z-index: 20;
        height: auto;
        gap: .75rem;
        padding: .75rem;
        overflow: visible;
        box-shadow: 0 14px 30px rgba(24, 35, 31, .14);
    }

    .merchant-body .brand {
        padding-bottom: .65rem;
    }

    .merchant-body .merchant-nav-list {
        display: flex;
        flex: 0 0 auto;
        gap: .45rem;
        overflow-x: auto;
        overflow-y: hidden;
        padding: 0 0 .25rem;
        scroll-snap-type: x proximity;
    }

    .merchant-body .merchant-nav-list a {
        flex: 0 0 auto;
        min-height: 38px;
        padding: .55rem .75rem;
        border: 1px solid rgba(255, 255, 255, .12);
        background: rgba(255, 255, 255, .06);
        white-space: nowrap;
        scroll-snap-align: start;
    }

    .merchant-body .merchant-nav-list a.active {
        box-shadow: inset 0 -3px 0 var(--accent);
    }

    .merchant-body .merchant-logout-form {
        margin-top: 0 !important;
        padding-top: .65rem;
    }

    .merchant-body .merchant-workspace {
        padding: 1rem;
    }

    .merchant-body .section-title {
        align-items: flex-start;
        flex-direction: column;
    }
}

@media print {
    .print-body {
        background: #fff;
        padding: 0;
    }

    .invoice-actions {
        display: none;
    }

    .invoice-sheet {
        border: 0;
        padding: 0;
    }
}

@media (max-width: 1100px) {
    .setup-step-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .setup-overview,
    .setup-dashboard-banner,
    .order-detail-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 820px) {
    .setup-step-grid {
        grid-template-columns: 1fr;
    }

    .repeat-head {
        display: none;
    }

    .repeat-row,
    .product-repeat-table.variants .repeat-row {
        grid-template-columns: 1fr;
    }

    .import-help-grid {
        grid-template-columns: 1fr;
    }

    .invoice-header,
    .invoice-parties,
    .settings-admin-grid {
        grid-template-columns: 1fr;
    }
}

/* Storefront refinement */
.storefront {
    --store-ink: #18231f;
    --store-muted: #65736f;
    --store-line: #dde6e1;
    --store-soft: #f4f7f2;
    --store-warm: #fff8ed;
    --store-coral: #a94d3d;
    --store-blue: #315c7d;
    background: #f7f5ef;
    color: var(--store-ink);
}

.store-sticky-bars {
    position: sticky;
    top: 0;
    z-index: 30;
}

.store-announcement {
    background: #142520;
    color: rgba(255, 255, 255, .86);
    font-size: .92rem;
}

.store-announcement-inner {
    min-height: 38px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.store-announcement-actions,
.store-language-switcher {
    display: flex;
    align-items: center;
    gap: .55rem;
    flex-wrap: wrap;
}

.store-language-switcher {
    border: 1px solid rgba(255, 255, 255, .22);
    border-radius: 999px;
    padding: .18rem;
    background: rgba(255, 255, 255, .08);
}

.store-language-switcher a {
    color: rgba(255, 255, 255, .78);
    border-radius: 999px;
    padding: .18rem .55rem;
    font-weight: 900;
    margin: 0;
}

.store-language-switcher a.active {
    background: var(--store-secondary);
    color: #1f1708;
}

.store-announcement-link {
    color: #fff;
    border: 1px solid rgba(255, 255, 255, .25);
    border-radius: 999px;
    padding: .18rem .65rem;
    font-weight: 900;
}

.store-announcement-link:hover {
    color: var(--store-secondary);
}

.store-header {
    position: static;
    border-bottom: 1px solid rgba(221, 230, 225, .86);
    box-shadow: 0 12px 30px rgba(24, 35, 31, .06);
    backdrop-filter: blur(14px);
}

.store-header-inner {
    min-height: 78px;
}

.store-brand strong {
    font-size: 1.08rem;
    color: var(--store-ink);
}

.store-nav a {
    font-weight: 700;
    color: #34433e;
    padding: .45rem .15rem;
}

.store-nav a:hover {
    color: var(--store-primary);
}

.store-header-actions {
    display: flex;
    align-items: center;
    gap: .6rem;
}

.account-link {
    display: inline-flex;
    align-items: center;
    min-height: 42px;
    border: 1px solid var(--store-line);
    border-radius: 8px;
    padding: .55rem .8rem;
    background: #fff;
    color: var(--store-ink);
    font-weight: 900;
    box-shadow: 0 10px 24px rgba(24, 35, 31, .05);
}

.account-link:hover {
    color: var(--store-primary);
}

.cart-link {
    display: inline-flex;
    align-items: center;
    gap: .55rem;
    background: #fff;
    box-shadow: 0 10px 24px rgba(24, 35, 31, .05);
}

.cart-link strong {
    min-width: 28px;
    height: 28px;
    display: grid;
    place-items: center;
    border-radius: 999px;
    background: var(--store-secondary);
    color: #251a07;
}

.cart-icon {
    color: var(--store-ink);
    font-weight: 800;
}

.store-hero.refined-hero {
    min-height: 560px;
    padding: 5rem 0;
    background-size: cover;
    background-position: center;
}

.hero-content {
    max-width: 820px;
}

.hero-kicker,
.page-kicker,
.store-section-heading span {
    display: inline-flex;
    align-items: center;
    color: var(--store-secondary);
    font-size: .9rem;
    font-weight: 900;
    margin-bottom: .45rem;
}

.store-hero h1 {
    max-width: 760px;
    font-size: 3.9rem;
    line-height: 1.12;
    margin-bottom: .9rem;
}

.store-hero p {
    color: rgba(255, 255, 255, .86);
    line-height: 1.9;
}

.hero-actions,
.hero-trust-row {
    display: flex;
    align-items: center;
    gap: .7rem;
    flex-wrap: wrap;
}

.hero-actions {
    margin-top: 1.2rem;
}

.hero-trust-row {
    margin-top: 1.4rem;
}

.hero-trust-row span {
    border: 1px solid rgba(255, 255, 255, .26);
    border-radius: 999px;
    padding: .35rem .75rem;
    background: rgba(255, 255, 255, .1);
    color: #fff;
}

.store-search.elevated-search {
    max-width: 900px;
    margin-top: 1.4rem;
    padding: .65rem;
    border: 1px solid rgba(255, 255, 255, .24);
    border-radius: 8px;
    background: rgba(255, 255, 255, .14);
    backdrop-filter: blur(12px);
}

.store-search.elevated-search .btn-primary {
    background: var(--store-secondary);
    border-color: var(--store-secondary);
    color: #201608;
}

.store-home {
    display: grid;
    gap: 2.2rem;
    padding: 2rem 0 3rem;
}

.store-section {
    display: grid;
    gap: 1rem;
}

.store-section-heading {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 1rem;
}

.store-section-heading h2 {
    margin: 0;
    font-size: 1.65rem;
}

.section-link {
    display: inline-flex;
    align-items: center;
    color: var(--store-primary);
    font-weight: 900;
}

.category-card-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1rem;
}

.category-card {
    position: relative;
    min-height: 178px;
    overflow: hidden;
    border-radius: 8px;
    color: #fff;
    background: #1d302b;
    isolation: isolate;
}

.category-card img {
    width: 100%;
    height: 100%;
    min-height: 178px;
    object-fit: cover;
    display: block;
    transform: scale(1.01);
    transition: transform .2s ease;
}

.category-card::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
    background: linear-gradient(180deg, rgba(12, 28, 26, .08), rgba(12, 28, 26, .74));
}

.category-card strong {
    position: absolute;
    inset-inline: 1rem;
    bottom: 1rem;
    z-index: 2;
    color: #fff;
    font-size: 1.08rem;
}

.category-card:hover img {
    transform: scale(1.06);
}

.store-promo-band {
    background: #172821;
    color: #fff;
    padding: 1.4rem 0;
}

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

.promo-card {
    border: 1px solid rgba(255, 255, 255, .14);
    border-radius: 8px;
    padding: 1rem;
    background: rgba(255, 255, 255, .06);
}

.promo-card span {
    color: var(--store-secondary);
    font-weight: 900;
}

.promo-card h2 {
    font-size: 1.25rem;
    margin: .4rem 0;
}

.promo-card p {
    color: rgba(255, 255, 255, .74);
    min-height: 52px;
}

.promo-card strong {
    font-size: 1.35rem;
    color: #fff;
}

.store-benefits {
    background: #fff;
    border-block: 1px solid var(--store-line);
    padding: 1.2rem 0;
}

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

.benefits-grid div {
    display: grid;
    gap: .25rem;
}

.benefits-grid strong {
    color: var(--store-ink);
}

.benefits-grid span {
    color: var(--store-muted);
}

.products-grid.refined-products-grid {
    align-items: stretch;
}

.store-product-card {
    min-width: 0;
    box-shadow: 0 16px 36px rgba(24, 35, 31, .06);
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.store-product-card:hover {
    transform: translateY(-3px);
    border-color: rgba(18, 108, 91, .28);
    box-shadow: 0 20px 42px rgba(24, 35, 31, .1);
}

.product-card-media {
    position: relative;
    display: block;
    background: #edf1ee;
}

.product-card-media img {
    aspect-ratio: 1 / 1;
}

.sale-badge,
.stock-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    min-height: 26px;
    padding: .2rem .65rem;
    font-size: .82rem;
    font-weight: 900;
}

.sale-badge {
    position: absolute;
    top: .75rem;
    inset-inline-start: .75rem;
    background: var(--store-coral);
    color: #fff;
}

.stock-badge.available {
    color: #176143;
    background: #e8f6ee;
}

.stock-badge.unavailable {
    color: #934235;
    background: #fff0ed;
}

.product-card-body {
    min-height: 230px;
}

.product-card-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: .5rem;
}

.product-card-meta small {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.store-product-card h2 {
    min-height: 48px;
}

.store-product-card .btn {
    margin-top: auto;
}

.refined-product-detail {
    margin-top: .8rem;
}

.refined-product-detail .product-media {
    position: relative;
    padding: 0;
    overflow: hidden;
    box-shadow: 0 18px 42px rgba(24, 35, 31, .08);
}

.refined-product-detail .product-media img {
    border-radius: 8px;
}

.product-thumb-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: .45rem;
    padding: .7rem;
    background: #fff;
}

.product-thumb-grid img {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid var(--store-line);
}

.product-thumb-button {
    border: 2px solid transparent;
    border-radius: 8px;
    padding: 0;
    background: transparent;
    overflow: hidden;
    cursor: pointer;
}

.product-thumb-button.active,
.product-thumb-button:hover {
    border-color: var(--store-primary);
}

.product-thumb-button img {
    border: 0;
}

.product-sale-badge {
    top: 1rem;
    inset-inline-start: 1rem;
}

.refined-product-info {
    display: grid;
    gap: .85rem;
    box-shadow: 0 18px 42px rgba(24, 35, 31, .06);
}

.product-status-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    flex-wrap: wrap;
}

.refined-product-info h1 {
    margin: 0;
    font-size: 2.1rem;
    line-height: 1.35;
}

.product-summary {
    color: var(--store-muted);
    line-height: 1.9;
}

.refined-variant-list {
    border: 0;
    padding: 0;
    margin: 0;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.refined-variant-list div {
    border: 1px solid var(--store-line);
    border-radius: 8px;
    padding: .75rem;
    background: var(--store-soft);
}

.refined-variant-list span {
    display: block;
    color: var(--store-muted);
    margin-top: .2rem;
}

.product-option-panel {
    display: grid;
    gap: .85rem;
    width: 100%;
    padding: .85rem;
    border: 1px solid var(--store-line);
    border-radius: 8px;
    background: #fbfcfa;
}

.product-option-group {
    display: grid;
    gap: .55rem;
}

.color-choice-list {
    display: flex;
    gap: .55rem;
    flex-wrap: wrap;
}

.color-choice {
    position: relative;
    display: grid;
    justify-items: center;
    gap: .3rem;
    cursor: pointer;
}

.color-choice input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.color-choice span {
    width: 54px;
    height: 54px;
    display: grid;
    place-items: center;
    border: 2px solid var(--store-line);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .06);
}

.color-choice img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.color-choice em {
    color: var(--store-muted);
    font-style: normal;
    font-size: .82rem;
    font-weight: 800;
}

.color-choice input:checked + span {
    border-color: var(--store-primary);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--store-primary) 16%, transparent);
}

.product-option-select {
    display: grid;
    gap: .35rem;
}

.product-option-select span {
    color: var(--store-ink);
    font-weight: 900;
}

.refined-add-cart {
    padding: .85rem;
    background: var(--store-warm);
    border: 1px solid #f2dfbf;
    border-radius: 8px;
}

.refined-add-cart label {
    min-width: 130px;
    color: #4c5b55;
    font-weight: 800;
}

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

.product-assurance span {
    border: 1px solid var(--store-line);
    border-radius: 8px;
    padding: .7rem;
    background: #fff;
    text-align: center;
    font-weight: 800;
    color: #44534d;
}

.product-extra-grid {
    display: grid;
    grid-template-columns: 1.1fr .9fr;
    gap: 1rem;
    margin-top: 1rem;
}

.product-extra-panel {
    background: #fff;
    border: 1px solid var(--store-line);
    border-radius: 8px;
    padding: 1rem;
}

.product-extra-panel h2 {
    margin: 0 0 .75rem;
}

.product-extra-panel p {
    color: var(--store-muted);
    line-height: 1.9;
}

.spec-grid {
    display: grid;
    gap: .55rem;
}

.spec-grid div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .7rem;
    padding: .65rem 0;
    border-bottom: 1px solid var(--store-line);
}

.spec-grid span {
    color: var(--store-muted);
}

.related-section {
    margin-top: 1.4rem;
}

.cart-layout,
.checkout-layout {
    display: grid;
    gap: 1rem;
    align-items: start;
}

.cart-layout {
    grid-template-columns: minmax(0, 1fr) 320px;
}

.cart-lines {
    display: grid;
    gap: .8rem;
}

.cart-line-item {
    display: grid;
    grid-template-columns: 92px minmax(0, 1fr) 120px 120px 120px;
    align-items: center;
    gap: .85rem;
    background: #fff;
    border: 1px solid var(--store-line);
    border-radius: 8px;
    padding: .8rem;
}

.cart-line-item img {
    width: 92px;
    height: 92px;
    border-radius: 8px;
    object-fit: cover;
}

.cart-line-item strong,
.cart-line-item span {
    display: block;
}

.cart-line-item span,
.cart-quantity {
    color: var(--store-muted);
}

.cart-line-price,
.cart-line-total {
    white-space: nowrap;
}

.cart-summary-panel,
.refined-checkout-summary {
    position: sticky;
    top: 96px;
    background: #fff;
    border: 1px solid var(--store-line);
    border-radius: 8px;
    padding: 1rem;
    box-shadow: 0 18px 42px rgba(24, 35, 31, .06);
}

.cart-summary-panel h2,
.refined-checkout-summary h2 {
    margin: 0 0 .75rem;
}

.cart-summary-panel .btn,
.refined-checkout-summary .btn {
    margin-top: .75rem;
}

.cart-summary-panel .section-link,
.refined-checkout-summary .section-link {
    justify-content: center;
    margin-top: .8rem;
}

.checkout-layout {
    grid-template-columns: minmax(0, 1fr) 350px;
}

.checkout-main {
    display: grid;
    gap: 1rem;
}

.checkout-step {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr);
    gap: .85rem;
    background: #fff;
    border: 1px solid var(--store-line);
    border-radius: 8px;
    padding: 1rem;
}

.checkout-step > span {
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    border-radius: 999px;
    background: var(--store-primary);
    color: #fff;
    font-weight: 900;
}

.checkout-step h2 {
    margin: 0 0 .85rem;
    font-size: 1.2rem;
}

.option-card-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .75rem;
}

.option-card {
    display: grid;
    gap: .35rem;
    min-height: 96px;
    border: 1px solid var(--store-line);
    border-radius: 8px;
    padding: .8rem;
    background: #fbfcfa;
    cursor: pointer;
}

.option-card input {
    width: 18px;
    height: 18px;
    accent-color: var(--store-primary);
}

.option-card strong {
    color: var(--store-ink);
}

.option-card small {
    color: var(--store-muted);
    line-height: 1.6;
}

.option-card:has(input:checked) {
    border-color: var(--store-primary);
    background: #eef7f2;
}

.option-card.is-static {
    cursor: default;
}

.refined-empty {
    display: grid;
    gap: .6rem;
    justify-items: center;
}

.checkout-summary .metric-row span,
.refined-checkout-summary .metric-row span {
    min-width: 0;
}

.footer-grid {
    align-items: start;
}

.store-footer h2 {
    font-size: 1rem;
    margin: 0 0 .75rem;
}

.footer-brand strong {
    font-size: 1.25rem;
}

.footer-contact-line {
    display: flex;
    gap: .6rem;
    flex-wrap: wrap;
}

.footer-contact-line span {
    color: rgba(255, 255, 255, .72);
}

@media (max-width: 1100px) {
    .category-card-grid,
    .promo-grid,
    .benefits-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .cart-layout,
    .checkout-layout,
    .product-extra-grid {
        grid-template-columns: 1fr;
    }

    .cart-summary-panel,
    .refined-checkout-summary {
        position: static;
    }

    .cart-line-item {
        grid-template-columns: 84px minmax(0, 1fr) 110px;
    }

    .cart-quantity,
    .cart-line-total {
        grid-column: span 1;
    }
}

@media (max-width: 820px) {
    .store-announcement-inner {
        flex-direction: column;
        align-items: flex-start;
        padding: .55rem 0;
    }

    .store-header-inner {
        gap: .75rem;
    }

    .store-header-actions,
    .cart-link {
        width: 100%;
    }

    .account-link {
        width: 100%;
    }

    .cart-link {
        justify-content: space-between;
    }

    .store-hero.refined-hero {
        min-height: 520px;
        padding: 3rem 0;
    }

    .store-hero h1 {
        font-size: 2.45rem;
    }

    .hero-actions .btn {
        width: 100%;
    }

    .store-search.elevated-search {
        padding: .55rem;
    }

    .store-section-heading {
        align-items: flex-start;
        flex-direction: column;
    }

    .category-card-grid,
    .promo-grid,
    .benefits-grid,
    .option-card-grid,
    .product-assurance,
    .refined-variant-list {
        grid-template-columns: 1fr;
    }

    .cart-line-item {
        grid-template-columns: 76px minmax(0, 1fr);
    }

    .cart-line-price,
    .cart-quantity,
    .cart-line-total {
        grid-column: 1 / -1;
    }

    .checkout-step {
        grid-template-columns: 1fr;
    }

    .checkout-step > span {
        width: 38px;
        height: 38px;
    }

    .refined-product-info h1 {
        font-size: 1.65rem;
    }

    .refined-add-cart {
        flex-direction: column;
        align-items: stretch;
    }
}

.store-split-page {
    display: grid;
    grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr);
    gap: 1rem;
    align-items: start;
    margin-top: .8rem;
}

.page-intro-panel,
.store-form-panel,
.store-content-page {
    background: #fff;
    border: 1px solid var(--store-line);
    border-radius: 8px;
    padding: 1.1rem;
    box-shadow: 0 18px 42px rgba(24, 35, 31, .06);
}

.page-intro-panel {
    min-height: 260px;
    display: grid;
    align-content: center;
}

.page-intro-panel h1,
.store-content-page h1 {
    margin: 0 0 .65rem;
    font-size: 2rem;
}

.page-intro-panel p {
    color: var(--store-muted);
    line-height: 1.9;
}

.refined-contact-lines {
    display: grid;
    gap: .55rem;
    margin-top: 1rem;
}

.refined-contact-lines span {
    border: 1px solid var(--store-line);
    border-radius: 8px;
    padding: .7rem;
    background: var(--store-soft);
}

.refined-track-form {
    margin: 0;
}

.refined-order-status {
    background: var(--store-soft);
    border-color: var(--store-line);
}

.refined-order-status > span {
    color: var(--store-muted);
}

.store-content-page {
    padding: 0;
    overflow: hidden;
}

.store-content-page .page-image {
    width: 100%;
    max-height: 360px;
    object-fit: cover;
    border-radius: 0;
    margin: 0;
}

.content-page-body {
    padding: 1.3rem;
}

.store-content-page .rich-content {
    color: #3b4944;
}

.store-content-page .dynamic-page-section {
    display: grid;
    grid-template-columns: 240px minmax(0, 1fr);
    gap: 1rem;
    align-items: center;
    padding: 1.3rem;
}

.store-content-page .dynamic-page-section img {
    margin: 0;
    max-height: 220px;
    height: 100%;
}

.store-content-page .dynamic-page-section p {
    color: var(--store-muted);
    line-height: 1.8;
}

/* Store customer account */
.account-auth-page,
.account-page {
    background: #f2f4f7;
}

.account-auth-layout {
    display: grid;
    grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr);
    gap: 1rem;
    align-items: start;
}

.account-auth-intro,
.account-auth-card,
.account-profile-card,
.account-menu,
.account-logout,
.account-panel,
.account-stat-grid article {
    background: #fff;
    border: 1px solid var(--store-line);
    border-radius: 8px;
    box-shadow: 0 18px 42px rgba(24, 35, 31, .06);
}

.account-auth-intro {
    min-height: 420px;
    padding: 1.4rem;
    display: grid;
    align-content: center;
    gap: .8rem;
}

.account-auth-intro h1 {
    margin: 0;
    font-size: 2.15rem;
    line-height: 1.35;
}

.account-auth-intro p {
    color: var(--store-muted);
    line-height: 1.9;
}

.account-auth-benefits,
.account-choice-row {
    display: flex;
    align-items: center;
    gap: .65rem;
    flex-wrap: wrap;
}

.account-auth-benefits span {
    border: 1px solid var(--store-line);
    border-radius: 999px;
    padding: .35rem .75rem;
    background: var(--store-soft);
    color: #34443f;
    font-weight: 900;
}

.account-auth-forms {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.account-auth-card {
    padding: 1.1rem;
    display: grid;
    gap: .9rem;
}

.account-auth-card h2,
.account-panel h2,
.account-heading h1 {
    margin: 0;
}

.account-auth-card p,
.account-heading p {
    margin: .35rem 0 0;
    color: var(--store-muted);
}

.account-page {
    padding: 1.4rem 0 2rem;
}

.account-layout {
    display: grid;
    grid-template-columns: minmax(250px, 320px) minmax(0, 1fr);
    gap: 1rem;
    align-items: start;
}

.account-sidebar {
    position: sticky;
    top: 96px;
    display: grid;
    gap: 1rem;
}

.account-profile-card {
    padding: 1rem;
    display: grid;
    grid-template-columns: 58px minmax(0, 1fr);
    gap: .8rem;
    align-items: center;
}

.account-avatar {
    width: 58px;
    height: 58px;
    display: grid;
    place-items: center;
    border-radius: 999px;
    background: var(--store-primary);
    color: #fff;
    font-weight: 900;
}

.account-profile-card strong,
.account-profile-card small {
    display: block;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.account-profile-card small {
    color: var(--store-muted);
}

.account-completion {
    grid-column: 1 / -1;
    display: grid;
    gap: .35rem;
}

.account-completion span {
    color: var(--store-muted);
    font-size: .9rem;
}

.account-completion div {
    height: 8px;
    border-radius: 999px;
    background: #e6ebe8;
    overflow: hidden;
}

.account-completion i {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: var(--store-secondary);
}

.account-menu {
    padding: .6rem;
    display: grid;
    gap: .35rem;
}

.account-menu a {
    min-height: 42px;
    display: flex;
    align-items: center;
    border-radius: 8px;
    padding: .55rem .75rem;
    color: #35433f;
    font-weight: 900;
}

.account-menu a:hover,
.account-menu a:focus {
    background: color-mix(in srgb, var(--store-secondary) 18%, #fff);
    color: var(--store-primary);
}

.account-logout {
    padding: .75rem;
}

.account-content {
    display: grid;
    gap: 1rem;
    min-width: 0;
}

.account-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.account-stat-grid,
.account-info-grid,
.shipping-summary,
.account-soft-grid,
.account-wishlist-grid {
    display: grid;
    gap: .75rem;
}

.account-stat-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.account-stat-grid article {
    padding: 1rem;
    display: grid;
    gap: .35rem;
}

.account-stat-grid span,
.account-info-grid span,
.shipping-summary span,
.account-soft-grid span {
    color: var(--store-muted);
}

.account-stat-grid strong {
    color: var(--store-primary);
    font-size: 1.35rem;
}

.account-panel {
    padding: 1.1rem;
    scroll-margin-top: 100px;
}

.account-info-grid,
.shipping-summary,
.account-soft-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.account-info-grid div,
.shipping-summary div,
.account-soft-grid div {
    border: 1px solid var(--store-line);
    border-radius: 8px;
    padding: .8rem;
    background: #fbfcfa;
    display: grid;
    gap: .25rem;
}

.account-info-grid strong,
.shipping-summary strong,
.account-soft-grid strong {
    color: var(--store-ink);
    word-break: break-word;
}

.account-choice-row {
    border: 1px solid var(--store-line);
    border-radius: 8px;
    padding: .75rem;
    background: #fbfcfa;
}

.account-choice-row > span {
    color: var(--store-muted);
    font-weight: 900;
}

.account-choice-row label {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    margin: 0;
}

.account-empty {
    display: grid;
    gap: .55rem;
    justify-items: start;
    color: var(--store-muted);
}

.account-empty h3 {
    color: var(--store-ink);
    margin: 0;
}

.account-cart-lines {
    display: grid;
    gap: .55rem;
}

.account-cart-lines div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    border-bottom: 1px solid var(--store-line);
    padding-bottom: .55rem;
}

.account-address-layout {
    display: grid;
    grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr);
    gap: 1rem;
    align-items: start;
}

.address-list,
.address-form {
    display: grid;
    gap: .75rem;
}

.address-list article {
    border: 1px solid var(--store-line);
    border-radius: 8px;
    padding: .8rem;
    background: #fbfcfa;
    display: grid;
    gap: .25rem;
}

.address-list span,
.address-list small {
    color: var(--store-muted);
}

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

.address-form .full-width {
    grid-column: 1 / -1;
}

.account-wishlist-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.account-wishlist-grid a {
    border: 1px solid var(--store-line);
    border-radius: 8px;
    padding: .85rem;
    display: grid;
    gap: .35rem;
    background: #fbfcfa;
    color: var(--store-ink);
}

.account-wishlist-grid span {
    color: var(--store-primary);
    font-weight: 900;
}

@media (max-width: 900px) {
    .store-split-page,
    .store-content-page .dynamic-page-section,
    .account-auth-layout,
    .account-layout,
    .account-address-layout {
        grid-template-columns: 1fr;
    }

    .account-sidebar {
        position: static;
    }

    .account-menu {
        display: flex;
        overflow-x: auto;
        scroll-snap-type: x proximity;
    }

    .account-menu a {
        flex: 0 0 auto;
        white-space: nowrap;
        scroll-snap-align: start;
    }
}

@media (max-width: 820px) {
    .store-header-actions {
        align-items: stretch;
    }

    .account-link {
        justify-content: center;
    }

    .account-auth-forms,
    .account-stat-grid,
    .account-info-grid,
    .shipping-summary,
    .account-soft-grid,
    .address-form,
    .account-wishlist-grid {
        grid-template-columns: 1fr;
    }

    .account-heading {
        align-items: stretch;
        flex-direction: column;
    }

    .account-panel {
        padding: .9rem;
    }

    .account-auth-intro {
        min-height: auto;
    }

    .account-auth-intro h1 {
        font-size: 1.7rem;
    }
}

.intelligence-panel {
    border: 1px solid rgba(18, 108, 91, .14);
    background: linear-gradient(180deg, #ffffff 0%, #f7fbf8 100%);
}

.intelligence-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: .85rem;
    margin-bottom: 1rem;
}

.intelligence-grid article,
.intelligence-list article {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    padding: .9rem;
    display: grid;
    gap: .35rem;
}

.intelligence-grid span,
.intelligence-grid small,
.intelligence-list p {
    color: var(--muted);
}

.intelligence-grid strong {
    color: var(--primary);
    font-size: 1.25rem;
}

.intelligence-list {
    display: grid;
    gap: .7rem;
}

.intelligence-strip {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: .85rem;
    margin-top: 1rem;
}

.intelligence-list h3 {
    margin: 0;
    font-size: 1rem;
}

.cart-link .cart-symbol,
.cart-link .cart-icon {
    background: transparent;
    color: inherit;
    border-radius: 0;
    padding: 0;
}

.cart-link .cart-symbol {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border: 1px solid color-mix(in srgb, var(--store-primary) 24%, transparent);
    border-radius: 999px;
    color: var(--store-primary);
}

.cart-link:hover .cart-symbol {
    background: color-mix(in srgb, var(--store-primary) 9%, #fff);
}

.occasion-badge {
    position: absolute;
    inset-inline-start: .7rem;
    inset-block-start: .7rem;
    z-index: 2;
    border-radius: 999px;
    padding: .35rem .65rem;
    background: var(--store-primary);
    color: #fff;
    font-size: .78rem;
    font-weight: 900;
    box-shadow: 0 10px 24px rgba(24, 35, 31, .16);
}

.occasion-saudi_national_day {
    --store-primary: #006c35;
    --store-secondary: #e5c36a;
}

.occasion-saudi_national_day .store-announcement,
.occasion-saudi_national_day .store-footer {
    background: #064d2d;
}

.occasion-saudi_national_day .store-announcement-inner::before {
    content: "اليوم الوطني";
    border: 1px solid rgba(255, 255, 255, .35);
    border-radius: 999px;
    padding: .22rem .65rem;
    color: #f8e7a1;
    font-weight: 900;
}

.occasion-saudi_national_day .btn-primary,
.occasion-saudi_national_day .occasion-badge {
    background: #006c35;
    border-color: #006c35;
}

.occasion-saudi_national_day .store-product-card {
    border-color: rgba(0, 108, 53, .22);
}

.occasion-ramadan {
    --store-primary: #1b5d72;
    --store-secondary: #c9a24d;
}

.occasion-ramadan .store-announcement,
.occasion-ramadan .store-footer {
    background: #123744;
}

.occasion-ramadan .store-announcement-inner::before {
    content: "رمضان كريم";
    border: 1px solid rgba(255, 255, 255, .35);
    border-radius: 999px;
    padding: .22rem .65rem;
    color: #f1d58c;
    font-weight: 900;
}

.occasion-mega_sale {
    --store-primary: #9f2f43;
    --store-secondary: #f2c14e;
}

.occasion-mega_sale .store-announcement {
    background: #3a1f2a;
}

.occasion-mega_sale .occasion-badge {
    background: #9f2f43;
}

.page-builder-shell {
    padding: 0;
    overflow: hidden;
}

.page-builder-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: .85rem 1rem;
    border-bottom: 1px solid var(--line);
    background: #fff;
}

.page-builder-title {
    display: grid;
    gap: .2rem;
}

.page-builder-title h2,
.builder-sidebar h3,
.builder-empty-state h3,
.builder-column-preview h4 {
    margin: 0;
}

.page-builder-actions {
    display: flex;
    align-items: center;
    gap: .55rem;
    flex-wrap: wrap;
}

.page-builder-workspace {
    display: grid;
    grid-template-columns: 230px minmax(0, 1fr) minmax(320px, 390px);
    min-height: 650px;
    background: #f4f7fa;
}

.builder-sidebar,
.builder-palette,
.builder-properties {
    border-inline-end: 1px solid var(--line);
    background: #fff;
    padding: 1rem;
    overflow: auto;
}

.builder-palette {
    position: sticky;
    top: 0;
    align-self: start;
    max-height: calc(100vh - 80px);
}

.builder-properties {
    border-inline-end: 0;
    border-inline-start: 1px solid var(--line);
    box-shadow: -18px 0 34px rgba(24, 35, 31, .04);
}

.builder-properties[hidden] {
    display: none !important;
}

.builder-add-form,
.builder-sidebar-group,
.builder-layout-options,
.builder-component-list,
.builder-columns-form,
.builder-columns-form fieldset {
    display: grid;
    gap: .7rem;
}

.builder-sidebar-group {
    padding-bottom: 1rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--line);
}

.builder-sidebar-group:last-child {
    border-bottom: 0;
    margin-bottom: 0;
    padding-bottom: 0;
}

.builder-option,
.builder-component-option {
    position: relative;
    display: grid;
    gap: .2rem;
    border: 1px dashed #c9d7e5;
    border-radius: 8px;
    background: #f8fafc;
    padding: .75rem;
    cursor: pointer;
}

.builder-component-option {
    width: 100%;
    text-align: inherit;
    color: var(--ink);
}

.builder-component-option:hover,
.builder-component-option.active {
    border-style: solid;
    border-color: var(--primary);
    background: #eef8f5;
}

.builder-component-option:active {
    cursor: grabbing;
}

.builder-option input,
.builder-component-option input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.builder-option span {
    display: grid;
    gap: .15rem;
}

.builder-option small,
.builder-component-option small {
    color: var(--muted);
}

.builder-option:has(input:checked),
.builder-component-option:has(input:checked) {
    border-style: solid;
    border-color: var(--primary);
    background: #eef8f5;
    box-shadow: 0 0 0 3px rgba(18, 108, 91, .08);
}

.builder-component-option {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
}

.builder-properties-head {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .85rem;
    margin-bottom: 1rem;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #f8fafc;
}

.builder-properties-head > span {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border-radius: 8px;
    background: var(--primary);
    color: #fff;
    font-weight: 900;
    font-size: .82rem;
}

.builder-properties-head div {
    display: grid;
    gap: .15rem;
}

.builder-properties-head small {
    color: var(--muted);
}

.builder-columns-form fieldset {
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: .75rem;
    background: #fbfcfd;
}

.builder-field {
    display: grid;
    gap: .6rem;
}

.builder-field[hidden],
.builder-column-fields[hidden] {
    display: none !important;
}

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

.builder-columns-form legend {
    float: none;
    width: auto;
    padding: 0 .35rem;
    margin: 0;
    color: var(--primary);
    font-size: .9rem;
    font-weight: 900;
}

.builder-canvas {
    padding: 2rem;
    display: grid;
    align-content: start;
    gap: 1rem;
}

.builder-drop-zone {
    min-height: 320px;
    display: grid;
    place-items: center;
    gap: 1rem;
    border: 2px dashed #c6d5e3;
    border-radius: 8px;
    background: linear-gradient(180deg, #f9fbfd 0%, #eef4f8 100%);
    padding: 1rem;
    transition: border-color .18s ease, background .18s ease, transform .18s ease;
}

.builder-drop-zone.is-over {
    border-color: var(--primary);
    background: #eef8f5;
    transform: translateY(-2px);
}

.builder-drop-zone.has-draft .builder-empty-state {
    display: none;
}

.builder-draft-card {
    width: min(100%, 520px);
    border: 1px solid color-mix(in srgb, var(--primary) 35%, var(--line));
    border-radius: 8px;
    background: #fff;
    padding: 1rem;
    display: grid;
    gap: .35rem;
    box-shadow: 0 18px 44px rgba(24, 35, 31, .08);
}

.builder-draft-card[hidden] {
    display: none !important;
}

.builder-draft-card small,
.builder-draft-card p {
    color: var(--muted);
}

.builder-draft-card strong {
    color: var(--primary);
    font-size: 1.15rem;
}

.builder-empty-state {
    min-height: 360px;
    display: grid;
    place-items: center;
    align-content: center;
    gap: .6rem;
    color: var(--muted);
    text-align: center;
}

.builder-empty-state span {
    width: 54px;
    height: 54px;
    display: grid;
    place-items: center;
    border-radius: 999px;
    background: #cfdceb;
    color: #fff;
    font-size: 2rem;
    font-weight: 900;
}

.builder-section-preview {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    padding: 1rem;
    display: grid;
    gap: .85rem;
}

.builder-saved-sections {
    display: grid;
    gap: .85rem;
}

.builder-saved-sections.is-saving::after {
    content: "جاري حفظ الترتيب...";
    color: var(--muted);
    font-size: .85rem;
}

.builder-section-preview[draggable="true"] {
    cursor: grab;
}

.builder-section-preview.is-dragging {
    opacity: .55;
    cursor: grabbing;
}

.builder-section-actions {
    display: flex;
    align-items: center;
    gap: .55rem;
}

.builder-drag-handle {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 8px;
    color: var(--muted);
    background: #f8fafc;
    cursor: grab;
}

.builder-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.builder-section-header div {
    display: grid;
    gap: .15rem;
}

.builder-section-header small,
.builder-column-preview p {
    color: var(--muted);
}

.builder-column-preview-grid,
.dynamic-section-columns {
    display: grid;
    gap: .85rem;
}

.builder-column-preview-grid.columns-one,
.dynamic-section-columns.columns-one {
    grid-template-columns: 1fr;
}

.builder-column-preview-grid.columns-two,
.dynamic-section-columns.columns-two {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.builder-column-preview-grid.columns-three,
.dynamic-section-columns.columns-three {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.builder-column-preview,
.dynamic-section-card {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fbfcfa;
    padding: .85rem;
    display: grid;
    gap: .55rem;
    min-width: 0;
}

.builder-video-pill {
    width: max-content;
    border-radius: 999px;
    padding: .2rem .55rem;
    background: #eef4ff;
    color: #31527c;
    font-size: .78rem;
    font-weight: 900;
}

.builder-column-preview img,
.store-content-page .dynamic-section-card img {
    width: 100%;
    height: auto;
    max-height: 260px;
    aspect-ratio: 16 / 10;
    object-fit: cover;
    border-radius: 8px;
    margin: 0;
}

.store-content-page .dynamic-page-section {
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr);
    gap: 1rem;
    align-items: start;
    border-top: 1px solid var(--store-line, var(--line));
    padding: 1.35rem 0;
}

.dynamic-section-heading {
    display: grid;
    gap: .3rem;
}

.dynamic-section-heading span {
    color: var(--store-primary);
    font-size: .78rem;
    font-weight: 900;
    text-transform: uppercase;
}

.dynamic-section-heading h2,
.dynamic-section-card h3 {
    margin: 0;
    color: var(--store-ink, var(--ink));
}

.dynamic-section-card {
    background: #fff;
    border-color: var(--store-line, var(--line));
}

.dynamic-section-card p {
    color: var(--store-muted, var(--muted));
    line-height: 1.8;
}

.dynamic-section-video {
    position: relative;
    width: 100%;
    overflow: hidden;
    border-radius: 8px;
    background: #111b18;
}

.dynamic-section-video iframe,
.dynamic-section-video video {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    border: 0;
}

.dynamic-section-video .btn {
    margin: .85rem;
}

.section-hero .dynamic-section-card {
    background: color-mix(in srgb, var(--store-primary, var(--primary)) 8%, #fff);
    border-color: color-mix(in srgb, var(--store-primary, var(--primary)) 25%, var(--store-line, var(--line)));
}

@media (max-width: 1100px) {
    .intelligence-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .intelligence-strip {
        grid-template-columns: 1fr;
    }

    .page-builder-workspace {
        grid-template-columns: 1fr;
    }

    .builder-sidebar,
    .builder-palette,
    .builder-properties {
        border-inline-end: 0;
        border-bottom: 1px solid var(--line);
        border-inline-start: 0;
        max-height: none;
        position: static;
    }

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

@media (max-width: 900px) {
    .store-content-page .dynamic-page-section,
    .builder-column-preview-grid.columns-two,
    .builder-column-preview-grid.columns-three,
    .dynamic-section-columns.columns-two,
    .dynamic-section-columns.columns-three {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 720px) {
    .intelligence-grid {
        grid-template-columns: 1fr;
    }

    .page-builder-topbar,
    .builder-section-header {
        align-items: stretch;
        flex-direction: column;
    }

    .page-builder-actions .btn {
        flex: 1 1 auto;
    }

    .builder-canvas {
        padding: 1rem;
    }

    .builder-image-controls {
        grid-template-columns: 1fr;
    }

    .builder-component-list {
        grid-template-columns: 1fr;
    }
}
