html, body {
    font-family: "Rajdhani", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
    font-weight: 800;
    margin: 0;
    padding: 0;
    background-color: rgba(214, 206, 191, 1);
}

body.vds-scroll-locked {
    overflow: hidden;
}

/* Global page content padding (top right bottom left).
   Change this single value to adjust padding site-wide. */
:root {
    --vds-content-padding: 1.1rem 1.5rem 0 2rem;
    --vds-accent: #2f7a52;
    --vds-accent-hover: #276646;
    --vds-accent-border: #22563b;
    --vds-focus-ring: rgba(47, 122, 82, 0.24);
    --vds-button-text: #f8f6f0;

    /* Reusable admin create/edit modal hierarchy tokens */
    --vds-modal-title-size: 1.85rem;
    --vds-modal-title-weight: 700;
    --vds-modal-title-color: var(--vds-accent);

    --vds-modal-label-size: 1.15rem;
    --vds-modal-label-weight: 600;
    --vds-modal-label-color: #1f2937;

    --vds-modal-input-size: 1rem;
    --vds-modal-input-weight: 400;
    --vds-modal-input-color: #1f2937;

    --vds-modal-helper-size: 0.85rem;
    --vds-modal-helper-weight: 400;
    --vds-modal-helper-color: #6b7280;
    --vds-modal-placeholder-color: #9ca3af;

    --vds-modal-header-padding-bottom: 20px;
    --vds-modal-header-margin-bottom: 24px;
    --vds-modal-header-border: 1px solid #e5e7eb;

    --vds-modal-section-gap: 22px;
    --vds-modal-label-gap: 8px;
    --vds-modal-actions-gap-top: 20px;
}

a,
.btn-link {
    color: var(--vds-accent);
}

.btn {
    border-radius: 10px;
    font-weight: 700;
    letter-spacing: 0.01em;
    transition: background-color 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease, transform 0.12s ease;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn-primary {
    color: var(--vds-button-text);
    background: linear-gradient(180deg, #3a8f61 0%, var(--vds-accent) 100%);
    border-color: var(--vds-accent-border);
    box-shadow: 0 2px 10px rgba(34, 86, 59, 0.14);
}

.btn-primary:hover,
.btn-primary:focus-visible {
    color: var(--vds-button-text);
    background: linear-gradient(180deg, #348157 0%, var(--vds-accent-hover) 100%);
    border-color: #1d4a32;
}

.btn-danger {
    color: var(--vds-button-text);
    background: linear-gradient(180deg, #d65a5a 0%, #b53d3d 100%);
    border-color: #8f2c2c;
    box-shadow: 0 2px 10px rgba(143, 44, 44, 0.16);
}

.btn-danger:hover,
.btn-danger:focus-visible {
    color: var(--vds-button-text);
    background: linear-gradient(180deg, #c94f4f 0%, #9f3434 100%);
    border-color: #782323;
}

.btn-danger:active,
.btn-danger.active,
.show > .btn-danger.dropdown-toggle {
    color: var(--vds-button-text);
    background: linear-gradient(180deg, #b84545 0%, #912f2f 100%);
    border-color: #6d1f1f;
}

.btn-danger:disabled,
.btn-danger.disabled {
    color: var(--vds-button-text);
    background: linear-gradient(180deg, #d99797 0%, #bd7a7a 100%);
    border-color: #b27a7a;
}

.btn-outline-secondary {
    color: #394039;
    background-color: #f7f5ee;
    border-color: #cfc7b6;
}

.btn-outline-secondary:hover,
.btn-outline-secondary:focus-visible {
    color: #1f241f;
    background-color: #ece5d6;
    border-color: #b6ab96;
}

.btn:focus,
.btn:active:focus,
.btn-link.nav-link:focus,
.form-control:focus,
.form-check-input:focus {
    box-shadow: 0 0 0 0.1rem white, 0 0 0 0.28rem var(--vds-focus-ring);
}

.content {
    padding: var(--vds-content-padding);
    box-sizing: border-box;
}

h1:focus {
    outline: none;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid #e50000;
}

.validation-message {
    color: #e50000;
}

.blazor-error-boundary {
    background: #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "An error has occurred."
    }

.darker-border-checkbox.form-check-input {
    border-color: #929292;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
    color: var(--bs-secondary-color);
    text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
    text-align: start;
}

/* NavMenu link styling moved out of CSS isolation (no ::deep). */
.sidebar .nav-item .nav-link {
    color: #d7d7d7;
    background: none;
    border: none;
    border-radius: 4px;
    height: 2.65rem;
    display: flex;
    align-items: center;
    line-height: 2.65rem;
    width: 100%;
    padding-left: 0.8rem;
}

.sidebar .nav-item a.active,
.sidebar .nav-item .nav-link.active {
    background-color: rgba(255,255,255,0.37);
    color: white;
}

.sidebar .nav-item .nav-link:hover {
    background-color: rgba(255,255,255,0.1);
    color: white;
}

/* Admin grid tables: constrain width to prevent page-level horizontal scrolling */
.admin-grid-table {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

/* Desktop: use fixed table layout to prevent content-driven width expansion */
@media (min-width: 641px) {
    .admin-grid-table {
        table-layout: fixed;
    }
}

/* Ensure cell content wraps safely instead of forcing table expansion */
.admin-grid-table th,
.admin-grid-table td {
    overflow-wrap: anywhere;
    word-break: break-word;
    white-space: normal;
}

/* Keep Metadata grid headers visible beneath the sticky admin tab bar while page scrolls. */
.metadata-grid thead th {
    position: sticky;
    top: var(--vds-admin-sticky-offset, 0px);
    z-index: 5;
    background-color: #fff;
}

/* Wrap long success/error messages near grids to prevent horizontal overflow */
.create-success-message,
.create-error-message,
.alert {
    overflow-wrap: anywhere;
    word-break: break-word;
}

/* Constrain utility columns to prevent them from taking excessive space */
.admin-grid-table .expand-cell,
.admin-grid-table .expand-column-header {
    width: 48px;
    min-width: 48px;
    max-width: 48px;
}

.admin-grid-table .actions-cell {
    width: auto;
    min-width: 120px;
}

/* Keep image columns compact */
.admin-grid-table td:has(.product-thumbnail),
.admin-grid-table td:has(.image-fallback) {
    width: 100px;
    min-width: 100px;
}

.vds-close-x {
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 2.5px solid var(--vds-accent);
    border-radius: 8px;
    background-color: #fff;
    color: var(--vds-accent);
    font-size: 1.25rem;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 1px 4px rgba(34, 86, 59, 0.10);
    transition: background-color 0.18s ease, color 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.vds-close-x:hover:not(:disabled),
.vds-close-x:focus-visible:not(:disabled) {
    background-color: var(--vds-accent);
    color: var(--vds-button-text);
    border-color: var(--vds-accent-border);
    box-shadow: 0 2px 8px rgba(34, 86, 59, 0.18);
}

.vds-close-x:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px var(--vds-focus-ring);
}

.vds-close-x:disabled {
    cursor: not-allowed;
    opacity: 0.65;
}
