/* =========================================================
   commemoration.css — ioann-presnya поминовение онлайн block styles
   Figma 1:2178 / 1:2182
   ========================================================= */

/* ─── Root section ─── */
.commemoration--ioann-presnya {
    width: 100%;
    box-sizing: border-box;
    padding: 48px 0 64px;
}

/* ─── Empty state ─── */
.commemoration--ioann-presnya .commemoration__empty {
    font-family: 'Golos Text', 'Golos', Arial, sans-serif;
    font-size: 16px;
    color: #aaa;
    text-align: center;
    padding: 48px 0;
    margin: 0;
}

/* ─── Form grid: head row spans all 3 cols, then 3 equal columns ─── */
.commemoration--ioann-presnya .commemoration__form {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    column-gap: 66px;
    width: 100%;
    box-sizing: border-box;
}

/* Hidden inputs must not affect layout */
.commemoration--ioann-presnya .commemoration__form > input[type="hidden"] {
    display: none;
}

/* ─── Header row (spans all 3 columns) ─── */
.commemoration--ioann-presnya .commemoration__head {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    column-gap: 66px;
    margin-bottom: 24px;
}

/* ─── Column titles ─── */
.commemoration--ioann-presnya .commemoration__col-title {
    margin: 0;
    text-align: center;
    font-family: 'Cormorant Garamond', serif;
    font-weight: 300;
    font-size: 36px;
    line-height: 1;
    letter-spacing: -0.396px;
    text-transform: uppercase;
    color: var(--ip-text);
}

/* --center modifier: harmless no-op since all are centered above */
.commemoration--ioann-presnya .commemoration__col-title--center {
    text-align: center;
}

/* Per-column titles live inside each column and only show on mobile,
   where the shared head row is hidden so each title sits above its block. */
.commemoration--ioann-presnya .commemoration__col-title--mobile {
    display: none;
}

/* ─── Column wrappers ─── */
.commemoration--ioann-presnya .commemoration__col {
    display: flex;
    flex-direction: column;
    gap: 0;
}

/* ─── Step bars (dark numbered headers) ─── */
.commemoration--ioann-presnya .commemoration__step {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #1b1b1b;
    color: #fff;
    padding: 16px 0 16px 36px;
    box-sizing: border-box;
    margin-bottom: 0;
}

.commemoration--ioann-presnya .commemoration__step-num {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 500px;
    /* Dark circle with thin white ring on the dark bar to match Figma render */
    background: #333;
    border: 1px solid #fff;
    color: #fff;
    font-family: 'Golos Text', 'Golos', Arial, sans-serif;
    font-size: 12px;
    font-weight: 600;
    line-height: 1;
}

.commemoration--ioann-presnya .commemoration__step-text {
    font-family: 'Golos Text', 'Golos', Arial, sans-serif;
    font-size: 14px;
    line-height: 1.3;
    color: #fff;
}

/* ─── Accordion (col 1) ─── */
.commemoration--ioann-presnya .commemoration__accordion {
    border-top: 1px solid #cecece;
}

.commemoration--ioann-presnya .commemoration__accordion-item {
    border-bottom: 1px solid #cecece;
}

.commemoration--ioann-presnya .commemoration__accordion-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 16px 36px;
    background: transparent;
    border: none;
    cursor: pointer;
    text-align: left;
    box-sizing: border-box;
}

.commemoration--ioann-presnya .commemoration__accordion-trigger:hover {
    background: #f9f9f9;
}

.commemoration--ioann-presnya .commemoration__accordion-label {
    font-family: 'Cormorant', 'Cormorant Garamond', Georgia, serif;
    font-weight: 700;
    font-size: 24px;
    line-height: 1;
    color: #1b1b1b;
}

/* ─── Chevron icon (CSS-only chevron via border trick) ─── */
.commemoration--ioann-presnya .commemoration__accordion-chevron {
    flex-shrink: 0;
    display: inline-block;
    width: 10px;
    height: 10px;
    border-right: 2px solid #1b1b1b;
    border-bottom: 2px solid #1b1b1b;
    transform: rotate(45deg);
    transition: transform 0.2s ease;
    margin-bottom: 3px;
}

/* Open state: rotate chevron up; driven by JS (.is-open) or CSS :has() */
.commemoration--ioann-presnya .commemoration__accordion-item.is-open
    .commemoration__accordion-chevron {
    transform: rotate(-135deg);
    margin-bottom: -3px;
}

/* Collapsed body */
.commemoration--ioann-presnya .commemoration__accordion-body {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.25s ease;
}

/* Expanded body via .is-open class (set by task #49 JS) */
.commemoration--ioann-presnya .commemoration__accordion-item.is-open
    .commemoration__accordion-body {
    max-height: 600px;
}

/* Option rows inside expanded accordion body */
.commemoration--ioann-presnya .commemoration__option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 36px 12px 52px;
    cursor: pointer;
    transition: background 0.15s;
    border-bottom: 1px solid #f0f0f0;
}

.commemoration--ioann-presnya .commemoration__option:last-child {
    border-bottom: none;
}

.commemoration--ioann-presnya .commemoration__option:hover {
    background: #f5f5f5;
}

/* Selected option state (toggled by task #49 JS) */
.commemoration--ioann-presnya .commemoration__option.is-selected {
    background: #f0f0f0;
}

.commemoration--ioann-presnya .commemoration__option-name {
    font-family: 'Golos Text', 'Golos', Arial, sans-serif;
    font-size: 15px;
    color: #333;
    line-height: 1.3;
}

.commemoration--ioann-presnya .commemoration__option-price {
    font-family: 'Golos Text', 'Golos', Arial, sans-serif;
    font-size: 15px;
    color: #555;
    white-space: nowrap;
    margin-left: 12px;
}

/* ─── Names column (col 2) ─── */
/*
 * NOTE: The Figma (1:2192) shows 10 numbered rows (1. through 10.) with per-row
 * dividers and numeric prefixes. The task #48 markup uses a single <textarea>
 * (not 10 discrete inputs), so task #49 JS can parse names by splitting on
 * newlines / commas / semicolons. CSS cannot inject per-line "1."–"10." numeral
 * prefixes or per-line dividers inside a textarea's value. Instead we approximate
 * the ruled-row look with a repeating-linear-gradient background. The missing
 * numeral prefixes are an intentional deviation driven by the #48 markup decision.
 */
.commemoration--ioann-presnya .commemoration__names {
    width: 100%;
    box-sizing: border-box;
    font-family: 'Golos Text', 'Golos', Arial, sans-serif;
    font-size: 16px;
    /* line-height matches the repeating-gradient pitch so typed text sits on ruled lines.
       Row pitch is 2.125em (34px) — 8px taller than the original 1.625em/26px. */
    line-height: 2.125;
    color: #1b1b1b;
    background-color: #fff;
    /* Repeating horizontal divider lines to approximate the 10-row Figma layout */
    background-image: repeating-linear-gradient(
        to bottom,
        transparent 0px,
        transparent calc(2.125em - 1px),
        #cecece calc(2.125em - 1px),
        #cecece 2.125em
    );
    border: 1px solid #cecece;
    border-radius: 0;
    resize: vertical;
    outline: none;
    padding: 8px 36px;
    /* Height to show ~10 rows: 10 × line-height(34px) + 2×padding */
    min-height: calc(10 * 2.125em + 16px);
    margin-top: 0;
}

.commemoration--ioann-presnya .commemoration__names::placeholder {
    color: #bdbdbd;
}

.commemoration--ioann-presnya .commemoration__names:focus {
    border-color: #579ca0;
    outline: none;
}

/* Subtotal band */
.commemoration--ioann-presnya .commemoration__subtotal {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f5f5f5;
    padding: 12px 36px;
    font-family: 'Golos Text', 'Golos', Arial, sans-serif;
    font-size: 16px;
    color: #1b1b1b;
    gap: 4px;
    margin-top: 0;
}

.commemoration--ioann-presnya .commemoration__subtotal-value {
    font-family: 'Cormorant', 'Cormorant Garamond', Georgia, serif;
    font-weight: 700;
    font-size: 20px;
    color: #a33d25;
}

/* Add button (teal filled, 1:2194) */
.commemoration--ioann-presnya .commemoration__add {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    margin-top: 16px;
    padding: 16px 20px;
    background: #579ca0;
    color: #fff;
    border: none;
    border-radius: 5px;
    font-family: 'Golos Text', 'Golos', Arial, sans-serif;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
    box-sizing: border-box;
    min-height: 48px;
}

.commemoration--ioann-presnya .commemoration__add:hover {
    background: #4a8589;
}

/* Icon space inside add button (task #49 will supply SVG/glyph; reserve space here) */
.commemoration--ioann-presnya .commemoration__add-icon {
    display: inline-block;
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

/* ─── Order column (col 3) ─── */
.commemoration--ioann-presnya .commemoration__summary {
    flex: 1;
    min-height: 80px;
}

.commemoration--ioann-presnya .commemoration__summary-empty {
    font-family: 'Golos Text', 'Golos', Arial, sans-serif;
    font-size: 15px;
    color: #aaa;
    text-align: center;
    padding: 24px 16px;
    margin: 0;
}

/* JS-rendered order summary lines */
.commemoration--ioann-presnya .commemoration__summary-kind {
    font-family: 'Cormorant', 'Cormorant Garamond', Georgia, serif;
    font-size: 18px;
    font-weight: 700;
    color: #1b1b1b;
    margin: 8px 0 4px;
    overflow-wrap: anywhere;
}

.commemoration--ioann-presnya .commemoration__summary-option {
    font-family: 'Golos Text', 'Golos', Arial, sans-serif;
    font-size: 15px;
    color: #333;
    margin: 0 0 4px;
    overflow-wrap: anywhere;
}

.commemoration--ioann-presnya .commemoration__summary-names {
    font-family: 'Golos Text', 'Golos', Arial, sans-serif;
    font-size: 14px;
    color: #555;
    margin: 0 0 4px;
    overflow-wrap: anywhere;
    white-space: pre-wrap;
}

.commemoration--ioann-presnya .commemoration__summary-price {
    font-family: 'Golos Text', 'Golos', Arial, sans-serif;
    font-size: 15px;
    font-weight: 700;
    color: #a33d25;
    text-align: right;
    margin: 0 0 8px;
    overflow-wrap: anywhere;
}

/* "Дополнительно" collapsible row */
.commemoration--ioann-presnya .commemoration__extra {
    border-top: 1px solid #cecece;
    border-bottom: 1px solid #cecece;
}

.commemoration--ioann-presnya .commemoration__extra-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 16px 36px;
    background: transparent;
    border: none;
    cursor: pointer;
    text-align: left;
    box-sizing: border-box;
}

.commemoration--ioann-presnya .commemoration__extra-trigger:hover {
    background: #f9f9f9;
}

.commemoration--ioann-presnya .commemoration__extra-label {
    font-family: 'Cormorant', 'Cormorant Garamond', Georgia, serif;
    font-weight: 700;
    font-size: 24px;
    line-height: 1;
    color: #1b1b1b;
}

/* Extra chevron (same style as accordion chevron) */
.commemoration--ioann-presnya .commemoration__extra-chevron {
    flex-shrink: 0;
    display: inline-block;
    width: 10px;
    height: 10px;
    border-right: 2px solid #1b1b1b;
    border-bottom: 2px solid #1b1b1b;
    transform: rotate(45deg);
    transition: transform 0.2s ease;
    margin-bottom: 3px;
}

.commemoration--ioann-presnya .commemoration__extra.is-open
    .commemoration__extra-chevron {
    transform: rotate(-135deg);
    margin-bottom: -3px;
}

.commemoration--ioann-presnya .commemoration__extra-body {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.25s ease;
    padding: 0 36px;
}

.commemoration--ioann-presnya .commemoration__extra.is-open
    .commemoration__extra-body {
    max-height: 400px;
    padding: 12px 36px;
}

/* Total band */
.commemoration--ioann-presnya .commemoration__total {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #f5f5f5;
    padding: 12px 36px;
    font-family: 'Cormorant', 'Cormorant Garamond', Georgia, serif;
    font-weight: 700;
    font-size: 20px;
    color: #1b1b1b;
    margin-top: 4px;
}

.commemoration--ioann-presnya .commemoration__total-value {
    color: #a33d25;
}

/* Outline button — "Добавить поминовения" (1:2208) */
.commemoration--ioann-presnya .commemoration__more {
    display: block;
    width: 100%;
    margin-top: 16px;
    padding: 16px 20px;
    background: transparent;
    color: #1b1b1b;
    border: 1px solid #1b1b1b;
    border-radius: 5px;
    font-family: 'Golos Text', 'Golos', Arial, sans-serif;
    font-size: 14px;
    font-weight: 500;
    text-align: center;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
    box-sizing: border-box;
    min-height: 48px;
}

.commemoration--ioann-presnya .commemoration__more:hover {
    background: #1b1b1b;
    color: #fff;
}

/* Pay button — teal filled, "Оплатить →" (1:2210) */
.commemoration--ioann-presnya .commemoration__pay {
    display: block;
    width: 100%;
    margin-top: 12px;
    padding: 16px 20px;
    background: #579ca0;
    color: #fff;
    border: none;
    border-radius: 5px;
    font-family: 'Golos Text', 'Golos', Arial, sans-serif;
    font-size: 14px;
    font-weight: 500;
    text-align: center;
    cursor: pointer;
    transition: background 0.2s;
    box-sizing: border-box;
    min-height: 48px;
}

.commemoration--ioann-presnya .commemoration__pay:hover {
    background: #4a8589;
}

/* Consent — required agreement checkbox (mirrors .help-us__agreement) */
.commemoration--ioann-presnya .commemoration__consent {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-top: 10px;
    font-family: 'Golos Text', 'Golos', Arial, sans-serif;
    font-size: 12px;
    color: #999;
    line-height: 1.4;
    cursor: pointer;
    text-align: left;
}

.commemoration--ioann-presnya .commemoration__consent input[type="checkbox"] {
    flex-shrink: 0;
    margin-top: 2px;
}

.commemoration--ioann-presnya .commemoration__consent a {
    color: #579ca0;
    text-decoration: underline;
}

.commemoration--ioann-presnya .commemoration__consent a:hover {
    color: #4a8589;
}

/* ─── Responsive: single-column stack below ~900px ─── */
@media (max-width: 900px) {
    .commemoration--ioann-presnya .commemoration__form {
        grid-template-columns: 1fr;
        row-gap: 48px;
    }

    /* Hide the shared head row; per-column mobile titles take over. */
    .commemoration--ioann-presnya .commemoration__head {
        display: none;
    }

    .commemoration--ioann-presnya .commemoration__col-title--mobile {
        display: block;
        margin-bottom: 8px;
    }

    .commemoration--ioann-presnya .commemoration__col-title {
        font-size: 28px;
    }
}

/* ─── Mobile: tighten spacing and gutters below 767.99px ─── */
/* The single-column grid is already set by the 900px block above.          */
/* This block reduces the 36px interior horizontal paddings that would      */
/* double-up with the 16px page gutter provided by base.css --ip-side-padding. */
@media (max-width: 767.99px) {
    .commemoration--ioann-presnya {
        padding: 32px 0 48px;
    }

    .commemoration--ioann-presnya .commemoration__form {
        row-gap: 24px;
    }

    /* Step bars */
    .commemoration--ioann-presnya .commemoration__step {
        padding: 14px 0 14px 16px;
    }

    .commemoration--ioann-presnya .commemoration__step-text {
        font-size: 14px;
    }

    /* Accordion trigger */
    .commemoration--ioann-presnya .commemoration__accordion-trigger {
        padding: 14px 16px;
    }

    .commemoration--ioann-presnya .commemoration__accordion-label {
        font-size: 20px;
    }

    /* Option rows: keep a small indent vs trigger but drop the 52px desktop left-pad */
    .commemoration--ioann-presnya .commemoration__option {
        padding: 12px 16px 12px 24px;
    }

    /* Allow long option names to wrap next to the nowrap price */
    .commemoration--ioann-presnya .commemoration__option-name {
        overflow-wrap: anywhere;
    }

    /* Names textarea */
    .commemoration--ioann-presnya .commemoration__names {
        padding: 8px 16px;
        /* Match desktop: full 10 rows (names are capped at 10) */
        min-height: calc(10 * 2.125em + 16px);
    }

    /* Subtotal band */
    .commemoration--ioann-presnya .commemoration__subtotal {
        padding: 12px 16px;
    }

    /* Total band */
    .commemoration--ioann-presnya .commemoration__total {
        padding: 12px 16px;
    }

    /* "Дополнительно" extra accordion */
    .commemoration--ioann-presnya .commemoration__extra-trigger {
        padding: 14px 16px;
    }

    .commemoration--ioann-presnya .commemoration__extra-label {
        font-size: 20px;
    }

    .commemoration--ioann-presnya .commemoration__extra-body {
        padding: 0 16px;
    }

    .commemoration--ioann-presnya .commemoration__extra.is-open
        .commemoration__extra-body {
        padding: 12px 16px;
    }

    /* Buttons — ensure font-size legible on mobile */
    .commemoration--ioann-presnya .commemoration__add,
    .commemoration--ioann-presnya .commemoration__more,
    .commemoration--ioann-presnya .commemoration__pay {
        font-size: 15px;
    }

    .commemoration--ioann-presnya .commemoration__more {
        margin-top: 12px;
    }

    /* Order summary ("cart") — tighten sizes, ensure overflow-wrap */
    .commemoration--ioann-presnya .commemoration__summary-kind {
        font-size: 16px;
    }

    .commemoration--ioann-presnya .commemoration__summary-option {
        font-size: 14px;
    }

    .commemoration--ioann-presnya .commemoration__summary-names {
        font-size: 13px;
    }

    .commemoration--ioann-presnya .commemoration__summary-price {
        font-size: 14px;
    }

    /* Empty state: keep centered within the section gutter */
    .commemoration--ioann-presnya .commemoration__empty {
        padding: 32px 0;
    }

    /* Column titles */
    .commemoration--ioann-presnya .commemoration__col-title {
        font-size: 24px;
    }
}

/* ── Дополнительные товары (products) ─────────────────────────────────────── */
/* Allow the expanded "Дополнительно" body to grow with the product list. */
.commemoration--ioann-presnya .commemoration__extra.is-open .commemoration__extra-body {
    max-height: 2000px;
}

.commemoration--ioann-presnya .commemoration__product {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px solid #ececec;
}

.commemoration--ioann-presnya .commemoration__product:last-child {
    border-bottom: none;
}

.commemoration--ioann-presnya .commemoration__product-check {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1 1 auto;
    cursor: pointer;
    font-family: 'Golos Text', 'Golos', Arial, sans-serif;
    font-size: 14px;
    color: #1b1b1b;
}

.commemoration--ioann-presnya .commemoration__product-toggle {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    cursor: pointer;
}

.commemoration--ioann-presnya .commemoration__product-price {
    font-family: 'Golos Text', 'Golos', Arial, sans-serif;
    font-size: 14px;
    font-weight: 700;
    color: #a33d25;
    white-space: nowrap;
}

.commemoration--ioann-presnya .commemoration__qty {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.commemoration--ioann-presnya .commemoration__qty-minus,
.commemoration--ioann-presnya .commemoration__qty-plus {
    width: 28px;
    height: 28px;
    line-height: 1;
    font-size: 16px;
    border: 1px solid #cecece;
    background: #fff;
    color: #1b1b1b;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.commemoration--ioann-presnya .commemoration__qty-minus {
    border-radius: 4px 0 0 4px;
}

.commemoration--ioann-presnya .commemoration__qty-plus {
    border-radius: 0 4px 4px 0;
}

.commemoration--ioann-presnya .commemoration__qty-minus:hover,
.commemoration--ioann-presnya .commemoration__qty-plus:hover {
    background: #f3f3f3;
}

.commemoration--ioann-presnya .commemoration__qty-input {
    width: 44px;
    height: 28px;
    text-align: center;
    border: 1px solid #cecece;
    border-left: none;
    border-right: none;
    font-family: 'Golos Text', 'Golos', Arial, sans-serif;
    font-size: 14px;
    color: #1b1b1b;
    -moz-appearance: textfield;
    box-sizing: border-box;
}

.commemoration--ioann-presnya .commemoration__qty-input::-webkit-outer-spin-button,
.commemoration--ioann-presnya .commemoration__qty-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.commemoration--ioann-presnya .commemoration__summary-product {
    font-family: 'Golos Text', 'Golos', Arial, sans-serif;
    font-size: 13px;
    color: #444;
    margin: 0 0 4px;
    text-align: right;
    overflow-wrap: anywhere;
}

/* ── Cart / order items ───────────────────────────────────────────────────── */
.commemoration--ioann-presnya .commemoration__order-item {
    position: relative;
    padding: 12px 28px 12px 0;
    border-bottom: 1px solid #ececec;
}

.commemoration--ioann-presnya .commemoration__order-item:first-child {
    border-top: 1px solid #ececec;
}

.commemoration--ioann-presnya .commemoration__order-current {
    opacity: 0.7;
}

.commemoration--ioann-presnya .commemoration__order-remove {
    position: absolute;
    top: 8px;
    right: 0;
    width: 22px;
    height: 22px;
    line-height: 1;
    font-size: 18px;
    border: none;
    background: transparent;
    color: #a33d25;
    cursor: pointer;
    padding: 0;
}

.commemoration--ioann-presnya .commemoration__order-remove:hover {
    color: #7c2d1b;
}
