These rules apply at all viewport widths. The desktop media query in
Section 5 selectively overrides a handful of them. Because Bootstrap's
collapse component now owns the show/hide mechanics, the panel
itself needs far fewer custom rules than a hand-rolled version would; just
enough to make it overlay the page instead of sitting in the normal flow.
.order-header-outer
.order-header-outer {
position: relative;
/*
* Creates a positioning context so that position:absolute on the panel
* is calculated from THIS element's edges, not from the nearest
* positioned ancestor elsewhere in the DOM.
* Without this, top:100% on the panel would not mean "below the toggle bar."
*/
display: flex;
justify-content: flex-end;
/*
* Pushes the toggle button to the right edge.
* When the button is in its collapsed (one-third-wide) state it appears as a
* compact tab in the corner rather than a left-aligned strip.
*/
}
.order-header-panel
.order-header-panel {
position: absolute;
/*
* Lifts the panel out of the normal document flow entirely.
* It will not push down sibling elements; it floats on top of them.
* This is the property that gives the panel its "overlay" behavior.
* Bootstrap's .collapse class still drives the height animation and
* the show/hidden state. This rule only changes how the panel is
* positioned once it's visible.
*/
top: 100%;
/*
* 100% equals the full height of the containing block (.order-header-outer).
* This places the top edge of the panel immediately below the toggle button.
*/
left: 0;
right: 0;
/*
* Stretches the panel to the full width of .order-header-outer.
*/
z-index: 200;
/*
* Stacks the panel above other page content when it is open.
* Raise this number if modals, sticky navbars, or other overlays
* appear in front of the panel unexpectedly.
*/
}
.order-header-toggle
.order-header-toggle {
display: flex;
align-items: center;
justify-content: flex-end;
gap: 15px;
width: 100%;
/*
* Full width when the panel is expanded (no .collapsed class).
* The width transitions smoothly; see transition below.
*/
border: none;
padding: 10px 20px;
cursor: pointer;
white-space: nowrap;
min-width: max-content;
/*
* Backstop only: keeps the label from clipping if it ever outgrows
* the 11em collapsed floor (see .collapsed below). If this clamp
* engages mid-animation the width visibly stops early, so widen the
* floor rather than lean on it.
*/
transition: width 0.35s ease;
/*
* Smoothly animates the width change between 100% (open) and
* max(33%, 11em) (collapsed). This runs independently of Bootstrap's own
* collapse animation on the panel. The two transitions are timed
* to match (0.35s) so they finish together.
*/
}
.order-header-toggle.collapsed {
width: max(33%, 11em);
/*
* Compact tab size when the panel is hidden. Because .order-header-outer
* uses justify-content:flex-end, the collapsed button sits anchored to
* the right side of the bar.
*
* The 11em floor is about TIMING, not just looks. With a plain 33%
* target, min-width: max-content clamps the rendered width on narrow
* screens, but the 0.35s transition timeline keeps running against
* that frozen width, so the button visibly stops moving before the
* panel's height animation finishes. Flooring the target with max()
* means the transition never fights the clamp, and both animations
* end together.
*
* The small script in Section 6 toggles this class in sync with
* Bootstrap's show.bs.collapse / hide.bs.collapse events.
*/
}
.order-header-toggle::after {
content: "";
display: block;
width: 8px;
height: 8px;
border-right: 2px solid currentColor;
border-bottom: 2px solid currentColor;
/*
* A box with only its right and bottom edges drawn forms a corner.
* Rotating that corner is what points it in different directions;
* see the transform values below and on .collapsed below that.
*/
transition: transform .2s ease;
transform: translateY(-2px) rotate(45deg); /* pointing down, shown when OPEN */
}
.order-header-toggle.collapsed::after {
transform: translateY(0) rotate(-45deg); /* pointing right, shown when CLOSED */
}
.order-header-container and .order-header-frame
.order-header-container {
display: flex;
flex-direction: column;
/*
* On mobile: stacks each data frame (label + value pair) vertically.
* The desktop media query overrides this to flex-direction:row.
*/
align-items: flex-start;
row-gap: 22px;
padding: 18px 24px 24px;
overflow-wrap: anywhere;
word-break: break-word;
/*
* Allows long strings (order numbers, tracking IDs) to wrap at any
* character instead of overflowing their container.
*/
}
.order-header-frame {
display: flex;
flex-direction: column;
align-items: flex-start;
gap: 4px;
min-width: 0;
/*
* A common flexbox fix: flex items default to min-width:auto which
* can cause them to overflow their container when content is wide.
*/
max-width: 100%;
}
.order-header-frame:empty {
display: none;
/*
* Automatically hides any frame element with no child content.
* Useful when fields are conditionally rendered server-side.
*
* Caveat: :empty only matches a TRULY empty element; even the
* whitespace/newline between tags defeats it. Render the empty
* frame as <div class="order-header-frame"></div> with
* nothing (not even a line break) between the tags.
*/
}