/* ==========================================================================
   Cart & checkout styles (ct-*)
   --------------------------------------------------------------------------
   Everything unique to the cart flow lives here: the artwork uploader on the
   product form, the cart line items, the checkout summary and the order
   variant of the thank-you page. Buttons, headings and colours reuse the
   shared hp-* primitives and tokens from public/css/home.css, so the brand
   recolours in one place.
   ========================================================================== */

/* --------------------------------------------------------------------------
   Design / artwork uploader (product quote form)
   -------------------------------------------------------------------------- */

.ct-upload {
    display: flex;
    align-items: center;
    gap: .9rem;
    width: 100%;
    padding: 1rem 1.1rem;
    border: 1.5px dashed var(--hp-border);
    border-radius: 12px;
    background: var(--hp-gray);
    cursor: pointer;
    transition: border-color .2s ease, background .2s ease;
}
.ct-upload:hover { border-color: var(--hp-accent); background: var(--hp-accent-soft); }
.ct-upload > i { font-size: 1.4rem; color: var(--hp-accent); }
.ct-upload input[type="file"] {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}
.ct-upload-text { display: flex; flex-direction: column; gap: .1rem; font-size: .78rem; color: var(--hp-muted); }
.ct-upload-text strong { font-size: .88rem; color: var(--hp-text); }

.ct-upload-progress { margin-top: .5rem; font-size: .82rem; color: var(--hp-accent); }

.ct-upload-list { list-style: none; margin: .6rem 0 0; padding: 0; display: flex; flex-direction: column; gap: .4rem; }
.ct-upload-list li {
    display: flex;
    align-items: center;
    gap: .55rem;
    padding: .45rem .7rem;
    border: 1px solid var(--hp-border);
    border-radius: 10px;
    background: #fff;
    font-size: .82rem;
    color: var(--hp-text);
}
.ct-upload-list li i { color: var(--hp-accent); }
.ct-upload-list li span { flex: 1 1 auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ct-upload-list li button {
    flex: 0 0 auto;
    width: 22px;
    height: 22px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: var(--hp-gray);
    color: var(--hp-muted);
    font-size: .9rem;
    line-height: 1;
    transition: all .2s ease;
}
.ct-upload-list li button:hover { background: #fdecec; color: #d64545; }

/* Get Instant Quote + Add to Cart side by side; stacked on narrow screens. */
.ct-btn-pair { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; }
.ct-btn-pair .hp-btn,
.ct-btn-pair .hp-btn-outline { width: 100%; }
@media (max-width: 479.98px) {
    .ct-btn-pair { grid-template-columns: 1fr; }
}

/* --------------------------------------------------------------------------
   Page header with the Cart → Checkout → Done progress steps
   -------------------------------------------------------------------------- */

.ct-page-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1.75rem;
}

.ct-steps { list-style: none; display: flex; align-items: center; gap: .4rem; margin: 0; padding: 0; }
.ct-steps li {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    font-size: .82rem;
    font-weight: 600;
    color: var(--hp-muted);
    white-space: nowrap;
}
.ct-steps li + li::before { content: "\2192"; margin-right: .4rem; color: var(--hp-border); font-weight: 400; }
.ct-steps li.is-active { color: var(--hp-accent); }
.ct-steps li.is-done,
.ct-steps li.is-done a { color: var(--hp-green); text-decoration: none; }

/* --------------------------------------------------------------------------
   Cards and cart line items
   -------------------------------------------------------------------------- */

.ct-card {
    background: #fff;
    border: 1px solid var(--hp-border);
    border-radius: var(--hp-radius);
    overflow: hidden;
}
.ct-card-pad { padding: 1.5rem; }

.ct-row-head {
    display: grid;
    grid-template-columns: 88px 1fr 200px 44px;
    gap: 1rem;
    padding: .8rem 1.25rem;
    background: var(--hp-gray);
    font-size: .75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--hp-muted);
}
.ct-row-head span:first-child { grid-column: 1 / 3; }

.ct-item {
    display: grid;
    grid-template-columns: 88px 1fr 200px 44px;
    grid-template-areas: "img info qty remove";
    gap: 1rem;
    align-items: center;
    padding: 1.1rem 1.25rem;
}
.ct-item + .ct-item { border-top: 1px solid var(--hp-border); }

.ct-item-img {
    grid-area: img;
    display: block;
    width: 88px;
    height: 88px;
    border: 1px solid var(--hp-border);
    border-radius: 12px;
    background: var(--hp-gray);
    overflow: hidden;
}
.hp-scope .ct-item-img img,
.ct-item-img img { width: 100%; height: 100%; object-fit: contain; display: block; }

.ct-item-info { grid-area: info; min-width: 0; }
.ct-item-name {
    display: block;
    font-weight: 700;
    font-size: .95rem;
    color: var(--hp-text);
    text-decoration: none;
}
.ct-item-name:hover { color: var(--hp-accent); }
.ct-item-cat {
    display: inline-block;
    margin-top: .3rem;
    padding: .15rem .6rem;
    border-radius: 999px;
    background: var(--hp-accent-soft);
    color: var(--hp-accent);
    font-size: .72rem;
    font-weight: 600;
}
.ct-item-specs {
    display: flex;
    flex-wrap: wrap;
    gap: .35rem 1rem;
    margin: .45rem 0 0;
    font-size: .78rem;
    color: var(--hp-muted);
}
.ct-item-specs i { margin-right: .25rem; color: var(--hp-accent); }

.ct-item-qty { grid-area: qty; }

/* Input and its Update button read as one control, matching the field styling
   in public/css/forms.css. */
.ct-qty {
    display: flex;
    align-items: stretch;
    border: 1.5px solid var(--hp-border);
    border-radius: 12px;
    background: #fff;
    overflow: hidden;
    transition: border-color .2s ease, box-shadow .2s ease;
}
.ct-qty:hover { border-color: #d7d7e2; }
.ct-qty:focus-within {
    border-color: var(--hp-accent);
    box-shadow: 0 0 0 4px rgba(114, 2, 255, .10);
}
.ct-qty input {
    width: 100%;
    min-width: 0;
    padding: .6rem .85rem;
    border: none;
    background: transparent;
    font-size: .88rem;
    color: var(--hp-text);
    -moz-appearance: textfield;
    appearance: textfield;
}
.ct-qty input::-webkit-outer-spin-button,
.ct-qty input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.ct-qty input:focus { outline: none; }
.ct-qty-update {
    flex: 0 0 auto;
    padding: .5rem 1rem;
    border: none;
    border-left: 1.5px solid var(--hp-border);
    background: var(--hp-gray);
    color: var(--hp-accent);
    font-size: .78rem;
    font-weight: 700;
    letter-spacing: .02em;
    transition: all .2s ease;
}
.ct-qty-update:hover:not(:disabled) { background: var(--hp-accent); color: #fff; border-left-color: var(--hp-accent); }
.ct-qty-update:disabled { opacity: .55; }

.ct-remove {
    grid-area: remove;
    width: 38px;
    height: 38px;
    padding: 0;
    border: 1px solid var(--hp-border);
    border-radius: 50%;
    background: #fff;
    color: var(--hp-muted);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all .2s ease;
}
.ct-remove:hover { border-color: #d64545; background: #fdecec; color: #d64545; }

.ct-under-list {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: .75rem;
    margin-top: 1.25rem;
}
.ct-clear {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    padding: .35rem .5rem;
    border: none;
    background: transparent;
    color: var(--hp-muted);
    font-size: .85rem;
    font-weight: 600;
    transition: color .2s ease;
}
.ct-clear:hover { color: #d64545; }

/* On small screens the row becomes image + info, then quantity + remove. */
@media (max-width: 767.98px) {
    .ct-row-head { display: none; }
    .ct-item {
        grid-template-columns: 72px 1fr 44px;
        grid-template-areas:
            "img info remove"
            "qty qty qty";
        align-items: start;
    }
    .ct-item-img { width: 72px; height: 72px; }
    .ct-item-qty { max-width: 260px; }
}

/* --------------------------------------------------------------------------
   Summary card (cart + checkout)
   -------------------------------------------------------------------------- */

.ct-summary {
    background: #fff;
    border: 1px solid var(--hp-border);
    border-radius: var(--hp-radius);
    padding: 1.5rem;
}
@media (min-width: 992px) {
    .ct-summary { position: sticky; top: 96px; }
}

.ct-summary-title { font-size: 1.05rem; font-weight: 700; margin: 0 0 1rem; }

.ct-summary-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: .55rem 0;
    border-top: 1px solid var(--hp-border);
    font-size: .9rem;
    color: var(--hp-muted);
}
.ct-summary-row strong { color: var(--hp-text); }

.ct-summary-note { margin: 1rem 0; font-size: .8rem; line-height: 1.55; color: var(--hp-muted); }
.ct-summary-note i { color: var(--hp-green); margin-right: .25rem; }

.ct-summary-perks { list-style: none; margin: 1.1rem 0 0; padding: 0; display: flex; flex-direction: column; gap: .45rem; }
.ct-summary-perks li { font-size: .8rem; color: var(--hp-muted); }
.ct-summary-perks i { color: var(--hp-green); margin-right: .45rem; }

/* Compact item list on the checkout summary */
.ct-mini-list { display: flex; flex-direction: column; gap: .8rem; margin-bottom: 1rem; max-height: 320px; overflow-y: auto; }
.ct-mini-item { display: flex; align-items: center; gap: .8rem; }
.ct-mini-img {
    flex: 0 0 54px;
    width: 54px;
    height: 54px;
    border: 1px solid var(--hp-border);
    border-radius: 10px;
    background: var(--hp-gray);
    overflow: hidden;
}
.hp-scope .ct-mini-img img,
.ct-mini-img img { width: 100%; height: 100%; object-fit: contain; display: block; }
.ct-mini-info { min-width: 0; display: flex; flex-direction: column; gap: .1rem; }
.ct-mini-name { font-size: .85rem; font-weight: 600; color: var(--hp-text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ct-mini-meta { font-size: .75rem; color: var(--hp-muted); }

.ct-edit-cart {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    margin-top: 1rem;
    font-size: .85rem;
    font-weight: 600;
    color: var(--hp-accent);
    text-decoration: none;
}
.ct-edit-cart:hover { color: var(--hp-purple-dark); }

/* --------------------------------------------------------------------------
   Empty cart state
   -------------------------------------------------------------------------- */

.ct-empty {
    max-width: 520px;
    margin: 2rem auto;
    padding: 3rem 2rem;
    text-align: center;
    background: #fff;
    border: 1px solid var(--hp-border);
    border-radius: var(--hp-radius);
}
.ct-empty-ico {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 72px;
    height: 72px;
    margin-bottom: 1.25rem;
    border-radius: 50%;
    background: var(--hp-accent-soft);
    color: var(--hp-accent);
    font-size: 1.6rem;
}
.ct-empty h2 { font-size: 1.35rem; font-weight: 700; }

/* --------------------------------------------------------------------------
   Thank-you page order reference
   -------------------------------------------------------------------------- */

.ct-order-number {
    display: inline-block;
    margin-bottom: 1rem;
    padding: .45rem 1.1rem;
    border-radius: 999px;
    background: var(--hp-mint-soft);
    color: var(--hp-green-dark);
    font-size: .9rem;
}
