[data-product-create-panel],
[data-product-create-panel][hidden],
.product-create-panel__brand-picker[hidden],
.product-create-panel__brand-clear[hidden],
.product-create-panel__brand-search-clear[hidden],
.product-create-panel__brand-create[hidden] {
    display: none !important;
}

.product-create-panel,
.product-create-panel *,
.product-create-panel *::before,
.product-create-panel *::after {
    box-sizing: border-box;
    min-width: 0;
}

.product-create-panel.is-open {
    position: fixed;
    inset: 0;
    z-index: 2600;
    display: grid !important;
    place-items: center;
    padding: max(14px, env(safe-area-inset-top)) max(14px, env(safe-area-inset-right)) max(14px, env(safe-area-inset-bottom)) max(14px, env(safe-area-inset-left));
    background: rgba(255, 255, 255, 0.72);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.product-create-panel__card {
    width: min(1180px, 100%);
    max-height: calc(100dvh - max(28px, env(safe-area-inset-top)) - max(28px, env(safe-area-inset-bottom)));
    overflow: auto;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
    border: 2px solid #111;
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.18);
    padding: clamp(20px, 2.8vw, 32px);
}

.product-create-panel__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 24px;
}

.product-create-panel__kicker,
.product-create-panel__brand-picker-kicker {
    margin: 0 0 7px;
    font-size: 10px;
    line-height: 1;
    font-weight: 800;
    letter-spacing: 0.24em;
    text-transform: uppercase;
    color: rgba(17, 17, 17, 0.52);
}

.product-create-panel__title {
    margin: 0;
    font-family: "Bodoni Moda", serif;
    font-size: clamp(38px, 4vw, 58px);
    line-height: 0.9;
    font-weight: 500;
    letter-spacing: -0.07em;
    color: #111;
}

.product-create-panel__close,
.product-create-panel__brand-picker-close {
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    width: 46px;
    height: 46px;
    border: 2px solid #111;
    border-radius: 0;
    background: #fff;
    color: #111;
    font: inherit;
    font-size: 27px;
    line-height: 1;
    cursor: pointer;
    transition: background-color 150ms ease, color 150ms ease;
}

.product-create-panel__close:hover,
.product-create-panel__brand-picker-close:hover,
.product-create-panel__close:focus-visible,
.product-create-panel__brand-picker-close:focus-visible {
    background: #111;
    color: #fff;
}

.product-create-panel__form {
    display: grid;
    gap: 20px;
}

.product-create-panel__grid {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 16px;
    align-items: start;
}

.product-create-panel__field {
    display: grid;
    gap: 8px;
}

.product-create-panel__field--type {
    grid-column: span 4;
}

.product-create-panel__field--brand {
    grid-column: span 8;
}

.product-create-panel__field--name {
    grid-column: span 6;
}

.product-create-panel__field--price,
.product-create-panel__field--old-price {
    grid-column: span 3;
}

.product-create-panel__field--wide {
    grid-column: 1 / -1;
}

.product-create-panel__label {
    font-size: 10px;
    line-height: 1.2;
    font-weight: 800;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: rgba(17, 17, 17, 0.62);
}

.product-create-panel__field-hint {
    font-size: 12px;
    line-height: 1.25;
    font-weight: 650;
    color: rgba(17, 17, 17, 0.5);
}

.product-create-panel__control,
.product-create-panel__brand-trigger {
    width: 100%;
    min-height: 48px;
    border: 2px solid #111;
    border-radius: 0;
    background-color: #fff;
    color: #111;
    padding: 0 14px;
    font: inherit;
    font-size: 15px;
    font-weight: 750;
    outline: none;
}

select.product-create-panel__control {
    appearance: none;
    -webkit-appearance: none;
    padding-right: 46px;
    background-image:
        linear-gradient(45deg, transparent 50%, #111 50%),
        linear-gradient(135deg, #111 50%, transparent 50%);
    background-position:
        calc(100% - 20px) 20px,
        calc(100% - 14px) 20px;
    background-size: 6px 6px, 6px 6px;
    background-repeat: no-repeat;
}

.product-create-panel__control:focus,
.product-create-panel__brand-trigger:focus-visible {
    box-shadow: inset 0 0 0 2px #111;
}

.product-create-panel__control::placeholder {
    color: rgba(17, 17, 17, 0.38);
}

.product-create-panel__brand-control {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
}

.product-create-panel__brand-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    text-align: left;
    cursor: pointer;
}

.product-create-panel__brand-trigger-value {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    color: rgba(17, 17, 17, 0.48);
}

.product-create-panel__brand-trigger.has-value .product-create-panel__brand-trigger-value {
    color: #111;
}

.product-create-panel__brand-trigger-icon {
    position: relative;
    flex: 0 0 auto;
    width: 14px;
    height: 10px;
}

.product-create-panel__brand-trigger-icon::before,
.product-create-panel__brand-trigger-icon::after {
    content: "";
    position: absolute;
    top: 4px;
    width: 8px;
    height: 2px;
    background: #111;
}

.product-create-panel__brand-trigger-icon::before {
    left: 0;
    transform: rotate(45deg);
}

.product-create-panel__brand-trigger-icon::after {
    right: 0;
    transform: rotate(-45deg);
}

.product-create-panel__brand-trigger[aria-expanded="true"] .product-create-panel__brand-trigger-icon {
    transform: rotate(180deg);
}

.product-create-panel__brand-clear {
    display: grid;
    place-items: center;
    width: 48px;
    min-height: 48px;
    margin-left: -2px;
    border: 2px solid #111;
    border-radius: 0;
    background: #fff;
    color: #111;
    font: inherit;
    font-size: 23px;
    line-height: 1;
    cursor: pointer;
}

.product-create-panel__brand-clear:hover,
.product-create-panel__brand-clear:focus-visible {
    background: #111;
    color: #fff;
}

.product-create-panel__brand-picker {
    position: fixed;
    inset: 0;
    z-index: 2900;
    display: grid;
    place-items: center;
    padding: max(16px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(16px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
}

.product-create-panel__brand-picker-backdrop {
    position: absolute;
    inset: 0;
    border: 0;
    background: rgba(17, 17, 17, 0.5);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    cursor: default;
}

.product-create-panel__brand-picker-dialog {
    position: relative;
    z-index: 1;
    width: min(680px, 100%);
    max-height: min(760px, calc(100dvh - 32px));
    display: grid;
    grid-template-rows: auto auto minmax(150px, 1fr) auto;
    overflow: hidden;
    border: 2px solid #111;
    background: #fff;
    box-shadow: 0 28px 72px rgba(0, 0, 0, 0.28);
}

.product-create-panel__brand-picker-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    padding: 22px 22px 18px;
    border-bottom: 1px solid rgba(17, 17, 17, 0.12);
}

.product-create-panel__brand-picker-title {
    margin: 0;
    font-family: "Bodoni Moda", serif;
    font-size: clamp(30px, 4vw, 44px);
    line-height: 0.95;
    font-weight: 500;
    letter-spacing: -0.055em;
}

.product-create-panel__brand-search-area {
    padding: 16px 22px 14px;
    border-bottom: 1px solid rgba(17, 17, 17, 0.1);
}

.product-create-panel__brand-search {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    min-height: 52px;
    border: 2px solid #111;
    background: #fff;
}

.product-create-panel__brand-search:focus-within {
    box-shadow: inset 0 0 0 2px #111;
}

.product-create-panel__brand-search-icon {
    position: relative;
    width: 18px;
    height: 18px;
    margin-left: 15px;
    border: 2px solid #111;
    border-radius: 50%;
}

.product-create-panel__brand-search-icon::after {
    content: "";
    position: absolute;
    width: 7px;
    height: 2px;
    right: -5px;
    bottom: -2px;
    background: #111;
    transform: rotate(45deg);
    transform-origin: left center;
}

.product-create-panel__brand-search-input {
    width: 100%;
    height: 48px;
    border: 0;
    background: transparent;
    padding: 0 13px;
    color: #111;
    font: inherit;
    font-size: 16px;
    font-weight: 700;
    outline: 0;
    -webkit-appearance: none;
    appearance: none;
}

.product-create-panel__brand-search-input::-webkit-search-cancel-button {
    display: none;
}

.product-create-panel__brand-search-clear {
    display: grid;
    place-items: center;
    width: 46px;
    height: 48px;
    border: 0;
    border-left: 1px solid rgba(17, 17, 17, 0.14);
    background: transparent;
    color: #111;
    font: inherit;
    font-size: 23px;
    cursor: pointer;
}

.product-create-panel__brand-search-clear:hover,
.product-create-panel__brand-search-clear:focus-visible {
    background: #111;
    color: #fff;
}

.product-create-panel__brand-results-count {
    min-height: 17px;
    margin-top: 9px;
    font-size: 12px;
    line-height: 1.35;
    font-weight: 700;
    color: rgba(17, 17, 17, 0.52);
}

.product-create-panel__brand-list {
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
    padding: 8px;
}

.product-create-panel__brand-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: stretch;
    border-bottom: 1px solid rgba(17, 17, 17, 0.09);
}

.product-create-panel__brand-row:last-child {
    border-bottom: 0;
}

.product-create-panel__brand-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    width: 100%;
    min-height: 58px;
    border: 0;
    background: #fff;
    color: #111;
    padding: 10px 13px;
    text-align: left;
    font: inherit;
    cursor: pointer;
}

.product-create-panel__brand-option:hover,
.product-create-panel__brand-option:focus-visible,
.product-create-panel__brand-option.is-active {
    background: rgba(17, 17, 17, 0.07);
    outline: 0;
}

.product-create-panel__brand-option[aria-selected="true"] {
    background: #111;
    color: #fff;
}

.product-create-panel__brand-option-name {
    overflow-wrap: anywhere;
    font-size: 15px;
    line-height: 1.25;
    font-weight: 850;
}

.product-create-panel__brand-option-meta {
    flex: 0 0 auto;
    font-size: 11px;
    line-height: 1.2;
    font-weight: 750;
    color: rgba(17, 17, 17, 0.52);
    white-space: nowrap;
}

.product-create-panel__brand-option[aria-selected="true"] .product-create-panel__brand-option-meta {
    color: rgba(255, 255, 255, 0.72);
}

.product-create-panel__brand-delete {
    align-self: stretch;
    min-width: 92px;
    border: 0;
    border-left: 1px solid rgba(17, 17, 17, 0.12);
    background: #fff;
    color: #8f1d1d;
    padding: 0 13px;
    font: inherit;
    font-size: 11px;
    font-weight: 900;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    cursor: pointer;
}

.product-create-panel__brand-delete:hover,
.product-create-panel__brand-delete:focus-visible {
    background: #8f1d1d;
    color: #fff;
}

.product-create-panel__brand-empty {
    display: grid;
    place-items: center;
    min-height: 180px;
    padding: 24px;
    text-align: center;
    color: rgba(17, 17, 17, 0.58);
    font-size: 14px;
    line-height: 1.45;
    font-weight: 750;
}

.product-create-panel__brand-picker-footer {
    display: grid;
    gap: 10px;
    padding: 14px 22px 18px;
    border-top: 1px solid rgba(17, 17, 17, 0.12);
    background: #fff;
}

.product-create-panel__brand-create {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 12px;
    width: 100%;
    min-height: 52px;
    border: 2px solid #111;
    background: #111;
    color: #fff;
    padding: 10px 14px;
    text-align: left;
    font: inherit;
    cursor: pointer;
}

.product-create-panel__brand-create:hover,
.product-create-panel__brand-create:focus-visible {
    background: #fff;
    color: #111;
}

.product-create-panel__brand-create:disabled,
.product-create-panel__brand-delete:disabled {
    opacity: 0.55;
    cursor: wait;
}

.product-create-panel__brand-create-label {
    font-size: 10px;
    line-height: 1.2;
    font-weight: 900;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.product-create-panel__brand-create-name {
    overflow-wrap: anywhere;
    font-size: 14px;
    line-height: 1.25;
    font-weight: 850;
}

.product-create-panel__brand-picker-note {
    margin: 0;
    font-size: 11px;
    line-height: 1.35;
    font-weight: 650;
    color: rgba(17, 17, 17, 0.5);
}

.product-create-panel__error {
    border-left: 3px solid #8f1d1d;
    padding: 4px 0 4px 12px;
    color: #8f1d1d;
    font-size: 14px;
    line-height: 1.4;
    font-weight: 750;
}

.product-create-panel__actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.product-create-panel__button {
    min-height: 48px;
    border: 2px solid #111;
    border-radius: 0;
    padding: 10px 22px;
    font: inherit;
    font-size: 12px;
    line-height: 1.15;
    font-weight: 900;
    letter-spacing: 0.075em;
    text-transform: uppercase;
    cursor: pointer;
}

.product-create-panel__button--primary {
    background: #111;
    color: #fff;
}

.product-create-panel__button--primary:hover,
.product-create-panel__button--primary:focus-visible {
    background: #fff;
    color: #111;
}

.product-create-panel__button--secondary {
    background: #fff;
    color: #111;
}

.product-create-panel__button--secondary:hover,
.product-create-panel__button--secondary:focus-visible {
    background: rgba(17, 17, 17, 0.06);
}

.product-create-panel__button:disabled,
.product-create-panel__close:disabled {
    opacity: 0.55;
    cursor: default;
}

.product-create-panel--page {
    display: block;
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
    padding: clamp(22px, 4vw, 54px) 0 clamp(52px, 8vw, 96px);
}

.product-create-panel--page .product-create-panel__bar,
.product-create-panel--page .product-create-panel__body {
    border: 2px solid #111;
    background: rgba(255, 255, 255, 0.96);
}

.product-create-panel--page .product-create-panel__bar {
    padding: clamp(18px, 3vw, 28px);
    border-bottom: 0;
}

.product-create-panel--page .product-create-panel__body {
    padding: clamp(18px, 3vw, 28px);
}

@media (max-width: 980px) {
    .product-create-panel__field--type {
        grid-column: span 4;
    }

    .product-create-panel__field--brand {
        grid-column: span 8;
    }

    .product-create-panel__field--name {
        grid-column: 1 / -1;
    }

    .product-create-panel__field--price,
    .product-create-panel__field--old-price {
        grid-column: span 6;
    }
}

@media (max-width: 760px) {
    .product-create-panel.is-open {
        place-items: start stretch;
        padding: max(8px, env(safe-area-inset-top)) max(8px, env(safe-area-inset-right)) max(8px, env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left));
    }

    .product-create-panel__card {
        max-height: calc(100dvh - max(16px, env(safe-area-inset-top)) - max(16px, env(safe-area-inset-bottom)));
        padding: 16px;
    }

    .product-create-panel__head {
        position: sticky;
        top: -16px;
        z-index: 5;
        align-items: center;
        gap: 12px;
        margin: -2px -2px 18px;
        padding: 2px 2px 14px;
        background: #fff;
    }

    .product-create-panel__title {
        font-size: clamp(34px, 10vw, 46px);
    }

    .product-create-panel__close {
        width: 48px;
        height: 48px;
    }

    .product-create-panel__grid {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .product-create-panel__field--type,
    .product-create-panel__field--brand,
    .product-create-panel__field--name,
    .product-create-panel__field--price,
    .product-create-panel__field--old-price,
    .product-create-panel__field--wide {
        grid-column: auto;
    }

    .product-create-panel__control,
    .product-create-panel__brand-trigger,
    .product-create-panel__brand-clear {
        min-height: 50px;
    }

    .product-create-panel__brand-clear {
        width: 50px;
    }

    .product-create-panel__actions {
        position: sticky;
        bottom: -16px;
        z-index: 4;
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        margin: 2px -2px -2px;
        padding: 16px 2px 2px;
        background: linear-gradient(180deg, rgba(255, 255, 255, 0), #fff 24%, #fff 100%);
    }

    .product-create-panel__button {
        width: 100%;
        min-height: 50px;
        padding-inline: 12px;
        white-space: normal;
    }

    .product-create-panel__brand-picker {
        place-items: end stretch;
        padding: max(8px, env(safe-area-inset-top)) 0 0;
    }

    .product-create-panel__brand-picker-dialog {
        width: 100%;
        height: min(88dvh, 760px);
        max-height: calc(100dvh - max(8px, env(safe-area-inset-top)));
        border-right: 0;
        border-bottom: 0;
        border-left: 0;
        grid-template-rows: auto auto minmax(120px, 1fr) auto;
    }

    .product-create-panel__brand-picker-head {
        padding: 18px 16px 14px;
    }

    .product-create-panel__brand-picker-close {
        width: 48px;
        height: 48px;
    }

    .product-create-panel__brand-search-area {
        padding: 12px 16px;
    }

    .product-create-panel__brand-search,
    .product-create-panel__brand-search-input {
        min-height: 52px;
    }

    .product-create-panel__brand-list {
        padding: 6px 8px;
    }

    .product-create-panel__brand-option {
        min-height: 60px;
        padding: 11px 10px;
    }

    .product-create-panel__brand-delete {
        min-width: 82px;
        padding-inline: 10px;
    }

    .product-create-panel__brand-picker-footer {
        padding: 12px 16px max(14px, env(safe-area-inset-bottom));
    }
}

@media (max-width: 520px) {
    .product-create-panel__card {
        padding: 12px;
    }

    .product-create-panel__head {
        top: -12px;
        margin-bottom: 14px;
    }

    .product-create-panel__kicker {
        font-size: 9px;
        letter-spacing: 0.18em;
    }

    .product-create-panel__title {
        font-size: clamp(32px, 11vw, 42px);
    }

    .product-create-panel__label {
        font-size: 9px;
        letter-spacing: 0.13em;
    }

    .product-create-panel__control,
    .product-create-panel__brand-trigger {
        padding-inline: 12px;
        font-size: 14px;
    }

    .product-create-panel__actions {
        bottom: -12px;
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .product-create-panel__brand-picker-title {
        font-size: 32px;
    }

    .product-create-panel__brand-option {
        gap: 8px;
    }

    .product-create-panel__brand-option-name {
        font-size: 14px;
    }

    .product-create-panel__brand-option-meta {
        font-size: 10px;
    }

    .product-create-panel__brand-delete {
        min-width: 72px;
        font-size: 9px;
    }
}

@media (max-width: 360px) {
    .product-create-panel__title {
        font-size: 30px;
    }

    .product-create-panel__brand-picker-head,
    .product-create-panel__brand-search-area,
    .product-create-panel__brand-picker-footer {
        padding-inline: 12px;
    }

    .product-create-panel__brand-row {
        grid-template-columns: minmax(0, 1fr);
    }

    .product-create-panel__brand-delete {
        min-height: 40px;
        border-top: 1px solid rgba(17, 17, 17, 0.12);
        border-left: 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    .product-create-panel__close,
    .product-create-panel__brand-picker-close {
        transition: none;
    }
}

/* Brand deletion opens above both the product dialog and the brand picker. */
[data-brand-delete-modal] {
    z-index: 3100;
}

[data-brand-delete-modal][hidden] {
    display: none !important;
}
.product-create-panel__modes {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}
.product-create-panel__modes > button { flex: 1 1 0; width: auto; padding-inline: 12px; }
.product-create-panel__modes > button[aria-selected="true"] { background: #111; color: #fff; }
.product-create-panel__import { min-height: 0; overflow-wrap: anywhere; }
.product-create-panel__import > a { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }
.product-create-panel__import form { display: grid; gap: 16px; margin: 20px 0; }
.product-create-panel__import [data-product-import-status] { margin: 16px 0; font-weight: 700; }
.product-create-panel__import [data-status="error"] { color: #8f1d1d; border-left: 3px solid currentColor; padding-left: 12px; }
.product-create-panel__import [data-product-import-results] { max-height: 260px; overflow: auto; }
.product-create-panel__import [data-product-import-confirm] { width: 100%; margin-top: 16px; }
.product-create-panel__import input[type="file"] { padding: 10px 12px; }
.product-create-panel__import input::file-selector-button { max-width: 100%; font: inherit; padding: 5px 8px; cursor: pointer; }
.product-create-panel__form[hidden], .product-create-panel__import[hidden] { display: none; }
