@import url("/static/css/fonts.css");

/* Shared Inventory Add/Edit Item modal ----------------------------------- */
.inventory-item-modal {
    position: fixed;
    inset: 0;
    z-index: 1300;
    align-items: center;
    justify-content: center;
    padding: 0;
    background: rgba(15, 23, 42, 0.4);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
}

.inventory-item-modal .modal-sheet {
    display: flex;
    width: 100%;
    height: 100dvh;
    max-height: none;
    flex-direction: column;
    overflow: hidden;
    border: 0;
    border-radius: 0;
    background: rgba(244, 248, 252, 0.95);
    box-shadow: 0 28px 80px rgba(15, 23, 42, 0.3);
    -webkit-backdrop-filter: blur(24px) saturate(125%);
    backdrop-filter: blur(24px) saturate(125%);
}

/* Wider screens (desktop browser, tablet): keep the sheet in the same 480px phone column as the
   app shell behind it, instead of stretching across the whole window. */
@media (min-width: 520px) {
    .inventory-item-modal .modal-sheet {
        max-width: 480px;
        margin: 0 auto;
    }
}

.inventory-item-modal .modal-hdr {
    display: flex;
    min-height: 72px;
    flex: 0 0 auto;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: calc(0.65rem + env(safe-area-inset-top, 0px)) 1rem 0.65rem;
    border-radius: 0;
    background: linear-gradient(135deg, #0799ed 0%, #087fc8 100%);
    color: #fff;
    box-shadow: 0 8px 24px rgba(7, 153, 237, 0.24);
}

.inventory-item-modal .modal-hdr-title {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 0.65rem;
    font-family: inherit;
}

.inventory-item-modal .modal-hdr-title > i {
    font-size: 1.25rem;
}

.edit-modal-title-copy {
    display: grid;
    min-width: 0;
    gap: 0.05rem;
}

.edit-modal-title-copy > span {
    font-size: 1.05rem;
    font-weight: 900;
    line-height: 1.15;
}

.edit-modal-title-copy small {
    overflow-wrap: anywhere;
    font-size: 0.75rem;
    font-weight: 750;
    line-height: 1.15;
    opacity: 0.88;
}

.inventory-item-modal .modal-close-btn {
    display: grid;
    width: 40px;
    height: 40px;
    flex: 0 0 40px;
    place-items: center;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.16);
    color: #fff;
    font-size: 1.08rem;
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
}

.inventory-item-modal .modal-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding: 0.7rem 0.7rem calc(8rem + env(safe-area-inset-bottom, 0px));
    background: transparent;
    scroll-padding-block: 0.75rem 110px;
    -webkit-overflow-scrolling: touch;
}

.inventory-item-modal .form-section {
    padding: 0.78rem;
    margin-bottom: 0.65rem;
    border: 1px solid rgba(218, 226, 236, 0.88);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.86);
    box-shadow: 0 5px 18px rgba(16, 24, 40, 0.055);
    -webkit-backdrop-filter: blur(16px);
    backdrop-filter: blur(16px);
}

.inventory-item-modal .form-section-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.7rem;
    color: #101828;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 900;
    line-height: 1.2;
}

.edit-section-icon {
    display: inline-grid;
    width: 28px;
    height: 28px;
    flex: 0 0 28px;
    place-items: center;
    border-radius: 8px;
    background: #eff8ff;
    color: #1570ef;
    font-size: 0.82rem;
}

.edit-item-summary {
    display: grid;
    grid-template-columns: 56px minmax(0, 1fr);
    align-items: center;
    gap: 0.7rem;
}

.edit-item-category-image {
    display: grid;
    width: 56px;
    height: 64px;
    overflow: hidden;
    place-items: center;
    border: 1px solid #edf1f5;
    border-radius: 10px;
    background: #f8fafc;
}

.edit-item-category-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.edit-item-category-image span {
    padding: 0.25rem;
    color: #667085;
    font-size: 0.72rem;
    font-weight: 800;
    text-align: center;
}

.edit-item-identity-copy {
    display: grid;
    min-width: 0;
    gap: 0.12rem;
}

.edit-item-identity-copy small {
    color: #98a2b3;
    font-size: 0.7rem;
    font-weight: 700;
}

.edit-item-stock-summary small {
    color: #98a2b3;
    font-size: 12px;
    font-weight: 700;
}

.edit-item-identity-copy strong {
    color: #101828;
    font-size: 1.03rem;
    font-weight: 900;
    line-height: 1.2;
    overflow-wrap: anywhere;
}

.edit-item-identity-copy > span {
    color: #667085;
    font-size: 0.8rem;
    font-weight: 650;
}

.edit-item-stock-summary {
    display: grid;
    grid-column: 1 / -1;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    justify-items: start;
    gap: 0.18rem;
}

.edit-item-stock-summary > span {
    padding: 0.22rem 0.45rem;
    border-radius: 999px;
    font-size: 0.66rem;
    font-weight: 850;
    white-space: nowrap;
}

.edit-item-stock-summary > span.healthy { background: #ecfdf3; color: #067647; }
.edit-item-stock-summary > span.low { background: #fff7ed; color: #f97316; }
.edit-item-stock-summary > span.out { background: #fef3f2; color: #d92d20; }

.edit-item-stock-summary > strong {
    justify-self: end;
    color: #079455;
    font-size: 22px;
    font-weight: 900;
    white-space: nowrap;
}

.inventory-item-modal .edit-item-identity #categoryGroup,
.inventory-item-modal .edit-item-identity #itemCodeGroup {
    margin-top: 0.6rem;
}

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

.inventory-item-modal .form-group {
    min-width: 0;
    margin-bottom: 0.62rem;
}

.inventory-item-modal .form-row:last-child .form-group:last-child,
.inventory-item-modal .form-section > .form-group:last-child {
    margin-bottom: 0;
}

.inventory-item-modal .form-label {
    margin-bottom: 0.28rem;
    color: #475467;
    font-size: 0.78rem;
    font-weight: 800;
    line-height: 1.25;
}

.inventory-item-modal .form-label,
.inventory-item-modal .variant-headers > span,
.inventory-item-modal .variant-headers > div {
    display: inline-flex;
    min-width: 0;
    align-items: center;
    gap: 0.28rem;
}

.field-options-info {
    display: inline-flex;
    width: 24px;
    height: 24px;
    flex: 0 0 24px;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: #eef8ff;
    color: #0799ed;
    font-size: 0.82rem;
    cursor: pointer;
}

.field-options-info:active { background: #dff2fd; color: #087ebf; }

.inventory-field-options-overlay {
    position: fixed;
    inset: 0;
    z-index: 3100;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 0.75rem;
    background: rgba(16, 24, 40, 0.52);
}

.inventory-field-options-overlay.open { display: flex; }

.inventory-field-options-sheet {
    width: min(calc(100% - 0.5rem), 440px);
    max-height: min(70dvh, 560px);
    overflow: hidden;
    border: 1px solid #b9e4fb;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 20px 50px rgba(16, 24, 40, 0.24);
}

.inventory-field-options-sheet header {
    display: flex;
    min-height: 66px;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.72rem 0.8rem;
    border-bottom: 1px solid #e4e7ec;
}

.inventory-field-options-sheet header div { display: grid; gap: 0.12rem; }
.inventory-field-options-sheet header small { color: #667085; font-size: 0.72rem; font-weight: 800; }
.inventory-field-options-sheet header strong { color: #101828; font-size: 1.08rem; font-weight: 950; }
.inventory-field-options-sheet header button {
    display: inline-flex;
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 1px solid #d0d5dd;
    border-radius: 50%;
    background: #fff;
    color: #344054;
    font-size: 1.05rem;
}

.inventory-field-options-list {
    display: flex;
    max-height: calc(min(70dvh, 560px) - 67px);
    overflow-y: auto;
    flex-wrap: wrap;
    align-content: flex-start;
    gap: 0.48rem;
    padding: 0.8rem;
    -webkit-overflow-scrolling: touch;
}

.inventory-field-options-list button {
    padding: 0.48rem 0.62rem;
    border: 1px solid #b9e4fb;
    border-radius: 8px;
    background: #f5fbff;
    color: #175cd3;
    font-size: 0.85rem;
    font-weight: 850;
    line-height: 1.25;
}

.inventory-field-options-list button[aria-pressed="true"] {
    border-color: #0799ed;
    background: #dff3ff;
    color: #087ebf;
    box-shadow: inset 0 0 0 1px #0799ed;
}

.shared-price-calculator-overlay {
    position: fixed;
    inset: 0;
    z-index: 3200;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 0.85rem;
    background: rgba(16, 24, 40, 0.56);
}

.shared-price-calculator-overlay.open { display: flex; }

.shared-price-calculator {
    width: min(100%, 420px);
    overflow: hidden;
    border: 1px solid #b9e4fb;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 20px 50px rgba(16, 24, 40, 0.26);
}

.shared-price-calculator header {
    display: flex;
    min-height: 66px;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.72rem 0.8rem;
    border-bottom: 1px solid #e4e7ec;
}

.shared-price-calculator header > div { display: grid; gap: 0.12rem; }
.shared-price-calculator header small { color: #667085; font-size: 0.72rem; font-weight: 800; }
.shared-price-calculator header strong { color: #101828; font-size: 1.08rem; font-weight: 950; }
.shared-price-calculator header button {
    display: inline-flex;
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 1px solid #d0d5dd;
    border-radius: 50%;
    background: #fff;
    color: #344054;
    font-size: 1.05rem;
}

.shared-price-calculator-body { display: grid; gap: 0.7rem; padding: 0.85rem; }
.shared-price-base,
.shared-price-result {
    display: flex;
    min-height: 48px;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.62rem 0.7rem;
    border-radius: 8px;
    background: #f5fbff;
    color: #475467;
    font-size: 0.82rem;
    font-weight: 800;
}

.shared-price-base strong,
.shared-price-result strong { color: #101828; font-size: 1.08rem; font-weight: 950; }
.shared-price-result { border: 1px solid #b9e4fb; }
.shared-price-result strong { color: #087ebf; font-size: 1.25rem; }
.shared-price-modes { display: grid; grid-template-columns: 1fr 1fr; gap: 0.4rem; }
.shared-price-modes button,
.shared-price-presets button {
    min-height: 42px;
    border: 1px solid #d0d5dd;
    border-radius: 8px;
    background: #fff;
    color: #475467;
    font-size: 0.82rem;
    font-weight: 850;
}

.shared-price-modes button.active { border-color: #0799ed; background: #eef8ff; color: #087ebf; }
.shared-price-input-label { display: flex; justify-content: space-between; color: #475467; font-size: 0.78rem; font-weight: 850; }
#sharedPriceExtraInput {
    width: 100%;
    min-height: 48px;
    padding: 0.65rem 0.72rem;
    border: 1px solid #d0d5dd;
    border-radius: 9px;
    color: #101828;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 850;
}

#sharedPriceExtraInput:focus { border-color: #0799ed; outline: 3px solid rgba(7, 153, 237, 0.14); }
.shared-price-presets { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.38rem; }
.shared-price-calculator footer { display: grid; grid-template-columns: 0.8fr 1.3fr; gap: 0.5rem; padding: 0.7rem 0.85rem calc(0.7rem + env(safe-area-inset-bottom, 0px)); border-top: 1px solid #e4e7ec; }
.shared-price-calculator footer button { min-height: 46px; border: 1px solid #d0d5dd; border-radius: 9px; background: #fff; color: #344054; font-size: 0.88rem; font-weight: 900; }
.shared-price-calculator footer button.apply { border-color: #0799ed; background: #0799ed; color: #fff; }

.inventory-item-modal .form-label small { display: none; }

.inventory-item-modal .form-input,
.inventory-item-modal .form-control {
    width: 100%;
    min-width: 0;
    min-height: 46px;
    padding: 0.65rem 0.72rem !important;
    border: 1px solid #d0d5dd !important;
    border-radius: 9px !important;
    background-color: #fff !important;
    color: #101828 !important;
    font-family: inherit !important;
    font-size: 1rem !important;
    font-weight: 700 !important;
    line-height: 1.2 !important;
}

.inventory-item-modal .form-input:focus,
.inventory-item-modal .form-control:focus {
    border-color: #0799ed !important;
    box-shadow: 0 0 0 3px rgba(7, 153, 237, 0.12) !important;
}

.inventory-item-modal .form-input.error,
.inventory-item-modal .form-control.error {
    border-color: #f04438 !important;
}

.inventory-item-modal .form-input::placeholder,
.inventory-item-modal .form-control::placeholder {
    color: #98a2b3;
    font-weight: 600;
}

.inventory-item-modal select.form-input,
.inventory-item-modal select.form-control {
    background-position: right 0.72rem center !important;
    padding-right: 2rem !important;
}

.inventory-item-modal .manual-category-input { padding-left: 2rem !important; }
.inventory-item-modal .manual-category-input-wrap > i { left: 0.72rem; color: #667085; font-size: 0.9rem; }

.inventory-item-modal .inventory-autocomplete-wrap { position: relative; min-width: 0; }

.inventory-item-modal .inventory-autocomplete-menu {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    z-index: 1450;
    max-height: 210px;
    overflow-y: auto;
    gap: 2px;
    padding: 4px;
    border: 1px solid #d0d5dd;
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 14px 30px rgba(16, 24, 40, 0.16);
    -webkit-overflow-scrolling: touch;
}

.inventory-item-modal .inventory-autocomplete-menu.open { display: grid; }

.inventory-item-modal .inventory-autocomplete-option {
    width: 100%;
    min-height: 44px;
    padding: 0.55rem 0.65rem;
    border: 0;
    border-radius: 8px;
    background: #fff;
    color: #101828;
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 700;
    line-height: 1.25;
    text-align: left;
    cursor: pointer;
}

.inventory-item-modal .inventory-autocomplete-option:hover,
.inventory-item-modal .inventory-autocomplete-option:active {
    background: #eef8ff;
    color: #087ebf;
}

.inventory-item-modal .manual-category-suggestions { border-color: #d0d5dd; font-size: 1rem; }
.inventory-item-modal .manual-category-suggestion { min-height: 44px; font-size: 0.9rem; }

.inventory-item-modal .edit-suggestion-wrap {
    position: relative;
    min-width: 0;
}

.inventory-item-modal .edit-basic-section {
    position: relative;
    z-index: 10;
    overflow: visible;
}

.inventory-item-modal .edit-variants-section {
    position: relative;
    z-index: 5;
    overflow: visible;
    padding: 0.65rem;
}

.inventory-item-modal .edit-variants-section .form-section-title { margin-bottom: 0.52rem; }

.inventory-item-modal #categorySpecificSection {
    position: relative;
    z-index: 1;
}

.inventory-item-modal .edit-product-details-grid {
    display: grid;
    gap: 0.7rem;
}

.inventory-item-modal [data-product-details-content][hidden] { display: none; }

.inventory-item-modal .edit-product-details-toggle {
    width: 100%;
    justify-content: space-between;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    color: #101828;
    cursor: pointer;
    text-align: left;
}

.inventory-item-modal .edit-product-details-toggle > span {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.inventory-item-modal .edit-product-details-chevron {
    color: #667085;
    font-size: 0.82rem;
    transition: transform 0.18s ease;
}

.inventory-item-modal .edit-product-details-section.expanded .edit-product-details-toggle {
    margin-bottom: 0.7rem;
}

.inventory-item-modal .edit-product-details-section.expanded .edit-product-details-chevron {
    transform: rotate(180deg);
}

.inventory-item-modal #categorySpecificSection .form-row {
    grid-template-columns: minmax(0, 1fr);
}

.inventory-item-modal .price-input-row {
    display: flex;
    align-items: center;
    gap: 0.42rem;
}

.inventory-item-modal .price-calc-btn {
    width: 46px;
    height: 46px;
    flex: 0 0 46px;
    border-color: #b9e2fa;
    border-radius: 9px;
    background: #eef8ff;
    color: #087ebf;
    font-size: 1.05rem;
}

.edit-pricing-summary {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    overflow: hidden;
    margin-top: 0.05rem;
    border: 1px solid #d9effc;
    border-radius: 10px;
    background: #f0f9ff;
}

.inventory-item-modal .edit-basic-section > .edit-pricing-summary {
    margin-bottom: 0.65rem;
}

.edit-pricing-summary > div {
    display: grid;
    min-width: 0;
    justify-items: center;
    gap: 0.18rem;
    padding: 0.55rem 0.25rem;
    text-align: center;
}

.edit-pricing-summary > div + div { border-left: 1px solid #d9effc; }

.edit-pricing-summary small {
    color: #667085;
    font-size: 0.78rem;
    font-weight: 800;
    line-height: 1.15;
}

.edit-pricing-summary strong {
    max-width: 100%;
    overflow-wrap: anywhere;
    color: #079455;
    font-size: 1.08rem;
    font-weight: 900;
    line-height: 1.15;
    text-align: center;
}

.edit-pricing-summary strong.negative { color: #d92d20; }

.edit-section-title-row {
    justify-content: space-between;
}

.edit-section-title-row > span {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.edit-section-title-row > strong {
    color: #475467;
    font-size: 0.73rem;
    font-weight: 800;
    white-space: nowrap;
}

.edit-section-title-row > strong span {
    color: #079455;
    font-size: 0.8rem;
    font-weight: 900;
}

.inventory-item-modal .variant-headers,
.inventory-item-modal .variant-row-item {
    display: grid;
}

.inventory-item-modal .variant-headers {
    display: none;
}

.inventory-item-modal .variant-row-item {
    display: block;
    padding: 0;
    margin: 0 0 0.48rem;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    background: #fbfdff;
    overflow: visible;
}

.inventory-item-modal .variant-row-item:last-child { margin-bottom: 0; }

.inventory-item-modal .variant-row-header {
    display: flex;
    align-items: center;
    gap: 0.18rem;
    padding-right: 0.32rem;
    border-radius: 12px 12px 0 0;
    background: #fff;
}

.inventory-item-modal .variant-row-item.collapsed .variant-row-header { border-radius: 12px; }

.inventory-item-modal .variant-accordion-toggle {
    display: flex;
    width: auto;
    min-height: 52px;
    min-width: 0;
    flex: 1 1 auto;
    align-items: center;
    gap: 0.38rem;
    padding: 0.46rem 0.38rem 0.46rem 0.5rem;
    border: 0;
    background: #fff;
    color: #101828;
    font: inherit;
    text-align: left;
}

.inventory-item-modal .variant-summary-identity {
    display: flex;
    min-width: 0;
    flex: 1 1 auto;
    align-items: center;
    gap: 0.35rem;
}

.inventory-item-modal .variant-summary-copy {
    flex: 0 1 auto;
    min-width: 0;
    color: #344054;
    font-size: 1.05rem;
    font-weight: 900;
    line-height: 1.2;
    overflow-wrap: anywhere;
    white-space: normal;
}

.inventory-item-modal .variant-summary-size {
    display: inline-flex;
    min-width: 40px;
    min-height: 32px;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    padding: 0.22rem 0.52rem;
    border-radius: 9px;
    background: #eaf6ff;
    color: #087ebf;
    font-size: 1.08rem;
    font-weight: 900;
    line-height: 1;
    white-space: nowrap;
}

.inventory-item-modal .variant-summary-quantity {
    display: inline-flex;
    align-items: center;
    gap: 0.22rem;
    color: #667085;
    font-size: 1.28rem;
    font-weight: 900;
    white-space: nowrap;
}

.inventory-item-modal .variant-summary-photos {
    display: none;
}

.inventory-item-modal .variant-summary-photo-frame {
    position: relative;
    display: block;
    width: 42px;
    height: 46px;
    flex: 0 0 42px;
    overflow: hidden;
    border: 1px solid #cfe0eb;
    border-radius: 8px;
    background: #fff;
}

.inventory-item-modal .variant-summary-photo-frame img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.inventory-item-modal .variant-summary-photo-frame small {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    background: rgba(4, 31, 48, 0.68);
    color: #fff;
    font-size: 0.68rem;
    font-weight: 900;
}

.inventory-item-modal .variant-summary-quantity { color: #067647; }
.inventory-item-modal .variant-summary-chevron { color: #667085; transition: transform 0.18s ease; }
.inventory-item-modal .variant-row-item.collapsed .variant-summary-chevron { transform: rotate(180deg); }
.inventory-item-modal .variant-row-item.collapsed .variant-row-content { display: none; }

.inventory-item-modal .variant-chevron-toggle {
    display: grid;
    width: 30px;
    height: 30px;
    flex: 0 0 30px;
    place-items: center;
    padding: 0;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: #667085;
    font: inherit;
}

.inventory-item-modal .variant-row-content {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.42rem;
    align-items: start;
    padding: 0.45rem;
    border-top: 1px solid #e8eef4;
}

.inventory-item-modal .variant-field {
    display: grid;
    min-width: 0;
    gap: 0.25rem;
}

.inventory-item-modal .variant-field > span {
    color: #667085;
    font-size: 0.68rem;
    font-weight: 850;
    line-height: 1.1;
}

.inventory-item-modal .variant-color-field,
.inventory-item-modal .variant-style-cell,
.inventory-item-modal .variant-size-field,
.inventory-item-modal .variant-quantity-field { grid-column: auto; }
.inventory-item-modal .variant-row-item.no-size .variant-quantity-field { grid-column: 1 / -1; }

.inventory-item-modal .variant-image-strip {
    display: grid;
    grid-column: 1 / -1;
    min-width: 0;
    gap: 0.48rem;
    padding: 0.15rem 0.08rem 0.6rem;
    scroll-margin-block: 0.75rem 7.5rem;
}

.inventory-item-modal .variant-image-label {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 0.3rem;
    color: #475467;
    font-size: 0.62rem;
    font-weight: 750;
}

.inventory-item-modal .variant-image-label i { color: #0799ed; }

.inventory-item-modal .variant-image-thumbnails {
    display: flex;
    width: 100%;
    min-width: 0;
    justify-content: flex-start;
    min-height: 106px;
    gap: 0.5rem;
    overflow-x: auto;
    padding: 2px 3px 8px;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
}

.inventory-item-modal .variant-image-thumbnails::-webkit-scrollbar { display: none; }

.inventory-item-modal .variant-photo-thumb {
    position: relative;
    display: block;
    width: 68px;
    height: 96px;
    flex: 0 0 68px;
    scroll-snap-align: start;
    margin: 1px 0;
}

.inventory-item-modal .variant-image-thumbnails button {
    width: 68px;
    height: 96px;
    flex: 0 0 68px;
    overflow: hidden;
    padding: 0;
    border: 2px solid #fff;
    border-radius: 9px;
    background: #eaf2f8;
    box-shadow: 0 0 0 1px #bdd7e8;
    scroll-snap-align: start;
}

.inventory-item-modal .variant-photo-thumb > [data-variant-photo] { width: 100%; height: 100%; }
.inventory-item-modal .variant-photo-kind {
    position: absolute;
    right: 4px;
    bottom: 4px;
    left: 4px;
    overflow: hidden;
    padding: 0.14rem 0.2rem;
    border-radius: 5px;
    color: #334155;
    background: rgba(255, 255, 255, 0.92);
    font-size: 0.54rem;
    font-weight: 900;
    line-height: 1.15;
    text-align: center;
    text-overflow: ellipsis;
    white-space: nowrap;
    pointer-events: none;
}
.inventory-item-modal .variant-photo-kind.enhanced {
    color: #075985;
    background: rgba(224, 242, 254, 0.94);
}
.inventory-item-modal .variant-photo-delete {
    position: absolute;
    top: 4px;
    right: 4px;
    z-index: 2;
    display: grid;
    width: 27px !important;
    height: 27px !important;
    place-items: center;
    padding: 0 !important;
    border: 1px solid rgba(255, 255, 255, 0.9) !important;
    border-radius: 50% !important;
    background: rgba(180, 24, 40, 0.9) !important;
    color: #fff;
    box-shadow: 0 2px 8px rgba(29, 41, 57, 0.28) !important;
}
.inventory-item-modal .variant-photo-delete i { font-size: 0.72rem; }

.inventory-photo-delete-confirm {
    position: fixed;
    inset: 0;
    z-index: 3800;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: rgba(5, 20, 35, 0.62);
    backdrop-filter: blur(6px);
}
.inventory-photo-delete-confirm.open { display: flex; }
.inventory-photo-delete-confirm > section {
    width: min(100%, 390px);
    padding: 1.25rem;
    border: 1px solid #cde5f4;
    border-radius: 20px;
    background: #fff;
    color: #143247;
    text-align: center;
    box-shadow: 0 24px 60px rgba(5, 35, 55, 0.28);
}
.inventory-photo-delete-icon {
    display: grid;
    width: 52px;
    height: 52px;
    margin: 0 auto 0.75rem;
    place-items: center;
    border-radius: 50%;
    background: #fff0f1;
    color: #c61f35;
    font-size: 1.25rem;
}
.inventory-photo-delete-confirm h2 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 900;
}
.inventory-photo-delete-confirm p {
    margin: 0.55rem 0 1rem;
    color: #587386;
    font-size: 0.9rem;
    line-height: 1.45;
}
.inventory-photo-delete-confirm section > div {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.65rem;
}
.inventory-photo-delete-confirm button {
    min-height: 46px;
    border: 1px solid #b9d7e9;
    border-radius: 12px;
    background: #f4faff;
    color: #17678f;
    font: inherit;
    font-weight: 850;
}
.inventory-photo-delete-confirm button.primary {
    border-color: #0b8fd8;
    background: #0799ed;
    color: #fff;
}

.inventory-item-modal .variant-image-thumbnails img { width: 100%; height: 100%; object-fit: contain; }

/* A lone product photo is the primary visual reference, not a tiny gallery thumb. */
.inventory-item-modal .variant-image-thumbnails [data-variant-photo]:only-child {
    width: 92px;
    height: 92px;
    flex-basis: 92px;
    border-radius: 12px;
    background: #fff;
}

.inventory-item-modal .variant-image-thumbnails .variant-images-more {
    border-color: #8ccff5;
    background: #eaf6ff;
    color: #087ebf;
    font-size: 0.72rem;
    font-weight: 900;
}

.inventory-item-modal .variant-image-thumbnails .variant-add-photos {
    display: flex;
    width: 68px;
    height: 96px;
    min-width: 68px;
    flex: 0 0 68px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.18rem;
    border: 1.5px dashed #8ccff5;
    border-radius: 9px;
    background: #f5fbff;
    color: #087dc1;
    box-shadow: none;
    font: inherit;
    font-size: 0.62rem;
    font-weight: 900;
    line-height: 1;
}

.inventory-item-modal .variant-image-thumbnails .variant-add-photos i { font-size: 0.9rem; }

.inventory-item-modal .variant-style-suggestions {
    display: flex;
    grid-column: 1 / -1;
    min-width: 0;
    align-items: center;
    gap: 0.35rem;
    overflow-x: auto;
    padding-top: 0.05rem;
    scrollbar-width: none;
}

.inventory-item-modal .variant-style-suggestions::-webkit-scrollbar { display: none; }

.inventory-item-modal .variant-style-suggestions > span {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    color: #667085;
    font-size: 0.64rem;
    font-weight: 800;
    white-space: nowrap;
}

.inventory-item-modal .variant-style-suggestions > span i { color: #0799ed; }

.inventory-item-modal .variant-style-suggestions > div {
    display: flex;
    min-width: 0;
    align-items: center;
    flex: 0 0 auto;
    flex-wrap: nowrap;
    gap: 0.28rem;
}

.inventory-item-modal .variant-style-suggestions button {
    min-height: 28px;
    padding: 0.25rem 0.55rem;
    border: 1px solid #c9deed;
    border-radius: 999px;
    background: #f7fbff;
    color: #38647f;
    font: inherit;
    font-size: 0.65rem;
    font-weight: 800;
    cursor: pointer;
    white-space: nowrap;
}

.inventory-item-modal .variant-style-suggestions button.active {
    border-color: #0799ed;
    background: #eaf6ff;
    color: #0874b4;
    box-shadow: 0 0 0 2px rgba(7, 153, 237, 0.08);
}

.inventory-item-modal .variant-style-suggestions:not(.expanded) [data-style-suggestion-extra] { display: none; }

.inventory-item-modal .variant-style-suggestions .variant-style-more {
    border-color: transparent;
    background: transparent;
    color: #087ebf;
    box-shadow: none;
}

.inventory-item-modal .variant-row-item .form-control {
    min-height: 44px;
    padding: 0.55rem 0.5rem !important;
    font-size: 0.9rem !important;
}

.inventory-item-modal .variant-row-actions {
    display: flex;
    grid-column: 1 / -1;
    align-items: center;
    justify-content: flex-start;
    gap: 0.25rem;
    padding-top: 0;
}

.inventory-item-modal .variant-row-actions:empty { display: none; }

.inventory-item-modal .variant-add-size {
    display: inline-flex;
    min-height: 40px;
    align-items: center;
    justify-content: center;
    gap: 0.36rem;
    padding: 0.4rem 0.35rem;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: #087ebf;
    font: inherit;
    flex: 0 1 auto;
    font-size: 0.94rem;
    font-weight: 850;
}

.inventory-item-modal .variant-discover-toggle {
    display: inline-flex;
    min-height: 44px;
    flex: 0 1 auto;
    gap: 0.42rem;
    align-items: center;
    justify-content: space-between;
    margin-left: auto;
    padding: 0.38rem 0.48rem 0.38rem 0.42rem;
    border: 1px solid #b9dff4;
    border-radius: 10px;
    color: #087fc4;
    background: linear-gradient(135deg, #f5fbff, #edf8ff);
    font: inherit;
    box-shadow: 0 3px 10px rgba(7, 153, 237, 0.08);
}

.inventory-item-modal .variant-discover-prepare {
    display: inline-flex;
    width: 100%;
    min-height: 54px;
    gap: 0.46rem;
    align-items: center;
    justify-content: flex-start;
    padding: 0.58rem 0.72rem;
    border: 1.5px solid #8dcef2;
    border-radius: 12px;
    background: linear-gradient(135deg, #eff9ff, #e4f5ff);
    color: #087fc4;
    font: inherit;
    margin-top: 0.05rem;
}

.inventory-item-modal .variant-discover-prepare > span { display: grid; gap: 0; text-align: left; }
.inventory-item-modal .variant-discover-prepare strong { font-size: 0.86rem; font-weight: 950; line-height: 1.15; }
.inventory-item-modal .variant-discover-prepare small { color: #517e98; font-size: 0.7rem; font-weight: 800; line-height: 1.25; }
.inventory-item-modal .variant-discover-prepare > .bi-compass-fill { color: #0799ed; font-size: 1.12rem; }
.inventory-item-modal .variant-discover-prepare > .bi-chevron-right { margin-left: auto; font-size: 0.68rem; }
.inventory-item-modal .variant-discover-prepare.is-ready {
    border-color: #86d7b5;
    color: #067647;
    background: #ecfdf3;
}
.inventory-item-modal .variant-discover-prepare.is-ready small { color: #398267; }
.inventory-item-modal .variant-discover-prepare.is-ready > .bi { color: #079455; }

.inventory-item-modal .variant-discover-copy {
    display: grid;
    gap: 0;
    text-align: left;
}

.inventory-item-modal .variant-discover-icon {
    display: grid;
    width: 29px;
    height: 29px;
    flex: 0 0 29px;
    place-items: center;
    border-radius: 9px;
    color: #087fc4;
    background: #dff3ff;
    font-size: 0.86rem;
}

.inventory-item-modal .variant-discover-toggle.is-ready .variant-discover-icon {
    color: #079455;
    background: #e7f8ef;
}

.inventory-item-modal .variant-discover-copy strong { font-size: 0.92rem; font-weight: 900; line-height: 1.05; }
.inventory-item-modal .variant-discover-copy small { color: #5e8eaa; font-size: 0.67rem; font-weight: 800; line-height: 1.1; }
.inventory-item-modal .variant-discover-switch { position: relative; width: 34px; height: 20px; flex: 0 0 34px; border-radius: 999px; background: #a9cfe5; transition: background 0.18s ease; }
.inventory-item-modal .variant-discover-switch > span { position: absolute; top: 3px; left: 3px; width: 14px; height: 14px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(16, 24, 40, 0.24); transition: transform 0.18s ease; }
.inventory-item-modal .variant-discover-toggle.active { border-color: #72c5f2; color: #057fc7; background: #e5f6ff; }
.inventory-item-modal .variant-discover-toggle.active .variant-discover-copy small { color: #057fc7; }
.inventory-item-modal .variant-discover-toggle.active .variant-discover-switch { background: #0799ed; }
.inventory-item-modal .variant-discover-toggle.active .variant-discover-switch > span { transform: translateX(14px); }
.inventory-item-modal .variant-discover-toggle:disabled { opacity: 0.62; cursor: wait; }

.inventory-item-modal .variant-remove-header {
    display: grid;
    width: 30px;
    height: 30px;
    flex: 0 0 30px;
    place-items: center;
    padding: 0;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: #b86b76;
    font: inherit;
    font-size: 0.76rem;
}

.inventory-item-modal .variant-row-item.collapsed .variant-remove-header { display: none; }
.inventory-item-modal .variant-remove-header:active { color: #943f4c; background: #fff1f3; }
.inventory-item-modal .variant-remove-header:disabled { color: #cfd4dc; }

.inventory-item-modal .variant-merge-note {
    display: inline-flex;
    grid-column: 1 / -1;
    align-items: center;
    gap: 0.3rem;
    color: #067647;
    font-size: 0.7rem;
    font-weight: 850;
}

.variant-gallery-overlay {
    position: fixed;
    inset: 0;
    z-index: 3600;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 0;
    background: #0b1724;
}

.variant-gallery-overlay.open { display: flex; }

.variant-gallery-sheet {
    position: relative;
    display: flex;
    width: 100vw;
    height: 100dvh;
    max-width: none;
    max-height: none;
    flex-direction: column;
    overflow: hidden;
    border: 0;
    border-radius: 0;
    background: #0b1724;
    color: #fff;
    box-shadow: none;
}

.variant-gallery-sheet header {
    position: absolute;
    inset: 0 0 auto;
    z-index: 5;
    display: grid;
    grid-template-columns: 1fr auto 42px;
    align-items: center;
    gap: 0.65rem;
    padding: calc(0.55rem + env(safe-area-inset-top, 0px)) max(0.75rem, env(safe-area-inset-right, 0px)) 1.5rem max(0.75rem, env(safe-area-inset-left, 0px));
    background: linear-gradient(180deg, rgba(4, 13, 24, 0.88) 0%, rgba(4, 13, 24, 0.58) 58%, transparent 100%);
}

.variant-gallery-sheet header strong { font-size: 0.92rem; }
.variant-gallery-sheet header span { color: #b8c7d6; font-size: 0.75rem; font-weight: 800; }
.variant-gallery-sheet header button,
.variant-gallery-stage button {
    display: grid;
    place-items: center;
    border: 0;
    color: #fff;
    background: rgba(255, 255, 255, 0.12);
}
.variant-gallery-sheet header button { width: 42px; height: 42px; border-radius: 50%; }

.variant-gallery-stage {
    position: relative;
    display: grid;
    min-height: 0;
    flex: 1 1 auto;
    grid-template-columns: minmax(0, 1fr);
    align-items: center;
    justify-items: center;
    padding: 0;
    overflow: hidden;
    background: #f1f5f9;
    touch-action: pan-y;
}

.variant-gallery-stage img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    max-width: none;
    max-height: none;
    object-fit: contain;
    object-position: center;
    border-radius: 0;
    transform-origin: center;
    transition: transform 160ms ease;
    user-select: none;
    -webkit-user-drag: none;
}

.variant-gallery-stage.is-zoomed { cursor: grab; touch-action: none; }
.variant-gallery-stage.is-zoomed:active { cursor: grabbing; }
.variant-gallery-stage img.is-zoomed { transition: none; }

.variant-gallery-stage button {
    position: absolute;
    top: 50%;
    z-index: 1;
    width: 38px;
    height: 52px;
    border-radius: 10px;
    transform: translateY(-50%);
}

.variant-gallery-stage [data-gallery-previous] { left: max(0.65rem, env(safe-area-inset-left, 0px)); }
.variant-gallery-stage [data-gallery-next] { right: max(0.65rem, env(safe-area-inset-right, 0px)); }

.variant-gallery-zoom {
    position: absolute;
    right: 50%;
    bottom: calc(0.75rem + env(safe-area-inset-bottom, 0px));
    z-index: 3;
    display: flex;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.55);
    border-radius: 999px;
    background: rgba(11, 23, 36, 0.82);
    box-shadow: 0 5px 18px rgba(0, 0, 0, 0.22);
    transform: translateX(50%);
}
.variant-gallery-stage .variant-gallery-zoom button {
    position: static;
    width: 42px;
    height: 40px;
    border-radius: 0;
    background: transparent;
    transform: none;
}
.variant-gallery-stage .variant-gallery-zoom [data-gallery-zoom-reset] {
    width: 60px;
    border-right: 1px solid rgba(255, 255, 255, 0.18);
    border-left: 1px solid rgba(255, 255, 255, 0.18);
    font-size: 0.7rem;
    font-weight: 850;
}

.variant-gallery-thumbnails {
    position: absolute;
    right: 50%;
    bottom: calc(0.65rem + env(safe-area-inset-bottom, 0px));
    z-index: 4;
    display: flex;
    max-width: calc(100% - 1.5rem - env(safe-area-inset-left, 0px) - env(safe-area-inset-right, 0px));
    gap: 0.45rem;
    overflow-x: auto;
    padding: 0.4rem;
    border: 1px solid rgba(255, 255, 255, 0.24);
    border-radius: 12px;
    background: rgba(11, 23, 36, 0.82);
    box-shadow: 0 5px 18px rgba(0, 0, 0, 0.22);
    transform: translateX(50%);
    scrollbar-width: none;
}

.variant-gallery-thumbnails::-webkit-scrollbar { display: none; }

.variant-gallery-overlay.has-thumbnails .variant-gallery-zoom {
    bottom: calc(5.35rem + env(safe-area-inset-bottom, 0px));
}

.variant-gallery-thumbnails[hidden] { display: none; }

.variant-gallery-thumbnails button {
    width: 58px;
    height: 58px;
    flex: 0 0 58px;
    overflow: hidden;
    padding: 0;
    border: 2px solid transparent;
    border-radius: 9px;
    background: #192a3a;
    opacity: 0.62;
}

.variant-gallery-thumbnails button.active { border-color: #31adf2; opacity: 1; }
.variant-gallery-thumbnails img { width: 100%; height: 100%; object-fit: contain; background: #f1f5f9; }

.inventory-item-modal .add-variant-btn {
    display: flex;
    width: 100%;
    min-height: 46px;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    margin-top: 0.4rem;
    border: 1.5px dashed #0799ed;
    border-radius: 9px;
    background: #fff;
    color: #087ebf;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 850;
}

.inventory-item-modal .modal-footer {
    display: grid;
    grid-template-columns: 0.85fr 1.4fr;
    gap: 0.55rem;
    padding: 0.65rem 0.75rem calc(0.65rem + env(safe-area-inset-bottom, 0px));
    border-top: 1px solid rgba(208, 213, 221, 0.8);
    background: rgba(255, 255, 255, 0.86);
    flex: 0 0 auto;
    position: sticky;
    bottom: 0;
    z-index: 20;
    -webkit-backdrop-filter: blur(18px);
    backdrop-filter: blur(18px);
}

.inventory-item-modal .save-footer .btn-cancel,
.inventory-item-modal .save-footer .btn-save {
    display: flex;
    width: 100%;
    min-height: 48px;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    padding: 0.6rem 0.7rem !important;
    border-radius: 10px !important;
    font-family: inherit !important;
    font-size: 0.9rem !important;
    font-weight: 900 !important;
}

.inventory-item-modal .save-footer .btn-cancel {
    border: 1px solid #d0d5dd !important;
    background: #fff !important;
    color: #344054 !important;
}

.inventory-item-modal .save-footer .btn-save {
    border: 0 !important;
    background: #0799ed !important;
    color: #fff !important;
    box-shadow: 0 7px 18px rgba(7, 153, 237, 0.24) !important;
}

.inventory-item-modal .save-footer .btn-save:disabled { opacity: 0.48; }

body.item-modal-keyboard-open .inventory-item-modal .save-footer {
    display: none;
}

body.item-modal-keyboard-open .inventory-item-modal .modal-body {
    padding-bottom: calc(8rem + env(safe-area-inset-bottom, 0px));
    scroll-padding: 20px 0 calc(96px + env(safe-area-inset-bottom, 0px));
}

body.item-modal-keyboard-open .inventory-item-modal :is(input, textarea, select, [contenteditable="true"]) {
    scroll-margin-block: 20px 96px;
}

@media (max-width: 380px) {
    .inventory-item-modal .modal-body { padding: 0.55rem 0.55rem calc(7.5rem + env(safe-area-inset-bottom, 0px)); }
    .inventory-item-modal .edit-variants-section { padding: 0.55rem; }
    .inventory-item-modal .variant-accordion-toggle { min-height: 50px; gap: 0.25rem; padding: 0.4rem 0.28rem 0.4rem 0.42rem; }
    .inventory-item-modal .variant-row-header { gap: 0.24rem; }
    .inventory-item-modal .variant-summary-copy { font-size: 0.94rem; }
    .inventory-item-modal .variant-summary-quantity { font-size: 1.18rem; }
    .inventory-item-modal .variant-row-content { gap: 0.36rem; padding: 0.4rem; }
    .inventory-item-modal .variant-row-item .form-control { min-height: 42px; }
    .inventory-item-modal .variant-image-thumbnails button { width: 60px; height: 86px; flex-basis: 60px; }
    .inventory-item-modal .variant-photo-thumb { width: 60px; height: 86px; flex-basis: 60px; }
    .inventory-item-modal .variant-image-thumbnails .variant-add-photos { width: 60px; height: 86px; min-width: 60px; flex-basis: 60px; }
    .inventory-item-modal .add-variant-btn { min-height: 44px; font-size: 0.96rem; }
    .inventory-item-modal .modal-footer { gap: 0.45rem; padding: 0.5rem 0.55rem calc(0.5rem + env(safe-area-inset-bottom, 0px)); }
}
