.spexcy-gift {
    box-sizing: border-box;
    width: min(840px, calc(100% - 40px));
    max-width: none;
    max-height: 90dvh;
    padding: 0;
    border: 0;
    border-radius: 16px;
    color: #111;
    background: #fff;
    box-shadow: 0 26px 85px #0004;
    font: 400 16px/1.5 Arial, sans-serif;
}
.spexcy-gift::backdrop { background: #0008; }
html:has(.spexcy-gift[open]) { overflow: hidden; }
.spexcy-gift__form { display: flex; flex-direction: column; margin: 0; height: min(760px, 90dvh); }
.spexcy-gift__header, .spexcy-gift__footer {
    flex: 0 0 auto;
    padding: 16px 24px;
    background: #fff;
}
.spexcy-gift__header { display: flex; justify-content: space-between; align-items: center; gap: 12px; border-bottom: 1px solid #e5e5e5; }
.spexcy-gift__header h2 { margin: 0; font: 600 22px/1.25 Arial, sans-serif; color: #111; }
.spexcy-gift__header p { margin: 3px 0 0; color: #555; font-size: 13px; }
.spexcy-gift__body { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 22px 24px; }
.spexcy-gift__body h3 { margin: 0 0 18px; color: #111; font: 400 clamp(22px, 4vw, 30px)/1.15 "Utopia Regular", Georgia, serif; }
.spexcy-gift__body [hidden], .spexcy-gift__footer [hidden] { display: none !important; }
.spexcy-gift__fields, .spexcy-gift__grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 14px; }
.spexcy-gift__wide { grid-column: 1 / -1; }
.spexcy-gift__fields label, .spexcy-gift__color { display: block; color: #222; font-size: 14px; font-weight: 600; }
.spexcy-gift__fields label span { color: #5a5a5a; font-weight: 400; }
.spexcy-gift__fields input, .spexcy-gift__fields textarea, .spexcy-gift select {
    box-sizing: border-box;
    display: block;
    width: 100%;
    min-height: 46px;
    margin: 4px 0 0;
    padding: 9px 12px;
    border: 1px solid #b9b9b9;
    border-radius: 8px;
    color: #111;
    background: #fff;
    font: 400 16px/1.35 Arial, sans-serif;
}
.spexcy-gift__card { display: block; min-width: 0; overflow: hidden; border: 1px solid #ddd; border-radius: 12px; color: #111; background: #fff; }
.spexcy-gift__card:has(:checked) { border-color: #111; box-shadow: inset 0 0 0 1px #111; }
.spexcy-gift__card img { display: block; width: 100%; height: auto; aspect-ratio: 2 / 1; padding: 12px; box-sizing: border-box; object-fit: contain; background: #f2f5f6; }
.spexcy-gift__card label { display: block; }
.spexcy-gift__card-line { display: grid; grid-template-columns: auto minmax(0,1fr) auto; align-items: center; gap: 8px; padding: 13px; font-size: 14px; cursor: pointer; }
.spexcy-gift .spexcy-gift__card-line input { appearance: auto; width: 18px; height: 18px; margin: 0; accent-color: #111; }
.spexcy-gift__card-line strong { overflow-wrap: anywhere; }
.spexcy-gift__color { margin: 0 13px 13px; }
.spexcy-gift__footer { border-top: 1px solid #e5e5e5; }
.spexcy-gift__buttons { display: flex; gap: 10px; }
.spexcy-gift button { box-sizing: border-box; min-height: 46px; padding: 9px 16px; border: 1px solid #111; border-radius: 8px; color: #111; background: #fff; font: 600 14px/1.3 Arial, sans-serif; cursor: pointer; }
.spexcy-gift button:focus-visible, .spexcy-gift input:focus-visible, .spexcy-gift select:focus-visible, .spexcy-gift textarea:focus-visible { outline: 2px solid #1c1c1c; outline-offset: 2px; }
.spexcy-gift .spexcy-gift__close { width: 44px; min-height: 44px; padding: 0; font-size: 25px; }
.spexcy-gift button[data-gift-next] { flex: 1; color: #fff; background: #111; }
.spexcy-gift button:disabled { opacity: .65; cursor: wait; }
.spexcy-gift__error { margin: 0 0 10px; color: #982626; font-size: 14px; }
.spexcy-gift-checkout { margin-bottom: 22px; padding: 14px 16px; border: 1px solid #ddd; border-radius: 8px; }
.spexcy-gift-checkout h3 { margin: 0 0 5px; font-size: 18px; overflow-wrap: anywhere; }
.spexcy-gift-checkout p { margin: 4px 0 0; overflow-wrap: anywhere; }
.spexcy-gift-shipping #ship-to-different-address { display: none; }
.spexcy-gift-shipping select, .spexcy-gift-shipping .select2-container { pointer-events: none; }
@media (max-width: 680px) {
    .spexcy-gift { inset: 0; width: 100vw; height: 100dvh; max-height: none; margin: 0; border-radius: 0; }
    .spexcy-gift__form { height: 100%; }
    .spexcy-gift__header { padding: max(12px,env(safe-area-inset-top)) 14px 12px; }
    .spexcy-gift__footer { padding: 12px 14px max(12px,env(safe-area-inset-bottom)); }
    .spexcy-gift__body { padding: 16px 14px; }
    .spexcy-gift__grid { grid-template-columns: minmax(0,1fr); }
}

.spexcy-gift .spexcy-gift__buttons > button:not([hidden]) {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 50px;
    padding: 10px 20px;
    text-align: center;
}
.spexcy-checkout-form:has([data-gift-mode="gift"]) [data-shipping-choice],
.spexcy-checkout-form:has([data-gift-mode="gift"]) .woocommerce-shipping-fields,
.spexcy-checkout-form:has([data-gift-mode="gift"]) .col-2 .spexcy-checkout-optional-toggle { display: none !important; }

.spexcy-gift__error a,
.spexcy-gift-checkout [data-edit-gift] {
    color: inherit;
    text-decoration: underline;
    text-underline-offset: .18em;
}

@media (hover: hover) {
    .spexcy-gift .spexcy-gift__buttons button:not(:disabled):hover { background: #111; color: #fff; }
    .spexcy-gift .spexcy-gift__buttons [data-gift-next]:not(:disabled):hover { background: #383838; }
}
@media (prefers-reduced-motion: no-preference) {
    .spexcy-gift .spexcy-gift__buttons button:not(:disabled) { transition: background-color 160ms ease, color 160ms ease, transform 160ms ease; }
    .spexcy-gift .spexcy-gift__buttons button:not(:disabled):hover { transform: translateY(-2px); }
}
