/* ==========================================================================
   apicrd — unified Persian storefront theme
   A soft sage / cream design language inspired by the home page.
   Loaded after bootstrap.min.css and slug.css.
   ========================================================================== */

@font-face {
    font-family: 'IRANSans';
    src: url('/fonts/IRANSans.woff2') format('woff2'),
         url('/fonts/IRANSans.woff') format('woff'),
         url('/fonts/IRANSans.ttf') format('truetype');
    font-weight: 100 900;
    font-style: normal;
    font-display: swap;
}

:root {
    --brand-50: #f7f6f1;
    --brand-100: #eef3ec;
    --brand-200: #dde8dc;
    --brand-300: #c5d8c3;
    --brand-400: #a5bfa2;
    --brand-500: #84a282;
    --brand-600: #63865f;
    --brand-700: #4c6b4a;
    --brand-800: #385237;
    --brand-900: #263a27;
    --brand-accent: #b98b4e;
    --brand-cream: #f8f1e7;
    --brand-mint: #e8f3ef;
    --brand-blush: #f7e9e7;
    --brand-lavender: #ecebf6;
    --surface: #ffffff;
    --surface-soft: #fbfaf6;
    --ink: #27322b;
    --muted: #6e7a71;
    --line: #e2e7df;
    --radius-sm: 12px;
    --radius-md: 16px;
    --radius-lg: 22px;
    --radius-xl: 28px;
    --shadow-soft: 0 10px 30px rgba(47, 125, 91, .07), 0 2px 8px rgba(40, 49, 43, .05);
    --shadow-hover: 0 18px 42px rgba(47, 125, 91, .14), 0 4px 12px rgba(40, 49, 43, .07);
    --shadow-nav: 0 8px 26px rgba(58, 79, 60, .16);

    --bs-body-font-family: 'IRANSans', 'Segoe UI', Tahoma, sans-serif;
    --bs-font-sans-serif: 'IRANSans', 'Segoe UI', Tahoma, sans-serif;
    --bs-body-bg: #f7f6f1;
    --bs-body-color: #27322b;
    --bs-body-color-rgb: 39, 50, 43;
    --bs-emphasis-color: #1d2721;
    --bs-secondary-color: #6e7a71;
    --bs-secondary-bg: #f1f4ef;
    --bs-tertiary-bg: #eef3ec;
    --bs-heading-color: #1f2a22;
    --bs-primary: #4d7c5f;
    --bs-primary-rgb: 77, 124, 95;
    --bs-primary-text-emphasis: #2f5c44;
    --bs-primary-bg-subtle: #e6f0e9;
    --bs-primary-border-subtle: #c8ddce;
    --bs-secondary: #a5bfa2;
    --bs-secondary-rgb: 165, 191, 162;
    --bs-secondary-text-emphasis: #4c6b4a;
    --bs-secondary-bg-subtle: #eef3ec;
    --bs-secondary-border-subtle: #d9e5d7;
    --bs-success: #2f7d5b;
    --bs-success-rgb: 47, 125, 91;
    --bs-success-text-emphasis: #236046;
    --bs-success-bg-subtle: #e4f2ea;
    --bs-success-border-subtle: #bfe2d0;
    --bs-info: #5c8fa4;
    --bs-info-rgb: 92, 143, 164;
    --bs-info-bg-subtle: #e7f1f5;
    --bs-info-border-subtle: #c6dfe8;
    --bs-warning: #b98b4e;
    --bs-warning-rgb: 185, 139, 78;
    --bs-warning-text-emphasis: #8a6630;
    --bs-warning-bg-subtle: #f8f1e4;
    --bs-warning-border-subtle: #ecdcc0;
    --bs-danger: #b56a63;
    --bs-danger-rgb: 181, 106, 99;
    --bs-danger-text-emphasis: #8e4f49;
    --bs-danger-bg-subtle: #f8eae8;
    --bs-danger-border-subtle: #ebcac6;
    --bs-light: #f7f6f1;
    --bs-light-rgb: 247, 246, 241;
    --bs-dark: #263a27;
    --bs-dark-rgb: 38, 58, 39;
    --bs-link-color: #3d6b4f;
    --bs-link-color-rgb: 61, 107, 79;
    --bs-link-hover-color: #2b5039;
    --bs-border-color: #e2e7df;
    --bs-border-color-translucent: rgba(39, 50, 43, .12);
    --bs-border-radius: var(--radius-sm);
    --bs-border-radius-sm: 10px;
    --bs-border-radius-lg: var(--radius-md);
    --bs-border-radius-xl: var(--radius-lg);
    --bs-border-radius-xxl: var(--radius-xl);
    --bs-focus-ring-color: rgba(77, 124, 95, .22);
    color-scheme: light;
}

[data-bs-theme=dark] {
    --surface: #1e2721;
    --surface-soft: #1a221d;
    --ink: #e7eee8;
    --muted: #9aa89e;
    --line: #2c3a31;
    --bs-body-bg: #151b17;
    --bs-body-color: #e7eee8;
    --bs-body-color-rgb: 231, 238, 232;
    --bs-emphasis-color: #f3f7f3;
    --bs-secondary-color: #a2b0a6;
    --bs-secondary-bg: #243029;
    --bs-tertiary-bg: #2a372f;
    --bs-heading-color: #f3f7f3;
    --bs-primary: #8fb99a;
    --bs-primary-rgb: 143, 185, 154;
    --bs-primary-text-emphasis: #c8e3d0;
    --bs-primary-bg-subtle: #25382d;
    --bs-primary-border-subtle: #35503f;
    --bs-secondary: #7f9c80;
    --bs-secondary-rgb: 127, 156, 128;
    --bs-secondary-text-emphasis: #c6d8c4;
    --bs-secondary-bg-subtle: #26322a;
    --bs-secondary-border-subtle: #3a4c3e;
    --bs-success: #74c39c;
    --bs-success-rgb: 116, 195, 156;
    --bs-success-text-emphasis: #a8ddc1;
    --bs-success-bg-subtle: #23382e;
    --bs-success-border-subtle: #335745;
    --bs-info-bg-subtle: #22343b;
    --bs-warning-bg-subtle: #3a2f1f;
    --bs-warning-border-subtle: #55452c;
    --bs-danger-bg-subtle: #3a2624;
    --bs-danger-border-subtle: #573936;
    --bs-link-color: #a8d4b9;
    --bs-link-color-rgb: 168, 212, 185;
    --bs-link-hover-color: #c9e8d4;
    --bs-border-color: #2c3a31;
    --bs-border-color-translucent: rgba(231, 238, 232, .12);
    --bs-focus-ring-color: rgba(143, 185, 154, .28);
    --shadow-soft: 0 10px 30px rgba(0, 0, 0, .35), 0 2px 8px rgba(0, 0, 0, .25);
    --shadow-hover: 0 18px 42px rgba(0, 0, 0, .45), 0 4px 12px rgba(0, 0, 0, .3);
    color-scheme: dark;
}

/* --------------------------------------------------------------------------
   Base
   -------------------------------------------------------------------------- */
html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
    overflow-x: clip;
}

body {
    background-color: var(--bs-body-bg);
    color: var(--bs-body-color);
    font-family: var(--bs-body-font-family);
    line-height: 1.85;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    min-height: 100vh;
    overflow-x: clip;
    background-image:
        radial-gradient(1100px 520px at 100% -120px, rgba(132, 162, 130, .13), transparent 62%),
        radial-gradient(900px 460px at -10% 18%, rgba(185, 139, 78, .07), transparent 60%);
    background-attachment: fixed;
}

[data-bs-theme=dark] body {
    background-image:
        radial-gradient(1100px 520px at 100% -120px, rgba(116, 195, 156, .07), transparent 62%),
        radial-gradient(900px 460px at -10% 18%, rgba(185, 139, 78, .05), transparent 60%);
}

h1, h2, h3, h4, h5, h6,
.h1, .h2, .h3, .h4, .h5, .h6 {
    font-weight: 800;
    letter-spacing: -.01em;
    color: var(--bs-heading-color);
    line-height: 1.5;
}

p {
    line-height: 1.9;
}

a {
    text-decoration: none;
    transition: color .18s ease, opacity .18s ease;
}

::selection {
    background: rgba(77, 124, 95, .22);
    color: var(--bs-heading-color);
}

:focus-visible {
    outline: 2px solid rgba(77, 124, 95, .45);
    outline-offset: 2px;
}

hr {
    border-color: var(--line);
    opacity: 1;
}

main {
    animation: page-rise .35s ease both;
}

@keyframes page-rise {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.img-thumbnail {
    background: var(--surface);
    border-color: var(--line);
    border-radius: var(--radius-sm);
}

/* --------------------------------------------------------------------------
   Navbar
   -------------------------------------------------------------------------- */
header.navbar {
    background: linear-gradient(135deg, #93aa90 0%, #7f9c80 55%, #6f8e73 100%) !important;
    border: 1px solid rgba(255, 255, 255, .22);
    border-radius: 999px !important;
    box-shadow: var(--shadow-nav);
    padding: .45rem .9rem;
    backdrop-filter: saturate(140%) blur(6px);
}

[data-bs-theme=dark] header.navbar {
    background: linear-gradient(135deg, #3c5442 0%, #32483a 55%, #2a3d31 100%) !important;
    border-color: rgba(255, 255, 255, .10);
}

header.navbar .navbar-brand img {
    border: 2px solid rgba(255, 255, 255, .65);
    box-shadow: 0 4px 12px rgba(0, 0, 0, .12);
    object-fit: cover;
}

header.navbar .navbar-nav .nav-link {
    color: rgba(255, 255, 255, .94);
    font-weight: 600;
    border-radius: 999px;
    margin: .15rem .12rem;
    padding: .45rem .9rem !important;
    transition: background .18s ease, color .18s ease, transform .18s ease;
}

header.navbar .navbar-nav .nav-link:hover,
header.navbar .navbar-nav .nav-link:focus {
    background: rgba(255, 255, 255, .16);
    color: #fff;
    transform: translateY(-1px);
}

header.navbar .navbar-nav .nav-link.active,
header.navbar .navbar-nav .show > .nav-link {
    background: rgba(255, 255, 255, .24);
    color: #fff;
}

header.navbar .dropdown-menu {
    margin-top: .55rem;
}

header.navbar .navbar-toggler {
    border: 1px solid rgba(255, 255, 255, .35);
    border-radius: 999px;
    padding: .4rem .55rem;
    color: #fff;
}

header.navbar .navbar-toggler:focus {
    box-shadow: 0 0 0 .2rem rgba(255, 255, 255, .25);
}

header.navbar .vr,
header.navbar .navbar-toggler-icon {
    color: rgba(255, 255, 255, .6);
}

/* Cart pill ---------------------------------------------------------------- */
.cart-nav {
    display: flex;
    align-items: center;
    flex: 0 0 auto;
    padding: .25rem;
}

.cart-button {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    padding: .4rem .8rem;
    border: 1px solid rgba(255, 255, 255, .42);
    border-radius: 999px;
    background: rgba(255, 255, 255, .14);
    color: #fff;
    font-size: .95rem;
    font-weight: 600;
    line-height: 1;
    white-space: nowrap;
    text-decoration: none;
    box-shadow: 0 6px 16px rgba(20, 40, 27, .16);
    transition: background-color .2s ease, border-color .2s ease, color .2s ease, box-shadow .2s ease, transform .2s ease;
}

.cart-button:hover {
    background: #fff;
    border-color: #fff;
    color: var(--bs-primary);
    text-decoration: none;
    box-shadow: 0 12px 26px rgba(20, 40, 27, .24);
    transform: translateY(-1px);
}

.cart-button:focus-visible {
    outline: 0;
    box-shadow: 0 0 0 .22rem rgba(255, 255, 255, .5), 0 12px 26px rgba(20, 40, 27, .24);
}

.cart-button:active {
    transform: translateY(0) scale(.98);
    box-shadow: 0 4px 10px rgba(20, 40, 27, .2);
}

.cart-button__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: transform .22s ease;
}

.cart-button:hover .cart-button__icon,
.cart-button:focus-visible .cart-button__icon {
    transform: scale(1.1);
}

.cart-button__count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.45rem;
    height: 1.45rem;
    padding: 0 .38rem;
    border-radius: 999px;
    background: #fff;
    color: var(--bs-primary);
    font-size: .78rem;
    font-weight: 800;
    letter-spacing: 0;
    transition: background-color .2s ease, color .2s ease;
}

.cart-button:hover .cart-button__count,
.cart-button:focus-visible .cart-button__count {
    background: var(--bs-primary);
    color: #fff;
}

@media (max-width: 1199.98px) {
    .cart-button__label {
        display: none;
    }

    .cart-button {
        padding: .4rem .55rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .cart-button,
    .cart-button__icon,
    .cart-button__count {
        transition: none;
    }

    .cart-button:hover,
    .cart-button:active {
        transform: none;
    }

    .cart-button:hover .cart-button__icon,
    .cart-button:focus-visible .cart-button__icon {
        transform: none;
    }
}

.offcanvas,
.offcanvas-lg {
    background: var(--surface);
    color: var(--bs-body-color);
}

.offcanvas-header {
    border-bottom: 1px solid var(--line);
}

.offcanvas-title {
    font-weight: 800;
}

/* --------------------------------------------------------------------------
   Buttons
   -------------------------------------------------------------------------- */
.btn {
    --bs-btn-border-radius: 999px;
    --bs-btn-padding-x: 1.05rem;
    --bs-btn-padding-y: .5rem;
    --bs-btn-font-weight: 600;
    --bs-btn-focus-box-shadow: 0 0 0 .22rem rgba(77, 124, 95, .18);
    transition: transform .16s ease, box-shadow .16s ease, background-color .16s ease, border-color .16s ease, color .16s ease;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn:active {
    transform: translateY(0);
}

.btn-primary {
    --bs-btn-bg: #4d7c5f;
    --bs-btn-border-color: #4d7c5f;
    --bs-btn-hover-bg: #416d52;
    --bs-btn-hover-border-color: #3c664d;
    --bs-btn-active-bg: #3a6149;
    --bs-btn-active-border-color: #365c45;
    --bs-btn-disabled-bg: #9db7a5;
    --bs-btn-disabled-border-color: #9db7a5;
    box-shadow: 0 8px 20px rgba(77, 124, 95, .22);
}

.btn-primary:hover {
    box-shadow: 0 12px 26px rgba(77, 124, 95, .28);
}

.btn-success {
    --bs-btn-bg: #2f7d5b;
    --bs-btn-border-color: #2f7d5b;
    --bs-btn-hover-bg: #286b4e;
    --bs-btn-hover-border-color: #256247;
    box-shadow: 0 8px 20px rgba(47, 125, 91, .22);
}

.btn-outline-primary {
    --bs-btn-color: #4d7c5f;
    --bs-btn-border-color: #b9d0bf;
    --bs-btn-hover-bg: #4d7c5f;
    --bs-btn-hover-border-color: #4d7c5f;
    --bs-btn-active-bg: #416d52;
    --bs-btn-active-border-color: #416d52;
}

[data-bs-theme=dark] .btn-outline-primary {
    --bs-btn-color: #a8d4b9;
    --bs-btn-border-color: #47614f;
    --bs-btn-hover-bg: #8fb99a;
    --bs-btn-hover-border-color: #8fb99a;
    --bs-btn-hover-color: #10241a;
}

.btn-outline-success {
    --bs-btn-color: #2f7d5b;
    --bs-btn-border-color: #a9cfb9;
    --bs-btn-hover-bg: #2f7d5b;
    --bs-btn-hover-border-color: #2f7d5b;
    --bs-btn-active-bg: #286b4e;
    --bs-btn-active-border-color: #286b4e;
}

.btn-outline-secondary {
    --bs-btn-color: #5c6a60;
    --bs-btn-border-color: #d3dbd2;
    --bs-btn-hover-bg: #eef3ec;
    --bs-btn-hover-border-color: #c5d2c5;
    --bs-btn-hover-color: #33493a;
}

[data-bs-theme=dark] .btn-outline-secondary {
    --bs-btn-color: #c3cec6;
    --bs-btn-border-color: #3b4a40;
    --bs-btn-hover-bg: #2a372f;
    --bs-btn-hover-border-color: #4a5c4f;
    --bs-btn-hover-color: #eef5ef;
}

.btn-light {
    --bs-btn-bg: #fff;
    --bs-btn-border-color: #e9ede6;
    --bs-btn-hover-bg: #f3f6f1;
    --bs-btn-hover-border-color: #dfe6dc;
}

.btn-link {
    text-decoration: none;
    font-weight: 600;
}

.btn-lg {
    --bs-btn-padding-y: .72rem;
    --bs-btn-padding-x: 1.5rem;
    --bs-btn-font-size: 1.02rem;
}

.btn-sm {
    --bs-btn-padding-y: .32rem;
    --bs-btn-padding-x: .8rem;
    --bs-btn-font-size: .82rem;
}

/* --------------------------------------------------------------------------
   Cards & surfaces
   -------------------------------------------------------------------------- */
.card {
    --bs-card-bg: var(--surface);
    --bs-card-border-color: var(--line);
    --bs-card-border-radius: var(--radius-lg);
    --bs-card-inner-border-radius: calc(var(--radius-lg) - 1px);
    --bs-card-cap-bg: transparent;
    --bs-card-spacer-y: 1.25rem;
    --bs-card-spacer-x: 1.25rem;
    border-width: 1px;
    box-shadow: var(--shadow-soft);
    transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}

.card.shadow-sm,
.card.shadow,
.card.shadow-lg {
    box-shadow: var(--shadow-soft) !important;
}

a.card:hover,
.card.hover-card:hover,
.hover-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-hover) !important;
    border-color: var(--bs-primary-border-subtle);
}

.card-header {
    border-bottom: 1px solid var(--line);
    font-weight: 700;
    padding: .95rem 1.25rem;
}

.card-footer {
    border-top: 1px solid var(--line);
    background: transparent;
}

.card-img-top {
    border-top-left-radius: calc(var(--radius-lg) - 1px);
    border-top-right-radius: calc(var(--radius-lg) - 1px);
}

.modal-content {
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-hover);
}

.modal-header,
.modal-footer {
    border-color: var(--line);
}

.dropdown-menu {
    --bs-dropdown-bg: var(--surface);
    --bs-dropdown-border-color: var(--line);
    --bs-dropdown-border-radius: var(--radius-md);
    --bs-dropdown-link-active-bg: var(--bs-primary-bg-subtle);
    --bs-dropdown-link-active-color: var(--bs-primary-text-emphasis);
    --bs-dropdown-link-hover-bg: var(--bs-primary-bg-subtle);
    --bs-dropdown-link-hover-color: var(--bs-emphasis-color);
    --bs-dropdown-item-border-radius: 10px;
    padding: .45rem;
    box-shadow: var(--shadow-soft);
    border-width: 1px;
}

.dropdown-item {
    padding: .48rem .7rem;
    font-weight: 500;
}

.dropdown-header {
    font-weight: 700;
    color: var(--muted);
}

/* --------------------------------------------------------------------------
   Forms
   -------------------------------------------------------------------------- */
.form-label,
.form-check-label {
    font-weight: 600;
    color: var(--bs-body-color);
    margin-bottom: .4rem;
}

.form-control,
.form-select {
    background-color: var(--surface);
    border: 1px solid #dbe3d8;
    border-radius: var(--radius-sm);
    padding: .58rem .9rem;
    color: var(--bs-body-color);
    transition: border-color .16s ease, box-shadow .16s ease, background-color .16s ease;
}

[data-bs-theme=dark] .form-control,
[data-bs-theme=dark] .form-select {
    border-color: #34443a;
    background-color: #1b241e;
}

.form-control::placeholder {
    color: #9aa79d;
}

.form-control:focus,
.form-select:focus {
    border-color: #8fb39a;
    box-shadow: 0 0 0 .22rem rgba(77, 124, 95, .14);
    background-color: var(--surface);
}

.form-check-input {
    border-color: #c3d0c2;
    border-radius: 6px;
}

.form-check-input:checked {
    background-color: var(--bs-primary);
    border-color: var(--bs-primary);
}

.form-check-input:focus {
    box-shadow: 0 0 0 .2rem rgba(77, 124, 95, .16);
    border-color: #8fb39a;
}

.input-group > .form-control,
.input-group > .form-select,
.input-group > .btn {
    border-radius: var(--radius-sm);
}

.input-group-text {
    background: var(--bs-tertiary-bg);
    border-color: #dbe3d8;
    color: var(--muted);
    border-radius: var(--radius-sm);
}

.form-text {
    color: var(--muted);
}

textarea.form-control {
    min-height: 110px;
}

/* --------------------------------------------------------------------------
   Tables
   -------------------------------------------------------------------------- */
.table {
    --bs-table-bg: transparent;
    --bs-table-color: var(--bs-body-color);
    --bs-table-border-color: var(--line);
    --bs-table-striped-bg: rgba(132, 162, 130, .07);
    --bs-table-hover-bg: rgba(132, 162, 130, .12);
    margin-bottom: 0;
}

.table > :not(caption) > * > * {
    padding: .8rem .9rem;
    vertical-align: middle;
}

.table thead th {
    background: var(--bs-tertiary-bg);
    color: var(--bs-heading-color);
    font-weight: 700;
    font-size: .86rem;
    border-bottom: 1px solid var(--line);
    white-space: nowrap;
}

.table-responsive {
    border-radius: var(--radius-lg);
    border: 1px solid var(--line);
    background: var(--surface);
    box-shadow: var(--shadow-soft);
    overflow-x: auto;
}

.table-responsive .table {
    margin-bottom: 0;
}

/* Keep row actions reachable when a wide table scrolls horizontally. */
.table-responsive .table-actions {
    position: sticky;
    left: 0;
    min-width: 215px;
    white-space: nowrap;
}

.table-responsive .table-actions .modern-btn-group {
    flex-wrap: nowrap;
    gap: .2rem;
}

.table-responsive .table-actions img {
    width: 20px;
    height: 20px;
}

.table-responsive tbody .table-actions {
    z-index: 2;
    background: var(--surface);
    border-inline-start: 1px solid var(--line);
    box-shadow: 10px 0 14px -12px rgba(0, 0, 0, .45);
}

.table-responsive thead .table-actions {
    z-index: 3;
    background: var(--bs-tertiary-bg);
    border-inline-start: 1px solid var(--line);
    box-shadow: 10px 0 14px -12px rgba(0, 0, 0, .45);
}

.modern-btn-group {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .3rem;
}

.modern-btn-group form {
    display: inline-flex;
    margin: 0;
}

.modern-btn-group .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: .3rem .38rem;
    line-height: 1;
}

/* --------------------------------------------------------------------------
   Badges / alerts / pagination / tabs
   -------------------------------------------------------------------------- */
.badge {
    --bs-badge-border-radius: 999px;
    --bs-badge-font-weight: 700;
    padding: .42em .75em;
}

.alert {
    border: 1px solid transparent;
    border-radius: var(--radius-md);
    box-shadow: 0 4px 14px rgba(40, 49, 43, .04);
    font-weight: 500;
}

.alert-success { border-color: var(--bs-success-border-subtle); }
.alert-danger { border-color: var(--bs-danger-border-subtle); }
.alert-warning { border-color: var(--bs-warning-border-subtle); }
.alert-info { border-color: var(--bs-info-border-subtle); }

.pagination {
    --bs-pagination-border-radius: 999px;
    --bs-pagination-padding-x: .8rem;
    --bs-pagination-padding-y: .38rem;
    gap: .35rem;
}

.page-link {
    border-radius: 999px !important;
    border-color: var(--line);
    font-weight: 600;
}

.page-item.active .page-link {
    background: var(--bs-primary);
    border-color: var(--bs-primary);
    box-shadow: 0 6px 14px rgba(77, 124, 95, .22);
}

.nav-tabs {
    --bs-nav-tabs-border-color: var(--line);
    gap: .35rem;
}

.nav-tabs .nav-link {
    border: 1px solid transparent;
    border-radius: 999px;
    color: var(--muted);
    font-weight: 600;
    padding: .48rem 1.05rem;
}

.nav-tabs .nav-link:hover {
    background: var(--bs-primary-bg-subtle);
    color: var(--bs-primary-text-emphasis);
    border-color: transparent;
}

.nav-tabs .nav-link.active {
    background: var(--bs-primary);
    border-color: var(--bs-primary);
    color: #fff;
}

.nav-pills .nav-link {
    border-radius: 999px;
    font-weight: 600;
}

.breadcrumb {
    --bs-breadcrumb-divider-color: var(--muted);
    --bs-breadcrumb-item-active-color: var(--muted);
    font-size: .88rem;
}

.breadcrumb-item + .breadcrumb-item::before {
    content: "‹";
    font-size: 1.05rem;
    line-height: 1;
}

/* --------------------------------------------------------------------------
   Page hero / section headers (shared custom components)
   -------------------------------------------------------------------------- */
.page-hero {
    position: relative;
    overflow: hidden;
    margin-bottom: 2rem;
    padding: clamp(2rem, 5vw, 3.6rem);
    border: 1px solid var(--line);
    border-radius: var(--radius-xl);
    background:
        radial-gradient(600px 260px at 100% 0%, rgba(132, 162, 130, .20), transparent 60%),
        radial-gradient(500px 240px at 0% 100%, rgba(185, 139, 78, .12), transparent 62%),
        linear-gradient(120deg, #e8f3ef, #f8f1e7);
    box-shadow: var(--shadow-soft);
}

[data-bs-theme=dark] .page-hero {
    background:
        radial-gradient(600px 260px at 100% 0%, rgba(116, 195, 156, .12), transparent 60%),
        radial-gradient(500px 240px at 0% 100%, rgba(185, 139, 78, .08), transparent 62%),
        linear-gradient(120deg, #1c2a22, #241f18);
}

.page-hero h1,
.page-hero .display-5 {
    font-weight: 800;
    letter-spacing: -.02em;
}

.page-hero p {
    color: #4f5d53;
    max-width: 60ch;
}

[data-bs-theme=dark] .page-hero p {
    color: #b8c6bc;
}

/* Bootstrap maps .text-secondary to the light sage brand swatch, which is
   unreadable on cream surfaces. Use the muted ink token instead. */
.text-secondary {
    color: var(--bs-secondary-color) !important;
}

.section-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1.4rem;
}

.section-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    margin-bottom: .45rem;
    padding: .28rem .75rem;
    border: 1px solid rgba(185, 139, 78, .28);
    border-radius: 999px;
    background: rgba(185, 139, 78, .09);
    color: #8a6630;
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .06em;
}

.feature-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    border-radius: 18px;
}

[data-bs-theme=dark] .section-eyebrow {
    border-color: rgba(185, 139, 78, .3);
    background: rgba(185, 139, 78, .12);
    color: #d7b57e;
}

.modern-section-header {
    padding: 1.15rem 1.35rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: linear-gradient(120deg, rgba(232, 243, 239, .75), rgba(248, 241, 231, .75));
    box-shadow: var(--shadow-soft);
}

[data-bs-theme=dark] .modern-section-header {
    background: linear-gradient(120deg, rgba(37, 56, 45, .8), rgba(46, 38, 28, .7));
}

.modern-section-header h1,
.modern-section-header h2 {
    margin-bottom: 0;
}

.gradient-text {
    background: linear-gradient(110deg, #2f7d5b 0%, #4d7c5f 45%, #8a6630 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
}

[data-bs-theme=dark] .gradient-text {
    background: linear-gradient(110deg, #a8ddc1 0%, #8fb99a 45%, #d7b57e 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.empty-state {
    padding: 3rem 1.5rem;
    text-align: center;
    color: var(--muted);
    border: 1.5px dashed var(--bs-border-color);
    border-radius: var(--radius-xl);
    background: var(--surface-soft);
}

.empty-state h3,
.empty-state h4 {
    color: var(--bs-heading-color);
}

/* --------------------------------------------------------------------------
   Product cards
   -------------------------------------------------------------------------- */
.product-card {
    overflow: hidden;
    background: var(--surface);
    border-radius: var(--radius-lg);
}

.product-card-img {
    position: relative;
    display: block;
    overflow: hidden;
    aspect-ratio: 1 / 1;
    background: linear-gradient(135deg, var(--brand-mint), var(--brand-cream));
}

[data-bs-theme=dark] .product-card-img {
    background: linear-gradient(135deg, #22302a, #2e281e);
}

.product-card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .45s cubic-bezier(.2, .7, .3, 1);
}

.product-card:hover .product-card-img img {
    transform: scale(1.06);
}

.product-card-badge {
    position: absolute;
    top: .8rem;
    right: .8rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 3rem;
    padding: .32rem .6rem;
    border-radius: 999px;
    background: linear-gradient(135deg, #c65f52, #a94a40);
    color: #fff;
    font-size: .8rem;
    font-weight: 800;
    box-shadow: 0 6px 16px rgba(169, 74, 64, .3);
}

.product-card .card-body {
    padding: 1rem 1.1rem 1.15rem;
}

.product-card-title {
    min-height: 2.9rem;
    margin-bottom: .35rem;
    font-size: .98rem;
    font-weight: 700;
    line-height: 1.55;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* The card link carries Bootstrap's .text-dark utility (!important); keep the
   title readable on the dark theme too. */
.product-card-title a,
.product-card-title a.text-dark {
    color: var(--bs-heading-color) !important;
}

.product-card .text-decoration-line-through {
    font-size: .8rem;
}

.product-card .fw-bold.text-primary {
    color: var(--bs-success) !important;
    font-size: 1.02rem;
    font-weight: 800 !important;
}

.product-card .btn {
    --bs-btn-padding-x: .7rem;
    --bs-btn-padding-y: .38rem;
}

/* --------------------------------------------------------------------------
   Feature / stat / media cards
   -------------------------------------------------------------------------- */
.feature-card,
.app-card,
.media-card,
.stat-card {
    padding: 1.4rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: var(--surface);
    box-shadow: var(--shadow-soft);
    transition: transform .2s ease, box-shadow .2s ease;
}

.feature-card:hover,
.app-card:hover,
.media-card:hover,
.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-hover);
}

.stat-card .stat-value {
    font-size: clamp(1.6rem, 3vw, 2.2rem);
    font-weight: 800;
    color: var(--bs-success);
    line-height: 1.2;
}

.feature-card .icon,
.feature-card i {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    margin-bottom: .9rem;
    border-radius: 14px;
    background: var(--bs-primary-bg-subtle);
    color: var(--bs-primary);
    font-size: 1.35rem;
}

.glass {
    background: rgba(255, 255, 255, .62);
    border: 1px solid rgba(255, 255, 255, .6);
    backdrop-filter: blur(14px) saturate(140%);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-soft);
}

[data-bs-theme=dark] .glass {
    background: rgba(30, 39, 33, .62);
    border-color: rgba(255, 255, 255, .08);
}

/* --------------------------------------------------------------------------
   Steps / progress / score
   -------------------------------------------------------------------------- */
.steps {
    display: flex;
    flex-direction: column;
    gap: .85rem;
}

.progress {
    height: .6rem;
    border-radius: 999px;
    background: var(--bs-tertiary-bg);
    overflow: hidden;
}

.progress-bar {
    border-radius: 999px;
    background: linear-gradient(90deg, #4d7c5f, #7fae8a);
}

.dropzone {
    padding: 2.4rem 1.5rem;
    text-align: center;
    border: 1.8px dashed #bfd2c1;
    border-radius: var(--radius-lg);
    background: var(--surface-soft);
    transition: border-color .18s ease, background .18s ease;
}

.dropzone:hover {
    border-color: var(--bs-primary);
    background: var(--bs-primary-bg-subtle);
}

.score-ring {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 92px;
    height: 92px;
    border-radius: 50%;
    background: conic-gradient(var(--bs-success) 0 72%, var(--bs-tertiary-bg) 72% 100%);
    color: var(--bs-heading-color);
    font-weight: 800;
    font-size: 1.3rem;
    position: relative;
}

.score-ring::after {
    content: "";
    position: absolute;
    inset: 8px;
    border-radius: 50%;
    background: var(--surface);
}

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */
footer.bd-footer,
footer.footer {
    margin-top: 3.5rem;
    padding-top: 2.5rem;
    border-top: 1px solid var(--line);
    background: linear-gradient(180deg, transparent, rgba(132, 162, 130, .06));
    color: var(--muted);
}

footer .fs-5 {
    font-weight: 800;
    color: var(--bs-heading-color);
}

footer h5 {
    font-size: .95rem;
    font-weight: 800;
    margin-bottom: .9rem;
}

footer a:not(.btn) {
    color: var(--muted);
    transition: color .16s ease;
}

footer a:not(.btn):hover {
    color: var(--bs-success);
}

/* --------------------------------------------------------------------------
   Admin shell
   -------------------------------------------------------------------------- */
.bd-sidebar {
    background: transparent;
}

.bd-sidebar .offcanvas-lg {
    background: var(--surface) !important;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-soft);
}

.bd-sidebar .offcanvas-body {
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
}

.bd-links {
    padding: .75rem;
}

.bd-links-link {
    color: var(--bs-body-color);
    font-weight: 600;
    padding: .5rem .75rem;
    border-radius: 10px;
    transition: background .16s ease, color .16s ease;
}

.bd-links-link:hover {
    background: var(--bs-primary-bg-subtle);
    color: var(--bs-primary-text-emphasis);
}

.bd-links-link.active {
    background: var(--bs-primary);
    color: #fff;
}

.bd-links-group > a.bd-links-link {
    font-weight: 800;
    color: var(--bs-heading-color);
}

.admin-sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    padding: .85rem 1rem;
    border-bottom: 1px solid var(--line) !important;
}

.admin-sidebar-header .offcanvas-title {
    font-size: .95rem;
    font-weight: 800;
    color: var(--bs-heading-color);
}

.admin-sidebar-collapse {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    padding: 0;
    color: var(--muted);
    background: var(--surface-soft);
    border: 1px solid var(--line);
    border-radius: 50%;
    transition: color .16s ease, background .16s ease, border-color .16s ease;
}

.admin-sidebar-collapse:hover,
.admin-sidebar-collapse:focus-visible {
    color: var(--bs-primary-text-emphasis);
    background: var(--bs-primary-bg-subtle);
    border-color: var(--bs-primary-border-subtle);
    outline: none;
}

.navbar .admin-sidebar-toggle {
    display: inline-flex !important;
    align-items: center;
    gap: .35rem;
    border: 0;
    border-radius: 999px;
    color: #fff;
    transition: background .16s ease;
}

.navbar .admin-sidebar-toggle:hover,
.navbar .admin-sidebar-toggle:focus-visible {
    background: rgba(255, 255, 255, .16);
}

/* The menu column keeps a fixed width and the content column can shrink to 0,
   so wide tables/forms scroll inside the content instead of squashing the menu. */
@media (min-width: 992px) {
    .bd-layout {
        --admin-sidebar-width: clamp(270px, 22vw, 330px);
        display: grid;
        grid-template-areas: "sidebar main";
        grid-template-columns: var(--admin-sidebar-width) minmax(0, 1fr);
        gap: clamp(1rem, 1.75vw, 1.75rem);
        align-items: start;
        transition: grid-template-columns .28s ease, gap .28s ease;
    }

    .bd-layout > .bd-sidebar {
        grid-area: sidebar;
        top: 5.5rem;
        height: auto;
        max-height: calc(100dvh - 7rem);
        min-width: 0;
        padding: 0;
        margin: 0;
        overflow-y: auto;
        overscroll-behavior: contain;
        scrollbar-width: thin;
        scrollbar-color: rgba(120, 132, 125, .5) transparent;
        transition: opacity .22s ease, visibility .22s ease;
    }

    .bd-layout > main {
        grid-area: main;
        min-width: 0;
    }

    /* Bootstrap hides the responsive offcanvas header above its breakpoint;
       the admin menu keeps it visible to host the collapse control. */
    .bd-sidebar .offcanvas-lg .offcanvas-header {
        display: flex;
    }

    .bd-sidebar .offcanvas-lg .offcanvas-body {
        display: block;
        padding: 0;
        overflow-y: visible;
    }

    html.admin-sidebar-collapsed .bd-layout {
        --admin-sidebar-width: 0px;
        gap: 0;
    }

    html.admin-sidebar-collapsed .bd-layout > .bd-sidebar {
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        overflow: hidden;
    }
}

.bd-content {
    --bd-content-bg: var(--surface);
}

.bd-content > .card,
.bd-content > .table-responsive {
    background: var(--surface);
}

/* --------------------------------------------------------------------------
   Utilities used by the views
   -------------------------------------------------------------------------- */
.text-success {
    color: var(--bs-success) !important;
}

.bg-success-subtle {
    background-color: var(--bs-success-bg-subtle) !important;
}

.border-success-subtle {
    border-color: var(--bs-success-border-subtle) !important;
}

.shadow-soft {
    box-shadow: var(--shadow-soft) !important;
}

.rounded-pill {
    border-radius: 999px !important;
}

main img {
    max-width: 100%;
    height: auto;
}

.stretched-link::after {
    border-radius: inherit;
}

/* Soft scrollbars */
* {
    scrollbar-width: thin;
    scrollbar-color: #b9c9b7 transparent;
}

*::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

*::-webkit-scrollbar-thumb {
    background: #c3d2c0;
    border-radius: 999px;
    border: 2px solid transparent;
    background-clip: content-box;
}

*::-webkit-scrollbar-thumb:hover {
    background: #a9bfa5;
    background-clip: content-box;
}

[data-bs-theme=dark] *::-webkit-scrollbar-thumb {
    background: #3d5043;
    background-clip: content-box;
}

/* --------------------------------------------------------------------------
   Responsive refinements
   -------------------------------------------------------------------------- */
@media (max-width: 991.98px) {
    header.navbar {
        margin-inline: .75rem !important;
        border-radius: 22px !important;
    }

    .page-hero {
        padding: 1.6rem 1.25rem;
        border-radius: var(--radius-lg);
    }

    .modern-section-header {
        padding: 1rem;
    }
}

@media (max-width: 575.98px) {
    body {
        line-height: 1.8;
    }

    .product-card-title {
        font-size: .9rem;
    }

    .table-responsive {
        border-radius: var(--radius-md);
    }
}

/* --------------------------------------------------------------------------
   Mobile navigation drawer
   The header uses a backdrop blur, which makes it the containing block for
   fixed children, so the off-canvas collapsed to the header height. Give it
   an explicit viewport height and a solid brand surface for readable links.
   -------------------------------------------------------------------------- */
@media (max-width: 991.98px) {
    #bdNavbar.offcanvas-lg {
        height: 100vh;
        height: 100dvh;
        background: linear-gradient(165deg, #437055 0%, #2f5c44 100%) !important;
        border: 0;
        border-radius: 0 0 0 var(--radius-xl);
        box-shadow: var(--shadow-nav);
    }

    #bdNavbar .offcanvas-header {
        border-bottom: 1px solid rgba(255, 255, 255, .14);
        padding-bottom: 1rem;
    }

    #bdNavbar .offcanvas-body {
        overflow-y: auto;
    }

    #bdNavbar .navbar-nav {
        flex-direction: column;
        gap: .15rem;
        width: 100%;
    }

    #bdNavbar .nav-item {
        width: 100%;
    }

    #bdNavbar .nav-link {
        padding: .7rem 1rem !important;
        border-radius: var(--radius-sm);
        color: rgba(255, 255, 255, .92);
    }

    #bdNavbar .nav-link:hover,
    #bdNavbar .nav-link:focus {
        background: rgba(255, 255, 255, .12);
        color: #fff;
    }

    #bdNavbar .dropdown-menu {
        border: 0;
        box-shadow: none;
        background: rgba(255, 255, 255, .08);
    }

    #bdNavbar .dropdown-item {
        color: rgba(255, 255, 255, .9);
        border-radius: var(--radius-sm);
    }

    #bdNavbar .dropdown-item:hover {
        background: rgba(255, 255, 255, .14);
        color: #fff;
    }
}

.shop-toolbar {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    padding: 1rem;
    box-shadow: var(--shadow-soft);
}

#product-grid .col-lg-3,
#product-grid .col-md-4,
#product-grid .col-sm-6 {
    padding-left: .5rem;
    padding-right: .5rem;
}

.projects-header {
    position: relative;
    overflow: hidden;
    width: calc(100% - 2rem);
    margin: 1rem auto;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-soft);
}

.projects-header::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        radial-gradient(420px 220px at 88% 0%, rgba(255, 255, 255, .16), transparent 65%),
        radial-gradient(360px 200px at 8% 100%, rgba(255, 255, 255, .10), transparent 62%);
}

/* --------------------------------------------------------------------------
   Error pages
   -------------------------------------------------------------------------- */
.error-page {
    padding: 3.5rem 2rem;
    margin-top: 1.5rem;
}

.error-code {
    font-size: clamp(3.5rem, 9vw, 6rem);
    font-weight: 800;
    line-height: 1;
    letter-spacing: .02em;
    color: var(--bs-primary);
    opacity: .9;
    margin-bottom: .75rem;
}

.error-page p {
    max-width: 52ch;
    margin-inline: auto;
    color: #4f5d53;
}

[data-bs-theme=dark] .error-page p {
    color: var(--bs-secondary-color);
}

/* --------------------------------------------------------------------------
   Empty states
   -------------------------------------------------------------------------- */
.modern-empty-state {
    padding: 3rem 1.5rem;
    text-align: center;
}

.modern-empty-state img {
    width: 84px !important;
    height: 84px !important;
    opacity: .55;
    margin-bottom: 1rem;
}

.modern-empty-state h3 {
    font-weight: 700;
    margin-bottom: .5rem;
}

.modern-empty-state p {
    color: var(--muted);
    margin-bottom: 0;
}

/* --------------------------------------------------------------------------
   Home hero (CMS inline background) – dark mode
   -------------------------------------------------------------------------- */
[data-bs-theme=dark] .container > section.rounded-4.overflow-hidden[style*="linear-gradient"] {
    background: linear-gradient(120deg, #1d2b23, #26211a) !important;
}

[data-bs-theme=dark] .container > section.rounded-4.overflow-hidden[style*="linear-gradient"] h1 {
    color: #f2f5ef;
}

/* Keep utility backgrounds theme-aware */
[data-bs-theme=dark] .bg-light {
    background-color: var(--bs-tertiary-bg) !important;
}

/* Cart table: keep prices on one line */
.cart-table th,
.cart-table td {
    vertical-align: middle;
}

@media (max-width: 575.98px) {
    .product-card .card-body {
        padding: .75rem .8rem .85rem;
    }

    .product-card .fw-bold.text-primary {
        font-size: .92rem;
    }

    .product-card .btn {
        --bs-btn-padding-x: .55rem;
        --bs-btn-padding-y: .32rem;
    }
}

/* Stacked tables on phones/tablets: each row becomes a card */
@media (max-width: 767.98px) {
    .table-stack {
        margin-bottom: 0;
    }

    .table-stack thead {
        display: none;
    }

    .table-stack tbody tr {
        display: block;
        margin-bottom: .85rem;
        padding: .65rem .85rem;
        border: 1px solid var(--line);
        border-radius: var(--radius-md);
        background: var(--surface);
        box-shadow: var(--shadow-soft);
    }

    .table-stack tbody tr:last-child {
        margin-bottom: 0;
    }

    .table-stack tbody td {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: .75rem;
        padding: .35rem 0;
        border: 0;
        text-align: end;
        white-space: normal;
    }

    .table-stack tbody td::before {
        content: attr(data-label);
        flex: 0 0 auto;
        color: var(--muted);
        font-size: .85rem;
        font-weight: 600;
        text-align: start;
    }

    .table-stack tbody td[data-label=""]::before,
    .table-stack tbody td:not([data-label])::before {
        display: none;
    }

    .table-stack tbody td.table-stack-primary {
        display: block;
        padding-top: .25rem;
        text-align: start;
    }

    .table-stack tbody td.table-stack-primary::before {
        display: none;
    }

    .table-stack tbody td.table-stack-actions {
        justify-content: flex-start;
        margin-top: .4rem;
        padding-top: .65rem;
        border-top: 1px dashed var(--line);
        text-align: start;
    }

    .cart-table td .d-flex {
        justify-content: flex-start;
        text-align: start;
    }
}

/* Product details: keep cards full width on small screens */
@media (max-width: 575.98px) {
    .shop-details-seller {
        margin-top: .25rem;
    }

    .product-gallery-thumbs .col-4 {
        width: 25%;
    }
}

/* Persian file input: replaces the browser's English "Choose file" chrome */
.fa-file-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
    gap: .65rem;
    min-height: 3rem;
    padding: .45rem .6rem .45rem .9rem;
    border: 1px dashed var(--line);
    border-radius: var(--radius-sm);
    background: var(--surface-soft);
    transition: border-color .2s ease, box-shadow .2s ease;
}

.fa-file-input-wrap:hover,
.fa-file-input-wrap:focus-within {
    border-color: var(--brand-500);
    box-shadow: 0 0 0 3px rgba(132, 162, 130, .16);
}

.fa-file-input-wrap > input[type=file] {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    z-index: 2;
}

.fa-file-input-face {
    display: flex;
    align-items: center;
    gap: .65rem;
    min-width: 0;
}

.fa-file-input-btn {
    flex: 0 0 auto;
    padding: .4rem .95rem;
    border-radius: 999px;
    background: var(--bs-primary);
    color: #fff;
    font-size: .85rem;
    font-weight: 600;
}

.fa-file-input-name {
    overflow: hidden;
    color: var(--muted);
    font-size: .9rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

[data-bs-theme=dark] .fa-file-input-wrap {
    background: var(--bs-tertiary-bg);
    border-color: var(--bs-border-color);
}

/* Keep black SVG icons visible on dark surfaces */
[data-bs-theme=dark] .modern-empty-state img,
[data-bs-theme=dark] .modern-section-header img,
[data-bs-theme=dark] .page-hero img,
[data-bs-theme=dark] .section-eyebrow img {
    filter: invert(1) brightness(1.7);
}

[data-bs-theme=dark] .modern-empty-state img {
    opacity: .7;
}

/* --------------------------------------------------------------------------
   Dynamic home sections
   -------------------------------------------------------------------------- */
.home-section-body {
    line-height: 1.95;
}

.home-section-body img,
.home-section-body video,
.home-section-body iframe {
    max-width: 100%;
    height: auto;
}

.home-section-body table {
    width: 100%;
}

.home-hero {
    overflow: hidden;
}

.home-video-frame {
    max-width: 960px;
    background: #000;
}

.home-newsletter-card {
    background: var(--surface);
    border: 1px solid var(--line);
}

[data-bs-theme=dark] .home-newsletter-card {
    background: var(--bs-tertiary-bg);
}

.home-newsletter-card .form-control {
    min-width: 0;
}

@media (max-width: 575.98px) {
    .home-newsletter .input-group .btn {
        padding-inline: 1rem;
        white-space: nowrap;
    }

    .home-hero .display-5 {
        font-size: clamp(1.7rem, 8vw, 2.4rem);
    }
}

/* --------------------------------------------------------------------------
   Image picker
   -------------------------------------------------------------------------- */
.image-picker .ip-drop {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .55rem;
    max-width: 210px;
    margin: 0 auto;
    padding: 14px;
    border: 2px dashed var(--brand-400);
    border-radius: var(--radius-md);
    background: var(--brand-100);
    cursor: pointer;
    transition: border-color .2s ease, background-color .2s ease;
}

.image-picker .ip-drop:hover,
.image-picker .ip-drop:focus-visible,
.image-picker .ip-drop.is-dragover {
    border-color: var(--bs-primary);
    background: var(--brand-200);
    outline: 0;
}

.image-picker .ip-drop:focus-visible {
    box-shadow: 0 0 0 .2rem rgba(77, 124, 95, .25);
}

.image-picker .ip-preview {
    width: 120px;
    height: 120px;
    border-radius: var(--radius-sm);
    object-fit: cover;
    background: var(--surface);
    box-shadow: var(--shadow-soft);
}

.image-picker .ip-drop-hint {
    color: var(--brand-700);
    font-size: .85rem;
    font-weight: 600;
    line-height: 1.6;
    text-align: center;
}

.image-picker .ip-gallery-card .card-header {
    background: transparent;
    border-bottom: 1px solid var(--line);
}

.image-picker .js-ip-search {
    min-width: 170px;
    max-width: 240px;
}

.image-picker .js-ip-gallery {
    transition: opacity .2s ease;
}

.image-picker .js-ip-gallery.is-loading {
    opacity: .5;
    pointer-events: none;
}

.image-picker .ip-gallery-item {
    display: flex;
    flex-direction: column;
    gap: .3rem;
    padding: .35rem;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    background: transparent;
    text-align: center;
    transition: border-color .18s ease, background-color .18s ease, box-shadow .18s ease, transform .18s ease;
}

.image-picker .ip-gallery-item:hover {
    border-color: var(--brand-300);
    background: var(--surface-soft);
    transform: translateY(-1px);
}

.image-picker .ip-gallery-item.is-selected {
    border-color: var(--bs-primary);
    background: var(--brand-100);
    box-shadow: 0 0 0 2px rgba(77, 124, 95, .22);
}

.image-picker .ip-thumb {
    width: 100%;
    height: 82px;
    border-radius: 8px;
    background: var(--surface-soft);
    object-fit: cover;
}

.image-picker .ip-caption {
    overflow: hidden;
    color: var(--muted);
    font-size: .72rem;
    white-space: nowrap;
    text-overflow: ellipsis;
}

[data-bs-theme=dark] .image-picker .ip-drop {
    background: var(--bs-tertiary-bg);
    border-color: var(--bs-primary-border-subtle);
}

[data-bs-theme=dark] .image-picker .ip-drop:hover,
[data-bs-theme=dark] .image-picker .ip-drop:focus-visible,
[data-bs-theme=dark] .image-picker .ip-drop.is-dragover {
    background: var(--bs-secondary-bg);
}

[data-bs-theme=dark] .image-picker .ip-gallery-item.is-selected {
    background: var(--bs-primary-bg-subtle);
}

/* Footer trust section (admin-pasted licenses and payment gateway HTML) */
.footer-trust {
    margin-top: 2.5rem;
    padding-top: 1.75rem;
    border-top: 1px solid var(--bs-border-color-translucent);
    text-align: center;
}

.footer-trust a {
    display: inline-block;
    margin: .3rem .55rem;
    vertical-align: middle;
}

.footer-trust img {
    max-height: 72px;
    width: auto;
    vertical-align: middle;
}

@media (max-width: 575.98px) {
    .footer-trust {
        margin-top: 1.75rem;
        padding-top: 1.25rem;
    }

    .footer-trust img {
        max-height: 56px;
    }
}
