/*
 * ATLAS Price & Bulk — storefront presentation.
 *
 * SCOPE RULE: every selector in this file is prefixed with `.atlas-pbp-` and every rule
 * lives under that prefix. Nothing here targets a bare `button`, `table`, `input`, `form`
 * or any other theme-wide element, and no declaration is ever forced with an override flag.
 * WoodMart, its child theme and its templates are never edited: this file only styles markup
 * the plugin itself rendered, so removing the plugin removes every trace of it.
 *
 * Loaded on single product pages only, and only while the plugin is enabled.
 */

/* ------------------------------------------------------------------- tokens */

.atlas-pbp-policy,
.atlas-pbp-selection {
    --atlas-navy: #12294b;
    --atlas-blue: #1b5fa8;
    --atlas-blue-soft: #eef4fb;
    --atlas-border: #d5dfea;
    --atlas-text: #1f2933;
    --atlas-muted: #5b6b7c;
    --atlas-surface: #ffffff;
    --atlas-success: #1c7a45;
}

/* ------------------------------------------------------------------- table */

.atlas-pbp-policy {
    margin: 18px 0 8px;
    color: var(--atlas-text);
}

.atlas-pbp-price-table {
    width: 100%;
    max-width: 560px;
    margin: 10px 0 0;
    border: 1px solid var(--atlas-border);
    border-collapse: collapse;
    background: var(--atlas-surface);
    font-size: 0.95em;
}

.atlas-pbp-price-table caption {
    padding: 0 0 8px;
    text-align: left;
    font-weight: 600;
    color: var(--atlas-navy);
}

.atlas-pbp-price-table thead th {
    padding: 10px 12px;
    text-align: left;
    font-weight: 600;
    white-space: nowrap;
    color: #ffffff;
    background: var(--atlas-navy);
    border-bottom: 1px solid var(--atlas-navy);
}

.atlas-pbp-price-table tbody th,
.atlas-pbp-price-table tbody td {
    padding: 9px 12px;
    border-top: 1px solid var(--atlas-border);
    vertical-align: middle;
}

.atlas-pbp-price-table tbody th {
    font-weight: 500;
    white-space: nowrap;
}

/* The current band is marked with a soft background AND a left border, so the state does
   not depend on colour alone and survives a monochrome display or a colour-blind reader. */
.atlas-pbp-price-table tbody tr.is-current {
    background: var(--atlas-blue-soft);
    box-shadow: inset 3px 0 0 var(--atlas-blue);
}

.atlas-pbp-price-table tbody tr.is-current th {
    font-weight: 700;
}

.atlas-pbp-price-table .atlas-pbp-best {
    display: inline-block;
    margin-left: 6px;
    padding: 1px 7px;
    border-radius: 10px;
    font-size: 0.78em;
    font-weight: 600;
    color: var(--atlas-success);
    background: #e8f5ee;
}

/* ------------------------------------------------------------------- notes */

.atlas-pbp-moq {
    margin: 0 0 4px;
}

.atlas-pbp-from {
    margin: 0 0 4px;
    color: var(--atlas-muted);
}

/* A broken configuration is a genuine fault, so it keeps the theme's own notice styling
   and only gains a readable margin. */
.atlas-pbp-info {
    margin: 12px 0;
}

/* --------------------------------------------------------------- selection */

.atlas-pbp-selection {
    margin: 18px 0;
    padding: 16px;
    border: 1px solid var(--atlas-border);
    border-radius: 6px;
    background: var(--atlas-surface);
    color: var(--atlas-text);
}

.atlas-pbp-selection-help {
    margin: 0 0 12px;
    color: var(--atlas-muted);
}

.atlas-pbp-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 0 0 8px;
}

/* Both actions are real buttons with generous hit areas. The hierarchy is carried by
   weight and colour: the first action is a solid secondary, the final action is the
   primary CTA. Neither is left looking like a text link. */
.atlas-pbp-selection .atlas-pbp-pick,
.atlas-pbp-selection .atlas-pbp-send {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 44px;
    padding: 11px 20px;
    border: 1px solid transparent;
    border-radius: 4px;
    font-size: 1em;
    font-weight: 600;
    line-height: 1.2;
    text-decoration: none;
    cursor: pointer;
    transition: background-color 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.atlas-pbp-selection .atlas-pbp-pick {
    color: #ffffff;
    background: var(--atlas-blue);
    border-color: var(--atlas-blue);
}

.atlas-pbp-selection .atlas-pbp-pick:hover,
.atlas-pbp-selection .atlas-pbp-pick:focus-visible {
    background: #164e8c;
    border-color: #164e8c;
}

/* The final action is heavier than the first, so the eye reads them in the right order. */
.atlas-pbp-selection .atlas-pbp-send {
    color: #ffffff;
    background: var(--atlas-navy);
    border-color: var(--atlas-navy);
    box-shadow: 0 1px 2px rgba(18, 41, 75, 0.25);
}

.atlas-pbp-selection .atlas-pbp-send:hover:not(:disabled),
.atlas-pbp-selection .atlas-pbp-send:focus-visible:not(:disabled) {
    background: #0c1f3a;
    border-color: #0c1f3a;
}

/* A disabled action must stay legible and explain itself, so it keeps its label contrast
   and only loses the solid fill. It must never read as a broken feature. */
.atlas-pbp-selection .atlas-pbp-send:disabled {
    color: var(--atlas-muted);
    background: #f2f5f8;
    border-color: var(--atlas-border);
    box-shadow: none;
    cursor: not-allowed;
    opacity: 1;
}

.atlas-pbp-selection .atlas-pbp-pick:focus-visible,
.atlas-pbp-selection .atlas-pbp-send:focus-visible {
    outline: 2px solid var(--atlas-navy);
    outline-offset: 2px;
}

.atlas-pbp-cta-mark {
    font-weight: 700;
}

.atlas-pbp-send-help {
    margin: 0 0 12px;
    font-size: 0.9em;
    color: var(--atlas-muted);
}

.atlas-pbp-rows {
    margin: 10px 0;
    padding: 0;
    list-style: none;
}

.atlas-pbp-rows li {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    border-top: 1px solid var(--atlas-border);
}

.atlas-pbp-rows .atlas-pbp-remove {
    margin-left: auto;
}

/* ---------------------------------------------------------------- progress */

.atlas-pbp-progress {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 12px;
    margin: 8px 0 0;
    font-size: 0.92em;
    color: var(--atlas-muted);
}

.atlas-pbp-progress.is-met {
    color: var(--atlas-success);
    font-weight: 600;
}

.atlas-pbp-status {
    margin: 8px 0 0;
    font-size: 0.92em;
    color: var(--atlas-muted);
}

/* --------------------------------------------------------------- responsive */

@media screen and (max-width: 640px) {
    .atlas-pbp-price-table {
        font-size: 0.9em;
    }

    .atlas-pbp-price-table thead th,
    .atlas-pbp-price-table tbody th,
    .atlas-pbp-price-table tbody td {
        padding: 8px 9px;
    }

    /* Three compact columns rather than a horizontally scrolling table. */
    .atlas-pbp-price-table .atlas-pbp-best {
        display: block;
        margin: 4px 0 0;
    }

    .atlas-pbp-selection .atlas-pbp-pick,
    .atlas-pbp-selection .atlas-pbp-send {
        flex: 1 1 100%;
        justify-content: center;
    }
}
