/* ==========================================================================
   Blessing Your Scalp — order confirmation
   --------------------------------------------------------------------------
   The page reports whichever payment state the backend recorded, so the tone
   is driven by a single modifier on the root (--success / --pending / --failed
   / --missing) that repaints the accent. Everything else is shared, which is
   what stops the four states drifting into four different designs.
   ========================================================================== */

.bys-confirm {
    --rose: #be6d76;
    --rose-deep: #a85961;
    --rose-rgb: 190, 109, 118;
    --cream: #fbf4f0;
    --blush: #f5e6e0;
    --white: #ffffff;
    --charcoal: #35312f;
    --stone: #6f6a67;
    --divider: #e3e3e3;
    --shadow-btn: 0 4px 15px rgba(190, 109, 118, 0.30);

    /* Repainted per state below. */
    --accent: #157a4a;
    --accent-soft: #e8f3ec;

    font-family: 'Jost', sans-serif;
    color: var(--charcoal);
    padding-bottom: clamp(56px, 8vw, 96px);
}

.bys-confirm--pending { --accent: #9a6410; --accent-soft: #fdf2e0; }
.bys-confirm--failed  { --accent: #a3302b; --accent-soft: #fbeceb; }
.bys-confirm--missing { --accent: #6f6a67; --accent-soft: #f2efed; }

.bys-confirm .visually-hidden {
    position: absolute !important;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

[x-cloak] { display: none !important; }

/* --------------------------------------------------------------------------
   Hero
   -------------------------------------------------------------------------- */

.bys-confirm__hero {
    max-width: 40rem;
    margin: 0 auto;
    padding: clamp(28px, 5vw, 52px) 0 clamp(32px, 5vw, 48px);
    text-align: center;
}

.bys-confirm__mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 72px;
    height: 72px;
    margin-bottom: 22px;
    border-radius: 50%;
    background: var(--accent-soft);
    color: var(--accent);
    animation: bys-confirm-pop 0.45s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes bys-confirm-pop {
    from { opacity: 0; transform: scale(0.7); }
    to   { opacity: 1; transform: scale(1); }
}

.bys-confirm__eyebrow {
    margin: 0 0 10px;
    color: var(--accent);
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.bys-confirm__title {
    margin: 0 0 14px;
    font-family: 'Jost', sans-serif;
    font-size: clamp(1.6rem, 4.5vw, 2.5rem);
    font-weight: 400;
    line-height: 1.15;
    letter-spacing: -0.01em;
}

.bys-confirm__title em {
    font-family: 'Parisienne', cursive;
    font-style: normal;
    font-size: 1.12em;
    color: var(--rose);
}

.bys-confirm__lede {
    margin: 0 auto;
    max-width: 34rem;
    color: var(--stone);
    font-size: 1rem;
    line-height: 1.7;
}

/* Order reference pill ------------------------------------------------------ */

.bys-confirm__ref {
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px 12px;
    margin: 26px 0 10px;
    padding: 10px 10px 10px 20px;
    max-width: 100%;
    border: 1px solid var(--blush);
    border-radius: 999px;
    background: var(--cream);
}

.bys-confirm__ref-label {
    color: var(--stone);
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.bys-confirm__ref-value {
    /* A ULID reference is long; it must wrap rather than widen the page. */
    min-width: 0;
    font-size: 0.92rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    overflow-wrap: anywhere;
    user-select: all;
}

.bys-confirm__ref-copy {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    /* 40px keeps the only icon-only control here a real target. */
    width: 40px;
    height: 40px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: var(--white);
    color: var(--charcoal);
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.bys-confirm__ref-copy:hover,
.bys-confirm__ref-copy:focus-visible {
    background: var(--rose);
    color: #fff;
}

.bys-confirm__placed {
    margin: 0;
    color: var(--stone);
    font-size: 0.82rem;
}

/* --------------------------------------------------------------------------
   Payment notice (pending / failed)
   -------------------------------------------------------------------------- */

.bys-confirm__notice {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 16px 24px;
    max-width: 62rem;
    margin: 0 auto clamp(28px, 4vw, 40px);
    padding: 20px 24px;
    border: 1px solid var(--accent);
    border-radius: 12px;
    background: var(--accent-soft);
}

.bys-confirm__notice-body { flex: 1 1 20rem; min-width: 0; }

.bys-confirm__notice-title {
    margin: 0 0 5px;
    color: var(--accent);
    font-size: 0.95rem;
    font-weight: 600;
}

.bys-confirm__notice-text {
    margin: 0;
    color: var(--charcoal);
    font-size: 0.88rem;
    line-height: 1.65;
}

/* --------------------------------------------------------------------------
   Panels
   -------------------------------------------------------------------------- */

.bys-confirm__grid {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
    align-items: start;
    gap: 24px;
    max-width: 62rem;
    margin: 0 auto;
}

.bys-confirm__side {
    display: grid;
    gap: 24px;
}

.bys-confirm__panel {
    padding: clamp(20px, 3vw, 28px);
    border: 1px solid var(--divider);
    border-radius: 12px;
    background: var(--white);
}

.bys-confirm__panel-title {
    margin: 0 0 18px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--divider);
    color: var(--stone);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

/* Items --------------------------------------------------------------------- */

.bys-confirm__items {
    margin: 0;
    padding: 0;
    list-style: none;
}

.bys-confirm__item {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 14px 0;
    border-bottom: 1px solid var(--divider);
}

.bys-confirm__item:first-child { padding-top: 0; }

.bys-confirm__item-media {
    position: relative;
    flex: 0 0 auto;
}

.bys-confirm__item-img {
    display: block;
    width: 56px;
    height: 56px;
    border-radius: 8px;
    border: 1px solid var(--divider);
    object-fit: cover;
    background: var(--cream);
}

.bys-confirm__item-img--empty { background: var(--blush); }

.bys-confirm__item-qty {
    position: absolute;
    top: -7px;
    right: -7px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 21px;
    height: 21px;
    padding: 0 5px;
    border-radius: 999px;
    background: var(--charcoal);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 600;
}

.bys-confirm__item-info {
    flex: 1 1 auto;
    min-width: 0;
}

.bys-confirm__item-name {
    margin: 0 0 3px;
    font-size: 0.92rem;
    font-weight: 600;
    line-height: 1.35;
    /* Long product names wrap instead of pushing the price off the card. */
    overflow-wrap: anywhere;
}

.bys-confirm__item-variant,
.bys-confirm__item-meta {
    margin: 0;
    color: var(--stone);
    font-size: 0.8rem;
    line-height: 1.5;
}

.bys-confirm__item-price {
    flex: 0 0 auto;
    font-size: 0.92rem;
    font-weight: 600;
    white-space: nowrap;
}

/* Totals -------------------------------------------------------------------- */

.bys-confirm__totals {
    margin: 20px 0 0;
}

.bys-confirm__total-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
    padding: 7px 0;
}

.bys-confirm__total-row dt {
    margin: 0;
    color: var(--stone);
    font-size: 0.88rem;
    font-weight: 400;
}

.bys-confirm__total-row dd {
    margin: 0;
    font-size: 0.88rem;
    font-weight: 500;
    white-space: nowrap;
}

.bys-confirm__total-row dd .is-free { color: #157a4a; font-weight: 600; }
.bys-confirm__total-row dd.is-credit { color: #157a4a; }

.bys-confirm__total-row--grand {
    margin-top: 8px;
    padding-top: 16px;
    border-top: 1px solid var(--divider);
}

.bys-confirm__total-row--grand dt {
    color: var(--charcoal);
    font-size: 1rem;
    font-weight: 600;
}

.bys-confirm__total-row--grand dd {
    font-size: 1.3rem;
    font-weight: 700;
}

.bys-confirm__currency {
    margin-right: 5px;
    color: var(--stone);
    font-size: 0.68rem;
    font-weight: 400;
}

/* Delivery ------------------------------------------------------------------ */

.bys-confirm__address {
    margin: 0;
    color: var(--charcoal);
    font-size: 0.9rem;
    font-style: normal;
    line-height: 1.75;
    overflow-wrap: anywhere;
}

.bys-confirm__address-name {
    display: block;
    font-weight: 600;
}

.bys-confirm__contact {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin: 14px 0 0;
    padding-top: 14px;
    border-top: 1px solid var(--divider);
    color: var(--stone);
    font-size: 0.85rem;
    overflow-wrap: anywhere;
}

.bys-confirm__notes {
    margin: 14px 0 0;
    padding: 12px 14px;
    border-radius: 8px;
    background: var(--cream);
    color: var(--charcoal);
    font-size: 0.85rem;
    line-height: 1.6;
}

.bys-confirm__notes-label {
    display: block;
    margin-bottom: 3px;
    color: var(--stone);
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

/* What happens next --------------------------------------------------------- */

.bys-confirm__next {
    margin: 0;
    padding: 0;
    list-style: none;
    counter-reset: bys-next;
}

.bys-confirm__next-step {
    position: relative;
    counter-increment: bys-next;
    padding: 0 0 20px 34px;
}

.bys-confirm__next-step:last-child { padding-bottom: 0; }

.bys-confirm__next-step::before {
    content: counter(bys-next);
    position: absolute;
    top: 0;
    left: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border: 1px solid var(--divider);
    border-radius: 50%;
    background: var(--white);
    color: var(--stone);
    font-size: 0.68rem;
    font-weight: 700;
}

.bys-confirm__next-step.is-done::before {
    border-color: var(--accent);
    background: var(--accent);
    color: #fff;
}

/* The connector stops short of the next marker rather than running through it. */
.bys-confirm__next-step:not(:last-child)::after {
    content: '';
    position: absolute;
    top: 26px;
    bottom: 6px;
    left: 11px;
    width: 1px;
    background: var(--divider);
}

.bys-confirm__next-title {
    display: block;
    margin-bottom: 2px;
    font-size: 0.88rem;
    font-weight: 600;
}

.bys-confirm__next-text {
    display: block;
    color: var(--stone);
    font-size: 0.82rem;
    line-height: 1.6;
    overflow-wrap: anywhere;
}

/* --------------------------------------------------------------------------
   Actions
   -------------------------------------------------------------------------- */

.bys-confirm__actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    max-width: 62rem;
    margin: clamp(32px, 5vw, 48px) auto 0;
}

.bys-confirm__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    /* 48px so every action clears the touch-target minimum. */
    min-height: 48px;
    padding: 13px 28px;
    border: 1px solid transparent;
    border-radius: 999px;
    font-family: 'Jost', sans-serif;
    font-size: 0.8125rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    text-decoration: none;
    cursor: pointer;
    transition: background-color 0.25s ease, color 0.25s ease, border-color 0.25s ease;
}

.bys-confirm__btn--primary {
    background: var(--rose);
    box-shadow: var(--shadow-btn);
    color: #fff;
}

.bys-confirm__btn--primary:hover,
.bys-confirm__btn--primary:focus-visible {
    background: var(--charcoal);
    color: #fff;
}

.bys-confirm__btn--ghost {
    border-color: var(--divider);
    background: none;
    color: var(--charcoal);
}

.bys-confirm__btn--ghost:hover,
.bys-confirm__btn--ghost:focus-visible {
    border-color: var(--charcoal);
    background: var(--charcoal);
    color: #fff;
}

.bys-confirm__foot {
    max-width: 40rem;
    margin: 26px auto 0;
    color: var(--stone);
    font-size: 0.85rem;
    line-height: 1.7;
    text-align: center;
}

.bys-confirm__foot a {
    color: var(--rose-deep);
    text-decoration: underline;
}

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

@media (max-width: 900px) {
    .bys-confirm__grid { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 479px) {
    .bys-confirm__ref {
        width: 100%;
        padding: 14px 16px;
    }

    .bys-confirm__actions .bys-confirm__btn { flex: 1 1 100%; }

    .bys-confirm__notice .bys-confirm__btn { width: 100%; }
}

/* --------------------------------------------------------------------------
   Focus & motion
   -------------------------------------------------------------------------- */

.bys-confirm a:focus-visible,
.bys-confirm button:focus-visible {
    outline: 2px solid var(--rose);
    outline-offset: 2px;
    border-radius: 4px;
}

@media (prefers-reduced-motion: reduce) {
    .bys-confirm *,
    .bys-confirm *::before,
    .bys-confirm *::after {
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
    }
}
