/* =========================================================================
   Power Souls webshop — frontend styles
   Palette mirrors the brand: slate #28393c, sage #87a0a5, sand #d1c5b0.
   Scoped under .cf-shop so it never bleeds into the theme.
   ========================================================================= */

.cf-shop {
    --cf-ink: #28393c;
    --cf-sage: #87a0a5;
    --cf-sage-dark: #6c8589;
    --cf-sand: #d1c5b0;
    --cf-bg: #ffffff;
    --cf-bg-soft: #f7f5f1;
    --cf-border: #e7e2d8;
    --cf-muted: #6b7a7d;
    --cf-radius: 14px;
    --cf-shadow: 0 6px 24px rgba(40, 57, 60, .08);

    color: var(--cf-ink);
    max-width: 1180px;
    margin: 0 auto;
    font-family: inherit;
}

.cf-shop *,
.cf-shop *::before,
.cf-shop *::after { box-sizing: border-box; }

.cf-shop__empty,
.cf-shop__notice {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--cf-muted);
    font-size: 1.05rem;
}

/* ---- buttons ----------------------------------------------------------- */
.cf-shop-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    border: 1px solid var(--cf-border);
    background: #fff;
    color: var(--cf-ink);
    font: inherit;
    font-weight: 600;
    line-height: 1;
    padding: .7rem 1.1rem;
    border-radius: 999px;
    cursor: pointer;
    transition: background .15s ease, color .15s ease, transform .05s ease, box-shadow .15s ease;
    text-decoration: none;
}
.cf-shop-btn:hover { box-shadow: var(--cf-shadow); }
.cf-shop-btn:active { transform: translateY(1px); }
.cf-shop-btn:disabled { opacity: .5; cursor: not-allowed; }
.cf-shop-btn--add {
    background: var(--cf-ink);
    border-color: var(--cf-ink);
    color: #fff;
}
.cf-shop-btn--add:hover { background: #1c2a2c; }
.cf-shop-btn--lg { padding: .9rem 1.6rem; font-size: 1.02rem; }
.cf-shop-btn--block { display: flex; width: 100%; margin-top: .75rem; }
.cf-shop-btn.is-done { background: var(--cf-sage); border-color: var(--cf-sage); }

/* Theme-override hardening. The Power Souls theme forces its own pink button
   background/border/colour (with !important), which collapsed our shop buttons
   to invisible text on a white box. Re-assert ours, scoped under .cf-shop and
   !important to outrank the theme — same approach the donation field uses for
   the theme's input reset. */
.cf-shop .cf-shop-btn,
.cf-shop a.cf-shop-btn,
.cf-shop button.cf-shop-btn {
    background: #fff !important;
    border: 1px solid var(--cf-border) !important;
    color: var(--cf-ink) !important;
    text-decoration: none !important;
    border-radius: 999px !important;
}
.cf-shop .cf-shop-btn--add,
.cf-shop a.cf-shop-btn--add,
.cf-shop button.cf-shop-btn--add {
    background: var(--cf-ink) !important;
    border-color: var(--cf-ink) !important;
    color: #fff !important;
}
.cf-shop .cf-shop-btn--add:hover,
.cf-shop a.cf-shop-btn--add:hover { background: #1c2a2c !important; }

/* Quantity stepper + form inputs likewise outrank the theme's button/input
   resets so they don't pick up the pink border / wrong background. */
.cf-shop .cf-qty__btn {
    background: transparent !important;
    border: 0 !important;
    color: var(--cf-ink) !important;
    border-radius: 0 !important;
}
.cf-shop .cf-qty__input {
    background: transparent !important;
    border: 0 !important;
    color: var(--cf-ink) !important;
}
.cf-shop .cf-checkout input[type=text],
.cf-shop .cf-checkout input[type=email] {
    background: #fff !important;
    border: 1px solid var(--cf-border) !important;
    color: var(--cf-ink) !important;
    border-radius: 10px !important;
}

/* ---- product grid ------------------------------------------------------ */
.cf-shop__grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1.5rem;
    padding: .5rem 0 2rem;
}

.cf-shop-card {
    background: var(--cf-bg);
    border: 1px solid var(--cf-border);
    border-radius: var(--cf-radius);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform .18s ease, box-shadow .18s ease;
}
.cf-shop-card:hover { transform: translateY(-3px); box-shadow: var(--cf-shadow); }

.cf-shop-card__media {
    position: relative;
    display: block;
    aspect-ratio: 1 / 1;
    background: var(--cf-bg-soft);
    overflow: hidden;
}
.cf-shop-card__media img {
    width: 100%; height: 100%;
    object-fit: cover;
    transition: transform .3s ease;
}
.cf-shop-card:hover .cf-shop-card__media img { transform: scale(1.04); }
.cf-shop-card__placeholder {
    position: absolute; inset: 0;
    background: linear-gradient(135deg, var(--cf-bg-soft), #ece7dd);
}
.cf-shop-card__badge {
    position: absolute; top: .75rem; left: .75rem;
    background: var(--cf-ink); color: #fff;
    font-size: .72rem; font-weight: 700; letter-spacing: .03em;
    text-transform: uppercase;
    padding: .3rem .6rem; border-radius: 999px;
}

.cf-shop-card__body { padding: 1rem 1.1rem 1.2rem; display: flex; flex-direction: column; flex: 1; }
.cf-shop-card__title { font-size: 1.05rem; margin: 0 0 .35rem; line-height: 1.3; }
.cf-shop-card__title a { color: var(--cf-ink); text-decoration: none; }
.cf-shop-card__title a:hover { color: var(--cf-sage-dark); }
.cf-shop-card__excerpt { color: var(--cf-muted); font-size: .9rem; margin: 0 0 1rem; flex: 1; }
.cf-shop-card__foot { display: flex; align-items: center; justify-content: space-between; gap: .75rem; margin-top: auto; }
.cf-shop-card__price { font-size: 1.15rem; font-weight: 700; }

/* ---- product detail ---------------------------------------------------- */
.cf-product { padding: 1rem 0 2.5rem; }
.cf-product__layout {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
    gap: 2.5rem;
    align-items: start;
}
.cf-product__main {
    aspect-ratio: 1 / 1;
    border-radius: var(--cf-radius);
    overflow: hidden;
    background: var(--cf-bg-soft);
    border: 1px solid var(--cf-border);
}
.cf-product__main img { width: 100%; height: 100%; object-fit: cover; }
.cf-product__main--empty { background: linear-gradient(135deg, var(--cf-bg-soft), #ece7dd); }
.cf-product__thumbs { display: flex; gap: .6rem; margin-top: .75rem; flex-wrap: wrap; }
.cf-product__thumb {
    width: 68px; height: 68px; padding: 0;
    border: 2px solid transparent; border-radius: 10px;
    overflow: hidden; cursor: pointer; background: var(--cf-bg-soft);
}
.cf-product__thumb img { width: 100%; height: 100%; object-fit: cover; }
.cf-product__thumb.is-active { border-color: var(--cf-sage); }

.cf-product__title { font-size: 1.9rem; line-height: 1.15; margin: 0 0 .75rem; }
.cf-product__price {
    font-size: 1.6rem; font-weight: 700; display: flex; align-items: baseline; gap: .5rem;
    margin-bottom: 1.25rem;
}
.cf-product__vat { font-size: .85rem; font-weight: 500; color: var(--cf-muted); }
.cf-product__desc { color: #3c4b4e; line-height: 1.65; margin-bottom: 1.25rem; }
.cf-product__desc p:last-child { margin-bottom: 0; }
.cf-product__meta { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1.5rem; }
.cf-product__tag, .cf-product__sku {
    font-size: .8rem; color: var(--cf-muted);
    background: var(--cf-bg-soft); border: 1px solid var(--cf-border);
    padding: .3rem .65rem; border-radius: 999px;
}
.cf-product__buy { display: flex; align-items: center; gap: .9rem; flex-wrap: wrap; }
.cf-product__soldout { color: #a23b3b; font-weight: 600; }
.cf-product__back { margin-top: 1.75rem; }
.cf-product__back a { color: var(--cf-sage-dark); text-decoration: none; font-weight: 600; }
.cf-product__back a:hover { text-decoration: underline; }

/* ---- quantity stepper -------------------------------------------------- */
.cf-qty {
    display: inline-flex; align-items: center;
    border: 1px solid var(--cf-border); border-radius: 999px;
    overflow: hidden; background: #fff;
}
.cf-qty__btn {
    width: 40px; height: 44px; border: 0; background: transparent;
    font-size: 1.3rem; line-height: 1; cursor: pointer; color: var(--cf-ink);
}
.cf-qty__btn:hover { background: var(--cf-bg-soft); }
.cf-qty__input {
    width: 48px; height: 44px; border: 0; text-align: center;
    font: inherit; font-weight: 600; background: transparent; color: var(--cf-ink);
    -moz-appearance: textfield;
}
.cf-qty__input::-webkit-outer-spin-button,
.cf-qty__input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

/* ---- cart -------------------------------------------------------------- */
.cf-cart { padding: 1rem 0 2.5rem; }
.cf-cart__layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 2rem;
    align-items: start;
}
.cf-cart__items { display: flex; flex-direction: column; gap: .9rem; }

.cf-cart-item {
    display: grid;
    grid-template-columns: 84px 1fr auto auto auto;
    align-items: center;
    gap: 1rem;
    background: #fff;
    border: 1px solid var(--cf-border);
    border-radius: var(--cf-radius);
    padding: .8rem 1rem;
}
.cf-cart-item__media { width: 84px; height: 84px; border-radius: 10px; overflow: hidden; background: var(--cf-bg-soft); display: block; }
.cf-cart-item__media img { width: 100%; height: 100%; object-fit: cover; }
.cf-cart-item__placeholder { display: block; width: 100%; height: 100%; background: linear-gradient(135deg, var(--cf-bg-soft), #ece7dd); }
.cf-cart-item__main { display: flex; flex-direction: column; gap: .25rem; min-width: 0; }
.cf-cart-item__title { font-weight: 600; color: var(--cf-ink); text-decoration: none; }
.cf-cart-item__title:hover { color: var(--cf-sage-dark); }
.cf-cart-item__unit { font-size: .85rem; color: var(--cf-muted); }
.cf-cart-item__subtotal { font-weight: 700; min-width: 80px; text-align: right; }
.cf-cart-item__remove {
    width: 32px; height: 32px; border: 0; border-radius: 50%;
    background: var(--cf-bg-soft); color: var(--cf-muted);
    font-size: 1.25rem; line-height: 1; cursor: pointer;
}
.cf-cart-item__remove:hover { background: #f0e2e2; color: #a23b3b; }

.cf-cart__summary {
    background: var(--cf-bg-soft);
    border: 1px solid var(--cf-border);
    border-radius: var(--cf-radius);
    padding: 1.4rem;
    position: sticky; top: 1.5rem;
}
.cf-cart__summary-title { margin: 0 0 1rem; font-size: 1.2rem; }
.cf-cart__rows { display: flex; flex-direction: column; gap: .55rem; margin-bottom: 1.1rem; }
.cf-cart__row { display: flex; justify-content: space-between; font-size: .95rem; }
.cf-cart__row--vat { color: var(--cf-muted); font-size: .82rem; }
.cf-cart__row--total {
    border-top: 1px solid var(--cf-border);
    margin-top: .35rem; padding-top: .7rem;
    font-size: 1.15rem; font-weight: 700;
}
.cf-cart__continue { display: block; text-align: center; margin-top: .75rem; color: var(--cf-sage-dark); text-decoration: none; font-size: .9rem; }
.cf-cart__continue:hover { text-decoration: underline; }
.cf-cart__empty { text-align: center; padding: 3rem 1rem; display: flex; flex-direction: column; align-items: center; gap: 1.25rem; }
.cf-cart__empty p { color: var(--cf-muted); font-size: 1.1rem; margin: 0; }

/* ---- floating cart button ---------------------------------------------- */
/* Rendered in wp_footer (outside .cf-shop), so colours are explicit here. */
.cf-cart-fab {
    position: fixed; right: 1.5rem; bottom: 1.5rem; z-index: 9998;
    width: 60px; height: 60px; border-radius: 50%;
    background: #28393c; color: #fff;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 8px 24px rgba(40,57,60,.28);
    text-decoration: none;
    transition: transform .15s ease, box-shadow .15s ease;
}
.cf-cart-fab:hover { transform: translateY(-2px); box-shadow: 0 12px 30px rgba(40,57,60,.34); color: #fff; }
.cf-cart-fab:active { transform: translateY(0); }
.cf-cart-fab svg { width: 26px; height: 26px; }
.cf-cart-fab__count {
    position: absolute; top: -4px; right: -4px;
    min-width: 22px; height: 22px; padding: 0 6px;
    border-radius: 11px; background: #d1c5b0; color: #28393c;
    font-size: .75rem; font-weight: 700;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 2px 6px rgba(40,57,60,.2);
}
.cf-cart-fab__count[hidden] { display: none; }

/* ---- toast ------------------------------------------------------------- */
.cf-shop-toast {
    position: fixed; right: 1.5rem; bottom: 5.5rem; z-index: 9999;
    background: var(--cf-ink); color: #fff;
    padding: .85rem 1.2rem; border-radius: 12px;
    box-shadow: 0 10px 30px rgba(40,57,60,.25);
    font-weight: 600; opacity: 0; transform: translateY(12px);
    transition: opacity .2s ease, transform .2s ease;
    pointer-events: none;
}
.cf-shop-toast.is-visible { opacity: 1; transform: translateY(0); }

/* ---- checkout ---------------------------------------------------------- */
.cf-checkout { padding: 1rem 0 2.5rem; }
.cf-checkout__layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: 2rem;
    align-items: start;
}
.cf-checkout__section {
    background: #fff;
    border: 1px solid var(--cf-border);
    border-radius: var(--cf-radius);
    padding: 1.4rem 1.5rem;
    margin-bottom: 1.25rem;
}
.cf-checkout__section h2 { margin: 0 0 1rem; font-size: 1.15rem; }
.cf-checkout .cf-field { margin-bottom: .9rem; }
.cf-checkout .cf-field label { display: block; font-size: .85rem; color: var(--cf-muted); margin-bottom: .3rem; }
.cf-checkout input[type=text],
.cf-checkout input[type=email] {
    width: 100%;
    padding: .7rem .85rem;
    border: 1px solid var(--cf-border);
    border-radius: 10px;
    font: inherit;
    color: var(--cf-ink);
    background: #fff;
}
.cf-checkout input:focus { outline: none; border-color: var(--cf-sage); box-shadow: 0 0 0 3px rgba(135,160,165,.18); }
.cf-field-row { display: flex; gap: .9rem; }
.cf-field-row .cf-field { flex: 1; }
.cf-field--narrow { flex: 0 0 34% !important; }
.cf-field--grow { flex: 1; }
.cf-check { display: flex; align-items: center; gap: .55rem; font-size: .92rem; margin: .4rem 0 .2rem; cursor: pointer; }
.cf-checkout__company, .cf-checkout__shipping { margin-top: 1rem; }
.cf-checkout__summary {
    background: var(--cf-bg-soft);
    border: 1px solid var(--cf-border);
    border-radius: var(--cf-radius);
    padding: 1.4rem;
    position: sticky; top: 1.5rem;
}
.cf-checkout__lines { display: flex; flex-direction: column; gap: .4rem; margin-bottom: .9rem; padding-bottom: .9rem; border-bottom: 1px solid var(--cf-border); }
.cf-checkout__line { display: flex; justify-content: space-between; gap: .75rem; font-size: .9rem; }
.cf-checkout__line span:first-child { color: #3c4b4e; }
.cf-checkout__error {
    background: #fbeaea; border: 1px solid #e9c9c9; color: #97362f;
    border-radius: 10px; padding: .7rem .85rem; font-size: .88rem; margin: .9rem 0;
}

/* ---- order confirmation ------------------------------------------------ */
.cf-confirm { max-width: 640px; padding: 1.5rem 0 3rem; }
.cf-confirm__head { text-align: center; margin-bottom: 1.75rem; }
.cf-confirm__icon {
    width: 64px; height: 64px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.9rem; color: #fff; margin: 0 auto 1rem;
}
.cf-confirm__icon.is-paid { background: #4CAF50; }
.cf-confirm__icon.is-pending { background: var(--cf-sage); }
.cf-confirm__head h1 { font-size: 1.6rem; margin: 0 0 .5rem; }
.cf-confirm__sub { color: var(--cf-muted); margin: 0 0 .75rem; }
.cf-confirm__number { font-weight: 600; }
.cf-confirm__summary {
    background: var(--cf-bg-soft);
    border: 1px solid var(--cf-border);
    border-radius: var(--cf-radius);
    padding: 1.4rem 1.5rem;
}
.cf-confirm__summary h2 { margin: 0 0 1rem; font-size: 1.15rem; }
.cf-confirm__summary .cf-cart__row { padding: .15rem 0; }
.cf-confirm__actions { text-align: center; margin-top: 1.75rem; }

/* ---- account: order history -------------------------------------------- */
.cf-orders { padding: 1rem 0 2.5rem; }
.cf-orders__title { font-size: 1.4rem; margin: 0 0 1.25rem; }
.cf-order-card {
    background: #fff;
    border: 1px solid var(--cf-border);
    border-radius: var(--cf-radius);
    padding: 1.1rem 1.3rem;
    margin-bottom: 1rem;
}
.cf-order-card__head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: .8rem; }
.cf-order-card__number { font-weight: 700; margin-right: .6rem; }
.cf-order-card__date { color: var(--cf-muted); font-size: .85rem; }
.cf-order-card__lines { list-style: none; margin: 0 0 .8rem; padding: 0; border-top: 1px solid var(--cf-border); }
.cf-order-card__lines li { display: flex; justify-content: space-between; gap: .75rem; padding: .45rem 0; font-size: .92rem; border-bottom: 1px solid var(--cf-border); }
.cf-order-card__lines li:last-child { border-bottom: none; }
.cf-order-card__foot { display: flex; justify-content: space-between; font-size: 1.05rem; }

.cf-order-badge {
    display: inline-block; padding: .28rem .7rem; border-radius: 999px;
    font-size: .75rem; font-weight: 700; letter-spacing: .02em; white-space: nowrap;
    background: var(--cf-bg-soft); color: var(--cf-muted);
}
.cf-order-badge--paid,
.cf-order-badge--completed { background: #e3f3e6; color: #2d7a4f; }
.cf-order-badge--pending { background: #fdf3da; color: #8a6d1f; }
.cf-order-badge--processing,
.cf-order-badge--shipped { background: #e4edf0; color: #3a6b7a; }
.cf-order-badge--cancelled,
.cf-order-badge--refunded,
.cf-order-badge--partially_refunded { background: #fbeaea; color: #97362f; }

/* ---- responsive -------------------------------------------------------- */
@media (max-width: 860px) {
    .cf-product__layout { grid-template-columns: 1fr; gap: 1.5rem; }
    .cf-cart__layout { grid-template-columns: 1fr; }
    .cf-cart__summary { position: static; }
    .cf-checkout__layout { grid-template-columns: 1fr; }
    .cf-checkout__summary { position: static; }
}
@media (max-width: 520px) {
    .cf-cart-item {
        grid-template-columns: 64px 1fr auto;
        grid-template-areas:
            "media main remove"
            "media qty  subtotal";
        row-gap: .6rem;
    }
    .cf-cart-item__media { grid-area: media; width: 64px; height: 64px; }
    .cf-cart-item__main { grid-area: main; }
    .cf-cart-item__remove { grid-area: remove; justify-self: end; }
    .cf-cart-item .cf-qty { grid-area: qty; }
    .cf-cart-item__subtotal { grid-area: subtotal; }
}
