/**
 * CertFlow Helper - product-page date picker (.cfh-pdc).
 *
 * Port of the hub's public-product-calendar.css with every cf-pdc token renamed to
 * cfh-pdc (class names AND custom properties), so the Helper can never collide with
 * CertFlow's own styles if both plugins end up on one site.
 *
 * Show/hide uses the [hidden] attribute and class toggles, never inline display:none -
 * an inline style would lose to the flex/grid rules below.
 */
/* CertFlow — WooCommerce single-product date calendar (cfh-pdc-* namespace) */

.cfh-pdc {
    --cfh-pdc-accent: #6366f1;
    --cfh-pdc-ink: #0f172a;
    --cfh-pdc-border: #e2e8f0;
    --cfh-pdc-muted: #64748b;
    --cfh-pdc-faint: #94a3b8;

    box-sizing: border-box;
    position: relative;
    width: 100%;
    max-width: 100%;
    margin: 0 0 18px;
    padding: 16px;
    border: 1px solid var(--cfh-pdc-border);
    border-radius: 14px;
    background: #fff;
    font-family: inherit;
}
.cfh-pdc *, .cfh-pdc *::before, .cfh-pdc *::after { box-sizing: border-box; }

/* ---------- city filter (custom dropdown) ---------- */
.cfh-pdc-filter { margin-bottom: 14px; }
.cfh-pdc-filter:empty { display: none; }
.cfh-pdc-city { position: relative; }
.cfh-pdc .cfh-pdc-city-toggle {
    display: flex; align-items: center; gap: 9px; width: 100%;
    margin: 0; padding: 10px 14px; min-height: 0; border-radius: 10px;
    border: 1px solid var(--cfh-pdc-border); background: #fff; color: var(--cfh-pdc-ink);
    font-size: 14px; font-weight: 600; line-height: 1.2; cursor: pointer; text-align: left;
    box-shadow: none; transition: border-color .15s ease, box-shadow .15s ease;
}
.cfh-pdc-city-toggle:hover { border-color: #cbd5e1; }
.cfh-pdc-city.is-open .cfh-pdc-city-toggle,
.cfh-pdc-city-toggle:focus-visible { outline: none; border-color: var(--cfh-pdc-accent); box-shadow: 0 0 0 3px rgba(15, 23, 42, 0.07); }
.cfh-pdc .cfh-pdc-city-pin { width: 16px; height: 16px; flex: 0 0 auto; stroke: var(--cfh-pdc-accent) !important; }
.cfh-pdc-city-current { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cfh-pdc .cfh-pdc-city-chevron { width: 16px; height: 16px; flex: 0 0 auto; stroke: #64748b !important; transition: transform .15s ease; }
.cfh-pdc-city.is-open .cfh-pdc-city-chevron { transform: rotate(180deg); }

.cfh-pdc-city-menu {
    position: absolute; z-index: 40; top: calc(100% + 6px); left: 0; right: 0;
    margin: 0; padding: 6px; list-style: none;
    background: #fff; border: 1px solid var(--cfh-pdc-border); border-radius: 12px;
    box-shadow: 0 16px 36px rgba(15, 23, 42, 0.16);
    max-height: 260px; overflow-y: auto;
}
.cfh-pdc-city:not(.is-open) .cfh-pdc-city-menu { display: none; }
.cfh-pdc-city-opt {
    padding: 9px 11px; border-radius: 8px; font-size: 14px; font-weight: 500; color: #334155;
    cursor: pointer; transition: background-color .12s ease, color .12s ease;
}
.cfh-pdc-city-opt:hover { background: #f1f5f9; }
.cfh-pdc-city-opt:focus { outline: none; box-shadow: inset 0 0 0 2px var(--cfh-pdc-accent); }
.cfh-pdc-city-opt.is-selected { background: var(--cfh-pdc-ink); color: #fff; font-weight: 600; }

/* ---------- head / nav ---------- */
.cfh-pdc-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.cfh-pdc-title { margin: 0; font-size: 16px; font-weight: 700; color: var(--cfh-pdc-ink); }
.cfh-pdc .cfh-pdc-nav {
    display: inline-flex; align-items: center; justify-content: center;
    width: 32px; height: 32px; min-height: 0; border-radius: 8px;
    padding: 0; box-shadow: none;
    border: 1px solid var(--cfh-pdc-border); background: #fff; color: #475569; cursor: pointer;
    transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}
.cfh-pdc-nav:hover { background: #f8fafc; color: var(--cfh-pdc-ink); border-color: #cbd5e1; }
/* Hardcode the arrow stroke: the nav button lives inside WooCommerce's form.cart,
   where host themes force button text color — so a currentColor stroke renders
   invisible. A fixed stroke is immune to that override. */
.cfh-pdc .cfh-pdc-ico { width: 18px; height: 18px; stroke: #475569 !important; fill: none !important; }

/* ---------- weekday header ---------- */
.cfh-pdc-weekdays {
    display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px;
    font-size: 11px; font-weight: 600; color: var(--cfh-pdc-faint);
    text-transform: uppercase; letter-spacing: .03em;
}
.cfh-pdc-weekday { text-align: center; padding: 4px 0; }

/* ---------- day grid ---------- */
.cfh-pdc-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; }
.cfh-pdc .cfh-pdc-day {
    position: relative; aspect-ratio: 1 / 1; min-width: 0;
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
    border: none; background: transparent; cursor: pointer;
    border-radius: 9px; font-size: 14px; color: #334155; padding: 2px;
    transition: background-color .15s ease, color .15s ease, box-shadow .15s ease;
}
.cfh-pdc-day-num { line-height: 1; font-weight: 500; }
.cfh-pdc-day-dot { width: 5px; height: 5px; border-radius: 999px; background: var(--cfh-pdc-accent); }

.cfh-pdc-day.is-empty,
.cfh-pdc-day.is-blank { cursor: default; color: #cbd5e1; }
.cfh-pdc-day.is-blank { pointer-events: none; }

.cfh-pdc-day.has-sessions:not(.is-full):not(.is-past):not(.is-selected):hover { background: #f1f5f9; }
.cfh-pdc-day.is-today { box-shadow: inset 0 0 0 1.5px var(--cfh-pdc-accent); }
.cfh-pdc-day.is-selected { background: var(--cfh-pdc-ink); color: #fff; }
.cfh-pdc-day.is-selected .cfh-pdc-day-dot { background: #fff; }

/* full / past dates — greyed and unselectable */
.cfh-pdc-day.is-full,
.cfh-pdc-day.is-past { color: var(--cfh-pdc-faint); cursor: not-allowed; opacity: .55; }
.cfh-pdc-day.is-full .cfh-pdc-day-dot { background: var(--cfh-pdc-faint); }
.cfh-pdc-day[disabled] { cursor: not-allowed; }

/* ---------- selected-date line ---------- */
.cfh-pdc-selected {
    margin: 12px 0 0; padding: 10px 12px;
    background: #f1f5f9; border-radius: 8px;
    font-size: 14px; font-weight: 600; color: var(--cfh-pdc-ink);
}
.cfh-pdc-selected[hidden] { display: none; }

/* ---------- session chooser (multi-session days) ---------- */
.cfh-pdc-sessions { display: flex; flex-direction: column; gap: 6px; margin-top: 12px; }
.cfh-pdc-sessions[hidden] { display: none; }
.cfh-pdc-sessions-label { margin: 0 0 2px; font-size: 12px; font-weight: 600; color: var(--cfh-pdc-muted); }
.cfh-pdc .cfh-pdc-session {
    display: flex; align-items: center; width: 100%;
    margin: 0; padding: 10px 12px; min-height: 0; border-radius: 9px;
    border: 1px solid var(--cfh-pdc-border); background: #fff; color: var(--cfh-pdc-ink);
    font-size: 14px; font-weight: 600; line-height: 1.2; cursor: pointer; text-align: left;
    box-shadow: none; transition: border-color .15s ease, background-color .15s ease;
}
.cfh-pdc-session:hover { border-color: #cbd5e1; background: #f8fafc; }
.cfh-pdc-session.is-active { border-color: var(--cfh-pdc-accent); background: rgba(15, 23, 42, 0.03); box-shadow: inset 0 0 0 1px var(--cfh-pdc-accent); }
.cfh-pdc-session:focus-visible { outline: none; box-shadow: inset 0 0 0 2px var(--cfh-pdc-accent); }

/* ---------- "can't find a date?" contact link ---------- */
.cfh-pdc .cfh-pdc-cta {
    display: flex; align-items: center; justify-content: center; gap: 6px;
    margin-top: 12px; padding: 10px 12px;
    border: 1px dashed var(--cfh-pdc-border); border-radius: 9px;
    color: var(--cfh-pdc-muted); font-size: 13px; font-weight: 600;
    text-decoration: none; cursor: pointer;
    transition: color .15s ease, border-color .15s ease, background-color .15s ease;
}
.cfh-pdc .cfh-pdc-cta:hover { color: var(--cfh-pdc-accent); border-color: var(--cfh-pdc-accent); background: rgba(15, 23, 42, 0.02); }
.cfh-pdc .cfh-pdc-cta-arrow { width: 15px; height: 15px; flex: 0 0 auto; stroke: currentColor; fill: none; }

/* Add-to-cart lock cue. The button is a sibling rendered by the WooCommerce
   template (outside .cfh-pdc), so this rule is class-gated, not descendant-scoped. */
.single_add_to_cart_button.cfh-pdc-locked { opacity: .55; cursor: not-allowed; }
