/* Components: add-product modal and action buttons. */

/* استایل‌های ساده برای مودال افزودن محصول */
#productModal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--white);
    z-index: 2000;
    animation: slideUp 0.3s;
}

#productModal .fullscreen-modal-content {
    padding: 112px 20px 20px;
    overflow-y: auto;
    height: calc(100% - 60px);
}

.product-category-selector-modal {
    z-index: 4200;
}

.product-shipping-selector-modal {
    z-index: 4300;
}

.product-extra-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.product-extra-grid .form-group {
    margin-bottom: 0;
}

.product-price-text-helper {
    min-height: 22px;
    margin-top: 7px;
    color: #64748b;
    font-size: 0.86rem;
    line-height: 1.7;
}

.product-price-text-helper.is-error {
    color: #dc2626;
    font-weight: 700;
}

.product-shipping-card,
.product-images-field {
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 16px;
    padding: 14px;
    background: rgba(255, 255, 255, 0.62);
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.05);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}

.product-shipping-area-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.product-shipping-area-head label {
    margin: 0;
}

.product-shipping-edit-btn {
    border: 1px solid rgba(220, 38, 38, 0.18);
    border-radius: 999px;
    background: rgba(220, 38, 38, 0.08);
    color: #dc2626;
    font-family: inherit;
    padding: 7px 13px;
    cursor: pointer;
}

.product-shipping-summary {
    margin-top: 10px;
    color: var(--text-color);
    font-size: 0.88rem;
    line-height: 1.8;
}

.product-multi-image-preview {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(92px, 1fr));
    gap: 10px;
    margin-top: 12px;
}

.product-multi-image-item {
    position: relative;
    aspect-ratio: 1;
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid rgba(148, 163, 184, 0.22);
    background: rgba(255, 255, 255, 0.72);
    transition: transform 220ms cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 180ms ease, opacity 160ms ease, border-color 160ms ease;
}

.product-multi-image-item.is-dragging {
    opacity: 0.34;
    transform: scale(0.96);
    border-style: dashed;
    border-color: #60a5fa;
}

.product-image-drag-ghost {
    position: fixed;
    inset: 0 auto auto 0;
    z-index: 5000;
    margin: 0;
    pointer-events: none;
    opacity: 0.94;
    transform-origin: center;
    box-shadow: 0 18px 42px rgba(15, 23, 42, 0.3);
    will-change: transform;
    transition: box-shadow 160ms ease, opacity 160ms ease;
}

.product-multi-image-item.is-drop-target {
    border-color: #2563eb;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.18);
    transform: scale(1.05);
}

.product-multi-image-item.is-drop-target::after {
    content: "جایگاه " attr(data-drop-position);
    position: absolute;
    inset: 50% auto auto 50%;
    z-index: 6;
    padding: 5px 9px;
    border-radius: 999px;
    color: #ffffff;
    background: rgba(37, 99, 235, 0.94);
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
    pointer-events: none;
    transform: translate(-50%, -50%);
}

.product-multi-image-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    user-select: none;
    -webkit-user-drag: none;
}

.product-multi-image-drag-handle {
    position: absolute;
    top: 6px;
    right: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    padding: 0;
    border: 0;
    border-radius: 9px;
    color: #fff;
    background: rgba(15, 23, 42, 0.76);
    font-size: 20px;
    line-height: 1;
    cursor: grab;
    touch-action: none;
}

.product-multi-image-drag-handle:active {
    cursor: grabbing;
}

.product-image-position {
    position: absolute;
    top: 7px;
    left: 50%;
    z-index: 3;
    min-width: 24px;
    padding: 3px 7px;
    border-radius: 999px;
    color: #ffffff;
    background: rgba(15, 23, 42, 0.76);
    font-size: 11px;
    font-weight: 700;
    line-height: 1.4;
    text-align: center;
    pointer-events: none;
    transform: translateX(-50%);
}

.product-multi-image-drag-handle:focus-visible,
.product-multi-image-remove:focus-visible {
    outline: 3px solid rgba(14, 165, 233, 0.7);
    outline-offset: 2px;
}

.product-multi-image-primary {
    position: absolute;
    right: 4px;
    bottom: 27px;
    padding: 2px 6px;
    border-radius: 6px;
    color: #fff;
    background: rgba(2, 132, 199, 0.9);
    font-size: 9px;
    line-height: 1.5;
    pointer-events: none;
}

.product-image-upload-status {
    --upload-progress: 0%;
    position: absolute;
    right: 4px;
    bottom: 4px;
    left: 4px;
    padding: 3px 5px;
    border-radius: 6px;
    background: linear-gradient(
        to left,
        rgba(34, 197, 94, 0.88) 0,
        rgba(34, 197, 94, 0.88) var(--upload-progress),
        rgba(17, 24, 39, 0.78) var(--upload-progress),
        rgba(17, 24, 39, 0.78) 100%
    );
    color: #fff;
    font-size: 10px;
    line-height: 1.3;
    text-align: center;
    pointer-events: none;
    overflow: hidden;
    transition: background 180ms ease;
}

.product-multi-image-item[data-upload-status="completed"] .product-image-upload-status {
    background: rgba(22, 101, 52, 0.88);
}

.product-multi-image-item[data-upload-status="failed"] .product-image-upload-status {
    background: rgba(185, 28, 28, 0.9);
}

.product-multi-image-item[data-upload-status="unknown"] .product-image-upload-status,
.product-multi-image-item[data-upload-status="retrying"] .product-image-upload-status {
    background: rgba(180, 83, 9, 0.9);
}

.product-multi-image-remove {
    position: absolute;
    top: 6px;
    left: 6px;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    border: 0;
    background: rgba(15, 23, 42, 0.76);
    color: #fff;
    cursor: pointer;
    line-height: 1;
}

.product-shipping-selector-shell {
    max-width: 760px;
    margin: 0 auto;
    direction: rtl;
}

.product-shipping-helper {
    color: var(--gray);
    line-height: 1.8;
    margin: 0 0 12px;
}

.product-province-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    padding-bottom: 120px;
}

.product-province-option {
    display: flex;
    align-items: center;
    gap: 8px;
    border: 1px solid rgba(148, 163, 184, 0.22);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.62);
    color: var(--text-color);
    padding: 11px 12px;
    cursor: pointer;
}

.product-province-option input {
    accent-color: #dc2626;
}

/* استایل برای دکمه افزودن محصول */
.submit-product-btn {
    width: 100%;
    padding: 15px;
    font-size: 1.1rem;
    margin-top: 20px;
    margin-bottom: 20px;
    border-radius: 8px;
    background-color: #4CAF50;
    color: white;
    border: none;
    cursor: pointer;
    transition: background-color 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.submit-product-btn:hover {
    background-color: #3d8b40;
}

.submit-product-btn:disabled {
    opacity: 0.85;
    cursor: not-allowed;
    background-color: #3d8b40;
}

.submit-product-btn i {
    margin-left: 10px;
}

.product-category-section {
    border: 1px solid rgba(220, 38, 38, 0.12);
    border-radius: 16px;
    padding: 14px;
    background: rgba(255, 255, 255, 0.58);
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.06);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}

.product-category-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
}

.product-category-head label {
    margin: 0;
    font-size: 0.95rem;
    line-height: 1.7;
}

.product-category-required {
    flex: 0 0 auto;
    color: #dc2626;
    background: rgba(220, 38, 38, 0.08);
    border: 1px solid rgba(220, 38, 38, 0.14);
    border-radius: 999px;
    padding: 4px 9px;
    font-size: 0.72rem;
}

.product-category-selected {
    display: flex;
    align-items: center;
    gap: 6px;
    border-radius: 12px;
    background: rgba(220, 38, 38, 0.08);
    color: var(--text-color);
    padding: 9px 10px;
    margin-bottom: 10px;
    font-size: 0.84rem;
}

.product-category-selected strong {
    color: #dc2626;
    font-weight: 600;
}

.product-category-suggestions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.product-category-chip {
    border: 1px solid rgba(148, 163, 184, 0.28);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.72);
    color: var(--text-color);
    padding: 10px 11px;
    font-family: inherit;
    font-size: 0.84rem;
    line-height: 1.5;
    cursor: pointer;
    text-align: right;
    transition: border-color .18s ease, background .18s ease, color .18s ease, box-shadow .18s ease;
}

.product-category-chip:hover,
.product-category-chip:focus-visible,
.product-category-chip.active {
    border-color: rgba(220, 38, 38, 0.34);
    background: rgba(220, 38, 38, 0.08);
    color: #dc2626;
    outline: none;
    box-shadow: 0 8px 18px rgba(220, 38, 38, 0.08);
}

.product-category-other {
    grid-column: 1 / -1;
    text-align: center;
}

.product-category-selector-shell {
    display: flex;
    flex-direction: column;
    gap: 14px;
    max-width: 720px;
    margin: 0 auto;
    direction: rtl;
}

.product-category-search-wrap {
    position: sticky;
    top: 0;
    z-index: 2;
    display: flex;
    align-items: center;
    gap: 8px;
    border: 1px solid rgba(148, 163, 184, 0.24);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.72);
    padding: 10px 12px;
    box-shadow: 0 12px 26px rgba(15, 23, 42, 0.06);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

.product-category-search-wrap i {
    color: #dc2626;
}

.product-category-search-wrap input {
    border: 0;
    background: transparent;
    width: 100%;
    min-height: 34px;
    font-family: inherit;
    color: var(--text-color);
    outline: none;
}

.product-category-picker-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding-bottom: 120px;
}

.product-category-parent {
    border: 1px solid rgba(148, 163, 184, 0.22);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.62);
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.05);
    overflow: hidden;
}

.product-category-parent summary {
    cursor: pointer;
    padding: 13px 14px;
    color: var(--text-color);
    font-weight: 500;
    list-style: none;
}

.product-category-parent summary::-webkit-details-marker {
    display: none;
}

.product-category-children {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    padding: 0 12px 12px;
}

.product-category-child {
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.58);
    color: var(--text-color);
    padding: 10px;
    font-family: inherit;
    font-size: 0.84rem;
    text-align: right;
    cursor: pointer;
}

.product-category-child.active {
    color: #dc2626;
    border-color: rgba(220, 38, 38, 0.42);
    background: rgba(220, 38, 38, 0.1);
}

.product-category-empty {
    text-align: center;
    color: var(--gray);
    padding: 28px 10px;
}

.product-category-picker-footer {
    position: sticky;
    bottom: 0;
    display: flex;
    align-items: center;
    gap: 10px;
    border-radius: 18px 18px 0 0;
    background: rgba(255, 255, 255, 0.86);
    border: 1px solid rgba(148, 163, 184, 0.24);
    padding: 12px;
    box-shadow: 0 -12px 28px rgba(15, 23, 42, 0.08);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
}

.product-category-picker-preview {
    flex: 1;
    min-width: 0;
    font-size: 0.84rem;
    color: var(--text-color);
}

.product-category-confirm-btn {
    width: auto;
    min-width: 138px;
    margin: 0;
    padding: 11px 14px;
    font-size: 0.9rem;
}

@media (max-width: 560px) {
    .product-category-suggestions,
    .product-category-children {
        grid-template-columns: 1fr;
    }

    .product-category-picker-footer {
        flex-direction: column;
        align-items: stretch;
    }

    .product-category-confirm-btn {
        width: 100%;
    }

    .product-extra-grid,
    .product-province-grid {
        grid-template-columns: 1fr;
    }
}

body.theme-dark .product-category-section,
body.theme-dark .product-shipping-card,
body.theme-dark .product-images-field,
body.theme-dark .product-province-option,
body.theme-dark .product-category-parent,
body.theme-dark .product-category-chip,
body.theme-dark .product-category-child,
body.theme-dark .product-category-search-wrap,
body.theme-dark .product-category-picker-footer {
    background: rgba(31, 41, 55, 0.72);
    border-color: rgba(148, 163, 184, 0.22);
}

body.theme-dark .product-category-section,
body.theme-dark .product-shipping-card,
body.theme-dark .product-images-field,
body.theme-dark .product-shipping-summary,
body.theme-dark .product-province-option,
body.theme-dark .product-category-head label,
body.theme-dark .product-category-selected,
body.theme-dark .product-category-chip,
body.theme-dark .product-category-other,
body.theme-dark .product-category-search-wrap input,
body.theme-dark .product-category-parent summary,
body.theme-dark .product-category-child,
body.theme-dark .product-category-picker-preview,
body.theme-dark .product-category-empty {
    color: #f8fafc;
}

body.theme-dark .product-shipping-helper,
body.theme-dark .product-images-field .form-hint {
    color: rgba(248, 250, 252, 0.68);
}

body.theme-dark .product-multi-image-item {
    background: rgba(248, 250, 252, 0.08);
    border-color: rgba(248, 250, 252, 0.14);
}

body.theme-dark .product-category-search-wrap input::placeholder {
    color: rgba(248, 250, 252, 0.62);
}

body.theme-dark .product-category-required,
body.theme-dark .product-category-selected strong,
body.theme-dark .product-category-search-wrap i {
    color: #ff3b3b;
}

body.theme-dark .product-category-required {
    background: rgba(255, 59, 59, 0.14);
    border-color: rgba(255, 59, 59, 0.28);
}

body.theme-dark .product-category-selected {
    background: rgba(255, 59, 59, 0.12);
}

body.theme-dark .product-category-chip:hover,
body.theme-dark .product-category-chip:focus-visible,
body.theme-dark .product-category-chip.active,
body.theme-dark .product-category-child.active {
    color: #ff3b3b;
    border-color: rgba(255, 59, 59, 0.5);
    background: rgba(255, 59, 59, 0.15);
    box-shadow: 0 10px 22px rgba(255, 59, 59, 0.12);
}

body.theme-dark .product-category-child:not(.active):hover,
body.theme-dark .product-category-child:not(.active):focus-visible {
    color: #ffffff;
    border-color: rgba(248, 250, 252, 0.28);
    background: rgba(248, 250, 252, 0.08);
}

body.theme-dark #editProductModal,
body.theme-dark #editProductModal .fullscreen-modal-content,
body.theme-dark #editProductModal label,
body.theme-dark #editProductModal .checkbox-label,
body.theme-dark #editProductModal .form-group,
body.theme-dark #editProductModal .info-box,
body.theme-dark #editProductModal .info-text,
body.theme-dark #editProductModal .info-text p {
    color: #f8fafc;
}

body.theme-dark #editProductModal input,
body.theme-dark #editProductModal textarea {
    color: #f8fafc;
    background: rgba(31, 41, 55, 0.78);
    border-color: rgba(148, 163, 184, 0.28);
}

body.theme-dark #editProductModal input::placeholder,
body.theme-dark #editProductModal textarea::placeholder {
    color: rgba(248, 250, 252, 0.62);
}

body.theme-dark #editProductModal .image-preview-container {
    color: #f8fafc;
}

/* Shared seller product editor */
#productModal,
#editProductModal {
    background: #f5f6f8;
}

#productModal .product-editor-topbar,
#editProductModal .product-editor-topbar {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr) auto;
    gap: 14px;
    width: calc(100% - 48px);
    max-width: 1200px;
    min-height: 72px;
    box-sizing: border-box;
    margin: 16px auto 0;
    padding: 12px 0;
    border: 0 !important;
    border-radius: 0 !important;
    background: #f5f6f8 !important;
    box-shadow: none !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}

#productModal .product-editor-topbar .fullscreen-modal-title,
#editProductModal .product-editor-topbar .fullscreen-modal-title {
    position: static;
    transform: none;
    color: #172033;
    text-align: right;
    text-shadow: none;
}

#productModal .product-editor-topbar .back-button,
#editProductModal .product-editor-topbar .back-button {
    width: 44px;
    height: 44px;
    color: #667085;
    border: 1px solid #e4e7ec;
    border-radius: 12px;
    background: #ffffff;
}

#productModal .product-editor-topbar .back-button:hover,
#editProductModal .product-editor-topbar .back-button:hover {
    color: #172033;
    border-color: #cfd5de;
    background: #f9fafb;
}

#productModal .back-button svg,
#editProductModal .back-button svg {
    width: 23px;
    height: 23px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

#productModal .fullscreen-modal-content.product-editor-page,
#editProductModal .fullscreen-modal-content.product-editor-page {
    height: calc(100% - 88px);
    margin-top: 0;
    padding: 28px clamp(24px, 4vw, 56px) 48px;
    box-sizing: border-box;
    background: #f5f6f8;
    overflow-x: hidden;
}

.product-editor-shell {
    width: 100%;
    max-width: 1200px;
    margin-inline: auto;
    direction: rtl;
}

.product-editor-intro {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 24px;
    margin-bottom: 24px;
    padding: 6px 2px;
}

.product-editor-intro h2,
.product-editor-card-heading h3 {
    margin: 0;
    color: #172033;
    font-weight: 700;
}

.product-editor-intro h2 {
    font-size: 1.35rem;
}

.product-editor-intro p,
.product-editor-card-heading p {
    margin: 5px 0 0;
    color: #667085;
    line-height: 1.7;
}

.product-editor-intro p {
    font-size: 0.88rem;
}

.product-editor-grid {
    display: grid;
    grid-template-columns: 300px minmax(0, 1fr);
    grid-template-areas: "sidebar main";
    gap: 16px;
    align-items: start;
    direction: ltr;
}

.product-editor-main,
.product-editor-sidebar {
    display: flex;
    flex-direction: column;
    gap: 20px;
    min-width: 0;
    direction: rtl;
}

.product-editor-main {
    grid-area: main;
}

.product-editor-sidebar {
    grid-area: sidebar;
}

.product-editor-card,
.product-editor-info-box {
    border: 1px solid #e7eaf0;
    border-radius: 14px;
    background: #ffffff;
    box-shadow: 0 4px 18px rgba(16, 24, 40, 0.035);
}

#productModal .product-editor-card,
#editProductModal .product-editor-card {
    padding-block: 112px;
    padding-inline: 112px;
}

#productModal .product-editor-card > *,
#editProductModal .product-editor-card > * {
    width: calc(100% - 80px);
    margin-inline: auto;
    box-sizing: border-box;
}

.product-editor-card-heading {
    padding-bottom: 18px;
    margin-bottom: 22px;
    border-bottom: 1px solid #eef1f4;
}

.product-editor-card-heading h3 {
    font-size: 1.05rem;
}

.product-editor-card-heading p {
    font-size: 0.84rem;
}

.product-editor-card .form-group {
    min-width: 0;
    margin-bottom: 24px;
}

.product-editor-card .form-group:last-child {
    margin-bottom: 0;
}

.product-editor-card label:not(.checkbox-label) {
    display: block;
    margin-bottom: 10px;
    color: #344054;
    font-size: 0.88rem;
    font-weight: 600;
}

#productModal .product-editor-card input:not([type="checkbox"]):not([type="file"]),
#editProductModal .product-editor-card input:not([type="checkbox"]):not([type="file"]),
#productModal .product-editor-card textarea,
#editProductModal .product-editor-card textarea {
    width: 100%;
    max-width: 100%;
    min-height: 48px;
    box-sizing: border-box;
    border: 1px solid #d7dce3;
    border-radius: 10px;
    background: #ffffff;
    color: #172033;
    padding: 12px 16px;
    font-family: inherit;
    font-size: 0.95rem;
    outline: none;
    transition: border-color 160ms ease, box-shadow 160ms ease;
}

#productModal .product-editor-card textarea,
#editProductModal .product-editor-card textarea {
    min-height: 148px;
    resize: vertical;
    line-height: 1.8;
}

#productModal .product-editor-card input:focus,
#editProductModal .product-editor-card input:focus,
#productModal .product-editor-card textarea:focus,
#editProductModal .product-editor-card textarea:focus {
    border-color: #dc2626;
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
}

.product-pricing-grid,
.product-extra-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.product-editor-grid-wide {
    grid-column: 1 / -1;
    max-width: calc(50% - 9px);
}

.product-discount-control {
    min-width: 0;
    padding: 16px;
    border: 1px solid #eef0f3;
    border-radius: 12px;
    background: #fafbfc;
}

.product-editor-card .checkbox-label {
    display: flex;
    align-items: center;
    min-height: 44px;
    gap: 10px;
    margin: 0;
    color: #344054;
    font-size: 0.88rem;
    cursor: pointer;
}

.product-discount-control > .checkbox-label,
.product-shipping-card > .checkbox-label {
    direction: rtl;
    flex-direction: row;
    justify-content: flex-start;
    text-align: right;
}

.product-discount-control > .checkbox-label input[type="checkbox"],
.product-shipping-card > .checkbox-label input[type="checkbox"] {
    order: -1;
}

.product-editor-card .checkbox-label input {
    width: 18px;
    height: 18px;
    flex: 0 0 auto;
    accent-color: #dc2626;
}

.product-editor-shipping-section .product-shipping-card,
.product-editor-sidebar .product-category-section {
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}

.product-editor-shipping-section .product-shipping-card {
    padding: 0;
    margin-bottom: 18px;
}

.product-editor-shipping-section .product-shipping-card:last-child {
    margin-bottom: 0;
    padding-top: 14px;
    border-top: 1px solid #eef0f3;
}

.product-editor-sidebar .product-category-section {
    padding: 32px;
    border: 1px solid #e7eaf0;
    border-radius: 14px;
    background: #ffffff;
}

.product-editor-sidebar .product-category-suggestions,
.product-editor-sidebar .product-category-children {
    grid-template-columns: 1fr;
}

.product-image-picker-label {
    display: inline-flex !important;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 112px;
    min-height: 112px;
    box-sizing: border-box;
    padding: 12px;
    margin: 0 !important;
    border: 1.5px dashed #93c5fd;
    border-radius: 12px;
    background: #f8fbff;
    color: #344054 !important;
    font-size: 0.82rem !important;
    cursor: pointer;
}

.product-image-picker-label::before {
    content: "+";
    margin-bottom: 6px;
    color: #2563eb;
    font-size: 1.8rem;
    font-weight: 300;
    line-height: 1;
}

.product-image-picker-label:hover,
.product-image-picker-label:focus-within {
    border-color: #60a5fa;
    background: #eff6ff;
}

.product-images-board {
    display: grid;
    grid-template-columns: 112px minmax(0, 1fr);
    gap: 12px;
    align-items: start;
    direction: rtl;
}

.product-images-field > input[type="file"] {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
}

.product-images-field .form-hint {
    display: block;
    margin-top: 12px;
    color: #667085;
    line-height: 1.7;
}

.product-multi-image-preview {
    grid-template-columns: repeat(auto-fill, minmax(104px, 112px));
    gap: 12px;
    margin-top: 0;
    justify-content: start;
}

.product-editor-actions {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 12px;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
}

.product-editor-actions .btn {
    flex: 0 0 auto;
    width: auto;
    min-width: 112px;
    min-height: 44px;
    margin: 0;
    padding: 12px 20px;
    border-radius: 10px;
    cursor: pointer;
}

.product-editor-actions .submit-product-btn {
    background: #dc2626;
    font-size: 0.95rem;
    transform: none !important;
    box-shadow: none !important;
    transition: background-color 160ms ease, opacity 160ms ease;
}

.product-editor-actions .submit-product-btn:hover,
.product-editor-actions .submit-product-btn:focus,
.product-editor-actions .submit-product-btn:active,
.product-editor-actions .submit-product-btn:disabled {
    transform: none !important;
    box-shadow: none !important;
}

.product-editor-actions .submit-product-btn:hover,
.product-editor-actions .submit-product-btn:focus-visible {
    background: #b91c1c;
}

.product-submit-spinner {
    width: 18px;
    height: 18px;
    flex: 0 0 18px;
    box-sizing: border-box;
    border: 2px solid rgba(255, 255, 255, 0.42);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: product-submit-spin 700ms linear infinite;
}

@keyframes product-submit-spin {
    to {
        transform: rotate(360deg);
    }
}

.product-editor-cancel-btn {
    border: 1px solid #d0d5dd;
    background: #ffffff;
    color: #344054;
    font-size: 0.95rem;
}

.product-editor-cancel-btn:hover {
    border-color: #98a2b3;
    background: #f9fafb;
}

.product-editor-info-box {
    margin: 0;
    padding: 14px;
}

@media (min-width: 901px) {
    .product-editor-sidebar {
        position: sticky;
        top: 10px;
    }
}

@media (max-width: 900px) {
    #productModal .fullscreen-modal-content.product-editor-page,
    #editProductModal .fullscreen-modal-content.product-editor-page {
        padding: 24px 24px 40px;
    }

    .product-editor-shell {
        max-width: 760px;
    }

    .product-editor-grid {
        grid-template-columns: minmax(0, 1fr);
        grid-template-areas: "main" "sidebar";
    }

    .product-editor-sidebar {
        position: static;
    }

    #productModal .product-editor-card,
    #editProductModal .product-editor-card {
        padding-block: 64px;
        padding-inline: 64px;
    }

    #productModal .product-editor-card > *,
    #editProductModal .product-editor-card > * {
        width: calc(100% - 48px);
    }
}

@media (max-width: 560px) {
    #productModal .product-editor-topbar,
    #editProductModal .product-editor-topbar {
        grid-template-columns: 44px minmax(0, 1fr);
        width: calc(100% - 24px);
        min-height: 116px;
        margin-top: 8px;
        padding: 8px 0 10px;
    }

    #productModal .product-editor-topbar .fullscreen-modal-title,
    #editProductModal .product-editor-topbar .fullscreen-modal-title {
        font-size: 1.05rem;
    }

    #productModal .fullscreen-modal-content.product-editor-page,
    #editProductModal .fullscreen-modal-content.product-editor-page {
        height: calc(100% - 124px);
        padding: 24px 12px calc(32px + env(safe-area-inset-bottom));
    }

    .product-editor-intro {
        margin-bottom: 18px;
    }

    .product-editor-intro > div {
        min-width: 0;
    }

    .product-editor-intro p {
        display: none;
    }

    .product-editor-grid,
    .product-editor-main,
    .product-editor-sidebar {
        gap: 16px;
    }

    #productModal .product-editor-card,
    #editProductModal .product-editor-card,
    .product-editor-sidebar .product-category-section {
        padding-block: 40px;
        padding-inline: 40px;
        border-radius: 14px;
    }

    #productModal .product-editor-card > *,
    #editProductModal .product-editor-card > * {
        width: calc(100% - 24px);
    }

    .product-editor-card-heading {
        padding-bottom: 15px;
        margin-bottom: 18px;
    }

    .product-editor-card .form-group {
        margin-bottom: 20px;
    }

    #productModal .product-editor-card input:not([type="checkbox"]):not([type="file"]),
    #editProductModal .product-editor-card input:not([type="checkbox"]):not([type="file"]),
    #productModal .product-editor-card textarea,
    #editProductModal .product-editor-card textarea {
        font-size: 1rem;
    }

    .product-editor-actions {
        grid-column: 1 / -1;
        width: 100%;
        gap: 8px;
    }

    .product-editor-actions .btn {
        flex: 1 1 0;
        min-width: 0;
    }

    .product-pricing-grid,
    .product-extra-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .product-editor-grid-wide {
        grid-column: auto;
        max-width: none;
    }

    .product-images-board {
        grid-template-columns: 96px minmax(0, 1fr);
        gap: 8px;
    }

    .product-image-picker-label {
        width: 96px;
        min-height: 96px;
    }

    .product-multi-image-preview {
        grid-template-columns: repeat(auto-fill, minmax(88px, 1fr));
        gap: 8px;
    }
}

@media (max-width: 360px) {
    #productModal .product-editor-card,
    #editProductModal .product-editor-card,
    .product-editor-sidebar .product-category-section {
        padding-block: 32px;
        padding-inline: 28px;
    }

    #productModal .product-editor-card > *,
    #editProductModal .product-editor-card > * {
        width: 100%;
    }

    .product-editor-actions {
        flex-direction: row;
    }

    .product-editor-actions .btn {
        width: 100%;
    }

    .product-images-board {
        grid-template-columns: 88px minmax(0, 1fr);
    }

    .product-image-picker-label {
        width: 88px;
        min-height: 88px;
    }
}

@media (prefers-reduced-motion: reduce) {
    #productModal,
    #editProductModal,
    .product-editor-card input,
    .product-editor-card textarea {
        animation: none;
        transition: none;
    }
}

body.theme-dark #productModal,
body.theme-dark #editProductModal,
body.theme-dark #productModal .fullscreen-modal-content.product-editor-page,
body.theme-dark #editProductModal .fullscreen-modal-content.product-editor-page {
    background: #111827 !important;
}

body.theme-dark #productModal .product-editor-topbar,
body.theme-dark #editProductModal .product-editor-topbar {
    background: #111827 !important;
}

body.theme-dark #productModal .product-editor-topbar .fullscreen-modal-title,
body.theme-dark #editProductModal .product-editor-topbar .fullscreen-modal-title {
    color: #f8fafc;
}

body.theme-dark #productModal .product-editor-topbar .back-button,
body.theme-dark #editProductModal .product-editor-topbar .back-button {
    color: #e2e8f0;
    border-color: rgba(148, 163, 184, 0.28);
    background: #1f2937;
}

body.theme-dark .product-editor-card,
body.theme-dark .product-editor-sidebar .product-category-section,
body.theme-dark .product-editor-info-box,
body.theme-dark .product-editor-actions {
    background: #1f2937;
    border-color: rgba(148, 163, 184, 0.24);
}

body.theme-dark .product-editor-topbar .product-editor-actions {
    border: 0;
    background: transparent;
}

body.theme-dark .product-editor-intro h2,
body.theme-dark .product-editor-card-heading h3,
body.theme-dark .product-editor-card label,
body.theme-dark .product-editor-card .checkbox-label {
    color: #f8fafc;
}

body.theme-dark .product-editor-intro p,
body.theme-dark .product-editor-card-heading p,
body.theme-dark .product-images-field .form-hint {
    color: #cbd5e1;
}

body.theme-dark .product-editor-card-heading,
body.theme-dark .product-editor-shipping-section .product-shipping-card:last-child {
    border-color: rgba(148, 163, 184, 0.2);
}

body.theme-dark .product-discount-control,
body.theme-dark .product-image-picker-label {
    background: #111827;
    border-color: rgba(148, 163, 184, 0.34);
    color: #f8fafc !important;
}

body.theme-dark .product-editor-cancel-btn {
    border-color: rgba(148, 163, 184, 0.34);
    background: #111827;
    color: #f8fafc;
}
