.pf-subscriptions {
    --pf-brown: #351f18;
    --pf-wine: #9b1235;
    --pf-cream: #fbf7f2;
    --pf-line: #e7ddd5;
    --pf-muted: #74655d;

    color: var(--pf-brown);
    background: #fff;
    padding: 54px 20px 72px;
}

.pf-subscriptions * {
    box-sizing: border-box;
}

.pf-shell {
    width: min(1180px, 100%);
    margin: 0 auto;
}

.pf-heading {
    max-width: 760px;
    margin: 0 auto 34px;
    text-align: center;
}

.pf-eyebrow {
    display: block;
    margin-bottom: 8px;
    color: var(--pf-wine);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .14em;
    text-transform: uppercase;
}

.pf-heading h1 {
    margin: 0 0 12px;
    color: var(--pf-brown);
    font-size: clamp(32px, 5vw, 52px);
    line-height: 1.05;
}

.pf-heading p {
    margin: 0;
    color: var(--pf-muted);
    font-size: 17px;
}

.pf-plan-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
    margin-bottom: 30px;
}

.pf-plan-card {
    position: relative;
    display: block;
    overflow: hidden;
    border: 1px solid var(--pf-line);
    border-radius: 22px;
    background: #fff;
    cursor: pointer;
    box-shadow: 0 12px 35px rgba(53,31,24,.08);
    transition:
        transform .18s ease,
        border-color .18s ease,
        box-shadow .18s ease;
}

.pf-plan-card:hover,
.pf-plan-card.is-selected {
    transform: translateY(-2px);
    border-color: var(--pf-wine);
    box-shadow: 0 18px 42px rgba(53,31,24,.13);
}

.pf-plan-card > input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.pf-plan-card__image {
    display: block;
    height: 180px;
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
}

.pf-plan-card__body {
    display: block;
    padding: 22px;
}

.pf-plan-card__body > small {
    display: block;
    margin-bottom: 5px;
    color: var(--pf-wine);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
}

.pf-plan-card__body > strong {
    display: block;
    margin-bottom: 12px;
    font-size: 25px;
}

.pf-plan-card__price {
    display: block;
    margin-bottom: 16px;
    color: var(--pf-wine);
    font-size: 25px;
    font-weight: 800;
}

.pf-plan-card__price em {
    color: var(--pf-muted);
    font-size: 13px;
    font-style: normal;
    font-weight: 500;
}

.pf-plan-card__features {
    display: grid;
    gap: 7px;
    color: var(--pf-muted);
    font-size: 14px;
}

.pf-checkout-layout {
    display: grid;
    grid-template-columns:
        minmax(0, 1.65fr)
        minmax(300px, .75fr);
    gap: 24px;
    align-items: start;
}

.pf-form {
    display: grid;
    gap: 18px;
}

.pf-panel,
.pf-summary {
    border: 1px solid var(--pf-line);
    border-radius: 22px;
    background: var(--pf-cream);
    box-shadow: 0 10px 28px rgba(53,31,24,.06);
}

.pf-panel {
    padding: 25px;
}

.pf-panel h2,
.pf-summary h2 {
    margin: 0 0 20px;
    color: var(--pf-brown);
    font-size: 22px;
}

.pf-fields {
    display: grid;
    gap: 16px;
}

.pf-fields--two {
    grid-template-columns:
        repeat(2, minmax(0, 1fr));
}

.pf-span-2 {
    grid-column: 1 / -1;
}

.pf-fields label > span {
    display: block;
    margin-bottom: 7px;
    font-size: 13px;
    font-weight: 700;
}

.pf-fields input,
.pf-fields select,
.pf-fields textarea {
    width: 100%;
    border: 1px solid #d9cec5;
    border-radius: 12px;
    background: #fff;
    padding: 12px 13px;
    color: var(--pf-brown);
    font: inherit;
}

.pf-fields input:focus,
.pf-fields select:focus,
.pf-fields textarea:focus {
    border-color: var(--pf-wine);
    outline: 2px solid rgba(155,18,53,.18);
}

.pf-fields select:disabled {
    color: #968a83;
    background: #f4efeb;
}

.pf-coverage {
    margin: 18px 0 0;
    padding: 12px 14px;
    border-radius: 12px;
    background: #f5ece5;
    color: #765f50;
    font-size: 13px;
}

.pf-consent {
    display: flex;
    gap: 11px;
    align-items: flex-start;
    color: var(--pf-muted);
    line-height: 1.5;
}

.pf-consent input {
    margin-top: 4px;
}

.pf-summary {
    position: sticky;
    top: 110px;
    padding: 25px;
}

.pf-summary ul {
    margin: 0 0 20px;
    padding-left: 20px;
    color: var(--pf-muted);
}

.pf-summary__row {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    padding: 12px 0;
    border-top: 1px solid var(--pf-line);
}

.pf-summary__row strong {
    text-align: right;
}

.pf-summary__row--total {
    margin-bottom: 16px;
    font-size: 19px;
}

.pf-summary__row--total strong {
    color: var(--pf-wine);
}

.pf-button {
    width: 100%;
    border: 0;
    border-radius: 999px;
    background: var(--pf-wine);
    padding: 14px 18px;
    color: #fff;
    font-weight: 800;
}

.pf-button:disabled {
    cursor: not-allowed;
    opacity: .45;
}

.pf-preview-note {
    margin: 12px 0 0;
    color: var(--pf-muted);
    font-size: 12px;
    text-align: center;
}

.pf-modal[hidden] {
    display: none;
}

.pf-modal {
    position: fixed;
    z-index: 999999;
    inset: 0;
    display: grid;
    place-items: center;
    padding: 20px;
}

.pf-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(25,14,10,.66);
}

.pf-modal__dialog {
    position: relative;
    z-index: 1;
    width: min(620px, 100%);
    border-radius: 24px;
    background: #fff;
    padding: 30px;
    box-shadow: 0 30px 90px rgba(0,0,0,.28);
}

.pf-modal__dialog h2 {
    margin: 0 0 18px;
}

.pf-q0 {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 16px;
    align-items: start;
    margin: 18px 0;
    border-radius: 16px;
    background: #f8eee8;
    padding: 17px;
}

.pf-q0 > strong {
    display: inline-flex;
    min-width: 76px;
    justify-content: center;
    border-radius: 999px;
    background: var(--pf-wine);
    padding: 8px 11px;
    color: #fff;
}

.pf-q0 p {
    margin: 0;
    color: var(--pf-muted);
    line-height: 1.5;
}

@media (max-width: 900px) {
    .pf-plan-grid {
        grid-template-columns: 1fr;
    }

    .pf-checkout-layout {
        grid-template-columns: 1fr;
    }

    .pf-summary {
        position: static;
    }
}

@media (max-width: 620px) {
    .pf-subscriptions {
        padding: 34px 14px 50px;
    }

    .pf-fields--two {
        grid-template-columns: 1fr;
    }

    .pf-span-2 {
        grid-column: auto;
    }

    .pf-panel,
    .pf-summary {
        padding: 20px;
        border-radius: 18px;
    }

    .pf-plan-card__image {
        height: 150px;
    }

    .pf-q0 {
        grid-template-columns: 1fr;
    }
}

/* =========================================================
   PORFIRIO SUBSCRIPTIONS UI R2
   Approved visual redesign
   ========================================================= */

.pf-subscriptions {
    background: transparent;
}

.pf-plan-section {
    margin-bottom: 24px;
}

.pf-section-title {
    display: flex;
    gap: 10px;
    align-items: center;
    margin: 0 0 18px;
    color: var(--pf-brown);
    font-size: 21px;
    font-weight: 800;
}

.pf-plan-grid {
    align-items: stretch;
}

.pf-plan-card {
    min-height: 365px;
    overflow: visible;
    background: rgba(251, 247, 242, .94);
}

.pf-plan-card__body {
    display: flex;
    height: 100%;
    flex-direction: column;
    padding: 28px 28px 24px;
}

.pf-plan-card__image {
    display: none !important;
}

.pf-plan-badge {
    position: absolute;
    z-index: 2;
    top: -13px;
    right: 16px;
    border-radius: 999px;
    background: var(--pf-wine);
    padding: 6px 13px;
    color: #fff;
    font-size: 11px;
    font-weight: 800;
}

.pf-plan-card__features {
    margin-top: 4px;
}

.pf-plan-card__description {
    margin: 20px 0 22px;
    color: var(--pf-muted);
    font-size: 14px;
    line-height: 1.55;
}

.pf-plan-card__select-row {
    display: grid;
    grid-template-columns: 24px 1fr;
    gap: 12px;
    align-items: center;
    margin-top: auto;
}

.pf-radio-indicator {
    display: block;
    width: 22px;
    height: 22px;
    border: 2px solid #b7a79e;
    border-radius: 50%;
    background: #fff;
    box-shadow: inset 0 0 0 5px #fff;
}

.pf-radio-indicator.is-selected {
    border-color: var(--pf-wine);
    background: var(--pf-wine);
}

.pf-select-control {
    display: block;
    border: 1px solid #a79083;
    border-radius: 10px;
    padding: 10px 16px;
    color: var(--pf-brown);
    background: #fff;
    font-size: 13px;
    font-weight: 800;
    text-align: center;
}

.pf-select-control.is-selected {
    border-color: var(--pf-wine);
    background: var(--pf-wine);
    color: #fff;
}

.pf-plan-card.is-selected {
    border-width: 2px;
}

.pf-panel--grind {
    padding-top: 20px;
    padding-bottom: 20px;
}

.pf-panel--grind h2 {
    margin-bottom: 5px;
}

.pf-panel-intro {
    margin: 0 0 14px;
    color: var(--pf-muted);
    font-size: 13px;
}

.pf-summary-consent {
    margin: 8px 0 16px;
    border-top: 1px solid var(--pf-line);
    padding-top: 16px;
}

.pf-summary-consent > strong {
    display: block;
    margin-bottom: 10px;
    color: var(--pf-brown);
    font-size: 13px;
}

.pf-summary-consent label {
    display: flex;
    gap: 9px;
    align-items: flex-start;
    color: var(--pf-muted);
    font-size: 11px;
    line-height: 1.45;
}

.pf-summary-consent input {
    flex: 0 0 auto;
    margin-top: 3px;
}

@media (max-width: 900px) {
    .pf-plan-card {
        min-height: auto;
    }
}

/* =========================================================
   PORFIRIO SUBSCRIPTIONS R4
   Standalone page + sticky summary
   ========================================================= */

body.pf-standalone-page {
    margin: 0;
    min-height: 100vh;
    background: #f4dfaa;
}

body.pf-standalone-page .pf-subscriptions {
    min-height: 100vh;
    padding-top: 42px;
    padding-bottom: 72px;
}

body.pf-standalone-page .pf-standalone-main {
    display: block;
    width: 100%;
    overflow: visible;
}

body.pf-standalone-page .pf-shell,
body.pf-standalone-page .pf-checkout-layout,
body.pf-standalone-page .pf-form {
    overflow: visible;
}

body.pf-standalone-page .pf-plan-card__description {
    display: none;
}

body.pf-standalone-page .pf-summary {
    position: sticky !important;
    top: 24px !important;
    align-self: start !important;
    height: max-content;
    max-height: calc(100vh - 48px);
    overflow-y: auto;
    z-index: 20;
}

@media (max-width: 900px) {
    body.pf-standalone-page .pf-summary {
        position: static !important;
        top: auto !important;
        max-height: none;
        overflow: visible;
    }

    body.pf-standalone-page .pf-subscriptions {
        padding-top: 28px;
    }
}

/* =========================================================
   PORFIRIO SUBSCRIPTIONS R5
   Theme header/footer restored.
   Theme page hero intentionally remains excluded.
   ========================================================= */

body.pf-standalone-page .pf-summary {
    position: sticky !important;
    top: 24px !important;
    align-self: start !important;

    height: auto !important;
    max-height: none !important;

    overflow: visible !important;
    overflow-x: visible !important;
    overflow-y: visible !important;
}

body.pf-standalone-page .pf-subscriptions {
    padding-bottom: 36px;
}

body.pf-standalone-page .pf-return-nav {
    width: min(1180px, 100%);
    margin: 0 auto;
    padding: 0 20px 48px;

    display: flex;
    justify-content: flex-start;
}

body.pf-standalone-page .pf-return-button {
    display: inline-flex;
    gap: 9px;
    align-items: center;
    justify-content: center;

    min-width: 130px;

    border: 1px solid var(--pf-wine);
    border-radius: 999px;

    padding: 11px 22px;

    background: transparent;

    color: var(--pf-wine);

    font-size: 14px;
    font-weight: 800;

    text-decoration: none;

    transition:
        background-color .18s ease,
        color .18s ease,
        transform .18s ease;
}

body.pf-standalone-page .pf-return-button:hover,
body.pf-standalone-page .pf-return-button:focus {
    background: var(--pf-wine);
    color: #fff;

    text-decoration: none;
    transform: translateY(-1px);
}

@media (max-width: 900px) {
    body.pf-standalone-page .pf-summary {
        position: static !important;

        top: auto !important;

        height: auto !important;
        max-height: none !important;

        overflow: visible !important;
    }

    body.pf-standalone-page .pf-return-nav {
        padding-right: 14px;
        padding-left: 14px;
    }
}

/* ==========================================================
   PORF-SUB-03-R1 · Subscription confirmation modal parity
   ========================================================== */

html.pf-modal-open,
html.pf-modal-open body {
    overflow: hidden;
}

.pf-modal__dialog {
    width: min(720px, calc(100vw - 32px));
    max-height: calc(100vh - 36px);
    overflow-y: auto;
    padding: 26px;
    border-radius: 24px;
}

.pf-modal__intro {
    margin: -8px 0 18px;
    color: rgba(42, 25, 18, .66);
    line-height: 1.5;
}

.pf-modal-review {
    display: grid;
    gap: 12px;
}

.pf-modal-card {
    padding: 15px 17px;
    border: 1px solid rgba(67, 44, 31, .12);
    border-radius: 16px;
    background: #fffdf9;
}

.pf-modal-card__eyebrow {
    display: block;
    margin-bottom: 7px;
    color: #8f142f;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.pf-modal-card__title {
    display: block;
    margin-bottom: 5px;
    font-size: 18px;
    color: #2a1912;
}

.pf-modal-card__body {
    color: rgba(42, 25, 18, .76);
    font-size: 15px;
    line-height: 1.55;
}

.pf-modal-totals > div {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    padding: 7px 0;
}

.pf-modal-totals__total {
    margin-top: 4px;
    padding-top: 12px !important;
    border-top: 1px solid rgba(67, 44, 31, .14);
    color: #8f142f;
    font-weight: 800;
}

.pf-q0 {
    margin-top: 14px;
    padding: 16px;
    border-radius: 16px;
    background: rgba(217, 164, 65, .12);
}

.pf-q0__badge {
    align-self: start;
}

.pf-modal-consent {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 12px;
    align-items: start;
    margin-top: 14px;
    padding: 16px;
    border: 1px solid rgba(143, 20, 47, .14);
    border-radius: 16px;
    background: rgba(143, 20, 47, .05);
    cursor: pointer;
}

.pf-modal-consent input {
    width: 19px;
    height: 19px;
    margin: 2px 0 0;
    accent-color: #8f142f;
}

.pf-modal-consent span {
    color: rgba(42, 25, 18, .78);
    font-size: 14px;
    line-height: 1.5;
}

.pf-modal-consent span strong {
    display: block;
    margin-bottom: 4px;
    color: #2a1912;
}

.pf-modal-consent-error {
    margin: 8px 0 0;
    color: #a20f36;
    font-size: 13px;
    font-weight: 700;
}

.pf-modal-actions {
    position: sticky;
    bottom: -26px;
    z-index: 2;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin: 18px -26px -26px;
    padding: 14px 26px 20px;
    background: #fff;
    border-top: 1px solid rgba(67, 44, 31, .10);
}

.pf-modal-action {
    min-height: 46px;
    padding: 0 19px;
    border-radius: 999px;
    font-weight: 800;
    cursor: pointer;
}

.pf-modal-action--secondary {
    border: 1px solid rgba(42, 25, 18, .28);
    background: #fff;
    color: #2a1912;
}

.pf-modal-action--primary {
    border: 1px solid #71162a;
    background: #71162a;
    color: #fff;
}

.pf-modal-action--primary:disabled {
    opacity: .45;
    cursor: not-allowed;
}

.pf-modal-preview-note {
    margin: 12px 0 0;
    text-align: center;
    color: rgba(42, 25, 18, .56);
    font-size: 12px;
    line-height: 1.45;
}

@media (max-width: 640px) {
    .pf-modal {
        padding: 8px;
    }

    .pf-modal__dialog {
        width: 100%;
        max-height: calc(100vh - 16px);
        padding: 18px 14px;
        border-radius: 18px;
    }

    .pf-modal-actions {
        bottom: -18px;
        margin:
            16px -14px -18px;
        padding:
            12px 14px 14px;
    }

    .pf-modal-actions {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }

    .pf-modal-action {
        padding-left: 12px;
        padding-right: 12px;
    }
}
