.single-product form.cart.hgc-form,
.woocommerce div.product form.cart.hgc-form,
form.cart.hgc-form {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 28px;
    width: 100%;
    max-width: 100%;
    counter-reset: hgc-step;
}

.hgc-step {
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-width: 0;
    margin: 0;
    padding: 0;
    border: 0;
    counter-increment: hgc-step;
}

.hgc-step[hidden] {
    display: none;
}

.hgc-step__title {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0;
    margin: 0 0 2px;
}

.hgc-step > :not(.hgc-step__title),
.hgc-preview {
    margin-left: 38px;
}

/* El legend no entra en el gap del fieldset: si lo que sigue no es el texto de ayuda, necesita su propio espacio. */
.hgc-step__title + :not(.hgc-step__help) {
    margin-top: 12px;
}

.hgc-step__number {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
}

.hgc-step__number::before {
    content: counter(hgc-step);
}

.hgc-form__options {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.hgc-amount,
.hgc-choice__option {
    position: relative;
    display: inline-flex;
    margin: 0;
    cursor: pointer;
}

.hgc-amount input,
.hgc-choice__option input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.hgc-choice {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.hgc-choice__card {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 2px 12px;
    box-sizing: border-box;
    width: 100%;
}

.hgc-choice__icon {
    grid-row: span 2;
}

.hgc-choice__title,
.hgc-choice__text {
    grid-column: 2;
}

.hgc-form__grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px 16px;
}

.hgc-form__field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
    margin: 0;
}

.hgc-form__field label {
    display: block;
    margin: 0;
}

.hgc-form__field .input-text {
    box-sizing: border-box;
    width: 100%;
    max-width: 100%;
    margin: 0;
}

.hgc-form__custom,
.hgc-form__date {
    max-width: 260px;
}

.hgc-form__custom[hidden],
.hgc-form__recipient[hidden],
.hgc-preview__from[hidden],
.hgc-preview__message[hidden] {
    display: none;
}

.hgc-form__counter {
    align-self: flex-end;
}

.hgc-preview__card {
    position: relative;
    display: flex;
    box-sizing: border-box;
    max-width: 420px;
    overflow: hidden;
}

.hgc-preview__card::before,
.hgc-preview__card::after {
    content: "";
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
}

.hgc-preview__card::before {
    right: -50px;
    bottom: -70px;
    width: 190px;
    height: 190px;
}

.hgc-preview__card::after {
    right: 60px;
    bottom: -40px;
    width: 90px;
    height: 90px;
}

.hgc-preview__card > * {
    position: relative;
}

.hgc-preview__body {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    gap: 10px;
    box-sizing: border-box;
    min-width: 0;
}

/* Con foto: foto a la izquierda y texto a la derecha. */
.hgc-preview__card.has-image .hgc-preview__body {
    justify-content: space-between;
}

.hgc-preview__media {
    flex: 0 0 40%;
    overflow: hidden;
}

.hgc-preview__media img,
.hgc-preview__media .hgc-preview__image {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
    max-width: none;
    margin: 0;
    object-fit: contain;
    object-position: center;
}

/* Con foto, el badge va chiquito en la esquina de la foto, sin ocupar lugar en el texto. */
.hgc-preview__media .hgc-preview__tag--corner {
    position: absolute;
    top: 8px;
    left: 8px;
    z-index: 1;
}

.hgc-preview__message {
    margin-bottom: 0;
}

.hgc-preview__top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.hgc-preview__people {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 18px;
}

.single-product form.cart.hgc-form .hgc-form__actions,
.hgc-form__actions {
    display: flex;
    align-items: stretch;
    gap: 12px;
}

.hgc-form__actions .quantity {
    flex: 0 0 auto;
    margin: 0;
}

.hgc-form__actions .single_add_to_cart_button {
    flex: 1 1 auto;
}

/* Apariencia por defecto: baja especificidad para que el tema la pise. El color de acento sale de --hgc-accent. */

:where(.hgc-step__title) {
    font-weight: 600;
}

:where(.hgc-step__number) {
    background: var(--hgc-accent, #333);
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    line-height: 1;
}

:where(.hgc-step__help) {
    margin: 0;
    font-size: .875em;
    opacity: .75;
}

:where(.hgc-amount__label) {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding: 0 18px;
    border: 1px solid rgba(0, 0, 0, .2);
    border-radius: 4px;
    background: #fff;
    transition: border-color .15s, box-shadow .15s;
}

:where(.hgc-choice__card) {
    padding: 14px 16px;
    border: 1px solid rgba(0, 0, 0, .2);
    border-radius: 8px;
    background: #fff;
    transition: border-color .15s, box-shadow .15s;
}

:where(.hgc-choice__icon) {
    color: var(--hgc-accent, currentColor);
}

:where(.hgc-choice__title) {
    font-weight: 600;
}

:where(.hgc-choice__text) {
    font-size: .8125em;
    line-height: 1.35;
    opacity: .7;
}

:where(.hgc-amount:hover .hgc-amount__label, .hgc-choice__option:hover .hgc-choice__card) {
    border-color: rgba(0, 0, 0, .5);
}

:where(.hgc-amount input:checked + .hgc-amount__label, .hgc-choice__option input:checked + .hgc-choice__card) {
    border-color: var(--hgc-accent, currentColor);
    box-shadow: inset 0 0 0 1px var(--hgc-accent, currentColor);
}

:where(.hgc-amount input:checked + .hgc-amount__label) {
    font-weight: 600;
}

:where(.hgc-amount input:focus-visible + .hgc-amount__label, .hgc-choice__option input:focus-visible + .hgc-choice__card) {
    outline: 2px solid var(--hgc-accent, currentColor);
    outline-offset: 2px;
}

:where(.hgc-form__field label, .hgc-redeem__label, .hgc-balance__label) {
    font-size: .875em;
}

:where(.hgc-form .input-text, .hgc-redeem .input-text, .hgc-balance .input-text) {
    min-height: 44px;
    padding: 8px 12px;
    border: 1px solid rgba(0, 0, 0, .2);
    border-radius: 4px;
    background: #fff;
    color: inherit;
    font: inherit;
}

:where(.hgc-form textarea.input-text) {
    min-height: 88px;
    resize: vertical;
}

:where(.hgc-form__hint, .hgc-form__counter) {
    display: block;
    margin: 0;
    font-size: .8125em;
    opacity: .7;
}

:where(.hgc-form__when) {
    display: block;
    font-size: .8125em;
    color: var(--hgc-accent, inherit);
}

:where(.hgc-form .optional) {
    font-weight: 400;
    opacity: .6;
}

:where(.hgc-preview__label) {
    margin: 0 0 8px;
    font-size: .75em;
    letter-spacing: .08em;
    text-transform: uppercase;
    opacity: .6;
}

:where(.hgc-preview__card) {
    border-radius: 16px;
    background-color: var(--hgc-accent, #333);
    background-image: radial-gradient(circle at 100% 0, rgba(255, 255, 255, .25), rgba(255, 255, 255, 0) 45%), linear-gradient(135deg, rgba(255, 255, 255, .12), rgba(0, 0, 0, .12));
    box-shadow: 0 12px 30px rgba(0, 0, 0, .15);
    color: #fff;
}

:where(.hgc-preview__card)::before {
    background: rgba(255, 255, 255, .1);
}

:where(.hgc-preview__card)::after {
    background: rgba(255, 255, 255, .07);
}

:where(.hgc-preview__body) {
    padding: 20px 22px;
}

:where(.hgc-preview__card.has-image .hgc-preview__body) {
    padding: 16px 18px;
}

:where(.hgc-preview__card.has-image .hgc-preview__amount) {
    font-size: 1.75em;
}

:where(.hgc-preview__store) {
    font-weight: 700;
}

:where(.hgc-preview__tag) {
    padding: 3px 9px;
    border: 1px solid rgba(255, 255, 255, .6);
    border-radius: 20px;
    font-size: .6875em;
    letter-spacing: .1em;
    text-transform: uppercase;
}

:where(.hgc-preview__tag--corner) {
    padding: 2px 6px;
    border: 0;
    background: var(--hgc-accent, #333);
    font-size: .5625em;
    line-height: 1.4;
}

:where(.hgc-preview__amount) {
    font-size: 2em;
    font-weight: 700;
    line-height: 1.1;
}

:where(.hgc-preview__people) {
    font-size: .875em;
}

:where(.hgc-preview__people strong.is-empty) {
    font-weight: 400;
    font-style: italic;
    opacity: .7;
}

:where(.hgc-preview__message) {
    margin: 0;
    font-size: .875em;
    font-style: italic;
    overflow-wrap: anywhere;
}

:where(.hgc-preview__message)::before {
    content: "\201C";
}

:where(.hgc-preview__message)::after {
    content: "\201D";
}

:where(.hgc-preview__expiry) {
    font-size: .6875em;
    opacity: .8;
}

@media (max-width: 480px) {
    .hgc-form__grid,
    .hgc-choice {
        grid-template-columns: minmax(0, 1fr);
    }

    .hgc-step > :not(.hgc-step__title),
    .hgc-preview {
        margin-left: 0;
    }

    .hgc-form__custom,
    .hgc-form__date {
        max-width: none;
    }
}

.hgc-redeem {
    margin: 0 0 24px;
}

.hgc-redeem__label,
.hgc-balance__label {
    display: block;
    margin-bottom: 6px;
}

.hgc-redeem__row {
    display: flex;
    gap: 8px;
}

.hgc-redeem__row .input-text {
    flex: 1 1 auto;
    box-sizing: border-box;
    min-width: 0;
    margin: 0;
    text-transform: uppercase;
}

.hgc-redeem__row .button {
    flex: 0 0 auto;
}

.hgc-fee-left {
    opacity: .75;
}

.hgc-account__code {
    letter-spacing: 1px;
}

.hgc-redeem--inline {
    margin: 0;
}

.hgc-redeem--inline .hgc-redeem__summary {
    cursor: pointer;
}

.hgc-redeem--inline .hgc-redeem__row {
    margin-top: 10px;
}

.hgc-redeem--inline.is-loading .hgc-redeem__row {
    opacity: .5;
    pointer-events: none;
}

.hgc-redeem__message[hidden] {
    display: none;
}

:where(.hgc-redeem__message) {
    margin-top: 6px;
    font-size: 13px;
    line-height: 18px;
}

:where(.hgc-redeem--inline.has-error .hgc-redeem__message) {
    color: #b32d2e;
}

:where(.hgc-redeem--inline.is-applied .hgc-redeem__message) {
    color: #1e7e34;
}

/* Página de saldo ([homi_gift_card_balance]) */

:where(.hgc-balance-page) :where(.entry-header, .entry-title, .page-header, .page-title) {
    text-align: center;
}

.hgc-balance {
    display: flex;
    flex-direction: column;
    gap: 20px;
    box-sizing: border-box;
    width: 100%;
    max-width: 560px;
    margin: 0 auto;
}

.hgc-balance__intro {
    display: flex;
    align-items: center;
    gap: 14px;
}

.hgc-balance__icon {
    flex: 0 0 auto;
}

.hgc-balance__lead {
    margin: 0;
}

.hgc-balance__row {
    display: flex;
    gap: 8px;
}

.hgc-balance__row .input-text {
    flex: 1 1 auto;
    box-sizing: border-box;
    min-width: 0;
    margin: 0;
    text-transform: uppercase;
}

.hgc-balance__row .button {
    flex: 0 0 auto;
    margin: 0;
}

.hgc-balance__result {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
}

.hgc-balance__card {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 6px;
    box-sizing: border-box;
    width: 100%;
    overflow: hidden;
}

.hgc-balance__card::before {
    content: "";
    position: absolute;
    right: -60px;
    bottom: -80px;
    width: 220px;
    height: 220px;
    border-radius: 50%;
    pointer-events: none;
}

.hgc-balance__card > * {
    position: relative;
}

.hgc-balance__top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 8px;
}

.hgc-balance__bar {
    height: 8px;
    margin-top: 6px;
    overflow: hidden;
    border-radius: 8px;
}

.hgc-balance__bar span {
    display: block;
    height: 100%;
    border-radius: inherit;
}

.hgc-balance__details {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 32px;
    margin: 10px 0 0;
}

.hgc-balance__details dt,
.hgc-balance__details dd {
    margin: 0;
}

:where(.hgc-balance__icon) {
    color: var(--hgc-accent, currentColor);
}

:where(.hgc-balance__lead) {
    line-height: 1.5;
    opacity: .8;
}

:where(.hgc-balance__card) {
    padding: 22px 24px;
    border-radius: 16px;
    background-color: var(--hgc-accent, #333);
    background-image: radial-gradient(circle at 100% 0, rgba(255, 255, 255, .25), rgba(255, 255, 255, 0) 45%), linear-gradient(135deg, rgba(255, 255, 255, .12), rgba(0, 0, 0, .12));
    box-shadow: 0 12px 30px rgba(0, 0, 0, .15);
    color: #fff;
}

:where(.hgc-balance__card)::before {
    background: rgba(255, 255, 255, .08);
}

:where(.hgc-balance__result--used, .hgc-balance__result--expired, .hgc-balance__result--disabled) .hgc-balance__card {
    background-color: #777;
}

:where(.hgc-balance__store) {
    font-weight: 700;
}

:where(.hgc-balance__status) {
    padding: 3px 10px;
    border: 1px solid rgba(255, 255, 255, .6);
    border-radius: 20px;
    font-size: .75em;
    letter-spacing: .06em;
    text-transform: uppercase;
}

:where(.hgc-balance__caption, .hgc-balance__of, .hgc-balance__details dt) {
    font-size: .8125em;
    opacity: .8;
}

:where(.hgc-balance__amount) {
    font-size: 2.25em;
    font-weight: 700;
    line-height: 1.1;
}

:where(.hgc-balance__amount *) {
    color: inherit;
}

:where(.hgc-balance__bar) {
    background: rgba(255, 255, 255, .25);
}

:where(.hgc-balance__bar span) {
    background: #fff;
}

:where(.hgc-balance__details dd) {
    font-weight: 600;
    letter-spacing: .02em;
}

:where(.hgc-balance__how) {
    margin: 0;
    font-size: .875em;
    line-height: 1.5;
    opacity: .8;
}

@media (max-width: 480px) {
    .hgc-balance__row {
        flex-direction: column;
    }
}
