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 (33%-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;
/*
* Ensures the button never becomes narrower than its own text content
* during the width animation.
*/
transition: width 0.35s ease;
/*
* Smoothly animates the width change between 100% (open) and
* 33% (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: 33%;
/*
* Compact tab size when the panel is hidden. Because .order-header-outer
* uses justify-content:flex-end, this 33%-wide button sits anchored to
* the right side of the bar. 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: "\2212"; /* − minus sign, shown when OPEN */
font-size: 22px;
line-height: 1;
}
.order-header-toggle.collapsed::after {
content: "\002B"; /* + plus sign, 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.
*/
}