/* 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; }

/* 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 .flipbook-hotspot-tooltip-variant-select,
.r3d-ordering .flipbook-hotspot-tooltip-qty { display: none !important; }

@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 { display: none !important; }
}
