/* ==========================================================================
   Cart & Checkout Flow Styles
   Scoped with the `ps-` prefix to avoid clashing with existing site styles.
   Brand color: #088178
   ========================================================================== */

:root {
    --ps-brand: #088178;
    --ps-brand-dark: #046963;
    --ps-brand-soft: #e8f4f3;
    --ps-ink: #1f2a37;
    --ps-muted: #6b7280;
    --ps-line: #e5e7eb;
    --ps-bg: #f7f9fa;
    --ps-danger: #ef4444;
    --ps-danger-soft: #fef2f2;
    --ps-radius: 14px;
    --ps-radius-sm: 10px;
    --ps-shadow: 0 6px 24px rgba(15, 23, 42, 0.07);
    --ps-shadow-sm: 0 2px 10px rgba(15, 23, 42, 0.06);
}

/* ---------- Shared primitives ---------- */
.ps-page-head { text-align: center; margin-bottom: 32px; }
.ps-page-title { font-size: 30px; font-weight: 700; color: var(--ps-ink); margin: 0 0 8px; }
.ps-page-sub { color: var(--ps-muted); font-size: 15px; margin: 0; }

.ps-section-title { font-size: 24px; font-weight: 700; color: var(--ps-ink); margin: 0 0 6px; }
.ps-section-sub { color: var(--ps-muted); font-size: 14px; margin: 0; }

.ps-label {
    display: block;
    font-size: 13.5px;
    font-weight: 600;
    color: var(--ps-ink);
    margin-bottom: 7px;
}
.ps-label small { color: var(--ps-muted); font-weight: 500; }
.ps-required { color: var(--ps-danger); }

.ps-field { margin-bottom: 18px; }

.ps-input {
    width: 100%;
    height: 46px;
    padding: 10px 14px;
    font-size: 14.5px;
    color: var(--ps-ink);
    background: #fff;
    border: 1px solid var(--ps-line);
    border-radius: var(--ps-radius-sm);
    transition: border-color .2s ease, box-shadow .2s ease;
    outline: none;
}
.ps-input::placeholder { color: #9aa2ad; }
.ps-input:focus {
    border-color: var(--ps-brand);
    box-shadow: 0 0 0 3px rgba(8, 129, 120, 0.14);
}
.ps-input.is-invalid { border-color: var(--ps-danger); }
.ps-select { cursor: pointer; }
.ps-textarea { height: auto; min-height: 96px; resize: vertical; padding-top: 12px; }

.ps-help { display: block; margin-top: 6px; font-size: 12px; color: var(--ps-muted); }
.ps-error { display: block; margin-top: 6px; font-size: 12.5px; color: var(--ps-danger); }

.ps-field-grid { display: grid; gap: 16px; }
.ps-field-grid .ps-field { margin-bottom: 0; }
.ps-field-grid--2 { grid-template-columns: repeat(2, 1fr); }
.ps-field-grid--3 { grid-template-columns: repeat(3, 1fr); }
.ps-field-grid--4 { grid-template-columns: repeat(4, 1fr); }
.ps-field-grid { margin-bottom: 18px; }

/* ---------- Buttons ---------- */
.ps-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 22px;
    font-size: 14.5px;
    font-weight: 600;
    line-height: 1;
    border-radius: var(--ps-radius-sm);
    border: 1.5px solid transparent;
    cursor: pointer;
    text-decoration: none;
    transition: transform .15s ease, background-color .2s ease, box-shadow .2s ease, color .2s ease;
    white-space: nowrap;
}
.ps-btn i { font-size: 15px; line-height: 0; }
.ps-btn:hover { transform: translateY(-1px); text-decoration: none; }
.ps-btn:disabled { opacity: .65; cursor: not-allowed; transform: none; }

.ps-btn--primary { background: var(--ps-brand); color: #fff; box-shadow: 0 4px 14px rgba(8, 129, 120, 0.28); }
.ps-btn--primary:hover { background: var(--ps-brand-dark); color: #fff; }

.ps-btn--outline { background: #fff; color: var(--ps-brand); border-color: var(--ps-brand); }
.ps-btn--outline:hover { background: var(--ps-brand-soft); color: var(--ps-brand-dark); }

.ps-btn--ghost { background: #fff; color: var(--ps-ink); border-color: var(--ps-line); }
.ps-btn--ghost:hover { background: var(--ps-bg); border-color: #d1d5db; }

.ps-btn--danger-ghost { background: #fff; color: var(--ps-danger); border-color: #f1d4d4; }
.ps-btn--danger-ghost:hover { background: var(--ps-danger-soft); }

.ps-btn--block { width: 100%; }

/* ---------- Alerts ---------- */
.ps-alert {
    border-radius: var(--ps-radius-sm);
    padding: 13px 16px;
    font-size: 14px;
    margin-bottom: 20px;
    border: 1px solid transparent;
}
.ps-alert--success { background: var(--ps-brand-soft); color: var(--ps-brand-dark); border-color: #b9e0dc; }
.ps-alert--error { background: var(--ps-danger-soft); color: #b91c1c; border-color: #f3c9c9; }

/* ==========================================================================
   Product page — Quote card
   ========================================================================== */
.ps-quote-card {
    background: #fff;
    border: 1px solid var(--ps-line);
    border-radius: var(--ps-radius);
    box-shadow: var(--ps-shadow);
    padding: 26px 26px 28px;
}
.ps-quote-card__header { margin-bottom: 22px; }
.ps-quote-card__title { font-size: 22px; font-weight: 700; color: var(--ps-ink); margin: 0 0 6px; }
.ps-quote-card__subtitle { font-size: 14px; color: var(--ps-muted); margin: 0; }

.ps-upload {
    display: flex;
    align-items: center;
    gap: 10px;
    height: 46px;
    padding: 0 14px;
    font-size: 13.5px;
    color: var(--ps-muted);
    background: var(--ps-bg);
    border: 1.5px dashed var(--ps-line);
    border-radius: var(--ps-radius-sm);
    cursor: pointer;
    transition: border-color .2s ease, background .2s ease, color .2s ease;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}
.ps-upload:hover { border-color: var(--ps-brand); color: var(--ps-brand); background: var(--ps-brand-soft); }
.ps-upload i { font-size: 17px; color: var(--ps-brand); }
.ps-upload__input { display: none; }

.ps-quote-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin-top: 24px;
}
.ps-quote-actions .ps-btn { padding: 14px 20px; }

/* ==========================================================================
   Cart page
   ========================================================================== */
.ps-cart-section, .ps-checkout-section, .ps-shop-section { padding: 44px 0 64px; }

.ps-cart-layout {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 28px;
    align-items: start;
}

.ps-cart-table {
    background: #fff;
    border: 1px solid var(--ps-line);
    border-radius: var(--ps-radius);
    box-shadow: var(--ps-shadow-sm);
    overflow: hidden;
}
.ps-cart-table__head {
    display: grid;
    grid-template-columns: 2.2fr 1.6fr 1.2fr 0.5fr;
    gap: 16px;
    padding: 15px 22px;
    background: var(--ps-bg);
    border-bottom: 1px solid var(--ps-line);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--ps-muted);
}
.ps-cart-row {
    display: grid;
    grid-template-columns: 2.2fr 1.6fr 1.2fr 0.5fr;
    gap: 16px;
    align-items: center;
    padding: 18px 22px;
    border-bottom: 1px solid var(--ps-line);
}
.ps-cart-row:last-child { border-bottom: none; }

.ps-cart-product { display: flex; align-items: center; gap: 14px; }
.ps-cart-thumb {
    width: 66px; height: 66px;
    flex-shrink: 0;
    border-radius: var(--ps-radius-sm);
    border: 1px solid var(--ps-line);
    background: #fff;
    overflow: hidden;
    display: flex; align-items: center; justify-content: center;
}
.ps-cart-thumb img { width: 100%; height: 100%; object-fit: contain; }
.ps-cart-name { font-size: 15px; font-weight: 600; margin: 0 0 4px; line-height: 1.35; }
.ps-cart-name a { color: var(--ps-ink); }
.ps-cart-name a:hover { color: var(--ps-brand); }
.ps-cart-cat {
    display: inline-block;
    font-size: 11.5px;
    font-weight: 600;
    color: var(--ps-brand-dark);
    background: var(--ps-brand-soft);
    padding: 3px 10px;
    border-radius: 20px;
}

.ps-spec-line { display: block; font-size: 13px; color: var(--ps-ink); margin-bottom: 4px; }
.ps-spec-line--muted { color: var(--ps-muted); }
.ps-spec-line i { color: var(--ps-brand); margin-right: 4px; }

.ps-qty {
    display: inline-flex;
    align-items: center;
    border: 1px solid var(--ps-line);
    border-radius: var(--ps-radius-sm);
    overflow: hidden;
    background: #fff;
}
.ps-qty__btn {
    width: 34px; height: 40px;
    border: none;
    background: var(--ps-bg);
    color: var(--ps-ink);
    font-size: 18px;
    cursor: pointer;
    transition: background .15s ease, color .15s ease;
}
.ps-qty__btn:hover { background: var(--ps-brand); color: #fff; }
.ps-qty__input {
    width: 48px; height: 40px;
    border: none;
    border-left: 1px solid var(--ps-line);
    border-right: 1px solid var(--ps-line);
    text-align: center;
    font-size: 14px;
    font-weight: 600;
    color: var(--ps-ink);
    -moz-appearance: textfield;
}
.ps-qty__input::-webkit-outer-spin-button,
.ps-qty__input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

.ps-remove {
    width: 38px; height: 38px;
    border: 1px solid var(--ps-line);
    background: #fff;
    border-radius: 50%;
    color: var(--ps-muted);
    cursor: pointer;
    transition: all .15s ease;
    display: inline-flex; align-items: center; justify-content: center;
}
.ps-remove:hover { background: var(--ps-danger-soft); color: var(--ps-danger); border-color: #f3c9c9; }

.ps-cart-toolbar {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    margin-top: 20px;
    flex-wrap: wrap;
}

/* Cart / checkout summary */
.ps-summary-card {
    background: #fff;
    border: 1px solid var(--ps-line);
    border-radius: var(--ps-radius);
    box-shadow: var(--ps-shadow-sm);
    padding: 24px;
    position: sticky;
    top: 20px;
}
.ps-summary-title { font-size: 17px; font-weight: 700; color: var(--ps-ink); margin: 0 0 18px; padding-bottom: 14px; border-bottom: 1px solid var(--ps-line); }
.ps-summary-row {
    display: flex; align-items: center; justify-content: space-between;
    font-size: 14px; color: var(--ps-muted);
    padding: 8px 0;
}
.ps-summary-row strong { color: var(--ps-ink); font-size: 15px; }
.ps-summary-note {
    display: flex; gap: 8px;
    font-size: 12.5px; color: var(--ps-muted);
    background: var(--ps-bg);
    border-radius: var(--ps-radius-sm);
    padding: 12px 14px;
    margin: 16px 0 18px;
    line-height: 1.5;
}
.ps-summary-note i { color: var(--ps-brand); margin-top: 1px; }

/* Empty cart */
.ps-empty {
    text-align: center;
    background: #fff;
    border: 1px solid var(--ps-line);
    border-radius: var(--ps-radius);
    box-shadow: var(--ps-shadow-sm);
    padding: 60px 24px;
    max-width: 520px;
    margin: 0 auto;
}
.ps-empty__icon {
    width: 84px; height: 84px;
    border-radius: 50%;
    background: var(--ps-brand-soft);
    color: var(--ps-brand);
    display: flex; align-items: center; justify-content: center;
    font-size: 34px;
    margin: 0 auto 20px;
}
.ps-empty__title { font-size: 20px; font-weight: 700; color: var(--ps-ink); margin: 0 0 8px; }
.ps-empty__text { color: var(--ps-muted); font-size: 14px; margin: 0 0 22px; }

/* ==========================================================================
   Checkout page
   ========================================================================== */
.ps-checkout-layout {
    display: grid;
    grid-template-columns: 1fr 360px;
    gap: 28px;
    align-items: start;
}
.ps-panel {
    background: #fff;
    border: 1px solid var(--ps-line);
    border-radius: var(--ps-radius);
    box-shadow: var(--ps-shadow-sm);
    padding: 26px;
}
.ps-panel__title {
    display: flex; align-items: center; gap: 9px;
    font-size: 17px; font-weight: 700; color: var(--ps-ink);
    margin: 0 0 20px; padding-bottom: 15px;
    border-bottom: 1px solid var(--ps-line);
}
.ps-panel__title i { color: var(--ps-brand); }

.ps-order-items {
    margin-bottom: 16px;
    max-height: 320px;
    overflow-y: auto;
    padding-right: 4px;
}
.ps-order-item {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 0;
    border-bottom: 1px dashed var(--ps-line);
}
.ps-order-item:last-child { border-bottom: none; }
.ps-order-thumb {
    position: relative;
    width: 52px; height: 52px;
    flex-shrink: 0;
    border: 1px solid var(--ps-line);
    border-radius: var(--ps-radius-sm);
    overflow: hidden;
    background: #fff;
}
.ps-order-thumb img { width: 100%; height: 100%; object-fit: contain; }
.ps-order-qty {
    position: absolute; top: -7px; right: -7px;
    min-width: 20px; height: 20px;
    padding: 0 5px;
    background: var(--ps-brand);
    color: #fff;
    font-size: 11px; font-weight: 700;
    border-radius: 20px;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 2px 6px rgba(8, 129, 120, 0.35);
}
.ps-order-detail { display: flex; flex-direction: column; gap: 3px; }
.ps-order-name { font-size: 13.5px; font-weight: 600; color: var(--ps-ink); line-height: 1.3; }
.ps-order-cat { font-size: 11.5px; color: var(--ps-muted); }

.ps-back-link {
    display: block;
    text-align: center;
    margin-top: 14px;
    font-size: 13.5px;
    color: var(--ps-muted);
}
.ps-back-link:hover { color: var(--ps-brand); }

/* ==========================================================================
   All products page
   ========================================================================== */
.ps-shop-head { text-align: center; margin-bottom: 26px; }
.ps-shop-head--products { margin-top: 48px; padding-top: 40px; border-top: 1px solid var(--ps-line); }

.ps-category-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 18px;
    margin-bottom: 12px;
}
.ps-cat-card {
    display: block;
    text-align: center;
    background: #fff;
    border: 1px solid var(--ps-line);
    border-radius: var(--ps-radius);
    padding: 16px 12px;
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.ps-cat-card:hover { transform: translateY(-3px); box-shadow: var(--ps-shadow); border-color: var(--ps-brand); }
.ps-cat-card__img {
    height: 96px;
    display: flex; align-items: center; justify-content: center;
    margin-bottom: 10px;
}
.ps-cat-card__img img { max-width: 100%; max-height: 96px; object-fit: contain; }
.ps-cat-card__name { font-size: 13.5px; font-weight: 600; color: var(--ps-ink); line-height: 1.3; }
.ps-cat-card:hover .ps-cat-card__name { color: var(--ps-brand); }

.ps-pagination { margin-top: 30px; display: flex; justify-content: center; }
.ps-pagination nav { display: flex; }

/* ==========================================================================
   Header cart badge
   ========================================================================== */
.ps-header-cart {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 46px; height: 46px;
    margin-right: 12px;
    border-radius: 10px;
    color: var(--ps-ink);
    background: #fff;
    border: 1px solid var(--ps-line);
    font-size: 19px;
    transition: all .18s ease;
}
.ps-header-cart:hover { color: var(--ps-brand); border-color: var(--ps-brand); background: var(--ps-brand-soft); }
.ps-header-cart__count {
    position: absolute; top: -6px; right: -6px;
    min-width: 20px; height: 20px;
    padding: 0 5px;
    background: var(--ps-brand);
    color: #fff;
    font-size: 11px; font-weight: 700;
    border-radius: 20px;
    display: none; align-items: center; justify-content: center;
    box-shadow: 0 2px 6px rgba(8, 129, 120, 0.4);
}
.ps-header-cart__count.is-active { display: flex; }

/* ==========================================================================
   Thank you page
   ========================================================================== */
.ps-thankyou-section {
    padding: 70px 0 90px;
    background:
        radial-gradient(1200px 380px at 50% -120px, var(--ps-brand-soft) 0%, rgba(232, 244, 243, 0) 70%);
}
.ps-thankyou-card {
    max-width: 640px;
    margin: 0 auto;
    text-align: center;
    background: #fff;
    border: 1px solid var(--ps-line);
    border-radius: 20px;
    box-shadow: var(--ps-shadow);
    padding: 48px 40px 40px;
}
.ps-thankyou-badge {
    width: 96px; height: 96px;
    margin: 0 auto 26px;
    border-radius: 50%;
    background: var(--ps-brand-soft);
    display: flex; align-items: center; justify-content: center;
    animation: ps-pop .4s ease-out both;
}
.ps-thankyou-check { width: 60px; height: 60px; }
.ps-thankyou-check__circle {
    stroke: var(--ps-brand);
    stroke-width: 2.5;
    stroke-dasharray: 151;
    stroke-dashoffset: 151;
    animation: ps-draw-circle .6s ease-out forwards;
}
.ps-thankyou-check__mark {
    stroke: var(--ps-brand);
    stroke-width: 3.5;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-dasharray: 45;
    stroke-dashoffset: 45;
    animation: ps-draw-mark .35s .55s ease-out forwards;
}
@keyframes ps-pop { 0% { transform: scale(.6); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }
@keyframes ps-draw-circle { to { stroke-dashoffset: 0; } }
@keyframes ps-draw-mark { to { stroke-dashoffset: 0; } }

.ps-thankyou-title { font-size: 34px; font-weight: 800; color: var(--ps-ink); margin: 0 0 12px; }
.ps-thankyou-lead { font-size: 16px; font-weight: 600; color: var(--ps-brand-dark); margin: 0 0 8px; }
.ps-thankyou-sub { font-size: 14.5px; color: var(--ps-muted); line-height: 1.6; margin: 0 auto 30px; max-width: 480px; }

.ps-thankyou-steps {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin: 0 0 32px;
    flex-wrap: wrap;
}
.ps-thankyou-step { display: flex; flex-direction: column; align-items: center; gap: 8px; width: 120px; }
.ps-thankyou-step__icon {
    width: 46px; height: 46px;
    border-radius: 50%;
    background: var(--ps-bg);
    border: 1px solid var(--ps-line);
    color: var(--ps-brand);
    display: flex; align-items: center; justify-content: center;
    font-size: 17px;
}
.ps-thankyou-step__label { font-size: 12.5px; font-weight: 600; color: var(--ps-ink); line-height: 1.3; }
.ps-thankyou-step__divider { width: 34px; height: 2px; background: var(--ps-line); border-radius: 2px; margin-top: -18px; }

.ps-thankyou-actions {
    display: flex;
    gap: 14px;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 26px;
}
.ps-thankyou-help { font-size: 13.5px; color: var(--ps-muted); margin: 0; }
.ps-thankyou-help a { color: var(--ps-brand); font-weight: 600; }
.ps-thankyou-help a:hover { color: var(--ps-brand-dark); }

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 991px) {
    .ps-cart-layout, .ps-checkout-layout { grid-template-columns: 1fr; }
    .ps-summary-card { position: static; }
    .ps-category-grid { grid-template-columns: repeat(4, 1fr); }
    .ps-field-grid--3 { grid-template-columns: repeat(2, 1fr); }
    .ps-field-grid--4 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 767px) {
    .ps-quote-actions { grid-template-columns: 1fr; }
    .ps-category-grid { grid-template-columns: repeat(3, 1fr); }

    .ps-cart-table__head { display: none; }
    .ps-cart-row {
        grid-template-columns: 1fr;
        gap: 14px;
        position: relative;
        padding: 18px 16px;
    }
    .ps-col-action { position: absolute; top: 14px; right: 14px; }
    .ps-col-qty { justify-self: start; }
    .ps-cart-toolbar { flex-direction: column; }
    .ps-cart-toolbar .ps-btn { width: 100%; }
    .ps-page-title { font-size: 24px; }

    .ps-thankyou-card { padding: 38px 22px 32px; }
    .ps-thankyou-title { font-size: 27px; }
    .ps-thankyou-step__divider { display: none; }
    .ps-thankyou-step { width: 92px; }
    .ps-thankyou-actions .ps-btn { width: 100%; }
}

@media (max-width: 480px) {
    .ps-field-grid--3, .ps-field-grid--4, .ps-field-grid--2 { grid-template-columns: 1fr; }
    .ps-category-grid { grid-template-columns: repeat(2, 1fr); }
    .ps-quote-card { padding: 20px 16px; }
}
