/* ==========================================================================
   Polycor — Stone Sample Request Form (Phase A)
   Namespaced with .psf- to avoid collision with .pef- Expert Finder styles.
   ========================================================================== */

/* --------------------------------------------------------------------------
   Wrap + shared layout
   -------------------------------------------------------------------------- */

.psf-wrap {
    max-width: 1200px;
    margin: 0 auto;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, sans-serif;
    color: #1a1a1a;
}

/* --------------------------------------------------------------------------
   Step 1 — 70/30 two-column layout
   -------------------------------------------------------------------------- */

.psf-step-1-columns {
    display: grid;
    grid-template-columns: 1fr minmax(380px, 420px);
    gap: 32px;
    align-items: start;
}

/* Left: selector + tray + footer */
.psf-step-1-main {
    min-width: 0;
}

/* Right: sticky request panel */
.psf-step-1-sidebar {
    position: sticky;
    top: 24px;
}

/* The sidebar panel wraps the tray + continue button */
.psf-sidebar-panel {
    border: 2px solid #2c5282;
    border-radius: 10px;
    overflow: hidden;
}

.psf-sidebar-panel .psf-tray {
    border: none;
    border-radius: 0;
    margin-bottom: 0;
}

.psf-sidebar-panel-footer {
    padding: 16px 20px;
    background: #f7f8fa;
    border-top: 1px solid #e2e8f0;
}

.psf-sidebar-panel-footer .psf-btn {
    width: 100%;
    text-align: center;
}

.psf-sidebar-panel-footer .psf-continue-hint {
    margin-top: 10px;
    display: block;
}

/* When tray is hidden, sidebar shows an empty-state prompt */
.psf-sidebar-empty {
    padding: 28px 20px;
    text-align: center;
    color: #aaa;
    font-size: 16px;
    font-style: italic;
}

@media (max-width: 900px) {
    .psf-step-1-columns {
        grid-template-columns: 1fr;
    }

    .psf-step-1-sidebar {
        position: static;
        order: 2;  /* summary comes after selection on mobile */
    }

    .psf-step-1-main {
        order: 1;
    }
}

.psf-hidden {
    display: none !important;
}

.psf-step {
    animation: psfFadeIn 0.3s ease;
}

@keyframes psfFadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* --------------------------------------------------------------------------
   Step header
   -------------------------------------------------------------------------- */

.psf-step-header {
    margin-bottom: 32px;
}

.psf-step-header h2 {
    font-size: 36px;
    font-weight: 700;
    margin: 0 0 12px;
    color: var(--global-palette3, #1a1a1a);
    line-height: 1.15;
}

/* --------------------------------------------------------------------------
   Selector panel
   -------------------------------------------------------------------------- */

.psf-selector-panel {
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 32px;
}

.psf-selector-section {
    padding: 24px;
    border-bottom: 1px solid #e2e8f0;
}

.psf-selector-section:last-child {
    border-bottom: none;
}

.psf-section-label {
    font-size: 17px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #888;
    margin-bottom: 16px;
}

/* --------------------------------------------------------------------------
   Pill buttons (Material + Finish)
   -------------------------------------------------------------------------- */

.psf-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.psf-pill {
    display: inline-block;
    padding: 8px 18px;
    font-size: 18px;
    font-weight: 500;
    border: 2px solid #d0d7de;
    border-radius: 100px;
    background: #fff;
    color: #333;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s, color 0.15s;
    line-height: 1.4;
}

.psf-pill--active {
    border-color: #2c5282;
    background: #2c5282;
    color: #fff;
}

.psf-pill--active:hover {
    background: #2a4a7a;
    border-color: #2a4a7a;
    color: #fff;
}

/* --------------------------------------------------------------------------
   Stone card grid
   -------------------------------------------------------------------------- */

.psf-stone-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 14px;
}

.psf-stone-card {
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: border-color 0.15s, box-shadow 0.15s;
    background: #fff;
    outline: none;
    user-select: none;
}

.psf-stone-card:hover {
    border-color: #eeb411;
    box-shadow: 0 2px 8px rgba(44, 82, 130, 0.15);
}

.psf-stone-card:focus-visible {
    box-shadow: 0 0 0 3px rgba(44, 82, 130, 0.3);
    border-color: #2c5282;
}

.psf-stone-card--active {
    border-color: #eeb411;
}

.psf-stone-img-wrap {
    width: 100%;
    aspect-ratio: 1;
    overflow: hidden;
    background: #f0f2f5;
    display: flex;
    align-items: center;
    justify-content: center;
}

.psf-stone-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.psf-stone-img-placeholder {
    font-size: 28px;
    font-weight: 700;
    color: #aaa;
    background: #e8edf2;
}

.psf-stone-name {
    padding: 8px 10px;
    font-size: 16px;
    font-weight: 600;
    color: #333;
    line-height: 1.2;
    word-break: break-word;
}

/* --------------------------------------------------------------------------
   Quantity stepper (selector)
   -------------------------------------------------------------------------- */

.psf-qty-row {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.psf-qty-stepper {
    display: flex;
    align-items: center;
    border: 2px solid #d0d7de;
    border-radius: 6px;
    overflow: hidden;
}

.psf-qty-btn {
    width: 38px;
    height: 38px;
    border: none;
    background: #f7f8fa;
    font-size: 20px;
    font-weight: 400;
    line-height: 1;
    color: #333;
    cursor: pointer;
    transition: background 0.15s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.psf-qty-btn:hover {
    background: #e2e8f0;
}

.psf-qty-display {
    min-width: 40px;
    text-align: center;
    font-size: 16px;
    font-weight: 600;
    padding: 0 6px;
    color: #1a1a1a;
}

.psf-add-feedback {
    margin-top: 10px;
    font-size: 13px;
    font-style: italic;
}

.psf-feedback--success { color: #276749; }
.psf-feedback--error   { color: #c53030; }

.psf-empty-note {
    font-size: 13px;
    color: #999;
    margin: 0;
}

/* --------------------------------------------------------------------------
   Buttons
   -------------------------------------------------------------------------- */

.psf-btn {
    display: inline-block;
    padding: 12px 28px;
    font-size: 16px;
    font-weight: 600;
    border: none;
    border-radius: 0;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s, opacity 0.15s;
    text-decoration: none;
    line-height: 1.4;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.psf-btn:active {
    transform: scale(0.98);
}

.psf-btn-primary {
    background: #eeb411;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.psf-btn-primary:hover {
    background: #717073;
}

.psf-btn-primary:disabled {
    background: #c5c5c5;
    cursor: not-allowed;
    transform: none;
}

.psf-btn-secondary {
    background: #2c5282;
    color: #fff;
}

.psf-btn-secondary:hover {
    background: #2a4a7a;
}

.psf-btn-ghost {
    background: transparent;
    color: #2c5282;
    border: 2px solid #2c5282;
    padding: 10px 24px;
}

.psf-btn-ghost:hover {
    background: #2c5282;
    color: #fff;
}

/* --------------------------------------------------------------------------
   Step footer
   -------------------------------------------------------------------------- */

.psf-step-footer {
    margin-top: 8px;
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.psf-continue-hint {
    font-size: 13px;
    color: #888;
    margin: 0;
    font-style: italic;
}

/* --------------------------------------------------------------------------
   Request Tray / Cart
   -------------------------------------------------------------------------- */

.psf-tray {
    border: 2px solid #2c5282;
    border-radius: 10px;
    margin-bottom: 24px;
    overflow: hidden;
}

.psf-tray-header {
    background: #2c5282;
    color: #fff;
    padding: 12px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.psf-tray-title {
    font-size: 17px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.psf-tray-count {
    font-size: 14px;
    font-weight: 500;
    opacity: 0.85;
}

.psf-tray-list, .psf-summary-list {
    list-style: none;
    margin: 0;
    padding-left: 0 !important;
}

.psf-tray-item {
    display: grid;
    grid-template-columns: 52px 1fr auto auto;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border-bottom: 1px solid #e2e8f0;
}

.psf-tray-item:last-child {
    border-bottom: none;
}

/* Thumbnail */
.psf-tray-thumb {
    width: 52px;
    height: 52px;
    border-radius: 6px;
    overflow: hidden;
    flex-shrink: 0;
    background: #e8edf2;
    display: flex;
    align-items: center;
    justify-content: center;
}

.psf-tray-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.psf-tray-thumb-placeholder {
    font-size: 18px;
    font-weight: 700;
    color: #aaa;
}

/* Details */
.psf-tray-details {
    flex: 1;
    min-width: 0;
}

.psf-tray-stone {
    font-size: 15px;
    font-weight: 600;
    color: #1a1a1a;
    white-space: normal;
    word-break: break-word;
    line-height: 1.2;
}

.psf-tray-finish {
    font-size: 13px;
    color: #555;
    margin-top: 2px;
}

.psf-tray-code {
    font-size: 11px;
    color: #999;
    margin-top: 2px;
    font-family: monospace;
}

/* Tray quantity stepper */
.psf-tray-qty {
    display: flex;
    align-items: center;
    border: 1px solid #d0d7de;
    border-radius: 4px;
    overflow: hidden;
    flex-shrink: 0;
}

.psf-tray-qty-btn {
    width: 30px;
    height: 30px;
    border: none;
    background: #f7f8fa;
    font-size: 16px;
    line-height: 1;
    color: #333;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
}

.psf-tray-qty-btn:hover {
    background: #e2e8f0;
}

.psf-tray-qty-num {
    min-width: 32px;
    text-align: center;
    font-size: 14px;
    font-weight: 600;
    color: #1a1a1a;
}

/* Remove button */
.psf-tray-remove {
    width: 30px;
    height: 30px;
    border: none;
    background: transparent;
    color: #aaa;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    flex-shrink: 0;
    transition: color 0.15s, background 0.15s;
}

.psf-tray-remove:hover {
    color: #c53030;
    background: #fff5f5;
}

/* --------------------------------------------------------------------------
   Step 2 — Summary + placeholder
   -------------------------------------------------------------------------- */

.psf-order-summary {
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 24px;
}

.psf-summary-label {
    background: #f7f8fa;
    padding: 10px 16px;
    font-size: 18px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #888;
    border-bottom: 1px solid #e2e8f0;
}

.psf-summary-list {
    list-style: none;
    margin: 0;
    padding: 0;
}


/* --------------------------------------------------------------------------
   Step 2 summary — image thumbnail (Issue A fix)
   -------------------------------------------------------------------------- */

.psf-summary-item {
    display: grid;
    grid-template-columns: 44px 1fr auto;
    align-items: center;
    gap: 10px;
    padding: 22px 16px;
    border-bottom: 1px solid #f0f2f5;
    font-size: 14px;
    color: #333;
}

.psf-summary-item:last-child {
    border-bottom: none;
}

.psf-summary-thumb {
    width: 44px;
    height: 44px;
    border-radius: 5px;
    overflow: hidden;
    flex-shrink: 0;
    background: #e8edf2;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 700;
    color: #aaa;
}

.psf-summary-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.psf-summary-thumb--placeholder {
    background: #e8edf2;
    color: #aaa;
}

.psf-summary-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.psf-summary-name {
    font-weight: 500;
    color: #1a1a1a;
    font-size: 16px;
    line-height: 1.3;
}

.psf-summary-code {
    font-size: 14px;
    color: #999;
    font-family: monospace;
}

.psf-summary-qty {
    font-weight: 600;
    color: #555;
    font-size: 18px;
    white-space: nowrap;
}


.psf-phase-b-placeholder {
    background: #f7f8fa;
    border: 2px dashed #d0d7de;
    border-radius: 8px;
    padding: 32px;
    text-align: center;
    margin-bottom: 24px;
}

.psf-phase-b-placeholder p {
    margin: 0;
    color: #888;
    font-size: 15px;
    font-style: italic;
}

/* --------------------------------------------------------------------------
   Fatal error
   -------------------------------------------------------------------------- */

.psf-fatal-error {
    padding: 24px;
    background: #fff5f5;
    border: 1px solid #fecaca;
    border-radius: 8px;
    color: #c53030;
    font-size: 14px;
}

#psf-details-errors ul li {
    color: #c53030;
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */

@media (max-width: 600px) {
    .psf-wrap {
        padding: 0 16px;
    }

    .psf-step-header h2 {
        font-size: 26px;
    }

    .psf-stone-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 10px;
    }

    .psf-tray-item {
        flex-wrap: wrap;
        gap: 10px;
    }

    .psf-step-footer {
        flex-direction: column;
        align-items: stretch;
    }

    .psf-btn {
        width: 100%;
        text-align: center;
    }

    .psf-qty-row {
        flex-direction: column;
        align-items: flex-start;
    }

    .psf-selector-section {
        padding: 16px;
    }
}

/* ==========================================================================
   Phase B additions — appended to sample-form.css
   ========================================================================== */

/* --------------------------------------------------------------------------
   Step 2 form layout
   -------------------------------------------------------------------------- */

.psf-details-form {
    margin-bottom: 0;
}

.psf-form-section {
    margin-bottom: 28px;
    padding-bottom: 24px;
    border-bottom: 1px solid #e2e8f0;
}

.psf-form-section:last-of-type {
    border-bottom: none;
    margin-bottom: 0;
}

.psf-form-section-title {
    font-size: 18px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #888;
    margin-bottom: 18px;
}

/* Field rows */
.psf-field-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin-bottom: 16px;
}

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

.psf-field label {
    display: block;
    font-size: 18px;
    font-weight: 500;
    color: #333;
    margin-bottom: 6px;
}

.psf-field .ts-control {
    border: 2px solid #c4c4c4;
    border-radius: 6px;
    font-size: 18px;
    padding: 10px 14px;
}

.psf-required {
    color: #c53030;
}

.psf-optional {
    color: #999;
    font-weight: 400;
    font-size: 12px;
}

.psf-field input[type="text"],
.psf-field input[type="email"],
.psf-field input[type="tel"],
.psf-field select {
    width: 100%;
    padding: 10px 14px;
    font-size: 15px;
    border: 2px solid #c4c4c4;
    border-radius: 6px;
    background: #fff;
    color: #333;
    box-sizing: border-box;
    transition: border-color 0.2s, box-shadow 0.2s;
    -webkit-appearance: none;
    appearance: none;
}

.psf-field select {
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23666' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpath d='M6 9l6 6 6-6'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
    padding-right: 36px;
    cursor: pointer;
}

.psf-field input:focus,
.psf-field select:focus {
    outline: none;
    border-color: #2c5282;
    box-shadow: 0 0 0 3px rgba(44, 82, 130, 0.1);
}

/* --------------------------------------------------------------------------
   Shipping panel
   -------------------------------------------------------------------------- */

.psf-shipping-panel {
    background: #f7f8fa;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 16px 20px;
    margin: 24px 0;
}

.psf-shipping-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.psf-shipping-label {
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

.psf-shipping-value {
    font-size: 14px;
    color: #555;
    text-align: right;
}

.psf-shipping-cost {
    font-size: 22px;
    font-weight: 700;
    color: #276749;
}

.psf-shipping-calculating {
    font-style: italic;
    color: #888;
}

.psf-shipping-unavailable {
    color: #c53030;
    font-size: 13px;
}

.psf-shipping-prompt {
    color: #aaa;
    font-size: 13px;
    font-style: italic;
}

.psf-shipping-note {
    font-size: 12px;
    color: #c53030;
    margin: 6px 0 0;
}

/* --------------------------------------------------------------------------
   Step 2 footer (back + submit)
   -------------------------------------------------------------------------- */

.psf-step-footer--2 {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid #e2e8f0;
}

/* --------------------------------------------------------------------------
   Phase B submit placeholder (replaced in Phase C)
   -------------------------------------------------------------------------- */

.psf-placeholder-confirm {
    text-align: center;
    padding: 48px 24px;
}

.psf-placeholder-icon {
    width: 56px;
    height: 56px;
    background: #c6f6d5;
    color: #276749;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    font-weight: bold;
    margin: 0 auto 16px;
}

.psf-placeholder-confirm h3 {
    font-size: 22px;
    font-weight: 700;
    margin: 0 0 10px;
    color: #1a1a1a;
}

.psf-placeholder-confirm p {
    font-size: 15px;
    color: #666;
    margin: 0;
}

/* --------------------------------------------------------------------------
   Responsive overrides for Phase B
   -------------------------------------------------------------------------- */

@media (max-width: 600px) {
    .psf-field-row {
        grid-template-columns: 1fr;
    }

    .psf-step-footer--2 {
        flex-direction: column-reverse;
        align-items: stretch;
    }

    .psf-step-footer--2 .psf-btn {
        width: 100%;
        text-align: center;
    }
}

/* --------------------------------------------------------------------------
   Step 0 — Persona picker (What Best Describes You)
   -------------------------------------------------------------------------- */

.psf-persona-section {
    margin-bottom: 8px;
    padding: 30px 0;
}

.psf-persona-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 14px;
}

.psf-persona-pill {
    display: inline-block;
    padding: 10px 20px;
    font-size: 18px;
    font-weight: 500;
    border: 2px solid #d0d7de;
    border-radius: 6px;
    background: #fff;
    color: #333;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s, color 0.15s;
    line-height: 1.4;
    text-align: left;
}

.psf-persona-pill:hover, .psf-persona-pill--active:hover, .psf-pill:hover {
    border-color: #eeb411;
    color: #eeb411;
    background-color: transparent;
}

.psf-pill--active, .psf-pill:active, .psf-persona-pill:active, .psf-persona-pill:focus, .psf-pill:focus {
    border-color: #eeb411;
    background: transparent;
    color: #eeb411;
}

.psf-persona-error {
    margin-top: 16px;
    font-size: 16px;
    color: #c53030;
}

/* --------------------------------------------------------------------------
   Privacy Policy consent field
   -------------------------------------------------------------------------- */

.psf-form-section--privacy {
    border-bottom: none;
    margin-bottom: 16px;
    padding-bottom: 0;
}

.psf-checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 18px;
    color: #333;
    cursor: pointer;
    line-height: 1.5;
}

.psf-checkbox-label input[type="checkbox"] {
    margin-top: 3px;
    flex-shrink: 0;
    width: 22px;
    height: 22px;
    cursor: pointer;
    accent-color: #2c5282;
}

.ts-dropdown-content {
    font-size: 18px;
}

.psf-checkbox-label a {
    text-decoration: underline;
}

.psf-checkbox-label a:hover {
    color: #2a4a7a;
}

@media (max-width: 600px) {
    .psf-persona-pills {
        flex-direction: column;
    }
    .psf-persona-pill {
        width: 100%;
    }
}

/* ==========================================================================
   UX Enhancement Pass — Nathan feedback
   ========================================================================== */

/* ── 5. Hide internal codes from customer-facing display ── */
.psf-tray-code,
.psf-summary-code {
    display: none !important;
}

/* ── 3. Multi-select finishes — checked pill state ── */
.psf-pill--checked {
    background: transparent;
    color: #eeb411;
    border-color: #eeb411;
}
.psf-pill--checked:hover {
    background: transparent;
    border-color: #eeb411;
}

/* ── 6. Validation error highlight on fields ── */
.psf-field--error input,
.psf-field--error select,
.psf-field--error textarea {
    border-color: #cc1818 !important;
    box-shadow: 0 0 0 2px rgba(204,24,24,0.12);
}
.psf-field--error label {
    color: #cc1818;
}
/* Privacy checkbox error */
.psf-form-section--privacy.psf-field--error {
    outline: 2px solid #cc1818;
    outline-offset: 4px;
    border-radius: 4px;
}
