/*
 * Wholesale Plus – Frontend Styles
 * Clean, minimal styles for customer-facing features.
 */

:root {
    --wsp-primary: #0073e6;
    --wsp-accent: #00b4d8;
    --wsp-success: #10b981;
    --wsp-radius: 8px;
    --wsp-transition: 150ms ease;
}

/* ===== Price Labels ===== */
.wsp-price-wrap {
    line-height: 1.6;
}

.wsp-price-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.wsp-price-label--wholesale {
    color: var(--wsp-success);
}

.wsp-price-label--retail {
    color: #94a3b8;
}

.wsp-hidden-price {
    font-style: italic;
    color: #64748b;
}

.wsp-tax-suffix {
    color: #94a3b8;
    font-size: 11px;
}

/* ===== Tiered Pricing Table ===== */
.wsp-tiered-pricing {
    margin: 20px 0;
    padding: 16px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: var(--wsp-radius);
}

/* Task 3: Strikethrough regular price styling - 50% smaller font size. */
.wsp-tiered-price-display .price .wsp-tiered-strikethrough-price,
.wsp-tiered-price-display .price span[style*="text-decoration: line-through"][style*="color: #9ca3af"] {
    font-size: 50% !important;
    display: inline-block;
}

/* Section 7: Force strikethrough price font-size to 12px in product table. */
.wsp-tiered-price-table-frontend .wsp-tiered-strikethrough-price,
.wsp-tiered-table-frontend .wsp-tiered-strikethrough-price {
    font-size: 12px !important;
}

/* Section 6: Cart/checkout price display - strikethrough at 14px, badge visible. */
.wsp-cart-tiered-price .wsp-tiered-strikethrough-price,
.wsp-cart-checkout-strikethrough,
.woocommerce-cart-form .wsp-tiered-strikethrough-price,
.woocommerce-checkout .wsp-tiered-strikethrough-price {
    font-size: 14px !important;
}

.wsp-cart-tiered-price .wsp-tiered-strikethrough-price {
    display: inline-block;
}

.wsp-tiered-pricing h4 {
    margin: 0 0 12px;
    font-size: 14px;
    font-weight: 600;
}

.wsp-tiered-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.wsp-tiered-table th {
    text-align: left;
    padding: 8px 12px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #64748b;
    border-bottom: 1px solid #e2e8f0;
}

.wsp-tiered-table td {
    padding: 8px 12px;
    border-bottom: 1px solid #f1f5f9;
}

.wsp-tiered-table tr:last-child td {
    border-bottom: none;
}

/* ===== Bulk Order Form ===== */
.wsp-bulk-order {
    max-width: 900px;
}

.wsp-bulk-order__search {
    position: relative;
    margin-bottom: 20px;
}

.wsp-bulk-order__results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: var(--wsp-radius);
    box-shadow: 0 4px 12px rgba(0,0,0,.1);
    max-height: 300px;
    overflow-y: auto;
    z-index: 100;
}

.wsp-bulk-result {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    cursor: pointer;
    transition: background var(--wsp-transition);
}

.wsp-bulk-result:hover {
    background: #f0f7ff;
}

.wsp-bulk-result img {
    width: 36px;
    height: 36px;
    object-fit: cover;
    border-radius: 4px;
}

.wsp-bulk-result__info {
    flex: 1;
}

.wsp-bulk-result__name {
    font-weight: 500;
    font-size: 13px;
}

.wsp-bulk-result__sku {
    font-size: 11px;
    color: #94a3b8;
}

.wsp-bulk-result__price {
    font-weight: 600;
    font-size: 13px;
    color: var(--wsp-primary);
}

.wsp-bulk-order__table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
}

.wsp-bulk-order__table th {
    text-align: left;
    padding: 10px 12px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #64748b;
    border-bottom: 2px solid #e2e8f0;
}

.wsp-bulk-order__table td {
    padding: 10px 12px;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: middle;
}

.wsp-bulk-order__table input[type="number"] {
    width: 70px;
    padding: 6px 8px;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    text-align: center;
}

.wsp-bulk-order__actions {
    text-align: right;
}

/* ===== Frontend Buttons ===== */
.wsp-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    border: none;
    border-radius: var(--wsp-radius);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--wsp-transition);
    text-decoration: none;
}

.wsp-btn--primary {
    background: var(--wsp-primary);
    color: #fff;
}
.wsp-btn--primary:hover {
    background: #005bb5;
    color: #fff;
}

.wsp-btn--accent {
    background: var(--wsp-accent);
    color: #fff;
}
.wsp-btn--accent:hover {
    background: #0096b7;
    color: #fff;
}

.wsp-btn--ghost {
    background: transparent;
    color: #64748b;
    border: 1px solid #e2e8f0;
}
.wsp-btn--ghost:hover {
    background: #f8fafc;
    color: #1e293b;
}

.wsp-btn--sm {
    padding: 6px 14px;
    font-size: 12px;
}

/* ===== Frontend Forms ===== */
.wsp-input, .wsp-select {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #e2e8f0;
    border-radius: var(--wsp-radius);
    font-size: 14px;
    transition: border-color var(--wsp-transition);
}

.wsp-input:focus, .wsp-select:focus {
    outline: none;
    border-color: var(--wsp-primary);
    box-shadow: 0 0 0 3px rgba(0, 115, 230, 0.1);
}

.wsp-field {
    margin-bottom: 16px;
}

.wsp-field label {
    display: block;
    font-weight: 600;
    margin-bottom: 6px;
    font-size: 13px;
}

.wsp-form-row {
    display: flex;
    gap: 16px;
}

.wsp-field--half {
    flex: 1;
}

/* ===== My Account Sections ===== */
.wsp-myaccount-section {
    margin-bottom: 30px;
}

.wsp-myaccount-section h3 {
    margin: 0 0 16px;
}

.wsp-myaccount-actions {
    margin-bottom: 16px;
}

/* ===== Purchase Lists ===== */
.wsp-purchase-lists__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

/* ===== Frontend Modal ===== */
.wsp-modal--frontend {
    position: fixed;
    inset: 0;
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.wsp-modal--frontend .wsp-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,.4);
}

.wsp-modal--frontend .wsp-modal__content {
    position: relative;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0,0,0,.15);
    width: 90%;
    max-width: 480px;
    max-height: 90vh;
    overflow-y: auto;
}

.wsp-modal--frontend .wsp-modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px 0;
}

.wsp-modal--frontend .wsp-modal__header h3 {
    margin: 0;
    font-size: 18px;
}

.wsp-modal--frontend .wsp-modal__close {
    background: none;
    border: none;
    font-size: 22px;
    cursor: pointer;
    color: #94a3b8;
}

.wsp-modal--frontend .wsp-modal__body {
    padding: 20px 24px;
}

.wsp-modal--frontend .wsp-modal__footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 16px 24px 20px;
    border-top: 1px solid #f1f5f9;
}

/* ===== Notifications ===== */
.wsp-notice {
    padding: 12px 16px;
    border-radius: var(--wsp-radius);
    margin-bottom: 16px;
    font-size: 14px;
}

.wsp-notice--success {
    background: #dcfce7;
    color: #15803d;
    border: 1px solid #bbf7d0;
}

.wsp-notice--error {
    background: #fee2e2;
    color: #b91c1c;
    border: 1px solid #fecaca;
}

/* ===== Credit Balance ===== */
.wsp-credit-balance {
    background: #f0f7ff;
    padding: 12px;
    border-radius: var(--wsp-radius);
    border: 1px solid #dbeafe;
}

/* ===== Gateway Fields ===== */
.wsp-gateway-fields {
    border: none;
    padding: 0;
    margin: 0;
}

.wsp-gateway-fields .form-row {
    margin-bottom: 10px;
}

/* ===== Loading ===== */
.wsp-loading {
    color: #94a3b8;
    font-style: italic;
    text-align: center;
    padding: 20px;
}

/* ===== Registration Fields ===== */
.wsp-reg-field {
    transition: opacity var(--wsp-transition);
}

.wsp-reg-field--hidden {
    display: none;
}

/* ===== Responsive ===== */
@media (max-width: 600px) {
    .wsp-form-row {
        flex-direction: column;
    }

    .wsp-bulk-order__table {
        font-size: 12px;
    }
}
