/* Etsy Profit Calculator page (page-etsy-profit-calculator.php). Loads after the theme's theme.css.
   Every class starts with pc-. Phone-first; desktop layout lives only inside @media (min-width: 960px).
   Palette: Lemon Yellow #F8ED43, Apricot Orange #F68C50, Cotinga Purple #501345, Slate #34454C on #F7F5F0. */
/* Shared by the Etsy and Amazon calculator pages.
   One background from header to footer (body classes added in inc/etsy-profit-calculator.php and inc/amazon-profit-calculator.php). */
body.ec-page-etsy-calculator, body.ec-page-amazon-calculator, .pc-page { background: #f7f5f0; }
.pc-main {
    --pc-bg: #f7f5f0;
    --pc-card: #ffffff;
    --pc-line: #e8e4dc;
    --pc-field: #f7f5f0;
    --pc-ink: #34454c;        /* slate */
    --pc-muted: #66747a;
    --pc-purple: #501345;
    --pc-purple-soft: #f1e8ef;
    --pc-yellow: #f8ed43;
    --pc-apricot: #f68c50;
    --pc-apricot-soft: #fdeadf;
    background: var(--pc-bg);
    color: var(--pc-ink);
    font: 16px/1.5 "DM Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    padding: 28px 0 64px;
}
.pc-main *, .pc-main *::before, .pc-main *::after { box-sizing: border-box; }
.pc-main [hidden] { display: none !important; } /* fields switched off by the page script */
.pc-main :is(p, h1, h2, h3, dl, dd) { margin: 0; padding: 0; }
/* The theme gives every h1-h4 a serif display face; only the page title keeps it. */
.pc-main h2 { font-family: inherit; line-height: 1.3; letter-spacing: normal; }
.pc-main a { text-decoration: none; }
.pc-wrap { width: min(980px, 100% - 32px); margin-inline: auto; }
.pc-num { font-variant-numeric: tabular-nums; }

/* ---------- Head ---------- */
.pc-head { max-width: 560px; margin: 0 auto 28px; text-align: center; }
.pc-h1 { font-size: clamp(2rem, 8vw, 2.8rem); line-height: 1.1; font-weight: 700; letter-spacing: -.02em; color: var(--pc-purple); }
.pc-lede { margin-top: 12px; color: var(--pc-muted); font-size: 1rem; text-wrap: pretty; }
.pc-main .pc-guide { margin: 10px 0 0; font-size: .95rem; }
.pc-main .pc-guide a { color: var(--pc-purple); font-weight: 700; text-decoration: underline; text-decoration-color: var(--pc-apricot); text-decoration-thickness: 2px; text-underline-offset: 4px; }
.pc-main .pc-h1--apricot { color: var(--pc-apricot); }

/* ---------- Switch between the Amazon and Etsy calculators ---------- */
.pc-switch { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 4px; width: min(100%, 480px); margin: -8px auto 24px; padding: 4px; border: 1px solid var(--pc-line); border-radius: 12px; background: var(--pc-card); }
.pc-main .pc-switch a { display: flex; align-items: center; justify-content: center; min-height: 44px; padding: 6px 10px; border-radius: 9px; font-size: .92rem; font-weight: 600; line-height: 1.25; text-align: center; color: var(--pc-muted); transition: background .2s, color .2s; }
.pc-main .pc-switch a:hover { background: var(--pc-field); color: var(--pc-ink); }
.pc-main .pc-switch a[aria-current="page"] { background: var(--pc-purple); color: #fff; }
.pc-main .pc-switch a:focus-visible { outline: 2px solid var(--pc-purple); outline-offset: 2px; }

/* ---------- Layout + cards ---------- */
.pc-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
.pc-card { background: var(--pc-card); border: 1px solid var(--pc-line); border-radius: 16px; padding: 22px 18px; }
.pc-main .pc-card__title { font-size: .78rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--pc-muted); margin-bottom: 16px; }
.pc-group + .pc-group { margin-top: 24px; padding-top: 22px; border-top: 1px solid var(--pc-line); }

/* ---------- Product type ---------- */
.pc-toggle { display: grid; grid-template-columns: 1fr 1fr; padding: 4px; border-radius: 12px; background: var(--pc-field); margin-bottom: 20px; }
.pc-toggle input { position: absolute; opacity: 0; pointer-events: none; }
.pc-toggle label { display: flex; align-items: center; justify-content: center; min-height: 44px; border-radius: 9px; cursor: pointer; font-weight: 600; color: var(--pc-muted); transition: background .2s, color .2s; -webkit-tap-highlight-color: transparent; }
.pc-toggle input:checked + label { background: var(--pc-ink); color: #fff; }
.pc-toggle label small { display: block; font-size: .72rem; font-weight: 500; letter-spacing: .04em; opacity: .75; }
.pc-toggle label:has(small) { flex-direction: column; padding: 6px 4px; line-height: 1.25; text-align: center; }
.pc-toggle input:focus-visible + label { outline: 2px solid var(--pc-purple); outline-offset: 2px; }

/* ---------- Fields ---------- */
.pc-fields, .pc-field { display: grid; grid-template-columns: minmax(0, 1fr); }
.pc-fields { gap: 16px; }
.pc-field { gap: 6px; min-width: 0; }
.pc-label { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 2px 10px; font-weight: 600; font-size: .95rem; }
.pc-hint { color: var(--pc-muted); font-size: .82rem; font-weight: 400; }
.pc-input { display: flex; align-items: center; border: 1px solid var(--pc-line); border-radius: 10px; background: var(--pc-field); transition: border-color .15s, background .15s; }
.pc-input:focus-within { border-color: var(--pc-purple); background: #fff; }
.pc-input__pre, .pc-input__post { color: var(--pc-muted); padding-left: 14px; flex: none; }
.pc-input__post { padding: 0 14px 0 0; }
.pc-input input, .pc-input select { flex: 1; width: auto; min-width: 0; min-height: 48px; margin: 0; padding: 0 14px 0 6px; border: 0; border-radius: 0; box-shadow: none; background: transparent; font: inherit; font-size: 1.05rem; color: var(--pc-ink); outline: none; }
.pc-input select { padding-left: 14px; cursor: pointer; }
.pc-input--big input { min-height: 56px; font-size: 1.35rem; font-weight: 600; }
.pc-input--big .pc-input__pre { font-size: 1.2rem; }
.pc-input input.pc-pad { padding-left: 14px; }
.pc-field.is-locked { opacity: .55; }
.pc-field.is-locked input { cursor: not-allowed; }
.pc-lock { display: none; padding-right: 14px; color: var(--pc-muted); font-size: .8rem; white-space: nowrap; }
.pc-field.is-locked .pc-lock { display: inline; }
.pc-row2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
.pc-cur { display: inline-flex; gap: 2px; padding: 2px; border-radius: 8px; background: var(--pc-field); font-size: .78rem; }
.pc-cur button { border: 0; border-radius: 6px; background: transparent; padding: 3px 10px; font: inherit; font-weight: 600; color: var(--pc-muted); cursor: pointer; }
.pc-cur button[aria-pressed="true"] { background: var(--pc-ink); color: #fff; }
.pc-cur button:disabled { cursor: not-allowed; }

.pc-check { display: flex; align-items: flex-start; gap: 12px; cursor: pointer; font-size: .95rem; }
.pc-check input { width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--pc-purple); flex: none; }
.pc-check small { display: block; color: var(--pc-muted); font-size: .82rem; }
.pc-free { margin-top: 4px; font-size: .9rem; }
.pc-field.is-locked .pc-free { display: none; }
.pc-field.is-free:not(.is-locked) .pc-input { opacity: .55; }
.pc-field.is-free input:disabled { cursor: not-allowed; }

details.pc-adv { margin-top: 24px; border-top: 1px solid var(--pc-line); }
details.pc-adv > summary { cursor: pointer; list-style: none; padding: 16px 0 0; font-size: .9rem; font-weight: 600; color: var(--pc-muted); display: flex; justify-content: space-between; }
details.pc-adv > summary::-webkit-details-marker { display: none; }
details.pc-adv > summary::after { content: "Show"; font-weight: 400; text-decoration: underline; }
details.pc-adv[open] > summary::after { content: "Hide"; }
.pc-adv__body { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; padding-top: 16px; }
.pc-adv__body .pc-input input, .pc-adv__body .pc-input select { min-height: 42px; font-size: .95rem; }
.pc-adv__body .pc-label { font-size: .85rem; }
.pc-link { justify-self: start; border: 0; background: none; padding: 0; font: inherit; font-size: .85rem; color: var(--pc-purple); text-decoration: underline; cursor: pointer; }

/* ---------- Result: the one big number ---------- */
.pc-hero { border-radius: 14px; background: var(--pc-purple); color: #fff; padding: 22px 20px; }
.pc-hero__label { font-size: .9rem; opacity: .85; }
.pc-hero__big { margin-top: 2px; font-size: clamp(2.6rem, 13vw, 3.4rem); line-height: 1.05; font-weight: 700; letter-spacing: -.02em; color: var(--pc-yellow); }
.pc-hero__sub { margin-top: 8px; font-size: .92rem; color: #e9dce6; }
.pc-hero__usd { display: block; font-size: 1.5rem; font-weight: 700; line-height: 1.2; color: var(--pc-apricot); }
.pc-hero.is-empty .pc-hero__big { font-size: 1.15rem; line-height: 1.4; font-weight: 500; letter-spacing: 0; color: #fff; }
.pc-hero.is-loss .pc-hero__big { color: var(--pc-apricot); }

/* ---------- Two supporting numbers ---------- */
.pc-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 12px; }
.pc-stat { border-radius: 12px; background: var(--pc-field); padding: 12px 14px; }
.pc-stat__label { font-size: .82rem; color: var(--pc-muted); }
.pc-stat__value { font-size: 1.45rem; font-weight: 700; line-height: 1.2; }
.pc-stat--fees { background: var(--pc-apricot-soft); }

/* ---------- Receipt: read top to bottom ---------- */
.pc-receipt { margin-top: 22px; }
.pc-receipt__title { font-size: .78rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--pc-muted); margin-bottom: 6px; }
.pc-lines { display: grid; grid-template-columns: minmax(0, 1fr); }
.pc-line { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 7px 0; font-size: .92rem; color: var(--pc-muted); }
.pc-line dt small { display: block; font-size: .78rem; }
.pc-line dd { white-space: nowrap; font-variant-numeric: tabular-nums; }
.pc-line--sub { margin: 4px 0; padding: 10px 0; border-top: 1px solid var(--pc-line); border-bottom: 1px solid var(--pc-line); color: var(--pc-ink); font-weight: 600; font-size: 1rem; }
.pc-line--sub:last-child { border-bottom: 0; }
.pc-line--final { color: var(--pc-purple); font-weight: 700; font-size: 1.05rem; }
.pc-line[hidden] { display: none; }

.pc-notes { margin-top: 22px; padding: 14px 16px; border-radius: 12px; background: var(--pc-field); }
.pc-notes ul { margin: 0; padding-left: 18px; display: grid; gap: 8px; font-size: .86rem; line-height: 1.5; color: var(--pc-muted); }
.pc-notes li::marker { color: var(--pc-apricot); }
.pc-notes strong { color: var(--pc-ink); font-weight: 600; }

/* ---------- Plain answers below the calculator ---------- */
.pc-noscript { margin: 0 auto 16px; max-width: 560px; padding: 12px 16px; border-radius: 12px; background: var(--pc-apricot-soft); text-align: center; }
.pc-learn { margin-top: 40px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
.pc-sec { background: var(--pc-card); border: 1px solid var(--pc-line); border-radius: 16px; padding: 22px 18px; scroll-margin-top: 110px; }
.pc-sec p { max-width: 68ch; font-size: .98rem; line-height: 1.65; text-wrap: pretty; }
.pc-sec p + p, .pc-sec p + .pc-table-wrap, .pc-sec .pc-table-wrap + p { margin-top: 12px; }
.pc-sec strong { font-weight: 700; color: var(--pc-ink); }
.pc-main .pc-sec__title { font-size: 1.3rem; font-weight: 700; line-height: 1.3; letter-spacing: -.01em; color: var(--pc-purple); margin-bottom: 10px; text-wrap: balance; }
.pc-main .pc-sec__sub { font-family: inherit; font-size: 1rem; font-weight: 700; line-height: 1.4; letter-spacing: normal; color: var(--pc-ink); margin: 0 0 4px; }
.pc-pair { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
.pc-pair > div { padding: 14px 16px; border-radius: 12px; background: var(--pc-field); }

.pc-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.pc-table { width: 100%; border-collapse: collapse; font-size: .9rem; line-height: 1.45; }
.pc-table caption { caption-side: bottom; padding-top: 8px; text-align: left; font-size: .8rem; color: var(--pc-muted); }
.pc-table th, .pc-table td { padding: 9px 8px 9px 0; border-bottom: 1px solid var(--pc-line); text-align: left; vertical-align: top; }
.pc-table thead th { font-size: .72rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--pc-muted); vertical-align: bottom; }
.pc-table tbody th { font-weight: 600; }
.pc-table th small { display: block; font-size: .8rem; font-weight: 400; color: var(--pc-muted); }
.pc-table td { color: var(--pc-muted); }
.pc-table .pc-num, .pc-table--nums td, .pc-table--nums th { text-align: right; font-variant-numeric: tabular-nums; }
.pc-table td.pc-num, .pc-table--nums td, .pc-table--nums tbody th { white-space: nowrap; }
.pc-table--nums th:first-child { text-align: left; }
.pc-table th:last-child, .pc-table td:last-child { padding-right: 0; }
.pc-table tfoot th, .pc-table tfoot td { border-bottom: 0; font-weight: 700; color: var(--pc-ink); }
.pc-table--nums td:last-child { font-weight: 700; color: var(--pc-purple); }

.pc-faq__item { padding: 14px 0; border-top: 1px solid var(--pc-line); }
.pc-faq__item:last-child { padding-bottom: 0; }
.pc-main .pc-faq__q { font-family: inherit; font-size: 1rem; font-weight: 700; line-height: 1.4; letter-spacing: normal; color: var(--pc-ink); margin: 0 0 4px; }
.pc-faq__item p { color: var(--pc-muted); font-size: .95rem; }

/* ---------- Masterclass promo + sources ---------- */
.pc-foot { margin-top: 16px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
.pc-cta { display: grid; grid-template-columns: minmax(0, 1fr); border-radius: 16px; overflow: hidden; background: var(--pc-ink); color: #fff; }
.pc-grid + .pc-cta { margin-top: 16px; } /* the copy right after the calculator */
.pc-cta__media { display: block; }
.pc-cta__img { display: block; width: 100%; max-width: none; height: auto; aspect-ratio: 1344 / 752; object-fit: cover; }
.pc-cta__body { display: grid; gap: 6px; padding: 18px 20px 20px; }
/* A product photo on white (Amazon page): shown whole, not cropped. */
.pc-cta--product .pc-cta__media { background: #fff; }
.pc-cta--product .pc-cta__img { aspect-ratio: 16 / 10; object-fit: contain; padding: 12px; }
.pc-main .pc-cta__title { font-size: 1.2rem; font-weight: 700; line-height: 1.3; color: #fff; }
.pc-main .pc-cta__text { font-size: .92rem; color: rgba(255, 255, 255, .85); }
.pc-cta__btns { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 10px; }
.pc-main .pc-cta__btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 10px 18px; border-radius: 10px; font-weight: 700; text-decoration: none; transition: background .2s, border-color .2s; }
.pc-main .pc-cta__btn--buy { background: var(--pc-yellow); color: var(--pc-purple); }
.pc-main .pc-cta__btn--buy:hover { background: #fff36b; color: var(--pc-purple); }
.pc-main .pc-cta__btn--more { border: 1.5px solid rgba(255, 255, 255, .55); color: #fff; }
.pc-main .pc-cta__btn--more:hover { border-color: #fff; background: rgba(255, 255, 255, .08); color: #fff; }
.pc-main .pc-cta__btn:focus-visible { outline: 2px solid var(--pc-yellow); outline-offset: 2px; }
.pc-cta__btn i { font-style: normal; }
.pc-sources { font-size: .8rem; color: var(--pc-muted); line-height: 1.55; }
.pc-main .pc-sources a { color: var(--pc-ink); text-decoration: underline; }

@media (min-width: 960px) {
    .pc-main { padding: 48px 0 88px; }
    .pc-head { margin-bottom: 36px; }
    .pc-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px; align-items: start; }
    .pc-card, .pc-sec { padding: 28px; }
    .pc-learn { margin-top: 56px; gap: 24px; }
    .pc-main .pc-sec__title { font-size: 1.5rem; }
    .pc-pair { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
    .pc-table { font-size: .95rem; }
    .pc-foot { margin-top: 24px; gap: 24px; }
    .pc-results { position: sticky; top: 112px; } /* clears the theme's fixed header (92px) */
    .pc-cta { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); align-items: center; }
    .pc-grid + .pc-cta { margin-top: 24px; }
    .pc-cta__media, .pc-cta__img { height: 100%; }
    .pc-cta--product .pc-cta__img { aspect-ratio: auto; max-height: 360px; margin: auto; }
    .pc-cta--product .pc-cta__media { display: flex; align-items: center; }
    .pc-cta__body { padding: 28px 32px; gap: 10px; }
    .pc-main .pc-cta__title { font-size: 1.5rem; }
}
@media (prefers-reduced-motion: reduce) { .pc-main * { transition: none !important; } }
