/**
 * PW Customer Portal — v1.0.0
 *
 * Full-width layout for WooCommerce My Account pages.
 * Overrides theme's narrow content container.
 */

/* ── Full-width override ──────────────────────────────────────
 * Target the WC My Account wrapper and its parent containers.
 * Multiple selectors for theme compatibility — most themes use
 * one of these patterns for the content area.
 */
.woocommerce-account .woocommerce,
.woocommerce-account .entry-content,
.woocommerce-account .site-content .content-area,
.woocommerce-account .site-main,
.woocommerce-account article .entry-content {
    max-width: 100% !important;
    width: 100% !important;
    padding-left: 2rem !important;
    padding-right: 2rem !important;
    box-sizing: border-box !important;
}

/* Some themes wrap content in a fixed-width container */
.woocommerce-account .container,
.woocommerce-account .site-content > .container,
.woocommerce-account .content-wrapper > .container,
.woocommerce-account .page-content > .container {
    max-width: 100% !important;
    width: 100% !important;
}

/* ── My Account nav + content layout ──────────────────────────
 * Side-by-side on desktop, stacked on mobile.
 */
.woocommerce-account .woocommerce-MyAccount-navigation,
.woocommerce-account .woocommerce-MyAccount-content {
    box-sizing: border-box;
}

/* Nav styling — clean links, no bullets */
.woocommerce-account .woocommerce-MyAccount-navigation ul {
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

.woocommerce-account .woocommerce-MyAccount-navigation ul li {
    margin: 0 !important;
    padding: 0 !important;
}

.woocommerce-account .woocommerce-MyAccount-navigation ul li a {
    display: block;
    padding: 0.6rem 1rem;
    color: #333;
    text-decoration: none;
    font-size: 0.95em;
    font-weight: 500;
    border-radius: 6px;
    transition: background 0.15s, color 0.15s;
}

.woocommerce-account .woocommerce-MyAccount-navigation ul li a:hover {
    background: #f0f0f1;
    color: #2271b1;
}

.woocommerce-account .woocommerce-MyAccount-navigation ul li.is-active a,
.woocommerce-account .woocommerce-MyAccount-navigation ul li.woocommerce-MyAccount-navigation-link--orders.is-active a,
.woocommerce-account .woocommerce-MyAccount-navigation ul li a[aria-current="page"] {
    background: #f0f7fc;
    color: #2271b1;
}

@media (min-width: 769px) {
    .woocommerce-account .woocommerce {
        display: flex !important;
        gap: 2rem;
        align-items: flex-start;
    }

    .woocommerce-account .woocommerce-MyAccount-navigation {
        flex: 0 0 200px;
        min-width: 200px;
    }

    .woocommerce-account .woocommerce-MyAccount-content {
        flex: 1;
        min-width: 0;
    }
}

@media (max-width: 768px) {
    .woocommerce-account .woocommerce,
    .woocommerce-account .entry-content,
    .woocommerce-account .site-main {
        padding-left: 1rem !important;
        padding-right: 1rem !important;
    }

    .woocommerce-account .woocommerce-MyAccount-navigation {
        margin-bottom: 1rem;
    }

    .woocommerce-account .woocommerce-MyAccount-navigation ul {
        display: flex !important;
        gap: 0.25rem;
    }

    .woocommerce-account .woocommerce-MyAccount-navigation ul li a {
        padding: 0.5rem 0.8rem;
        font-size: 0.9em;
        white-space: nowrap;
    }
}

/* ── Orders table responsive ──────────────────────────────────
 * Full width, no horizontal scroll on mobile.
 */
.woocommerce-account .woocommerce-orders-table {
    width: 100%;
}

@media (max-width: 768px) {
    .woocommerce-account .woocommerce-orders-table {
        font-size: 0.9em;
    }
}

/* ── Addresses page ───────────────────────────────────────────
 * Billing read-only + shipping editable, side by side.
 */
.pw-addresses-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

@media (max-width: 768px) {
    .pw-addresses-grid {
        grid-template-columns: 1fr;
    }
}

.pw-address-card {
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 1.5rem;
}

.pw-address-card header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.pw-address-card h3 {
    margin: 0;
    font-size: 1.1em;
}

.pw-address-card address {
    font-style: normal;
    line-height: 1.6;
}

.pw-address-edit-link {
    font-size: 0.9em;
}

.pw-address-readonly-note {
    margin-top: 1rem;
    font-size: 0.85em;
    color: #888;
    font-style: italic;
}

/* ── Shipping addresses section ───────────────────────────────
 * Cards grid + inline add/edit form.
 */
.pw-shipping-addresses {
    margin-top: 2rem;
}

.pw-shipping-addresses h3 {
    margin: 0 0 1rem;
}

.pw-address-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.pw-address-shipping-card {
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 1.2rem;
}

.pw-address-shipping-card header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.8rem;
}

.pw-address-shipping-card h4 {
    margin: 0;
    font-size: 1em;
}

.pw-card-actions {
    display: flex;
    gap: 0.5rem;
}

.pw-addr-edit-btn,
.pw-addr-delete-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 0.85em;
    padding: 2px 6px;
    border-radius: 3px;
}

.pw-addr-edit-btn {
    color: #2271b1;
}

.pw-addr-edit-btn:hover {
    background: #f0f0f1;
}

.pw-addr-delete-btn {
    color: #b32d2e;
}

.pw-addr-delete-btn:hover {
    background: #fcebeb;
}

.pw-addr-delete-btn.pw-addr-delete-disabled,
.pw-addr-delete-btn:disabled {
    color: #aaa;
    cursor: not-allowed;
    opacity: 0.5;
}

.pw-addr-delete-btn.pw-addr-delete-disabled:hover,
.pw-addr-delete-btn:disabled:hover {
    background: none;
}

.pw-addr-phone {
    margin: 0.5rem 0 0;
    font-size: 0.9em;
    color: #666;
}

.pw-add-address-btn {
    margin-bottom: 1rem;
}

/* ── Address form ─────────────────────────────────────────── */
.pw-address-form-wrap {
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 1.5rem;
    margin-top: 1rem;
    background: #fafafa;
}

.pw-address-form-wrap h4 {
    margin: 0 0 1rem;
}

.pw-form-row {
    margin-bottom: 1rem;
}

.pw-form-row label {
    display: block;
    font-size: 0.9em;
    margin-bottom: 0.3rem;
    font-weight: 500;
}

.pw-form-row input,
.pw-form-row select {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 1em;
    box-sizing: border-box;
}

.pw-form-row-half {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

@media (max-width: 480px) {
    .pw-form-row-half {
        grid-template-columns: 1fr;
    }
}

.pw-form-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 1.5rem;
}

.pw-btn-save {
    background: #2271b1 !important;
    color: #fff !important;
    border-color: #2271b1 !important;
}

.pw-btn-save:hover {
    background: #135e96 !important;
}

.required {
    color: #b32d2e;
}

/* ── Orders portal ─────────────────────────────────────────────
 * Card-based order list with tabs, search, and time filter.
 */
.pw-orders-portal {
    position: relative;
}

.pw-orders-toolbar {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.pw-search-wrap {
    flex: 1;
    min-width: 200px;
}

.pw-search-input {
    width: 100%;
    padding: 0.6rem 1rem;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 1em;
    box-sizing: border-box;
    height: 42px;
}

.pw-search-input:focus {
    outline: none;
    border-color: #2271b1;
    box-shadow: 0 0 0 1px #2271b1;
}

.pw-filter-wrap {
    flex-shrink: 0;
}

.pw-date-filter {
    padding: 0.6rem 0.8rem;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 1em;
    background: #fff;
    cursor: pointer;
    height: 42px;
    box-sizing: border-box;
}

/* Tabs */
.pw-orders-tabs {
    display: flex;
    gap: 0;
    border-bottom: 2px solid #e0e0e0;
    margin-bottom: 1.5rem;
}

.pw-tab {
    padding: 0.7rem 1.2rem;
    border: none;
    background: none;
    font-size: 1em;
    cursor: pointer;
    color: #666;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: color 0.15s, border-color 0.15s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.pw-tab:hover {
    color: #333;
}

.pw-tab-active {
    color: #2271b1;
    border-bottom-color: #2271b1;
    font-weight: 500;
}

.pw-tab-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 22px;
    padding: 0 6px;
    border-radius: 11px;
    background: #e0e0e0;
    font-size: 0.8em;
    font-weight: 600;
    color: #555;
}

.pw-tab-active .pw-tab-count {
    background: #2271b1;
    color: #fff;
}

/* Tab panels */
.pw-tab-panel {
    display: none;
}

.pw-tab-panel-active {
    display: block;
}

/* Order cards */
.pw-order-card {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    margin-bottom: 0.75rem;
    background: #fff;
    transition: box-shadow 0.15s;
}

.pw-order-card:hover {
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

/* Awaiting-dispatch accent (merged, ShipStation not yet confirmed).
   Mirrors pw-badge-awaiting convention from the production board. */
.pw-order-card--awaiting {
    border-left: 3px solid #e0a800;
}

.pw-order-card--cancelled {
    border-left: 3px solid #9e9e9e;
    opacity: 0.85;
}

.pw-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding: 1rem 1.2rem;
    cursor: pointer;
    user-select: none;
}

.pw-card-summary {
    flex: 1;
    min-width: 0;
}

.pw-card-top-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.pw-card-order-number {
    font-weight: 600;
    font-size: 1.05em;
}

.pw-card-order-date {
    color: #888;
    font-size: 0.9em;
}

.pw-card-order-total {
    font-weight: 500;
    font-size: 0.95em;
}
.pw-card-order-total .pw-price-struck {
    text-decoration: line-through;
    color: #999;
    margin-right: 4px;
}

.pw-card-top-row .pw-status-badge {
    margin-left: auto;
}

.pw-card-bottom-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 0.4rem;
    flex-wrap: wrap;
}

.pw-card-tracking {
    font-size: 0.88em;
    color: #555;
}

.pw-card-dispatch-date {
    font-size: 0.85em;
    color: #666;
    margin-left: auto;
}

.pw-status-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.78em;
    font-weight: 500;
    color: #fff;
    white-space: nowrap;
}

.pw-card-expand-icon {
    flex-shrink: 0;
    color: #999;
    padding: 0.2rem;
    transition: transform 0.2s;
}

.pw-card-expanded .pw-card-expand-icon {
    transform: rotate(180deg);
}

/* Expanded detail */
.pw-card-detail {
    border-top: 1px solid #f0f0f0;
    padding: 1rem 1.2rem;
}

.pw-detail-section {
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #f0f0f0;
}

.pw-line-items-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.92em;
    border: 1px solid #e8e8e8;
    border-radius: 6px;
    overflow: hidden;
}

.pw-line-items-table td {
    padding: 0.45rem 0.75rem;
}

.pw-li-name {
    color: #333;
}

.pw-li-qty {
    color: #888;
    font-size: 0.9em;
}

.pw-li-price {
    text-align: right;
    white-space: nowrap;
    color: #333;
}

.pw-li-shipping td {
    padding-top: 0.5rem;
    border-top: 1px solid #f5f5f5;
    color: #666;
    font-size: 0.9em;
}

.pw-li-total td {
    padding-top: 0.5rem;
    border-top: 1px solid #e0e0e0;
}

.pw-payment-method {
    margin-top: 0.5rem;
    font-size: 0.85em;
    color: #888;
}

.pw-customer-note {
    margin-top: 0.8rem;
    padding-top: 0.8rem;
    border-top: 1px solid #f0f0f0;
    font-size: 0.9em;
    color: #555;
}

.pw-item-detail {
    padding: 0.8rem 0;
    border-bottom: 1px solid #f5f5f5;
}

.pw-item-detail:last-child {
    border-bottom: none;
}

.pw-item-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    flex-wrap: wrap;
}

.pw-item-name-wrap {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.pw-prod-ref {
    font-size: 0.82em;
    color: #999;
    font-weight: 400;
}

.pw-item-epo {
    margin: 0.5rem 0;
    padding: 0.5rem 0.75rem;
    background: #f9f9f9;
    border-radius: 4px;
}

.pw-epo-row {
    font-size: 0.9em;
    line-height: 1.6;
    color: #555;
}

.pw-epo-label {
    font-weight: 600;
    color: #333;
}

.pw-item-files {
    margin: 0.5rem 0;
    font-size: 0.9em;
}

.pw-files-label {
    font-weight: 500;
    margin-right: 0.3rem;
}

.pw-file-link {
    display: inline-block;
    margin-right: 0.5rem;
    color: #2271b1;
    text-decoration: none;
    word-break: break-all;
}

.pw-file-link:hover {
    text-decoration: underline;
}

/* ── 3D / Image File Preview — Thumbnail Grid ──── */
.pw-p-file-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 8px;
    margin: 0.6rem 0;
}
.pw-p-thumb {
    border-radius: 6px;
    overflow: hidden;
    border: 1.5px solid #ddd;
    cursor: pointer;
    transition: border-color 0.15s, box-shadow 0.15s;
    background: #fff;
}
.pw-p-thumb:hover {
    border-color: #29235C;
    box-shadow: 0 1px 4px rgba(41,35,92,0.15);
}
.pw-p-thumb-canvas {
    width: 100%;
    height: 85px;
    background: #F5F3EF;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}
.pw-p-thumb-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.pw-p-thumb-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}
.pw-p-ext-badge {
    padding: 3px 10px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.5px;
}
.pw-p-ext-3d {
    background: rgba(30,140,90,0.12);
    color: #1a7a4a;
}
.pw-p-ext-img {
    background: rgba(34,113,177,0.12);
    color: #185fa5;
}
.pw-p-thumb-label {
    display: flex;
    align-items: center;
    padding: 4px 6px;
    gap: 4px;
    border-top: 1px solid #eee;
    background: #fafafa;
}
.pw-p-thumb-name {
    flex: 1;
    min-width: 0;
    font-size: 11px;
    color: #444;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.pw-p-thumb-dl {
    flex-shrink: 0;
    font-size: 12px;
    text-decoration: none;
    opacity: 0.35;
    transition: opacity 0.15s;
    line-height: 1;
}
.pw-p-thumb-dl:hover {
    opacity: 1;
}

/* ── Large Viewer ────────────────────────────────── */
/* ── 3D Preview Modal ─────────────────────────────── */
.pw-3d-modal-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: 999999;
    background: rgba(0, 0, 0, 0.6);
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.pw-3d-modal-overlay.pw-3d-modal-visible {
    display: flex;
}
.pw-3d-modal {
    background: #fff;
    border-radius: 8px;
    width: 100%;
    max-width: 700px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}
.pw-3d-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid #eee;
    gap: 12px;
    min-height: 48px;
}
.pw-3d-modal-fname {
    font-weight: 600;
    font-size: 0.9rem;
    color: #29235C;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
}
.pw-3d-modal-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}
.pw-3d-modal-dl {
    font-size: 0.85rem;
    color: #29235C !important;
    text-decoration: none !important;
    font-weight: 600;
    white-space: nowrap;
}
.pw-3d-modal-dl:hover {
    text-decoration: underline !important;
}
.pw-3d-modal-close {
    background: none;
    border: none;
    font-size: 1.3rem;
    cursor: pointer;
    color: #666;
    padding: 0;
    line-height: 1;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
}
.pw-3d-modal-close:hover {
    background: #f0f0f0;
    color: #222;
}
.pw-3d-modal-body {
    width: 100%;
    height: 450px;
    background: #F5F3EF;
    position: relative;
    overflow: hidden;
}
.pw-3d-modal-body canvas {
    display: block;
    width: 100% !important;
    height: 100% !important;
}
.pw-p-viewer-img {
    max-width: 100%;
    max-height: 100%;
    display: block;
    margin: 0 auto;
    object-fit: contain;
}
.pw-p-viewer-msg {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #888;
    font-size: 13px;
}

@media (max-width: 600px) {
    .pw-3d-modal {
        max-width: 100%;
    }
    .pw-3d-modal-body {
        height: 300px;
    }
}
.pw-p-progress {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    gap: 8px;
    padding: 20px;
}
.pw-p-progress-label {
    font-size: 12px;
    color: #888;
}
.pw-p-progress-track {
    width: 60%;
    max-width: 200px;
    height: 5px;
    background: #e0e0e0;
    border-radius: 3px;
    overflow: hidden;
}
.pw-p-progress-bar {
    width: 0;
    height: 100%;
    background: #2ea043;
    border-radius: 3px;
    transition: width 0.2s;
}

.pw-item-dispatch {
    font-size: 0.85em;
    color: #666;
    margin-top: 0.3rem;
}

.pw-item-remake {
    display: inline-block;
    margin-top: 0.3rem;
    padding: 2px 8px;
    background: #fff3cd;
    color: #856404;
    border-radius: 4px;
    font-size: 0.8em;
    font-weight: 500;
}

.pw-tracking-info {
    margin-top: 0.8rem;
    padding-top: 0.8rem;
    border-top: 1px solid #f0f0f0;
    font-size: 0.95em;
}

.pw-tracking-link {
    color: #2271b1;
    text-decoration: none;
    font-weight: 500;
}

.pw-tracking-link:hover {
    text-decoration: underline;
}

.pw-tracking-courier {
    color: #888;
    font-size: 0.9em;
}

/* 1.2.4: Copy tracking number button ─────────────────────────── */
.pw-tracking-copy {
    background: transparent;
    border: 1px solid #ddd;
    border-radius: 3px;
    padding: 2px 5px;
    margin-left: 4px;
    cursor: pointer;
    vertical-align: middle;
    line-height: 1;
    transition: background 0.15s, border-color 0.15s;
}
.pw-tracking-copy:hover {
    background: #f0f6fc;
    border-color: #2271b1;
}
.pw-tracking-copy:active {
    background: #e0eaf3;
}
.pw-tracking-copy-icon {
    font-size: 12px;
    line-height: 1;
    display: inline-block;
}
.pw-tracking-copy--copied {
    background: #d4edda;
    border-color: #28a745;
}
.pw-tracking-copy--copied .pw-tracking-copy-icon {
    color: #28a745;
}

/* Docket download */
.pw-docket-download {
    margin-top: 1rem;
    padding-top: 0.8rem;
    border-top: 1px solid #f0f0f0;
}

.pw-docket-btn {
    display: inline-flex;
    align-items: center;
    padding: 0.5rem 1rem;
    background: #2271b1;
    color: #fff;
    border-radius: 5px;
    text-decoration: none;
    font-size: 0.9em;
    font-weight: 500;
    transition: background 0.15s;
}

.pw-docket-btn:hover {
    background: #135e96;
    color: #fff;
}

/* Empty state */
.pw-empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: #999;
}

/* Loading overlay */
.pw-loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    border-radius: 8px;
}

.pw-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid #e0e0e0;
    border-top-color: #2271b1;
    border-radius: 50%;
    animation: pw-spin 0.6s linear infinite;
}

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

/* Responsive */
@media (max-width: 768px) {
    .pw-orders-toolbar {
        flex-direction: column;
    }

    .pw-card-header {
        padding: 0.8rem 1rem;
    }

    .pw-card-top-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.3rem;
    }

    .pw-card-bottom-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.3rem;
    }
}

/* ── Checkout shipping selector ───────────────────────────────
 */
.pw-checkout-shipping {
    margin-bottom: 1.5rem;
}

.pw-ship-to-billing {
    margin: 0 0 0.5rem;
    color: #666;
}

.pw-show-new-address-form {
    font-size: 0.95em;
}

.pw-selected-address {
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 1rem;
    margin-bottom: 0.75rem;
}

.pw-selected-address strong {
    display: block;
    margin-bottom: 0.4rem;
}

.pw-selected-address address {
    font-style: normal;
    line-height: 1.5;
}

/* ── Address radio selector (2+ addresses) ──────────────────── */
.pw-address-selector {
    margin-bottom: 1rem;
}

.pw-address-option {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 1rem;
    margin-bottom: 0.5rem;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
}

.pw-address-option:hover {
    border-color: #bbb;
}

.pw-address-option.pw-selected {
    border-color: #2271b1;
    background: #f0f7fc;
}

.pw-address-option input[type="radio"] {
    margin-top: 0.25rem;
    flex-shrink: 0;
}

.pw-address-option-content strong {
    display: block;
    margin-bottom: 0.3rem;
}

.pw-address-option-content address {
    font-style: normal;
    line-height: 1.5;
    font-size: 0.9em;
}

/* ── New address form at checkout ────────────────────────────── */
.pw-new-address-form {
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 1.5rem;
    margin-top: 1rem;
    background: #fafafa;
}

.pw-new-address-form h4 {
    margin: 0 0 1rem;
}

.pw-new-address-form .pw-form-row {
    margin-bottom: 1rem;
}

.pw-new-address-form label {
    display: block;
    font-size: 0.9em;
    margin-bottom: 0.3rem;
    font-weight: 500;
}

.pw-new-address-form input,
.pw-new-address-form select {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 1em;
    box-sizing: border-box;
}

.pw-new-address-form .pw-form-row-half {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

@media (max-width: 480px) {
    .pw-new-address-form .pw-form-row-half {
        grid-template-columns: 1fr;
    }
}

/* ── Hide WC's default shipping fields ────────────────────── */
.pw-hidden-field {
    display: none !important;
}

/* ── Billing readonly at checkout ─────────────────────────── */
.pw-billing-readonly input,
.pw-billing-readonly select,
.pw-billing-readonly textarea {
    pointer-events: none !important;
    opacity: 0.7 !important;
    background: #f5f5f5 !important;
}

.pw-billing-readonly select {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

/* ── Pricelist page ───────────────────────────────────────── */
.pw-pricelist-page {
    max-width: 900px;
}

.pw-pricelist-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    gap: 1rem;
    flex-wrap: wrap;
}

.pw-pricelist-header h2 {
    margin: 0;
    font-size: 1.5rem;
    color: #29235C;
}

.pw-pricelist-download-btn {
    display: inline-block;
    padding: 0.6rem 1.4rem;
    background: #29235C;
    color: #fff !important;
    border-radius: 4px;
    text-decoration: none !important;
    font-size: 0.9rem;
    font-weight: 600;
    transition: background 0.2s;
}

.pw-pricelist-download-btn:hover {
    background: #3d3580;
}

.pw-pricelist-table-wrap {
    overflow-x: auto;
}

.pw-pricelist-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.pw-pricelist-table thead th {
    background: #f5f5f5;
    border-bottom: 2px solid #29235C;
    padding: 0.6rem 0.8rem;
    text-align: left;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    color: #555;
}

.pw-pricelist-table th.pw-pl-price,
.pw-pricelist-table td.pw-pl-price {
    text-align: right;
    width: 120px;
    white-space: nowrap;
}

.pw-pl-category-row td {
    background: #29235C;
    color: #fff;
    font-weight: 700;
    font-size: 0.95rem;
    padding: 0.55rem 0.8rem;
}

.pw-pl-product-row td {
    background: #f5f3fa;
    padding: 0.55rem 0.8rem;
    border-bottom: 1px solid #ccc;
    color: #29235C;
}

.pw-pl-option-row td {
    padding: 0.45rem 0.8rem;
    border-bottom: 1px solid #eee;
    color: #444;
    font-size: 0.85rem;
}

.pw-pl-indent {
    padding-left: 1.8rem !important;
}

.pw-pl-your-price {
    font-weight: 700;
    color: #29235C;
}

.pw-pl-dash {
    color: #ccc;
}

@media (max-width: 600px) {
    .pw-pricelist-table th.pw-pl-price,
    .pw-pricelist-table td.pw-pl-price {
        width: 80px;
        font-size: 0.8rem;
    }
    .pw-pricelist-header {
        flex-direction: column;
        align-items: flex-start;
    }
}
