/* MCF Christmas Catalog */

body.mcf-christmas-context {
    --mcf-accent: #213e77;      /* theme navy */
    --mcf-orange: #f18d21;      /* theme cart / checkout buttons */
    --mcf-orange-dark: #d47512;
    --mcf-border: #e3ddd3;
    --mcf-muted: #6b6259;
    --mcf-surface: #faf7f2;
    --mcf-radius: 8px;
}

/* ---------------------------------------------------------------------
 * Header (Christmas pages only)
 * ------------------------------------------------------------------- */

/* Drop the "Back to MCFUS.org" row once the sticky header is scrolled. */
.mcf-christmas-context .fl-theme-builder-header-scrolled .fl-node-excty5zvisng { display: none; }

/* Quieter "Donate Now" so it doesn't compete with the gifts. */
.mcf-christmas-context .fl-module-menu .menu .mcf-menu-quiet > a {
    font-size: 12px;
    font-weight: 400;
    color: #7a7f88;
    text-transform: none;
    letter-spacing: 0;
}

/* ---------------------------------------------------------------------
 * Catalog page: hero and intro (page content blocks)
 * ------------------------------------------------------------------- */

body.mcf-christmas-page { overflow-x: clip; }
.mcf-christmas-page .fl-post-header { display: none; }

.mcf-christmas-page figure.mcf-hero {
    width: 100vw;
    max-width: 100vw;
    height: clamp(220px, 30vw, 460px);
    margin: -40px 0 32px calc(50% - 50vw);
    overflow: hidden;
}
.mcf-christmas-page figure.mcf-hero img {
    display: block;
    width: 100%;
    max-width: none;
    height: 100%;
    object-fit: cover;
    object-position: 50% 60%;
}

.mcf-intro {
    max-width: 720px;
    margin: 0 auto 32px;
}
.mcf-intro .mcf-intro__title {
    margin: 0 0 4px;
    text-align: center;
}
.mcf-intro .mcf-intro__subtitle {
    margin: 0 0 24px;
    text-align: center;
    font-size: 20px;
    font-weight: 600;
    color: var(--mcf-accent);
}

/* ---------------------------------------------------------------------
 * Cart summary and Complete Twelve Days banner
 * ------------------------------------------------------------------- */

.mcf-cart-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px 16px;
    margin: 0 0 24px;
    padding: 12px 16px;
    background: #fff;
    border: 1px solid var(--mcf-border);
    border-radius: var(--mcf-radius);
    box-shadow: 0 4px 12px rgba(0, 0, 0, .06);
}
.mcf-cart-bar__summary { font-weight: 600; }
.mcf-cart-bar__actions { display: flex; align-items: center; gap: 16px; }
.mcf-cart-bar__link { text-decoration: underline; }

.mcf-complete-banner {
    display: grid;
    gap: 4px;
    margin: 0 0 32px;
    padding: 20px 24px;
    background: var(--mcf-surface);
    border: 1px solid var(--mcf-border);
    border-left: 6px solid var(--mcf-orange);
    border-radius: var(--mcf-radius);
    color: inherit;
    text-decoration: none;
}
.mcf-complete-banner:hover,
.mcf-complete-banner:focus { color: inherit; text-decoration: none; border-color: var(--mcf-orange); }
.mcf-complete-banner__eyebrow {
    font-size: 13px;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--mcf-muted);
}
.mcf-complete-banner__title { font-size: 22px; font-weight: 700; color: var(--mcf-accent); }
.mcf-complete-banner__cta { margin-top: 4px; font-weight: 700; color: var(--mcf-orange-dark); }

/* ---------------------------------------------------------------------
 * Notices ("added to your cart", honoree errors): compact, card-sized
 * ------------------------------------------------------------------- */

.mcf-gift__notices { margin: 4px 0 12px; }
.mcf-catalog__notices { margin: 0 0 24px; }
.mcf-catalog div.woocommerce-message,
.mcf-catalog ul.woocommerce-error,
.mcf-catalog div.woocommerce-info {
    position: relative;
    margin: 0;
    padding: 10px 14px 10px 40px;
    border: 1px solid;
    border-radius: 6px;
    font-size: 15px;
    line-height: 1.45;
    list-style: none;
    box-shadow: none;
}
.mcf-catalog div.woocommerce-message {
    background: #f3f8ea;
    border-color: #cfe3ae;
    color: #2f3b1c;
}
.mcf-catalog ul.woocommerce-error {
    background: #fdf2f1;
    border-color: #f0c7c2;
    color: #7d1d14;
}
.mcf-catalog div.woocommerce-info {
    background: #eef3fa;
    border-color: #c9d7ec;
    color: #213e77;
}
.mcf-catalog div.woocommerce-message::before,
.mcf-catalog ul.woocommerce-error::before,
.mcf-catalog div.woocommerce-info::before {
    /* Plain CSS badge instead of the WooCommerce icon font. */
    content: '\2713';
    position: absolute;
    top: 12px;
    left: 13px;
    width: 18px;
    height: 18px;
    margin: 0;
    border-radius: 50%;
    background: #6f9b22;
    color: #fff;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 11px;
    font-weight: 700;
    line-height: 18px;
    text-align: center;
}
.mcf-catalog ul.woocommerce-error::before { content: '!'; background: #c0392b; font-size: 12px; }
.mcf-catalog div.woocommerce-info::before { content: 'i'; background: var(--mcf-accent); }
.mcf-catalog ul.woocommerce-error li { margin: 0; padding: 0; }
.mcf-catalog ul.woocommerce-error li + li { margin-top: 4px; }

/* "View cart" as a plain link instead of a floating button.
   !important: the theme styles .woocommerce-message .button with a navy fill. */
.mcf-catalog div.woocommerce-message a.button.wc-forward {
    float: none !important;
    display: inline !important;
    margin: 0 0 0 4px !important;
    padding: 0 !important;
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
    color: var(--mcf-accent) !important;
    font-size: inherit !important;
    font-weight: 700;
    line-height: inherit !important;
    text-decoration: underline;
    text-transform: none;
    white-space: nowrap;
}
.mcf-catalog div.woocommerce-message a.button.wc-forward::after { content: ' \2192'; }
.mcf-catalog div.woocommerce-message a.button.wc-forward:hover,
.mcf-catalog div.woocommerce-message a.button.wc-forward:focus {
    color: var(--mcf-orange-dark) !important;
}

/* ---------------------------------------------------------------------
 * Gift grid: 3 per row on desktop, 2 on tablets, 1 on phones
 * ------------------------------------------------------------------- */

.mcf-catalog__list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 24px;
}
.mcf-catalog__notices:empty,
.mcf-gift__notices:empty,
.mcf-catalog .woocommerce-notices-wrapper:empty { display: none; }

.mcf-gift {
    display: flex;
    flex-direction: column;
    margin: 0;
    background: #fff;
    border: 1px solid var(--mcf-border);
    border-radius: var(--mcf-radius);
    overflow: hidden;
    scroll-margin-top: 140px; /* clears the theme's fixed header */
}

/* 5:4 frame, photo fills it from the center. MCF crops the photos to 5:4
   (e.g. 1200 x 960) so what they upload is exactly what shows. */
.mcf-gift__media {
    position: relative;
    aspect-ratio: 5 / 4;
    overflow: hidden;
    background: #efe9df;
}
.mcf-gift__media img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: 50% 50%;
}

.mcf-gift__body {
    display: flex;
    flex-direction: column;
    flex: 1;
    padding: 18px 20px 20px;
    font-size: 16px;
    line-height: 1.5;
}
.mcf-gift__eyebrow {
    margin: 0 0 6px;
    font-size: 11px;
    line-height: 1.6;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--mcf-muted);
}
.mcf-gift__day {
    display: inline-block;
    margin-right: 6px;
    padding: 2px 8px;
    border-radius: 999px;
    background: var(--mcf-accent);
    color: #fff;
    font-weight: 700;
}
.mcf-catalog .mcf-gift__title {
    margin: 0 0 8px;
    font-size: 24px;
    line-height: 1.2;
    text-transform: uppercase;
    letter-spacing: .04em;
}
.mcf-gift__tagline p {
    margin: 0 0 8px;
    font-size: 17px;
    line-height: 1.4;
    font-weight: 600;
}
.mcf-gift__description p { margin: 0 0 10px; }
.mcf-gift__description ul { margin: 0 0 10px 1.2em; }

/* "Read more" (JS adds .is-clamped only when the text overflows) */
.mcf-gift__description.is-clamped {
    position: relative;
    max-height: 4.5em; /* 3 lines */
    overflow: hidden;
}
.mcf-gift__description.is-clamped::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 2em;
    background: linear-gradient(rgba(255, 255, 255, 0), #fff);
}
.mcf-catalog button.mcf-gift__more {
    align-self: flex-start;
    margin: 0 0 8px;
    padding: 0;
    background: none;
    border: 0;
    box-shadow: none;
    color: var(--mcf-accent);
    font-size: inherit;
    font-weight: 600;
    text-decoration: underline;
    text-transform: none;
    cursor: pointer;
}

/* The Complete Twelve Days: full-width feature card, photo band on top,
   details left and gift options right. */
.mcf-gift--complete {
    grid-column: 1 / -1;
    background: var(--mcf-surface);
    border: 2px solid var(--mcf-orange);
}
.mcf-gift--complete .mcf-gift__media { aspect-ratio: 2 / 1; } /* crop to 2:1, e.g. 2000 x 1000 */
.mcf-gift--complete .mcf-gift__body {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    column-gap: 40px;
    align-content: start;
    padding: 24px 28px;
}
.mcf-gift--complete .mcf-gift__body > * { grid-column: 1; }
.mcf-gift--complete .mcf-gift__body > .mcf-gift__form {
    grid-column: 2;
    grid-row: 1 / span 6;
    align-self: start;
    margin-top: 0;
    padding-top: 0;
}
.mcf-catalog .mcf-gift--complete .mcf-gift__title { font-size: 26px; }
.mcf-gift--complete .mcf-gift__description ul { columns: 2; column-gap: 16px; margin-left: 1.1em; }
.mcf-gift--complete .mcf-gift__description li { break-inside: avoid; }

/* ---------------------------------------------------------------------
 * Options and add to cart
 * ------------------------------------------------------------------- */

.mcf-gift__form { margin-top: auto; padding-top: 8px; }
.mcf-gift__options {
    margin: 0 0 14px;
    padding: 0;
    border: 0;
    display: grid;
    gap: 8px;
}
.mcf-gift__legend {
    margin-bottom: 6px;
    padding: 0;
    font-size: 15px;
    font-weight: 700;
}
.mcf-option {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
    padding: 8px 12px;
    border: 1px solid var(--mcf-border);
    border-radius: var(--mcf-radius);
    background: #fff;
    cursor: pointer;
    font-size: 15px;
    line-height: 1.35;
    font-weight: normal;
}
.mcf-option:has(input:checked) {
    border-color: var(--mcf-accent);
    box-shadow: inset 0 0 0 1px var(--mcf-accent);
}
.mcf-option input { margin: 0; accent-color: var(--mcf-accent); }
.mcf-option__name { flex: 1; }
.mcf-option__price { font-weight: 700; white-space: nowrap; }

.mcf-gift__actions {
    display: flex;
    align-items: flex-end;
    gap: 10px;
}
.mcf-catalog .mcf-gift__quantity { flex: 0 0 auto; margin: 0; }
.mcf-gift__quantity span {
    /* Visually hidden; the input keeps its accessible label. */
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}
.mcf-catalog .mcf-gift__quantity input[type="number"] {
    width: 60px;
    min-width: 0;
    height: 48px;
    padding: 4px;
    text-align: center;
    box-sizing: border-box;
}

.mcf-catalog .mcf-gift__form button.button.mcf-button,
.mcf-catalog .mcf-cart-bar a.button.mcf-button {
    background: var(--mcf-orange);
    border: 0;
    color: #fff;
    border-radius: 4px;
    font-weight: 700;
}
.mcf-catalog .mcf-gift__form button.button.mcf-button {
    flex: 1 1 auto;
    min-width: 0;
    height: 48px;
    padding: 0 20px;
    font-size: 17px;
    line-height: 48px;
    white-space: nowrap;
}
.mcf-catalog .mcf-gift__form button.button.mcf-button:hover,
.mcf-catalog .mcf-gift__form button.button.mcf-button:focus,
.mcf-catalog .mcf-cart-bar a.button.mcf-button:hover,
.mcf-catalog .mcf-cart-bar a.button.mcf-button:focus {
    background: var(--mcf-orange-dark);
    color: #fff;
}

/* ---------------------------------------------------------------------
 * Honoree fields
 * ------------------------------------------------------------------- */

.mcf-honoree { margin: 0 0 14px; }
.single-product .mcf-honoree { margin-top: 16px; }
.mcf-honoree__toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    cursor: pointer;
}
.mcf-honoree__checkbox { margin: 0; accent-color: var(--mcf-accent); }
.mcf-honoree__fields {
    display: none;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 8px 12px;
    margin-top: 12px;
    padding: 14px;
    background: var(--mcf-surface);
    border-radius: var(--mcf-radius);
}
.mcf-gift--complete .mcf-honoree__fields { background: #fff; }
.mcf-honoree.is-open .mcf-honoree__fields,
.mcf-honoree:has(.mcf-honoree__checkbox:checked) .mcf-honoree__fields { display: grid; }
.mcf-honoree__note { grid-column: 1 / -1; margin: 0 0 4px; color: var(--mcf-muted); font-size: .95em; }
.mcf-honoree__note--limit { margin-top: -4px; font-size: .85em; font-style: italic; }
.mcf-honoree__field { grid-column: 1 / -1; margin: 0; }
.mcf-honoree__field--state,
.mcf-honoree__field--postcode { grid-column: span 3; }
.mcf-honoree__field label { display: block; margin-bottom: 4px; font-size: .9em; font-weight: 600; }
.mcf-honoree__field input,
.mcf-honoree__field select { width: 100%; max-width: none; box-sizing: border-box; }
.mcf-honoree__field select {
    /* The theme styles text inputs but not selects; match them. */
    height: 34px;
    padding: 6px 12px;
    border: 1px solid #e6e6e6;
    border-radius: 4px;
    background-color: #fcfcfc;
    font-size: 14px;
    color: #414142;
}

/* ---------------------------------------------------------------------
 * Cart page
 * ------------------------------------------------------------------- */

.mcf-keep-choosing { margin: 0 0 16px; }
.mcf-keep-choosing a { font-weight: 600; }

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

@media (max-width: 1023px) {
    .mcf-catalog__list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 767px) {
    .mcf-catalog__list { grid-template-columns: 1fr; gap: 20px; }
    .mcf-gift--complete .mcf-gift__body { display: flex; padding: 20px; }
    .mcf-catalog .mcf-gift--complete .mcf-gift__title { font-size: 22px; }
    .mcf-gift--complete .mcf-gift__body > .mcf-gift__form { margin-top: 8px; }
    .mcf-christmas-page figure.mcf-hero { margin-top: -20px; margin-bottom: 24px; }
    .mcf-intro .mcf-intro__title { font-size: 36px; line-height: 1.15; }
    .mcf-intro .mcf-intro__subtitle { font-size: 17px; }
}
