/**
 * Webisport Dashboard - Shop Section Styles
 */

.webisport-dashboard .shop-section-warning .webisport-card-body p {
    margin: 0;
}

.webisport-dashboard .shop-table-card {
    overflow: hidden;
}

.webisport-dashboard .shop-product-cell,
.webisport-dashboard .shop-order-detail-item {
    display: flex;
    align-items: center;
    gap: var(--ws-space-3);
}

.webisport-dashboard .shop-product-copy,
.webisport-dashboard .shop-table-stack,
.webisport-dashboard .shop-order-detail-item div {
    display: flex;
    flex-direction: column;
    gap: var(--ws-space-1);
    min-width: 0;
}

.webisport-dashboard .shop-product-copy span,
.webisport-dashboard .shop-table-stack span,
.webisport-dashboard .shop-order-meta,
.webisport-dashboard .shop-price-sale {
    color: var(--ws-text-muted);
    font-size: 13px;
}

.webisport-dashboard .shop-product-thumb,
.webisport-dashboard .shop-order-detail-item img {
    width: 56px;
    height: 56px;
    border-radius: var(--ws-radius);
    object-fit: cover;
    background: var(--ws-bg-subtle);
    flex-shrink: 0;
}

.webisport-dashboard .shop-product-thumb-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--ws-text-muted);
}

.webisport-dashboard .shop-chip-list,
.webisport-dashboard .shop-order-items-preview {
    display: flex;
    flex-wrap: wrap;
    gap: var(--ws-space-2);
}

.webisport-dashboard .shop-chip,
.webisport-dashboard .shop-order-item,
.webisport-dashboard .shop-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.42rem 0.77rem;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    line-height: 1;
}

.webisport-dashboard .shop-chip,
.webisport-dashboard .shop-order-item,
.webisport-dashboard .shop-status-badge-neutral {
    background: var(--ws-bg-subtle);
    color: var(--ws-text-muted);
}

.webisport-dashboard .shop-status-badge-success {
    background: rgba(40, 199, 111, 0.16);
    color: #28c76f;
}

.webisport-dashboard .shop-status-badge-warning {
    background: rgba(255, 159, 67, 0.16);
    color: #ff9f43;
}

.webisport-dashboard .shop-status-badge-danger {
    background: rgba(234, 84, 85, 0.16);
    color: #ea5455;
}

.webisport-dashboard .shop-empty-inline {
    color: var(--ws-text-muted);
}

.webisport-dashboard .shop-product-form {
    display: flex;
    flex-direction: column;
    max-width: 46rem;
    width: 100%;
    margin: 0 auto;
}

/* Create wizard: step indicator above the current section */
.webisport-dashboard .shop-product-create-wizard {
    margin-bottom: var(--ws-space-5);
}

.webisport-dashboard .shop-product-step-indicator {
    margin: 0;
    padding: 0;
    list-style: none;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: var(--ws-space-2);
}

.webisport-dashboard .shop-product-step-indicator li {
    display: flex;
    align-items: center;
    gap: var(--ws-space-2);
    min-width: 0;
    padding: 0.5rem 0.6rem;
    border-radius: var(--ws-radius);
    background: var(--ws-bg-subtle);
    color: var(--ws-text-muted);
    border: 1px solid transparent;
}

.webisport-dashboard .shop-product-step-indicator li span {
    width: 22px;
    height: 22px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    background: rgba(47, 43, 61, 0.12);
    color: inherit;
    flex-shrink: 0;
}

.webisport-dashboard .shop-product-step-indicator li strong {
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.webisport-dashboard .shop-product-step-indicator li.is-active {
    border-color: rgba(var(--ws-primary-border-rgb), 0.32);
    background: rgba(var(--ws-primary-rgb), 0.08);
    color: var(--ws-primary-ink);
}

.webisport-dashboard .shop-product-step-indicator li.is-active span {
    background: var(--ws-primary);
    color: var(--ws-on-primary);
}

.webisport-dashboard .shop-product-step-indicator li.is-completed {
    color: #28c76f;
}

.webisport-dashboard .shop-product-step-indicator li.is-completed span {
    background: rgba(40, 199, 111, 0.18);
    color: #28c76f;
}

/* Only one section is visible per wizard step: no separator above it */
.webisport-dashboard .shop-product-form.is-create-wizard .pr-section {
    border-top: none;
    margin-top: 0;
    padding-top: 0;
}

.webisport-dashboard .shop-product-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0 var(--ws-space-4);
    align-items: start;
}

/* The theme's additional CSS strips the select chevron with
   `background: … !important`; put it back for this form. */
.webisport-dashboard #shop-product-modal .webisport-select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 22' fill='none'%3E%3Cpath d='M10.9999 12.0743L15.5374 7.53676L16.8336 8.83292L10.9999 14.6666L5.16626 8.83292L6.46243 7.53676L10.9999 12.0743Z' fill='%232f2b3d' fill-opacity='0.85'/%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: right 0.8rem center !important;
    background-size: 1.1rem 1.2rem !important;
    padding-right: 2.625rem !important;
}

.webisport-dashboard #shop-product-modal .webisport-textarea {
    min-height: 5rem;
    resize: vertical;
}

/* Description editor: light toolbar on one line */
.webisport-dashboard #shop-product-modal .shop-product-editor .wp-editor-wrap {
    border: 1px solid var(--ws-border-light);
    border-radius: var(--ws-radius);
    overflow: hidden;
    background: #fff;
}

.webisport-dashboard #shop-product-modal .shop-product-editor .wp-editor-container,
.webisport-dashboard #shop-product-modal .shop-product-editor .mce-tinymce,
.webisport-dashboard #shop-product-modal .shop-product-editor .mce-panel {
    border: 0 !important;
    box-shadow: none !important;
}

.webisport-dashboard #shop-product-modal .shop-product-editor .mce-toolbar-grp {
    background: var(--ws-bg-subtle) !important;
    border-bottom: 1px solid var(--ws-border-light) !important;
    padding: 0.25rem 0.35rem;
}

.webisport-dashboard #shop-product-modal .shop-product-editor .mce-toolbar .mce-btn-group {
    display: flex;
    flex-wrap: wrap;
    gap: 2px;
}

.webisport-dashboard #shop-product-modal .shop-product-editor .mce-toolbar .mce-btn,
.webisport-dashboard #shop-product-modal .shop-product-editor .mce-toolbar .mce-btn button {
    background: transparent !important;
    border-color: transparent !important;
    box-shadow: none !important;
    color: #444050 !important;
}

.webisport-dashboard #shop-product-modal .shop-product-editor .mce-toolbar .mce-btn:hover,
.webisport-dashboard #shop-product-modal .shop-product-editor .mce-toolbar .mce-btn.mce-active {
    background: rgba(47, 43, 61, 0.08) !important;
    border-radius: 0.3rem;
}

.webisport-dashboard #shop-product-modal .shop-product-editor .mce-toolbar .mce-btn button {
    padding: 4px 6px !important;
    min-height: 0 !important;
}

.webisport-dashboard #shop-product-modal .shop-product-editor .mce-toolbar .mce-ico {
    color: #444050 !important;
}

.webisport-dashboard #shop-product-modal .shop-product-editor .mce-toolbar .mce-listbox,
.webisport-dashboard #shop-product-modal .shop-product-editor .mce-toolbar .mce-listbox button {
    background: #fff !important;
    border: 1px solid var(--ws-border-light) !important;
    border-radius: 0.3rem;
}

.webisport-dashboard .shop-checkbox-row {
    display: inline-flex;
    align-items: center;
    gap: var(--ws-space-2);
    font-weight: 500;
    cursor: pointer;
}

.webisport-dashboard #shop-product-modal .shop-checkbox-row input[type="checkbox"] {
    appearance: auto !important;
    width: 1rem !important;
    height: 1rem !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    accent-color: var(--ws-primary);
}

/* Images */
.webisport-dashboard .shop-media-box {
    display: flex;
    flex-direction: column;
    gap: var(--ws-space-3);
}

.webisport-dashboard .shop-media-preview {
    border: 1px dashed var(--ws-border-light);
    border-radius: var(--ws-radius);
    background: var(--ws-bg-subtle);
    overflow: hidden;
    min-height: 140px;
}

.webisport-dashboard .shop-media-preview-large {
    display: flex;
    align-items: center;
    justify-content: center;
    width: min(100%, 18rem);
    aspect-ratio: 1 / 1;
    min-height: 0;
}

/* Show the whole picture (posters, products) instead of cropping it */
.webisport-dashboard .shop-media-preview-large img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.webisport-dashboard .shop-media-empty {
    min-height: inherit;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: var(--ws-space-2);
    color: var(--ws-text-muted);
}

.webisport-dashboard .shop-media-preview-large .shop-media-empty {
    width: 100%;
    height: 100%;
}

.webisport-dashboard .shop-media-empty-inline {
    min-height: 88px;
    padding: 0 var(--ws-space-4);
    border: 1px dashed var(--ws-border-light);
    border-radius: var(--ws-radius);
    background: var(--ws-bg-subtle);
}

/* Categories */
.webisport-dashboard #shop-product-modal .webisport-choice-grid {
    background: #fff;
}

.webisport-dashboard .shop-category-create-row {
    display: flex;
    gap: var(--ws-space-2);
    align-items: stretch;
}

.webisport-dashboard .shop-category-create-row .webisport-input {
    flex: 1 1 auto;
    min-width: 0;
}

.webisport-dashboard .shop-category-create-row .webisport-btn {
    flex: 0 0 auto;
    white-space: nowrap;
}

.webisport-dashboard .shop-media-actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--ws-space-2);
}

.webisport-dashboard .shop-gallery-preview {
    display: flex;
    flex-wrap: wrap;
    gap: var(--ws-space-3);
}

.webisport-dashboard .shop-gallery-thumb {
    position: relative;
    width: 88px;
    height: 88px;
    border-radius: var(--ws-radius);
    overflow: hidden;
    background: var(--ws-bg-subtle);
    box-shadow: var(--ws-shadow-sm);
}

.webisport-dashboard .shop-gallery-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.webisport-dashboard .shop-gallery-remove {
    position: absolute;
    top: var(--ws-space-1);
    right: var(--ws-space-1);
    width: 24px;
    height: 24px;
    border: none;
    border-radius: 999px;
    background: rgba(47, 43, 61, 0.75);
    color: var(--ws-white);
    cursor: pointer;
    padding: 0;
    line-height: 24px;
}

.webisport-dashboard .shop-gallery-remove:hover {
    background: var(--ws-danger);
}

.webisport-dashboard .shop-variable-product-notice {
    display: flex;
    gap: var(--ws-space-3);
    padding: var(--ws-space-4);
    border: 1px solid rgba(255, 159, 67, 0.28);
    border-radius: var(--ws-radius);
    background: rgba(255, 159, 67, 0.08);
    margin-bottom: var(--ws-space-4);
}

.webisport-dashboard .shop-variable-product-notice .dashicons {
    color: #ff9f43;
}

.webisport-dashboard .shop-variable-product-notice p {
    margin: 0 0 var(--ws-space-2);
    color: var(--ws-text-muted);
}

/* Order detail blocks (Client, Statut commande, Articles, Notes) */
.webisport-dashboard .shop-product-panel {
    border: 1px solid var(--ws-border-light);
    border-radius: var(--ws-radius);
    background: var(--ws-white);
    padding: var(--ws-space-5);
    box-shadow: 0 1px 2px rgba(47, 43, 61, 0.06);
}

.webisport-dashboard .shop-product-panel-header {
    margin-bottom: var(--ws-space-4);
}

.webisport-dashboard .shop-product-panel-header h4 {
    margin: 0 0 var(--ws-space-1);
    font-size: 15px;
    font-weight: 600;
    color: var(--ws-text);
}

.webisport-dashboard .shop-product-panel-header p {
    margin: 0;
    color: var(--ws-text-muted);
    font-size: 13px;
}

.webisport-dashboard .shop-order-detail-shell {
    display: flex;
    flex-direction: column;
    gap: var(--ws-space-4);
}

.webisport-dashboard .shop-order-detail-top,
.webisport-dashboard .shop-order-detail-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--ws-space-4);
}

.webisport-dashboard .shop-order-detail-summary h4 {
    margin: 0 0 var(--ws-space-2);
    font-size: 18px;
}

.webisport-dashboard .shop-order-detail-total {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    font-size: 28px;
    font-weight: 700;
    color: var(--ws-text);
}

.webisport-dashboard .shop-info-list {
    display: flex;
    flex-direction: column;
    gap: var(--ws-space-3);
}

.webisport-dashboard .shop-info-list div {
    display: flex;
    flex-direction: column;
    gap: var(--ws-space-1);
}

.webisport-dashboard .shop-info-list strong {
    font-size: 12px;
    color: var(--ws-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.webisport-dashboard .shop-note-list {
    display: flex;
    flex-direction: column;
    gap: var(--ws-space-3);
}

.webisport-dashboard .shop-note {
    border: 1px solid var(--ws-border-light);
    border-radius: var(--ws-radius);
    background: var(--ws-bg-subtle);
    padding: var(--ws-space-4);
}

.webisport-dashboard .shop-note-head {
    display: flex;
    justify-content: space-between;
    gap: var(--ws-space-3);
    margin-bottom: var(--ws-space-2);
    color: var(--ws-text-muted);
    font-size: 13px;
}

.webisport-dashboard .shop-note p {
    margin: 0;
    color: var(--ws-text);
    white-space: pre-wrap;
}

.webisport-dashboard .shop-error-state {
    color: var(--ws-danger);
    margin: 0;
}

.webisport-dashboard #shop-product-modal .webisport-modal-content,
.webisport-dashboard #shop-order-detail-modal .webisport-modal-content {
    max-height: min(90vh, 960px);
}

.webisport-dashboard #shop-order-detail-modal .webisport-modal-body {
    background: var(--ws-bg-subtle);
}

@media (max-width: 1100px) {
    .webisport-dashboard .shop-order-detail-top,
    .webisport-dashboard .shop-order-detail-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .webisport-dashboard .shop-product-step-indicator {
        grid-template-columns: 1fr;
    }

    .webisport-dashboard .shop-product-grid {
        grid-template-columns: 1fr;
    }

    .webisport-dashboard .shop-order-detail-total {
        justify-content: flex-start;
    }
}
