These rules apply at all viewport widths. The desktop media query in
Section 5 selectively overrides a handful of them.
.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;
/*
* Activates flexbox so that justify-content below has an effect.
* On mobile this wrapper contains only the toggle button as a visible child.
*/
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.
*/
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.
* Together these two properties make the panel as wide as the bar itself.
*/
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.
*/
max-height: 0;
/*
* Collapses the panel to zero height, making it invisible.
* This is the "hidden" default state on mobile.
* Works in tandem with overflow:hidden below.
*/
overflow: hidden;
/*
* Clips any content that extends beyond max-height:0.
* Without this the content would remain visible even at max-height:0
* because it would just spill outside the element's bounds.
*/
transition: max-height 0.35s ease;
/*
* Animates the height change when JavaScript adds or removes .show.
* The panel slides smoothly into view rather than appearing instantly.
* The timing (0.35s) should match the toggle button's width transition.
*/
}
.order-header-panel.show {
max-height: 600px;
/*
* JavaScript adds this class to reveal the panel.
* Set this value larger than the panel will ever actually be — the
* animation runs from 0 to this number, but stops visually as soon as
* the content ends. Too small: content is clipped. Too large: the
* animation eases out too slowly on short content. 600px is a safe
* default for a compact info bar; adjust for taller panels.
*/
}
.order-header-toggle
.order-header-toggle {
display: flex;
align-items: center;
justify-content: flex-end;
/*
* Lays out the label text and icon side by side, right-aligned.
* This keeps the text/icon position consistent as the button
* animates between its wide (100%) and narrow (33%) states.
*/
gap: 15px;
/*
* Space between the label text ("Order Details") and the +/- icon.
*/
width: 100%;
/*
* Full width when the panel is expanded (no .collapsed class).
* The width transitions smoothly; see transition below.
*/
border: none;
/*
* Removes the default browser button border. Essential for a
* clean bar appearance — without this a rectangle outline appears.
*/
padding: 10px 20px;
cursor: pointer;
white-space: nowrap;
/*
* Prevents the label text from wrapping to a new line during
* the width animation. Without this the text reflows awkwardly
* as the button shrinks from 100% to 33%.
*/
min-width: max-content;
/*
* Ensures the button never becomes narrower than its own text content.
* Acts as a floor so the label is never cut off during the animation.
* min-width: max-content means "be at least as wide as the content."
*/
transition: width 0.35s ease;
/*
* Smoothly animates the width change between 100% (open) and
* 33% (collapsed). The duration matches the panel's max-height
* transition so both animations finish at the same time.
*/
}
.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.
* JavaScript adds/removes .collapsed on click.
*/
}
.order-header-toggle::after {
content: "\2212"; /* − minus sign */
/*
* A CSS pseudo-element adds the expand/collapse icon without
* requiring any extra HTML element.
* The minus sign is shown when the panel is OPEN.
*/
font-size: 22px;
line-height: 1;
}
.order-header-toggle.collapsed::after {
content: "\002B"; /* + plus sign */
/*
* Swaps to a plus sign automatically whenever .collapsed is present.
* No JavaScript needed to change the icon — it follows the class.
*/
}
.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;
/*
* Vertical space between each frame. row-gap only applies in
* flex-direction:column; in row direction the gap property is used instead.
*/
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.
* overflow-wrap:anywhere is modern; word-break:break-word is the
* older-browser fallback that achieves the same result.
*/
}
.order-header-frame {
display: flex;
flex-direction: column;
/*
* The label sits above the value in a vertical 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.
* Setting min-width:0 allows the item to shrink past its content size.
*/
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 — an
* empty frame would otherwise leave a visible gap in the layout.
*/
}