/* ==========================================================================
   Predefined carts — expert tab, customer popup, admin tables
   ========================================================================== */

/* --------------------------------------------------------------------------
   Expert tab
   -------------------------------------------------------------------------- */

.wpo-sc-carts__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 20px;
}

.wpo-sc-carts__head h3 {
    margin: 0 0 6px;
}

.wpo-sc-carts__lead {
    margin: 0;
    font-size: 13px;
    color: #5a7fa8;
    max-width: 640px;
}

.wpo-sc-carts__empty {
    padding: 18px 20px;
    background: #f7f7f7;
    border-radius: 6px;
    font-size: 14px;
}

.wpo-sc-cart-card {
    border: 1px solid #c2d9f5;
    border-radius: 6px;
    background: #f8fbff;
    padding: 18px 20px;
    margin-bottom: 16px;
}

/* Nagłówek karty = przycisk zwijania */
.wpo-sc-cart-card__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
    padding: 0;
    background: none;
    border: none;
    text-align: left;
    cursor: pointer;
    color: inherit;
    font: inherit;
    box-shadow: none;
}

/* Motyw potrafi nadpisywać stylowanie <button> — trzymamy nagłówek płaski. */
.wpo-sc-cart-card__head:hover,
.wpo-sc-cart-card__head:focus {
    background: none;
    box-shadow: none;
    color: inherit;
}

.wpo-sc-cart-card__head-main {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.wpo-sc-cart-card__title {
    font-size: 17px;
    font-weight: 600;
    color: #1a3c5e;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.wpo-sc-cart-card__chevron {
    flex: 0 0 auto;
    width: 9px;
    height: 9px;
    border-right: 2px solid #5a7fa8;
    border-bottom: 2px solid #5a7fa8;
    transform: rotate(45deg);
    transition: transform .15s ease;
}

.wpo-sc-cart-card.is-collapsed .wpo-sc-cart-card__chevron {
    transform: rotate(-45deg);
}

.wpo-sc-cart-card__summary {
    font-size: 12px;
    color: #5a7fa8;
    white-space: nowrap;
}

.wpo-sc-cart-card:not(.is-collapsed) .wpo-sc-cart-card__summary {
    display: none;
}

.wpo-sc-cart-card__body {
    margin-top: 14px;
}

.wpo-sc-cart-card.is-collapsed .wpo-sc-cart-card__body {
    display: none;
}

.wpo-sc-cart-card.is-collapsed {
    padding: 14px 20px;
}

.wpo-sc-cart-card__stats {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 14px;
}

.wpo-sc-chip {
    display: inline-flex;
    flex-direction: column;
    min-width: 74px;
    padding: 8px 12px;
    background: #fff;
    border: 1px solid #d8e5f5;
    border-radius: 5px;
    line-height: 1.3;
}

.wpo-sc-chip strong {
    font-size: 17px;
    color: #1a3c5e;
}

.wpo-sc-chip span {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .4px;
    color: #7a8ba0;
}

.wpo-sc-chip--revenue strong {
    color: #1a6e1a;
}

.wpo-sc-cart-card__link {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}

.wpo-sc-cart-card__link-input {
    flex: 1 1 auto;
    font-size: 12px;
    background: #fff;
}

.wpo-sc-cart-card__items {
    margin: 0 0 14px;
    padding-left: 18px;
    font-size: 13px;
    color: #444;
}

.wpo-sc-cart-card__items li {
    margin: 0 0 3px;
}

.wpo-sc-cart-card__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 10px;
}

.wpo-sc-cart-card__meta {
    font-size: 11px;
    color: #8a97a8;
}

/* Buttons of the expert tab.
   expert-zone.css (which holds the base .wpo-sc-btn) is not loaded on this endpoint, so the
   whole set lives here. Every rule is scoped to .wpo-sc-carts on purpose — themes style bare
   `button` elements, and the two-class selector keeps those declarations from winning. */

.wpo-sc-carts .wpo-sc-btn {
    display: inline-block;
    padding: 6px 16px;
    border: 1px solid #c2d9f5;
    border-radius: 4px;
    background: #fff;
    color: #1a3c5e;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.5;
    text-decoration: none;
    cursor: pointer;
    transition: background .15s;
}

.wpo-sc-carts .wpo-sc-btn:hover {
    background: #f0f7ff;
    color: #1a3c5e;
}

.wpo-sc-carts .wpo-sc-btn--primary {
    background: #1a3c5e;
    border-color: #1a3c5e;
    color: #fff;
}

.wpo-sc-carts .wpo-sc-btn--primary:hover {
    background: #0d2640;
    color: #fff;
}

.wpo-sc-carts .wpo-sc-btn--danger {
    background: #fff;
    border-color: #d63638;
    color: #d63638;
}

.wpo-sc-carts .wpo-sc-btn--danger:hover {
    background: #d63638;
    color: #fff;
}

.wpo-sc-carts .wpo-sc-btn--link {
    background: none;
    border: none;
    color: #d63638;
    padding: 4px 6px;
    text-decoration: underline;
}

.wpo-sc-carts .wpo-sc-btn--link:hover {
    background: none;
    color: #a02224;
}

/* --------------------------------------------------------------------------
   Modals (expert tab)
   -------------------------------------------------------------------------- */

body.wpo-sc-cart-modal-open,
body.wpo-sc-popup-open {
    overflow: hidden;
}

.wpo-sc-cart-modal {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.wpo-sc-cart-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(10, 25, 45, .55);
}

.wpo-sc-cart-modal__box {
    position: relative;
    width: 100%;
    max-width: 640px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 18px 50px rgba(0, 0, 0, .3);
}

.wpo-sc-cart-modal__box--narrow {
    max-width: 380px;
}

.wpo-sc-cart-modal__header,
.wpo-sc-cart-modal__footer {
    padding: 16px 20px;
}

.wpo-sc-cart-modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid #e5eaf0;
}

.wpo-sc-cart-modal__header h4 {
    margin: 0;
    font-size: 17px;
    color: #1a3c5e;
}

.wpo-sc-cart-modal__close {
    background: none;
    border: none;
    font-size: 26px;
    line-height: 1;
    color: #7a8ba0;
    cursor: pointer;
}

.wpo-sc-cart-modal__body {
    padding: 18px 20px;
    overflow-y: auto;
}

.wpo-sc-cart-modal__footer {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    border-top: 1px solid #e5eaf0;
}

.wpo-sc-cart-modal__feedback {
    margin-top: 12px;
    font-size: 13px;
}

.wpo-sc-error {
    color: #d63638;
}

.wpo-sc-success {
    color: #1a6e1a;
}

.wpo-sc-cart-search-results {
    margin-top: 6px;
    border: 1px solid #d8e5f5;
    border-radius: 5px;
    max-height: 240px;
    overflow-y: auto;
    background: #fff;
}

.wpo-sc-carts .wpo-sc-search-result {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    width: 100%;
    padding: 8px 12px;
    background: none;
    border: none;
    border-bottom: 1px solid #eef3f9;
    border-radius: 0;
    color: #1a3c5e;
    font-size: 13px;
    font-weight: 400;
    text-align: left;
    cursor: pointer;
}

.wpo-sc-carts .wpo-sc-search-result:hover {
    background: #f0f7ff;
    color: #1a3c5e;
}

.wpo-sc-search-result__price {
    white-space: nowrap;
    color: #5a7fa8;
}

.wpo-sc-search-note {
    padding: 10px 12px;
    font-size: 13px;
    color: #7a8ba0;
}

.wpo-sc-cart-items {
    margin-top: 16px;
}

.wpo-sc-cart-items__empty {
    padding: 12px;
    background: #f7f9fc;
    border-radius: 5px;
    font-size: 13px;
    color: #7a8ba0;
}

.wpo-sc-cart-items__table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.wpo-sc-cart-items__table td {
    padding: 8px 6px;
    border-bottom: 1px solid #eef3f9;
    vertical-align: middle;
}

.wpo-sc-cart-items__price {
    color: #7a8ba0;
}

.wpo-sc-cart-items__qty {
    width: 90px;
}

.wpo-sc-cart-items__qty input {
    width: 80px;
}

.wpo-sc-cart-items__remove {
    width: 90px;
    text-align: right;
}

.wpo-sc-qr-body {
    text-align: center;
}

.wpo-sc-qr-canvas {
    display: inline-block;
    padding: 10px;
    background: #fff;
}

.wpo-sc-qr-canvas img,
.wpo-sc-qr-canvas canvas {
    display: block;
    margin: 0 auto;
}

.wpo-sc-qr-link {
    margin: 12px 0 0;
    font-size: 11px;
    word-break: break-all;
    color: #7a8ba0;
}

.wpo-sc-events-filters {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-bottom: 14px;
    padding-bottom: 14px;
    border-bottom: 1px solid #eef3f9;
    font-size: 13px;
}

.wpo-sc-pagination__info {
    font-size: 12px;
    color: #7a8ba0;
}

/* --------------------------------------------------------------------------
   Customer popup
   -------------------------------------------------------------------------- */

.wpo-sc-cart-popup {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    font-size: 14px;
}

.wpo-sc-cart-popup__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(10, 25, 45, .6);
}

.wpo-sc-cart-popup__box {
    position: relative;
    width: 100%;
    max-width: 680px;
    max-height: 92vh;
    display: flex;
    flex-direction: column;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, .35);
    overflow: hidden;
}

.wpo-sc-cart-popup__header {
    padding: 20px 24px 14px;
    background: #f0f7ff;
    border-bottom: 1px solid #c2d9f5;
}

.wpo-sc-cart-popup__header h3 {
    margin: 0 0 6px;
    font-size: 19px;
    color: #1a3c5e;
}

.wpo-sc-cart-popup__subtitle {
    margin: 0;
    font-size: 14px;
    color: #33506e;
}

.wpo-sc-cart-popup__coupon {
    margin: 8px 0 0;
    font-size: 13px;
    font-weight: 600;
    color: #1a6e1a;
}

.wpo-sc-cart-popup__body {
    padding: 16px 24px;
    overflow-y: auto;
}

.wpo-sc-cart-popup__hint {
    margin: 0 0 12px;
    font-size: 13px;
    color: #7a8ba0;
}

.wpo-sc-cart-popup__items {
    margin: 0;
    padding: 0;
    list-style: none;
}

.wpo-sc-cart-popup__item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid #eef3f9;
}

.wpo-sc-cart-popup__item.is-unavailable {
    opacity: .55;
}

.wpo-sc-cart-popup__item label {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
    cursor: pointer;
}

.wpo-sc-cart-popup__thumb {
    width: 48px;
    height: 48px;
    object-fit: cover;
    border-radius: 4px;
}

.wpo-sc-cart-popup__info {
    display: flex;
    flex-direction: column;
}

.wpo-sc-cart-popup__name {
    font-weight: 600;
    color: #1a3c5e;
}

.wpo-sc-cart-popup__meta {
    font-size: 12px;
    color: #7a8ba0;
}

.wpo-sc-cart-popup__qty {
    display: flex;
    align-items: center;
    gap: 10px;
    white-space: nowrap;
}

/* Ten sam zapis ceny co w koszyku: stara cena przekreslona, nowa na pigulce. */
.wpo-sc-cart-popup__unit-was {
    margin-right: 6px;
    text-decoration: line-through;
    font-weight: 400;
    color: #9aa0a6;
}

.wpo-sc-cart-popup__unit.is-discounted {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 6px;
    background: #1a3c5e;
    color: #fff;
    font-weight: 600;
}

/* Gdy kupon obniza kwote, suma sprzed kuponu idzie na przekreslenie. */
.wpo-sc-cart-popup__total.has-coupon #wpo-sc-cart-popup-total {
    text-decoration: line-through;
    font-weight: 400;
    color: #9aa0a6;
}

.wpo-sc-cart-popup__total-final {
    margin-left: 6px;
}

.wpo-sc-cart-popup__line-total {
    min-width: 72px;
    text-align: right;
    font-weight: 600;
    color: #1a3c5e;
}

.wpo-sc-cart-popup__total {
    flex: 1 1 auto;
    margin-right: auto;
    min-width: 0;
    font-size: 14px;
    color: #33506e;
}

.wpo-sc-cart-popup__qty-input {
    width: 68px;
    padding: 5px 6px;
    border: 1px solid #d8e5f5;
    border-radius: 4px;
}

.wpo-sc-cart-popup__notice {
    margin: 14px 0 0;
    padding: 10px 12px;
    background: #fff8e1;
    border-left: 3px solid #f0a500;
    font-size: 13px;
}

.wpo-sc-cart-popup__feedback {
    margin-top: 12px;
    font-size: 13px;
}

.wpo-sc-cart-popup__footer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    padding: 14px 24px;
    border-top: 1px solid #e5eaf0;
    background: #fafbfd;
}

/* Przyciski trzymają jedną linię; gdy zabraknie miejsca, na osobny wiersz
   przenosi się podsumowanie, nie łamie się tekst w przycisku. */
.wpo-sc-cart-popup__footer .wpo-sc-btn {
    white-space: nowrap;
}

/* Popup ładuje się także na stronach bez expert-zone.css — bazowe przyciski. */
.wpo-sc-cart-popup .wpo-sc-btn {
    display: inline-block;
    padding: 9px 18px;
    background: #fff;
    border: 1px solid #c2d9f5;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
    color: #1a3c5e;
    cursor: pointer;
}

.wpo-sc-cart-popup .wpo-sc-btn--primary {
    background: #1a3c5e;
    border-color: #1a3c5e;
    color: #fff;
}

.wpo-sc-cart-popup .wpo-sc-btn--primary:hover {
    background: #0d2640;
}

@media (max-width: 600px) {
    .wpo-sc-cart-popup__item {
        flex-wrap: wrap;
    }

    .wpo-sc-carts__head {
        flex-direction: column;
    }

    .wpo-sc-cart-card__head {
        flex-wrap: wrap;
    }

    .wpo-sc-cart-card__summary {
        white-space: normal;
        flex-basis: 100%;
        padding-left: 19px;
    }
}

/* --------------------------------------------------------------------------
   Admin
   -------------------------------------------------------------------------- */

.wpo-sc-ca-summary__chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 14px 0;
}

.wpo-sc-ca-chip {
    display: inline-flex;
    flex-direction: column;
    min-width: 90px;
    padding: 8px 12px;
    background: #fff;
    border: 1px solid #dcdcde;
    border-radius: 4px;
    line-height: 1.3;
}

.wpo-sc-ca-chip strong {
    font-size: 16px;
}

.wpo-sc-ca-chip span {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .4px;
    color: #787c82;
}

.wpo-sc-carts-admin .wpo-sc-filters {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin: 12px 0;
}

.wpo-sc-ca-deleted-label {
    font-size: 13px;
}

.wpo-sc-ca-link {
    font-size: 11px;
    word-break: break-all;
}

.wpo-sc-ca-badge {
    display: inline-block;
    padding: 1px 6px;
    background: #f0f0f1;
    border-radius: 9px;
    font-size: 11px;
    color: #787c82;
}

.wpo-sc-ca-events {
    margin-top: 24px;
}
