/* Public shop UI: load after the host stylesheet. All selectors use one wrapper. */
.o4d-shop {
    max-width: 760px;
    margin: 0 auto;
    padding: 24px 16px 40px;
    box-sizing: border-box;
    color: #222;
    font-family: inherit;
    font-size: 16px;
    font-weight: 400;
    font-style: normal;
    line-height: 1.5;
    letter-spacing: normal;
    text-align: left;
    text-transform: none;
}
.o4d-shop *,
.o4d-shop *::before,
.o4d-shop *::after { box-sizing: border-box; }

/* Restore typography only inside the component, including directly styled forms. */
.o4d-shop form,
.o4d-shop fieldset,
.o4d-shop legend,
.o4d-shop label,
.o4d-shop input,
.o4d-shop select,
.o4d-shop button,
.o4d-shop p,
.o4d-shop a,
.o4d-shop span,
.o4d-shop .o4d-shop-result,
.o4d-shop .o4d-shop-reminder {
    color: inherit;
    font: inherit;
    letter-spacing: normal;
    text-transform: none;
    text-shadow: none;
    text-align: inherit;
}
.o4d-shop form {
    display: block;
    float: none;
    width: 100%;
    max-width: none;
    min-width: 0;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
}
.o4d-shop p { margin: 12px 0; padding: 0; }
.o4d-shop a { color: #365d00; text-decoration: underline; }
.o4d-shop a:hover { color: #243e00; }
.o4d-shop strong { color: inherit; font-family: inherit; font-size: inherit; font-weight: 700; line-height: inherit; }
.o4d-shop small { font-size: 13px; font-weight: 400; line-height: 1.5; }
.o4d-shop h1,
.o4d-shop h2 {
    margin: 0 0 12px;
    padding: 0;
    color: inherit;
    font-family: inherit;
    font-weight: 700;
    font-style: normal;
    line-height: 1.25;
    letter-spacing: normal;
    text-transform: none;
}
.o4d-shop h1 { font-size: 28px; }
.o4d-shop h2 { font-size: 22px; }

/* Compact fields; preserve the existing outer width and centering. */
.o4d-shop fieldset { display: block; min-width: 0; margin: 20px 0; padding: 0; border: 0; }
.o4d-shop legend {
    display: block;
    float: none;
    width: 100%;
    margin: 0 0 10px;
    padding: 0;
    color: inherit;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.4;
}
.o4d-shop .o4d-shop-fields {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px 16px;
    width: 100%;
    min-width: 0;
    margin: 0;
    padding: 0;
}
.o4d-shop .o4d-shop-fields label {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
    float: none;
    width: auto;
    min-width: 0;
    margin: 0;
    padding: 0;
    color: inherit;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.4;
}
.o4d-shop .o4d-shop-fields label small {
    display: block;
    margin: 0;
    padding: 0;
    color: #4e5747;
    font-size: 13px;
    font-weight: 400;
    line-height: 1.4;
}
/* Three classes match common input:not(...) host specificity; loaded last wins. */
.o4d-shop .o4d-shop-form .o4d-shop-fields input,
.o4d-shop .o4d-shop-form .o4d-shop-fields select {
    display: block;
    float: none;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    height: 46px;
    min-height: 46px;
    margin: 0;
    padding: 10px 12px;
    border: 1px solid #888;
    border-radius: 5px;
    background: #fff;
    color: #222;
    box-shadow: none;
    font-family: inherit;
    font-size: 16px;
    font-weight: 400;
    line-height: 1.4;
}
.o4d-shop .o4d-shop-form .o4d-shop-fields select:disabled { background: #eee; color: #666; cursor: not-allowed; }
.o4d-shop input:focus-visible,
.o4d-shop select:focus-visible,
.o4d-shop button:focus-visible,
.o4d-shop a:focus-visible { outline: 3px solid #315f82; outline-offset: 2px; }
.o4d-shop .o4d-shop-help { margin: 10px 0 0; padding: 0; color: #4e5747; font-size: 14px; line-height: 1.5; }
.o4d-shop .o4d-shop-total { margin: 18px 0 12px; font-size: 18px; line-height: 1.5; }
.o4d-shop button {
    display: inline-block;
    float: none;
    width: auto;
    max-width: 100%;
    min-height: 46px;
    height: auto;
    margin: 0;
    padding: 12px 20px;
    border: 1px solid transparent;
    border-radius: 6px;
    background: #589000;
    color: #fff;
    box-shadow: none;
    font-size: 16px;
    font-weight: 700;
    line-height: 1.4;
    text-align: center;
    white-space: normal;
    cursor: pointer;
}
.o4d-shop button:disabled { opacity: .6; cursor: default; }
.o4d-shop button.o4d-shop-secondary { background: #eef1e9; color: #303b25; border-color: #9ba68e; }
.o4d-shop .o4d-shop-error { margin: 12px 0; padding: 12px 14px; border-left: 4px solid #b33400; background: #fff1eb; color: #582900; overflow-wrap: anywhere; }
.o4d-shop .o4d-shop-honey { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

/* Existing package presentation for other installations. */
.o4d-shop .o4d-shop-packages { display: flex; gap: 12px; }
.o4d-shop .o4d-shop-package { flex: 1; position: relative; cursor: pointer; }
.o4d-shop .o4d-shop-package input { position: absolute; top: 16px; left: 12px; width: 20px; height: 20px; margin: 0; accent-color: #589000; }
.o4d-shop .o4d-shop-package span { display: block; padding: 16px 12px 16px 40px; border: 2px solid #ccc; border-radius: 10px; background: #fff; }
.o4d-shop .o4d-shop-package input:checked + span { border-color: #589000; background: #eff9df; }
.o4d-shop .o4d-shop-package input:focus-visible + span { outline: 3px solid #222; outline-offset: 3px; }

/* Result and reminder retain their existing presentation within the same scope. */
.o4d-shop .o4d-shop-result { margin: 12px 0; padding: 32px; border: 1px solid #d8dfd1; border-radius: 12px; background: #fafcf7; overflow-wrap: anywhere; }
.o4d-shop .o4d-shop-result h1 { margin: 12px 0 20px; font-size: clamp(24px, 4vw, 32px); }
.o4d-shop .o4d-shop-result p { margin: 14px 0; }
.o4d-shop .o4d-shop-result form { margin-top: 24px; }
.o4d-shop .o4d-shop-result-success { background: #f4faed; border-color: #a6c780; }
.o4d-shop .o4d-shop-result-success > p:not(.o4d-shop-result-number) strong { white-space: nowrap; }
.o4d-shop .o4d-shop-result-number { padding: 14px 0; border-top: 1px solid #d8dfd1; border-bottom: 1px solid #d8dfd1; }
.o4d-shop .o4d-shop-result-check { display: inline-flex; align-items: center; justify-content: center; width: 54px; height: 54px; border-radius: 50%; background: #e0f0cc; color: #456f00; font-size: 32px; font-weight: 700; }
.o4d-shop .o4d-shop-result-spinner { display: block; width: 38px; height: 38px; border: 3px solid #dce7cf; border-top-color: #589000; border-radius: 50%; animation: o4d-shop-result-spin 1.2s linear infinite; }
.o4d-shop .o4d-shop-result-long { padding: 12px 14px; border-left: 3px solid #7c925f; background: #edf2e7; }
.o4d-shop .o4d-shop-result-actions { display: flex; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.o4d-shop .o4d-shop-result-actions form { margin-top: 12px; flex: 1 1 220px; width: auto; }
.o4d-shop .o4d-shop-result-leave-note { font-size: 14px; color: #4e5747; }
.o4d-shop .o4d-shop-reminder { margin: 24px 0; padding: 18px 20px; border: 1px solid #d8dfd1; border-left: 4px solid #589000; border-radius: 8px; background: #f7faf2; overflow-wrap: anywhere; }
.o4d-shop .o4d-shop-reminder h2 { margin: 0 0 10px; font-size: 20px; line-height: 1.35; }
.o4d-shop .o4d-shop-reminder p { margin: 10px 0; }
.o4d-shop .o4d-shop-reminder-actions { display: flex; gap: 12px 20px; align-items: center; flex-wrap: wrap; }
.o4d-shop .o4d-shop-reminder-actions form { margin: 0; width: auto; }
.o4d-shop .o4d-shop-reminder button { padding: 10px 14px; font-size: 15px; }

@keyframes o4d-shop-result-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
    .o4d-shop .o4d-shop-result-spinner { animation: none; }
}
@media (max-width: 560px) {
    .o4d-shop .o4d-shop-fields { grid-template-columns: minmax(0, 1fr); }
    .o4d-shop .o4d-shop-packages { flex-direction: column; }
    .o4d-shop button { width: 100%; }
    .o4d-shop .o4d-shop-result { padding: 24px 18px; }
    .o4d-shop .o4d-shop-result-check { width: 46px; height: 46px; font-size: 28px; }
}
/* Last: hidden validation messages and stopped spinners must stay hidden. */
.o4d-shop [hidden] { display: none; }
