/* Real3D Flipbook — order pad (bulk ordering). Inert unless a host activates it. */

.r3d-order-fab {
    position: fixed;
    right: 16px;
    bottom: 72px;
    z-index: 9999990;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border: 0;
    border-radius: 999px;
    background: #1a1a1a;
    color: #fff;
    font: 600 14px/1 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
    cursor: pointer;
}
.r3d-order-fab:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }
.r3d-order-fab-count {
    min-width: 22px;
    height: 22px;
    padding: 0 6px;
    border-radius: 11px;
    background: rgba(255, 255, 255, 0.18);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
}
.r3d-order-fab.has-items .r3d-order-fab-count { background: #2e7d32; }

.r3d-order-panel {
    box-sizing: border-box;
    width: min(460px, 100%);
    max-width: 100%;
    height: 100%;
    max-height: 100%;
    margin: 0 0 0 auto;
    padding: 0;
    border: 0;
    background: #fff;
    color: #1a1a1a;
    font: 14px/1.4 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.r3d-order-panel:not([open]) { display: none; }
.r3d-order-panel::backdrop { background: rgba(0, 0, 0, 0.35); }
.r3d-order-panel button { font: inherit; }
.r3d-order-panel button:focus-visible,
.r3d-order-panel input:focus-visible { outline: 2px solid #1a1a1a; outline-offset: 2px; }

.r3d-order-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px 8px;
}
.r3d-order-title { margin: 0; font-size: 18px; font-weight: 600; }
.r3d-order-close {
    border: 0;
    background: transparent;
    font-size: 26px;
    line-height: 1;
    cursor: pointer;
    padding: 4px 8px;
}
.r3d-order-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 0 20px 12px;
    border-bottom: 1px solid #e5e5e5;
}
.r3d-order-filter {
    border: 1px solid #c9c9c9;
    background: #fff;
    border-radius: 999px;
    padding: 6px 12px;
    cursor: pointer;
}
.r3d-order-filter.is-on { background: #1a1a1a; color: #fff; border-color: #1a1a1a; }
.r3d-order-count { color: #6b7280; font-size: 13px; }
.r3d-order-status { padding: 0 20px; color: #374151; font-size: 13px; }
.r3d-order-status:empty { display: none; }
.r3d-order-status:not(:empty) { padding-top: 12px; }

.r3d-order-list { flex: 1; overflow-y: auto; padding: 8px 20px 16px; }
.r3d-order-chapter { margin: 14px 0 6px; font-size: 12px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: #6b7280; }
.r3d-order-empty, .r3d-order-note { color: #6b7280; margin: 8px 0; }
.r3d-order-product { border-bottom: 1px solid #eee; }
.r3d-order-product-head {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    border: 0;
    background: transparent;
    text-align: left;
    cursor: pointer;
}
.r3d-order-thumb { width: 44px; height: 44px; object-fit: cover; border-radius: 6px; background: #f3f4f6; flex-shrink: 0; }
.r3d-order-product-text { min-width: 0; }
.r3d-order-product-title { font-weight: 600; }
.r3d-order-product-meta { color: #6b7280; font-size: 12px; }
.r3d-order-product-body { padding: 0 0 10px 56px; }
.r3d-order-variant { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 6px 0; }
.r3d-order-variant-text { min-width: 0; }
.r3d-order-variant-meta, .r3d-order-variant-landed { color: #6b7280; font-size: 12px; }
.r3d-order-variant-landed { color: #b45309; }
.r3d-order-qty-wrap { flex-shrink: 0; width: 72px; }
.r3d-order-qty {
    width: 100%;
    box-sizing: border-box;
    padding: 6px 8px;
    border: 1px solid #c9c9c9;
    border-radius: 6px;
    font: inherit;
    text-align: right;
}
.r3d-order-qty[aria-invalid="true"] { border-color: #b91c1c; }
.r3d-order-qty-error { color: #b91c1c; font-size: 11px; margin-top: 2px; }
.r3d-order-qty-error:empty { display: none; }
.r3d-order-link { color: #1a1a1a; text-decoration: underline; background: none; border: 0; padding: 0; cursor: pointer; }

.r3d-order-foot { padding: 12px 20px 16px; border-top: 1px solid #e5e5e5; background: #fff; }
.r3d-order-pricenote { color: #6b7280; font-size: 12px; margin-bottom: 8px; }
.r3d-order-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.r3d-order-btn {
    padding: 10px 16px;
    border: 1px solid #1a1a1a;
    border-radius: 6px;
    background: #fff;
    color: #1a1a1a;
    cursor: pointer;
}
.r3d-order-btn.is-primary { background: #1a1a1a; color: #fff; }
.r3d-order-btn.is-danger { border-color: #b91c1c; color: #b91c1c; }
.r3d-order-btn:disabled { opacity: 0.5; cursor: default; }

/* Request mode: prices per line, totals and the contact step. */
.r3d-order-price { font-size: 13px; color: #1a1a1a; }
.r3d-order-price.is-muted { color: #6b7280; }
.r3d-order-summary { margin-bottom: 10px; font-size: 13px; }
.r3d-order-summary:empty { display: none; }
.r3d-order-sum-row { display: flex; justify-content: space-between; gap: 12px; padding: 2px 0; }
.r3d-order-sum-row.is-total { font-weight: 600; font-size: 15px; border-top: 1px solid #e5e5e5; margin-top: 4px; padding-top: 6px; }
.r3d-order-sum-note { color: #6b7280; font-size: 12px; margin-top: 4px; white-space: pre-line; }
.r3d-order-pricenote:empty { display: none; }
.r3d-order-form { display: flex; flex-direction: column; gap: 10px; padding-bottom: 8px; }
.r3d-order-field { display: flex; flex-direction: column; gap: 4px; }
.r3d-order-field-label { font-size: 13px; color: #374151; }
.r3d-order-input {
    box-sizing: border-box;
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #c9c9c9;
    border-radius: 6px;
    background: #fff;
    color: #1a1a1a;
    font: inherit;
}
.r3d-order-input[aria-invalid="true"] { border-color: #b91c1c; }
.r3d-order-panel select:focus-visible,
.r3d-order-panel textarea:focus-visible { outline: 2px solid #1a1a1a; outline-offset: 2px; }
.is-request .r3d-order-qty-wrap { width: 84px; }

/* While ordering is active the pad is the editor: hide the tooltip's own
   variant select and stepper so a buyer chooses once. */
.r3d-ordering:not(.r3d-order-inline) .flipbook-hotspot-tooltip-variant-select,
.r3d-ordering:not(.r3d-order-inline) .flipbook-hotspot-tooltip-qty { display: none !important; }

.r3d-slot {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 40px;
    display: flex;
    gap: 4px;
    background: var(--cat-paper, #fff);
    -webkit-user-select: none;
    user-select: none;
}
.r3d-slot-btn,
.r3d-slot-step {
    flex: 1;
    min-width: 0;
    height: 40px;
    padding: 0 8px;
    border: 0;
    border-radius: 4px;
    background: var(--cat-ink, #1a1a1a);
    color: var(--cat-paper, #fff);
    font: 500 12px/40px var(--cat-font-body, inherit);
    letter-spacing: 1px;
    text-transform: uppercase;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: pointer;
}
.r3d-slot-step { flex: none; width: 40px; padding: 0; font-size: 18px; letter-spacing: 0; }
.r3d-slot-btn:disabled { opacity: .6; cursor: default; }
.r3d-slot-qty {
    flex: 1;
    min-width: 0;
    box-sizing: border-box;
    height: 40px;
    border: 1px solid var(--cat-ink, #1a1a1a);
    border-radius: 4px;
    background: var(--cat-paper, #fff);
    color: var(--cat-ink, #1a1a1a);
    font: 600 14px/38px var(--cat-font-body, inherit);
    text-align: center;
    -webkit-user-select: text;
    user-select: text;
}
.r3d-slot button:focus-visible,
.r3d-slot input:focus-visible { outline: 2px solid var(--cat-ink, #1a1a1a); outline-offset: 2px; }
.r3d-order-inline .cat-order-thumb.is-on { outline: 2px solid var(--cat-ink, #1a1a1a); outline-offset: 1px; }

.r3d-order-toast {
    position: fixed;
    left: 50%;
    bottom: 72px;
    transform: translateX(-50%);
    z-index: 2147483000;
    display: flex;
    align-items: center;
    gap: 12px;
    max-width: calc(100% - 32px);
    box-sizing: border-box;
    padding: 10px 14px;
    border-radius: 8px;
    background: #1a1a1a;
    color: #fff;
    font: 14px/1.3 system-ui, -apple-system, sans-serif;
}
.r3d-order-toast-btn {
    padding: 0;
    border: 0;
    background: none;
    color: #fff;
    font: inherit;
    text-decoration: underline;
    cursor: pointer;
}

@media (max-width: 600px) {
    .r3d-order-panel { width: 100%; }
    .r3d-order-product-body { padding-left: 0; }
}
@media (prefers-reduced-motion: reduce) {
    .r3d-order-panel, .r3d-order-fab { transition: none; }
}
@media print {
    .r3d-order-panel, .r3d-order-fab, .r3d-order-toast, .r3d-slot { display: none !important; }
}
