.ltud-fpo {
    --ltud-fpo-accent: #1a9c00;
    --ltud-fpo-border: #d8d8d8;
    box-sizing: border-box;
    width: 100%;
    margin: 24px 0;
    color: #222;
}

.ltud-fpo *,
.ltud-fpo *::before,
.ltud-fpo *::after {
    box-sizing: border-box;
}

.ltud-fpo-header {
    margin-bottom: 18px;
}

.ltud-fpo-header h2 {
    margin: 0 0 7px;
    font-size: clamp(1.45rem, 2.5vw, 2rem);
    line-height: 1.2;
}

.ltud-fpo-header p,
.ltud-fpo-section > p {
    margin: 0;
    color: #555;
}

.ltud-fpo-section {
    margin: 0 0 18px;
    padding: 20px;
    border: 1px solid var(--ltud-fpo-border);
    border-radius: 9px;
    background: #fff;
}

.ltud-fpo-section h3 {
    margin: 0 0 7px;
    font-size: 1.22rem;
    line-height: 1.25;
}

.ltud-fpo-variations .variations {
    width: 100%;
    margin: 14px 0 4px;
    border: 0;
}

.ltud-fpo-variations .variations th,
.ltud-fpo-variations .variations td {
    padding: 7px 0;
    border: 0;
    background: transparent;
    text-align: left;
    vertical-align: middle;
}

.ltud-fpo-variations .variations th {
    width: 120px;
    padding-right: 14px;
    font-weight: 800;
}

.ltud-fpo-variations .variations select {
    width: 100%;
    min-height: 44px;
    margin: 0;
    padding-left: 12px;
    padding-right: 42px;
    -webkit-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%23555' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    background-size: 12px 8px;
}

.ltud-fpo-variations .reset_variations {
    display: inline-block;
    margin-top: 5px;
}

.ltud-fpo-variations .single_variation {
    margin-top: 10px;
}

.ltud-fpo fieldset {
    min-width: 0;
    margin: 0;
    padding: 0;
    border: 0;
}

.ltud-fpo-families {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 9px;
    margin-top: 17px !important;
}

.ltud-fpo-family {
    display: block;
    cursor: pointer;
}

.ltud-fpo-family input {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
}

.ltud-fpo-family span {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: 9px 12px;
    border: 2px solid var(--ltud-fpo-border);
    border-radius: 7px;
    background: #fafafa;
    font-weight: 700;
    line-height: 1.25;
    text-align: center;
}

.ltud-fpo-family input:checked + span {
    border-color: var(--ltud-fpo-accent);
    background: #f4fff2;
    box-shadow: 0 0 0 1px var(--ltud-fpo-accent);
}

.ltud-fpo-family input:focus-visible + span {
    outline: 3px solid rgba(26, 156, 0, .28);
    outline-offset: 2px;
}

.ltud-fpo-family.is-custom span {
    color: #fff;
    border-color: transparent;
    background: linear-gradient(115deg, #c62828, #ef6c00, #f9a825, #2e7d32, #1565c0, #6a1b9a);
    text-shadow: 0 1px 2px rgba(0, 0, 0, .45);
}

.ltud-fpo-family.is-custom input:checked + span {
    color: #fff;
    border-color: var(--ltud-fpo-accent);
    background: linear-gradient(115deg, #c62828, #ef6c00, #f9a825, #2e7d32, #1565c0, #6a1b9a);
    box-shadow: 0 0 0 1px var(--ltud-fpo-accent);
    text-shadow: 0 1px 2px rgba(0, 0, 0, .45);
}

.ltud-fpo-swatches,
.ltud-fpo-custom {
    margin-top: 18px !important;
}

.ltud-fpo-swatches[hidden],
.ltud-fpo-custom[hidden],
.ltud-fpo-mail[hidden],
.ltud-fpo-extra-dye[hidden],
.ltud-fpo-extra-dye-controls[hidden],
.ltud-fpo-extra-dye-sizes[hidden] {
    display: none !important;
}

.ltud-fpo-swatches legend,
.ltud-fpo-choice-list legend {
    margin-bottom: 10px;
    font-weight: 800;
}

.ltud-fpo-subgroups {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.ltud-fpo-subgroup {
    min-width: 0;
}

.ltud-fpo-subgroup h4 {
    margin: 0 0 7px;
    font-size: 1rem;
    font-weight: 800;
    line-height: 1.25;
    text-align: center;
}

.ltud-fpo-swatch-strip {
    display: flex;
    width: min(100%, 560px);
    min-height: 108px;
    overflow: hidden;
    border: 1px solid rgba(0, 0, 0, .28);
    border-radius: 8px;
    background: #fff;
}

.ltud-fpo-swatch {
    position: relative;
    display: block;
    min-width: 0;
    min-height: 108px;
    flex: 1 1 0;
    margin: 0;
    padding: 0;
    overflow: hidden;
    border: 0;
    border-right: 0;
    border-radius: 0;
    cursor: pointer;
}

.ltud-fpo-swatch:last-child {
    border-right: 0;
}

.ltud-fpo-swatch input {
    position: absolute;
    z-index: 2;
    inset: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    opacity: 0;
    cursor: pointer;
}

.ltud-fpo-swatch-color {
    position: absolute;
    z-index: 0;
    inset: 32px 0 0;
    display: block;
}

.ltud-fpo-swatch-badge {
    position: absolute;
    z-index: 1;
    left: 0;
    top: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 32px;
    transform: none;
    border: 0;
    border-radius: 0;
    background: #fff;
    color: #111;
    box-shadow: none;
    font-size: .9rem;
    font-weight: 900;
    line-height: 1;
}

.ltud-fpo-check {
    position: absolute;
    z-index: 3;
    top: 38px;
    right: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #1a9c00;
    color: #fff;
    font-size: 14px;
    font-weight: 900;
    opacity: 0;
}

.ltud-fpo-swatch:has(input:checked) {
    z-index: 1;
    box-shadow: inset 0 0 0 4px #1a9c00;
}

.ltud-fpo-swatch:has(input:focus-visible) {
    z-index: 2;
    box-shadow: inset 0 0 0 4px #1769aa;
}

.ltud-fpo-swatch input:checked ~ .ltud-fpo-check {
    opacity: 1;
}

.ltud-fpo-choice-list {
    display: grid;
    gap: 10px;
    margin-top: 13px;
}

.ltud-fpo-choice {
    display: grid;
    grid-template-columns: 22px minmax(0, 1fr);
    gap: 11px;
    align-items: start;
    margin: 0;
    padding: 13px 14px;
    border: 2px solid var(--ltud-fpo-border);
    border-radius: 7px;
    background: #fff;
    cursor: pointer;
}

.ltud-fpo-choice:has(input:checked) {
    border-color: var(--ltud-fpo-accent);
    background: #f6fff4;
}

.ltud-fpo-choice input {
    width: 18px;
    height: 18px;
    margin: 2px 0 0;
    accent-color: var(--ltud-fpo-accent);
}

.ltud-fpo-extra-dye-toggle {
    display: grid;
    grid-template-columns: 22px minmax(0, 1fr);
    gap: 11px;
    align-items: start;
    margin-top: 13px;
    padding: 14px;
    border: 2px solid var(--ltud-fpo-border);
    border-radius: 7px;
    background: #fff;
    cursor: pointer;
}

.ltud-fpo-extra-dye-toggle:has(input:checked) {
    border-color: var(--ltud-fpo-accent);
    background: #f6fff4;
}

.ltud-fpo-extra-dye-toggle input {
    width: 18px;
    height: 18px;
    margin: 2px 0 0;
    accent-color: var(--ltud-fpo-accent);
}

.ltud-fpo-extra-dye-toggle span {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 3px;
}

.ltud-fpo-extra-dye-toggle small {
    color: #595959;
    line-height: 1.35;
}

.ltud-fpo-extra-dye-controls {
    margin-top: 14px;
}

.ltud-fpo-extra-dye-quantity {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 14px;
    font-weight: 800;
}

.ltud-fpo-extra-dye-qty {
    width: 88px;
    min-height: 42px;
    padding: 7px 10px;
}

.ltud-fpo-choice-copy {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 3px;
}

.ltud-fpo-choice-copy strong {
    line-height: 1.25;
}

.ltud-fpo-choice-copy small {
    color: #595959;
    line-height: 1.35;
}

.ltud-fpo-product-meta {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 6px 14px;
    margin-top: 3px;
    color: #222 !important;
    font-weight: 700;
}

.ltud-fpo-choice.is-unavailable {
    cursor: not-allowed;
    opacity: .55;
}

.ltud-fpo-unavailable {
    color: #b32d2e !important;
    font-weight: 700;
}

.ltud-fpo-badge {
    align-self: flex-start;
    padding: 2px 7px;
    border-radius: 999px;
    background: #1a9c00;
    color: #fff;
    font-size: .72rem;
    font-weight: 800;
    line-height: 1.35;
    text-transform: uppercase;
}

.ltud-fpo-custom-intro,
.ltud-fpo-mail {
    padding: 15px;
    border-radius: 7px;
    background: #f8f8f8;
}

.ltud-fpo-custom-intro > :first-child,
.ltud-fpo-mail-instructions > :first-child {
    margin-top: 0;
}

.ltud-fpo-custom-intro > :last-child,
.ltud-fpo-mail-instructions > :last-child {
    margin-bottom: 0;
}

.ltud-fpo-mail {
    margin-top: 12px;
}

.ltud-fpo-confirm {
    display: grid;
    grid-template-columns: 20px minmax(0, 1fr);
    gap: 10px;
    align-items: start;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #ddd;
    font-weight: 700;
}

.ltud-fpo-confirm input {
    width: 18px;
    height: 18px;
    margin-top: 3px;
    accent-color: var(--ltud-fpo-accent);
}

.ltud-fpo-summary {
    border-color: #bbb;
    background: #fafafa;
}

.ltud-fpo-summary-lines {
    margin-top: 12px;
    border-top: 1px solid #ddd;
}

.ltud-fpo-summary-line {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 16px;
    align-items: start;
    padding: 12px 0;
    border-bottom: 1px solid #ddd;
}

.ltud-fpo-summary-line > span:first-child {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 2px;
}

.ltud-fpo-summary-line small {
    color: #5a5a5a;
}

.ltud-fpo-summary-line > span:last-child {
    white-space: nowrap;
    font-weight: 700;
}

.ltud-fpo-summary-fee {
    background: #fff8e6;
}

.ltud-fpo-total {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 16px 0 5px;
    font-size: 1.24rem;
}

.ltud-fpo-purchase-row {
    display: flex;
    align-items: end;
    gap: 14px;
    margin-top: 14px;
}

.ltud-fpo-quantity {
    display: flex;
    flex-direction: column;
    gap: 5px;
    font-weight: 700;
}

.ltud-fpo-quantity .quantity input.qty {
    width: 78px;
    min-height: 46px;
}

.ltud-fpo-add-to-cart {
    min-height: 46px;
    padding: 10px 22px !important;
    background: var(--ltud-fpo-accent) !important;
    color: #fff !important;
    font-weight: 800 !important;
}

.ltud-fpo-add-to-cart.is-loading,
.ltud-fpo.is-quoting .ltud-fpo-total-value {
    opacity: .65;
}

.ltud-fpo-total-note {
    margin: 11px 0 0;
    color: #666;
    font-size: .88rem;
}

.ltud-fpo-status {
    min-height: 1.4em;
    margin-top: 10px;
    font-weight: 700;
}

.ltud-fpo-status.is-error,
.ltud-fpo-alert {
    color: #b32d2e;
}

.ltud-fpo-status.is-success {
    color: #1a6f00;
}

@media (max-width: 760px) {
    .ltud-fpo-variations .variations th,
    .ltud-fpo-variations .variations td {
        display: block;
        width: 100%;
        padding: 4px 0;
    }

    .ltud-fpo-families {
        grid-template-columns: 1fr;
    }

    .ltud-fpo-subgroups {
        grid-template-columns: 1fr;
    }

    .ltud-fpo-swatch-strip {
        flex-direction: column;
        width: 100%;
        min-height: 0;
    }

    .ltud-fpo-swatch {
        flex: 0 0 86px;
        min-height: 86px;
    }

    .ltud-fpo-swatch-color {
        inset: 0;
    }

    .ltud-fpo-swatch-badge {
        left: 8px;
        top: 50%;
        width: 30px;
        height: 30px;
        transform: translateY(-50%);
        border: 1px solid rgba(0, 0, 0, .22);
        border-radius: 6px;
        background: rgba(255, 255, 255, .92);
        box-shadow: 0 1px 3px rgba(0, 0, 0, .22);
    }

    .ltud-fpo-check {
        top: 6px;
    }

    .ltud-fpo-section {
        padding: 16px;
    }

    .ltud-fpo-purchase-row {
        align-items: stretch;
        flex-direction: column;
    }

    .ltud-fpo-add-to-cart {
        width: 100%;
    }
}
