/**
 * Sanitary Welding CPQ — Frontend Configurator Styles (v3.1.1)
 *
 * Design tokens extracted directly from Manus prototype (sanitaryweldingcpq.manus.space):
 *
 *   --background:          oklch(99% .005 240)  → #fafbfc  (near-white, cool tint)
 *   --foreground:          oklch(20% .01 240)   → #1a1c20  (near-black)
 *   --card:                oklch(100% 0 0)      → #ffffff
 *   --primary:             oklch(35% .08 240)   → #2d4a6e  (dark navy)
 *   --primary-foreground:  oklch(98% .01 240)   → #f8f9fb
 *   --accent:              oklch(65% .15 50)    → #c97a1a  (amber-orange, used for Total Price)
 *   --muted:               oklch(96% .005 240)  → #f4f4f6
 *   --muted-foreground:    oklch(50% .01 240)   → #6b7280
 *   --border / --input:    oklch(88% .005 240)  → #dddde3
 *   --radius:              0.5rem = 8px
 *   Font:                  Inter (all elements — no IBM Plex Sans in prototype)
 *   Dropdown height:       36px, font-size 14px, padding 8px 12px
 */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

/* ── Root ──────────────────────────────────────────────────────────────────── */
#sw-cpq-root {
    font-family: Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 14px;
    line-height: 1.6;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 16px;
    color: #1a1c20;
    background: transparent;
}

/* ── Loading state ─────────────────────────────────────────────────────────── */
.sw-cpq-loading {
    text-align: center;
    padding: 48px;
    color: #6b7280;
    font-size: 14px;
    font-style: italic;
}

/* ── Grid layout ───────────────────────────────────────────────────────────── */
.sw-cpq-grid {
    display: grid;
    grid-template-columns: 1fr 360px;
    gap: 24px;
    align-items: start;
}
@media (max-width: 900px) {
    .sw-cpq-grid { grid-template-columns: 1fr; }
}

/* ── Panel cards ───────────────────────────────────────────────────────────── */
.sw-cpq-panel {
    background: #ffffff;
    border: 1px solid #dddde3;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(26,28,32,.06), 0 1px 6px rgba(26,28,32,.04);
}

/* Section heading — matches prototype: Inter 600, 16px, title-case, dark foreground */
.sw-cpq-panel h2 {
    font-family: Inter, sans-serif;
    font-size: 16px;
    font-weight: 600;
    color: #1a1c20;
    margin: 0 0 4px;
    padding: 0;
    border: none;
    letter-spacing: normal;
    text-transform: none;
}

/* Section subtitle — matches prototype: 14px, muted grey */
.sw-cpq-panel .sw-cpq-section-subtitle {
    font-size: 14px;
    color: #6b7280;
    margin: 0 0 16px;
}

/* ── Form fields ───────────────────────────────────────────────────────────── */
.sw-cpq-field {
    margin-bottom: 14px;
}
.sw-cpq-field label {
    display: block;
    font-weight: 500;
    font-size: 14px;
    color: #1a1c20;
    margin-bottom: 4px;
}

/* Native selects (fallback for non-Radix rendering) */
.sw-cpq-field select,
.sw-cpq-field input[type="text"],
.sw-cpq-field input[type="number"],
.sw-cpq-field input[type="email"],
.sw-cpq-field input[type="tel"] {
    width: 100%;
    height: 36px;
    padding: 8px 12px;
    border: 1px solid #dddde3;
    border-radius: 6px;
    font-size: 14px;
    font-family: Inter, sans-serif;
    background: #ffffff;
    color: #1a1c20;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
    box-sizing: border-box;
    -webkit-appearance: none;
    appearance: none;
}
.sw-cpq-field select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%236b7280' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    padding-right: 32px;
}
.sw-cpq-field select:focus,
.sw-cpq-field input:focus {
    outline: none;
    border-color: #2d4a6e;
    box-shadow: 0 0 0 3px rgba(45,74,110,.12);
}

/* Placeholder text color */
.sw-cpq-field input::placeholder {
    color: #6b7280;
}

/* ── Disabled / unavailable dropdown options ───────────────────────────────── */
.sw-cpq-disabled-option {
    color: #9ca3af;
    text-decoration: line-through;
}

/* ── 2-column field grid (Material | OD, Finish | Wall) ────────────────────── */
.sw-cpq-field-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
@media (max-width: 600px) {
    .sw-cpq-field-grid { grid-template-columns: 1fr; }
}

/* ── Add to Cart / primary action button ───────────────────────────────────── */
/* Matches site primary brand color #0F4C81 used across account/portal buttons */
/* ID selector + !important on key visual props to prevent WooCommerce/theme override */
.sw-cpq-add-to-cart-btn,
#sw-cpq-add-btn {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
    width: 100% !important;
    height: 40px !important;
    padding: 0 16px !important;
    background: #0F4C81 !important;
    background-color: #0F4C81 !important;
    color: #ffffff !important;
    border: none !important;
    border-radius: 7px !important;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif !important;
    font-size: 1rem !important;
    font-weight: 700 !important;
    cursor: pointer !important;
    transition: background 0.15s ease, transform 0.1s ease;
    text-decoration: none !important;
    box-shadow: none !important;
    outline: none !important;
    line-height: 1 !important;
    letter-spacing: normal !important;
    text-transform: none !important;
}
.sw-cpq-add-to-cart-btn:hover,
#sw-cpq-add-btn:hover {
    background: #0a3a63 !important;
    background-color: #0a3a63 !important;
    color: #ffffff !important;
}
.sw-cpq-add-to-cart-btn:active,
#sw-cpq-add-btn:active {
    transform: scale(0.98);
}
.sw-cpq-add-to-cart-btn:disabled,
#sw-cpq-add-btn:disabled {
    background: #9ca3af !important;
    background-color: #9ca3af !important;
    color: #ffffff !important;
    cursor: not-allowed !important;
    transform: none;
}

/* ── Save Quote / outline button ───────────────────────────────────────────── */
/* Matches prototype: transparent bg, 1px solid #dddde3, dark text */
.sw-cpq-pdf-btn,
#sw-cpq-pdf-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    height: 40px;
    padding: 0 16px;
    background: transparent;
    color: #1a1c20;
    border: 1px solid #dddde3;
    border-radius: 6px;
    font-family: Inter, sans-serif;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease;
    margin-top: 8px;
}
.sw-cpq-pdf-btn:hover,
#sw-cpq-pdf-btn:hover {
    background: #f4f4f6;
    border-color: #c0c0c8;
}
.sw-cpq-pdf-btn:disabled,
#sw-cpq-pdf-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ── Save Quote button ─────────────────────────────────────────────────────── */
/* Styled as a secondary outline button, same height as pdf-btn */
.sw-cpq-save-quote-btn,
#sw-cpq-save-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    height: 40px;
    padding: 0 16px;
    background: transparent;
    color: #2d4a6e;
    border: 1px solid #2d4a6e;
    border-radius: 6px;
    font-family: Inter, sans-serif;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
    margin-top: 8px;
}
.sw-cpq-save-quote-btn:hover,
#sw-cpq-save-btn:hover {
    background: #2d4a6e;
    color: #f8f9fb;
}
.sw-cpq-save-quote-btn:disabled,
#sw-cpq-save-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ── Pricing Summary panel ──────────────────────────────────────────────────── */
/* Matches prototype: white card, same border/radius as other panels */
.sw-cpq-pricing-panel {
    background: #ffffff;
    border: 1px solid #dddde3;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(26,28,32,.06), 0 1px 6px rgba(26,28,32,.04);
}

/* ── Pricing summary rows ───────────────────────────────────────────────────── */
/* Matches prototype: flex row, 14px, muted separator */
.sw-cpq-pricing-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
    border-bottom: 1px solid #f0f0f3;
    font-size: 14px;
    color: #1a1c20;
}
.sw-cpq-pricing-row:last-child {
    border-bottom: none;
}

/* Total Price row — matches prototype: "Total Price" label normal weight, value in accent orange, 24px bold mono */
.sw-cpq-pricing-row.total {
    font-size: 14px;
    font-weight: 600;
    color: #1a1c20;
    border-top: 1px solid #dddde3;
    border-bottom: none;
    margin-top: 8px;
    padding-top: 12px;
}
.sw-cpq-pricing-row.total .sw-cpq-total-value {
    font-size: 24px;
    font-weight: 700;
    font-family: 'Courier New', monospace;
    color: #c97a1a;   /* oklch(65% .15 50) — the amber accent */
    letter-spacing: -0.02em;
}

/* ── "Awaiting Configuration" status badge ──────────────────────────────────── */
/* Matches prototype: amber-orange text with circle-alert icon */
.sw-cpq-awaiting {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    font-weight: 500;
    color: #c97a1a;
    margin-bottom: 12px;
}

/* ── RFQ / manual quote notice ──────────────────────────────────────────────── */
.sw-cpq-rfq-notice {
    background: #fffbeb;
    border: 1px solid #f59e0b;
    border-left: 4px solid #c97a1a;
    border-radius: 6px;
    padding: 10px 14px;
    font-size: 13px;
    color: #78350f;
    margin-top: 12px;
    line-height: 1.5;
}

/* ── End Connection Images ──────────────────────────────────────────────────── */
.sw-cpq-conn-image-wrap {
    margin-top: 10px;
    text-align: center;
    background: #f4f4f6;
    border: 1px solid #dddde3;
    border-radius: 6px;
    padding: 10px;
}
.sw-cpq-conn-image {
    max-width: 100%;
    max-height: 140px;
    object-fit: contain;
    display: block;
    margin: 0 auto;
}

/* ── Spool length validation hints ─────────────────────────────────────────── */
.sw-cpq-field-hint {
    font-size: 12px;
    color: #6b7280;
    margin: 4px 0 0;
    line-height: 1.4;
}
.sw-cpq-field-error {
    font-size: 13px;
    color: #dc2626;
    margin: 4px 0 0;
    font-weight: 500;
}

/* ── Sticky pricing sidebar on desktop ─────────────────────────────────────── */
.sw-cpq-right {
    position: sticky;
    top: 24px;
}

/* ── Checkbox / toggle fields ───────────────────────────────────────────────── */
.sw-cpq-field input[type="checkbox"] {
    width: 16px;
    height: 16px;
    margin-right: 8px;
    accent-color: #2d4a6e;
    cursor: pointer;
    vertical-align: middle;
}

/* ── Estimated Lead Time section ────────────────────────────────────────────── */
.sw-cpq-lead-time {
    background: #f4f4f6;
    border-radius: 6px;
    padding: 10px 14px;
    font-size: 14px;
    color: #1a1c20;
    margin-top: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.sw-cpq-lead-time-value {
    font-size: 20px;
    font-weight: 700;
    color: #1a1c20;
}

/* ── Engraving text input ───────────────────────────────────────────────────── */
.sw-cpq-engraving-text {
    margin-top: 8px;
}

/* ── Separator line ─────────────────────────────────────────────────────────── */
.sw-cpq-separator {
    border: none;
    border-top: 1px solid #dddde3;
    margin: 16px 0;
}

/* ── 2-column field row (prototype layout) ──────────────────────────────────── */
.sw-cpq-field-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
@media (max-width: 600px) {
    .sw-cpq-field-row { grid-template-columns: 1fr; }
}

/* Required asterisk */
.sw-cpq-required {
    color: #dc2626;
    margin-left: 2px;
}

/* Addon row hover highlight */
.sw-cpq-addon-row:hover {
    background: #f4f4f6;
    border-radius: 6px;
    margin-left: -8px;
    padding-left: 8px;
}

/* Lead time value — smaller to fit in the panel */
.sw-cpq-lead-time .sw-cpq-lead-time-value {
    font-size: 14px;
    font-weight: 700;
    color: #2d4a6e;
}
