@import url('https://fonts.googleapis.com/css2?family=Bowlby+One&family=Inter:wght@400;500;600;700;800&display=swap');

@layer theme {
  :root {
    /* Graffiti UI Core Overrides */
    --gra-color-primary: #0B2B54;
    --gra-color-accent: #00AEEF;
    --gra-font-family-heading: 'Inter', sans-serif;
    --gra-font-family-base: 'Inter', sans-serif;

    /* Custom App Variables
     * Why these exist: Graffiti UI provides semantic utility classes and base brand colors (--gra-color-primary, --gra-color-accent). 
     * However, it does not mandate specific application background colors or surface layers. 
     * We define these here to build the Will-Fi specific layout (calculator cards, sidebar) on top of the framework. 
     */
    --color-primary: #0B2B54;
    --color-accent: #00AEEF;
    --color-bg: #F8FAFC;
    --color-surface: #FFFFFF;
    --color-surface-translucent: rgba(255, 255, 255, 0.5);
    --color-heading: var(--color-primary);
    --color-text: #1E293B;
    --color-text-light: #64748B;
    --color-border: #E2E8F0;
    --color-danger: #EF4444;
    --color-danger-bg: #FEF2F2;
    --color-danger-text: #991B1B;
    --radius: 12px;

    /* Animation Easing */
    --ease-spring: linear(0, 0.009, 0.035 1.1%, 0.141 2.4%, 0.383 4.2%, 0.725 6.5%, 0.941 8.3%,
        1.109 10.5%, 1.22 13.2%, 1.259 15.6%, 1.258 18.2%, 1.218 20.9%,
        1.144 24.2%, 1.05 28%, 0.985 31.8%, 0.948 36.2%, 0.941 40%,
        0.954 44.5%, 0.982 50.4%, 1.011 57.5%, 1.018 64.1%, 1.012 70.9%,
        0.999 77.4%, 0.996 85.3%, 1);
    --ease-squash: linear(0, 0.4, 0.8, 1.1, 1.15, 1.1, 1.02, 0.98, 1, 1);
  }

  [data-theme="dark"] {
    --color-primary: #020617;
    /* Slate 950 */
    --color-bg: #0F172A;
    /* Slate 900 */
    --color-surface: #1E293B;
    /* Slate 800 */
    --color-surface-translucent: rgba(30, 41, 59, 0.5);
    --color-heading: var(--color-text);
    --color-text: #F8FAFC;
    /* Slate 50 */
    --color-text-light: #94A3B8;
    /* Slate 400 */
    --color-border: #334155;
    /* Slate 700 */
    --color-danger: #EF4444;
    --color-danger-bg: #450a0a;
    --color-danger-text: #fecaca;
  }
}

body {
  background-color: var(--color-bg);
  color: var(--color-text);
  font-family: var(--gra-font-family-base, 'Inter', sans-serif);
  margin: 0;
  background-color: var(--color-bg);
  color: var(--color-text);
  line-height: 1.6;
  overflow-x: hidden;
}

/* Geometric SVG Background */
#geo-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: -1;
  pointer-events: none;
}

#geo-bg path.base-path {
  stroke: var(--color-text);
  stroke-width: 1;
  fill: none;
  opacity: 0.12;
}

#geo-bg path.trace-path {
  stroke: var(--color-accent);
  stroke-width: 3;
  fill: none;
  filter: drop-shadow(0 0 6px var(--color-accent)) drop-shadow(0 0 12px var(--color-accent));
  stroke-linecap: round;
  /* 8% trace length, 120% gap */
  stroke-dasharray: 0.08 1.2;
  /* As scroll-progress goes 0 -> 1, offset increases, pushing the dash backwards. We add initial-offset to stagger them. */
  stroke-dashoffset: calc((var(--scroll-progress, 0) * 1) + var(--initial-offset, 0));
  will-change: stroke-dashoffset;
}

h1,
h2,
h3,
h4 {
  font-family: var(--gra-font-family-heading, 'Inter', sans-serif);
  font-weight: 800; /* Extra bold Inter for card headings */
  color: var(--color-heading);
  margin-top: 0;
}

.header {
  position: relative;
  background: var(--color-primary);
  color: white;
  padding-top: 2rem;
  padding-bottom: 6rem; /* Extra padding for the geometric cut */
  clip-path: polygon(0 0, 100% 0, 100% 80%, 0 100%);
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto 2rem auto;
  padding: 0 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.theme-toggle {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: white;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: background-color 0.2s ease, transform 0.4s var(--ease-spring);
}

.theme-toggle:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: scale(1.1);
}

.theme-toggle svg {
  width: 20px;
  height: 20px;
}

.header h1 {
  font-family: 'Bowlby One', cursive;
  color: white;
  margin: 0 0 0.5rem 0;
  font-size: clamp(2.2rem, 5vw + 1rem, 3.5rem);
  font-weight: normal; /* Bowlby One only comes in normal */
}

.header h1 span {
  color: var(--color-accent);
}

.header p {
  margin: 0;
  opacity: 0.8;
  font-size: clamp(1rem, 2vw + 0.5rem, 1.1rem);
}

.app-container {
  max-width: 1200px;
  margin: -4rem auto 2rem auto; /* Negative margin pulls it up over the geometric cut */
  position: relative;
  z-index: 10;
  /* Ensure cards sit above the header and SVG */
  padding: 0 2rem;
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
}

@media (min-width: 900px) {
  .app-container {
    grid-template-columns: 2fr 1fr;
  }
}

/* Custom Component: .category-block
 * Why it exists: Graffiti UI provides generic panels, but we need specific grid spacing, custom borders, and layout geometry for the calculator's hardware category rows.
 */
.category-block {
  background: var(--color-surface-translucent);
  backdrop-filter: blur(12px);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  border: 1px solid var(--color-border);
}

.category-details summary::-webkit-details-marker {
  display: none;
}

.category-summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  user-select: none;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid transparent; /* Reserve space for border */
  transition: border-color 0.2s;
}

.category-details[open] .category-summary {
  margin-bottom: 1.5rem;
  border-bottom-color: var(--color-bg);
}

.category-summary h2 {
  margin-bottom: 0;
  font-size: clamp(1.25rem, 3vw + 0.5rem, 1.5rem);
  border-bottom: none;
  padding-bottom: 0;
}

.category-details .toggle-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: 2px solid var(--color-border);
  background: var(--color-surface-translucent);
  transition: all 0.3s var(--ease-spring);
}

.category-summary:hover .toggle-icon {
  background: var(--color-border);
  transform: scale(1.1);
  box-shadow: 0 4px 12px rgba(0, 174, 239, 0.2);
  border-color: var(--color-accent);
}

.category-details .toggle-icon::after {
  content: "";
  width: 8px;
  height: 8px;
  border: solid var(--color-text);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg) translateY(-2px);
  transition: transform 0.4s var(--ease-spring);
}

.category-details[open] .toggle-icon::after {
  transform: rotate(225deg) translate(-2px, -2px);
}

.category-content {
  /* No extra margin top needed since summary has margin-bottom */
}

.item-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 1rem;
  padding: 1rem 0;
  border-bottom: 1px solid var(--color-bg);
}

.item-row:last-child {
  border-bottom: none;
}

.item-info strong {
  display: block;
  font-size: 1.1rem;
}

.item-info small {
  color: var(--color-text-light);
}

.item-price {
  font-weight: 600;
  color: var(--color-text-light);
}

.item-control {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.item-control input[type="range"] {
  width: 100px;
  accent-color: var(--color-accent);
}

.item-control .qty-display {
  width: 30px;
  text-align: center;
  font-weight: 600;
  font-family: var(--gra-font-family-heading);
}

.btn-stepper {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  color: var(--color-text);
  border-radius: 4px;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-weight: bold;
  font-size: 1.1rem;
  transition: transform 0.4s var(--ease-spring), background 0.2s ease;
}

.btn-stepper:hover {
  background: var(--color-border);
}

.btn-stepper:active {
  transform: scale(0.85);
}

.hw-radio,
.hw-checkbox {
  width: 20px;
  height: 20px;
  accent-color: var(--color-accent);
  cursor: pointer;
}

/* Custom Component: .quote-card
 * Why it exists: This is a highly specialized sticky sidebar layout element utilizing a frosted glass backdrop-filter (glassmorphism) specifically for the live quote.
 */
.quote-card {
  background: var(--color-surface-translucent);
  backdrop-filter: blur(10px);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 1.5rem;
  position: sticky;
  top: 2rem;
  box-shadow: 0 20px 25px -5px rgba(11, 43, 84, 0.1), 0 10px 10px -5px rgba(11, 43, 84, 0.04);
}

.totals-block {
  margin-bottom: 2rem;
}

.totals-block h3 {
  margin-bottom: 0.25rem;
  font-size: 1.25rem;
}

.subtitle {
  margin: 0 0 1rem 0;
  font-size: 0.85rem;
  color: var(--color-text-light);
}

.total-price {
  font-size: clamp(1.8rem, 5vw + 1rem, 2.5rem);
  font-weight: 800;
  font-family: var(--gra-font-family-heading);
  color: var(--color-heading);
  line-height: 1;
}

.mrr-price {
  color: var(--color-accent);
}

.total-row.grand-total {
  margin-top: 1rem;
  font-size: clamp(1.5rem, 4vw + 0.5rem, 2.5rem);
  font-weight: 700;
  color: var(--color-text);
}

.per-month {
  font-size: 1rem;
  font-weight: 600;
  color: var(--color-text-light);
}

.breakdown-details {
  margin-top: 1rem;
  font-size: 0.9rem;
}

.breakdown-details summary {
  cursor: pointer;
  color: var(--color-text-light);
  font-weight: 500;
}

.breakdown-list {
  list-style: none;
  padding: 0;
  margin: 0.5rem 0 0 0;
}

.breakdown-list li {
  display: flex;
  justify-content: space-between;
  padding: 0.25rem 0;
  color: var(--color-text-light);
}

.export-btn {
  width: 100%;
  padding: 1rem;
  background-color: var(--color-accent);
  color: white;
  border: none;
  border-radius: 8px;
  font-weight: 700;
  font-size: 1.1rem;
  cursor: pointer;
  transition: background-color 0.2s, transform 0.4s var(--ease-spring);
}

.export-btn:hover {
  background-color: #0096D1;
}

.export-btn:active {
  transform: scale(0.95);
}

/* Custom Component: .tier-card
 * Why it exists: Graffiti UI does not provide a complex, selectable MSP tier card with interactive hover/active states and integrated price scaling. 
 */
.tier-cards {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  margin-top: 1rem;
}

@media (min-width: 768px) {
  .tier-cards {
    grid-template-columns: repeat(3, 1fr);
  }
}

.tier-card {
  background: var(--color-surface-translucent);
  backdrop-filter: blur(12px);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 1.5rem;
  cursor: pointer;
  transition: transform 0.5s var(--ease-spring), box-shadow 0.5s var(--ease-spring), border-color 0.2s ease, background 0.2s ease;
  display: flex;
  flex-direction: column;
}

.tier-card:hover {
  border-color: #cbd5e1;
  transform: translateY(-4px) scale(1.02);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.tier-card:active {
  transform: scale(0.98);
}

.tier-card.selected {
  border-color: var(--color-accent);
  background: rgba(0, 174, 239, 0.05);
  box-shadow: 0 0 0 1px var(--color-accent);
}

.tier-card h3 {
  margin: 0 0 0.5rem 0;
  font-size: 1.25rem;
}

.tier-price {
  font-size: 2rem;
  font-weight: 800;
  color: var(--color-heading);
  margin-bottom: 0.25rem;
}

.tier-price span {
  font-size: 1rem;
  color: var(--color-text-light);
  font-weight: 500;
}

.tier-device-price {
  color: var(--color-accent);
  font-weight: 600;
  margin-bottom: 1rem;
}

.tier-features {
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 0.9rem;
  color: var(--color-text-light);
  flex-grow: 1;
}

.tier-features li {
  padding: 0.3rem 0;
  border-bottom: 1px solid var(--color-bg);
}

.tier-features li:last-child {
  border-bottom: none;
}

.tier-features li::before {
  content: "✓";
  color: var(--color-accent);
  margin-right: 0.5rem;
  font-weight: bold;
}

/* Sub-items */
.sku-text {
  font-size: 0.8rem;
  color: var(--color-text-light);
  font-weight: normal;
  margin-left: 5px;
}

.item-desc {
  font-size: 0.85rem;
  color: var(--color-text-light);
  margin-top: 0.25rem;
  line-height: 1.3;
}

.subcategory-header {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--color-heading);
  background: var(--color-bg);
  padding: 8px 12px;
  border-radius: 6px;
  margin: 1.5rem 0 0.5rem 0;
}

/* Badges */
.managed-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background-color: rgba(0, 174, 239, 0.1);
  color: var(--color-accent);
  padding: 4px 8px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
  margin-top: 6px;
}

.unmanaged-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background-color: var(--color-bg);
  color: var(--color-text-light);
  padding: 4px 8px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 500;
  margin-top: 6px;
}

/* Animations */
.anim-fade-up {
  animation: fade-up-squash 0.8s var(--ease-squash) both;
}

@keyframes fade-up-squash {
  0% {
    transform: translateY(30px) scaleY(1.1);
    opacity: 0;
  }

  60% {
    transform: translateY(-2px) scaleY(0.95);
    opacity: 1;
  }

  100% {
    transform: translateY(0) scaleY(1);
    opacity: 1;
  }
}

/* System Unlocks */
.unlocks-container {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 1.5rem;
}

.unlock-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background-color: var(--color-surface);
  border: 1px solid var(--color-accent);
  color: var(--color-text);
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: help;
  box-shadow: 0 2px 4px rgba(0, 174, 239, 0.1);
  transition: transform 0.4s var(--ease-spring), box-shadow 0.2s ease;
}

.unlock-badge:hover {
  transform: translateY(-2px) scale(1.05);
  box-shadow: 0 4px 6px rgba(0, 174, 239, 0.15);
}

.unlock-badge svg {
  width: 14px;
  height: 14px;
  color: var(--color-accent);
}

.anim-spring-pop {
  animation: spring-pop 0.6s var(--ease-spring) both;
}

@keyframes spring-pop {
  0% {
    transform: scale(0.5);
    opacity: 0;
  }

  100% {
    transform: scale(1);
    opacity: 1;
  }
}

/* Custom Component: .toast 
 * Why it exists: Native implementation of the HTML Popover API for validation warnings, integrating specific @starting-style animations and spring physics not natively bundled in Graffiti UI. 
 */
#toast-container {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  right: auto;
  margin: 0;
  padding: 1rem;
  border: none;
  background: transparent;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  pointer-events: none;
  /* Let clicks pass through empty areas */
  z-index: 9999;
}

#toast-container:popover-open {
  display: flex;
  /* Override popover default display block */
}

.toast {
  pointer-events: auto;
  /* Re-enable clicks on the toast itself */
  background: var(--color-surface-translucent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(0, 0, 0, 0.05);
  padding: 12px 16px;
  border-radius: 8px;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
  color: var(--color-text);
  font-weight: 500;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  gap: 12px;
  transform-origin: bottom center;

  /* Entry & Exit animations using modern web standards */
  opacity: 1;
  transform: translateY(0) scale(1);

  transition-property: opacity, transform, display, overlay;
  transition-duration: 0.5s;
  transition-timing-function: var(--ease-spring);
  transition-behavior: allow-discrete;
}

/* @starting-style defines the entry animation */
@starting-style {
  .toast {
    opacity: 0;
    transform: translateY(20px) scale(0.9);
  }
}

/* Base exit state (when class .closing is applied) */
.toast.closing {
  opacity: 0;
  transform: translateY(20px) scale(0.9);
}

.toast-content {
  flex: 1;
}

.toast.warning {
  background: var(--color-danger-bg);
  border: 1px solid var(--color-danger);
  color: var(--color-danger-text);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.toast.warning .toast-close {
  color: var(--color-danger-text);
}

.toast.warning .toast-close:hover {
  background-color: rgba(239, 68, 68, 0.15);
  /* light red hover */
}

.toast-close {
  background: none;
  border: none;
  color: var(--color-text-light);
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s;
}

.toast-close:hover {
  background-color: var(--color-border);
  color: var(--color-text);
}

/* ==========================================================================
   Geometric & Glassmorphic Form Controls
   ========================================================================== */

/* Shared Reset */
.geo-checkbox,
.geo-radio,
.geo-slider,
.geo-stepper {
  appearance: none;
  -webkit-appearance: none;
  background: var(--color-surface-translucent);
  border: 2px solid var(--color-border);
  box-sizing: border-box;
  margin: 0;
  transition: all 0.2s var(--ease-spring);
}

.geo-checkbox:focus-visible,
.geo-radio:focus-visible,
.geo-slider:focus-visible,
.geo-stepper:focus-visible,
.btn-stepper:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

.geo-checkbox:disabled,
.geo-radio:disabled,
.geo-slider:disabled,
.geo-stepper:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Checkbox (Sharp Square) */
.geo-checkbox {
  width: 22px;
  height: 22px;
  border-radius: 0;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
  vertical-align: middle;
}

.geo-checkbox:checked {
  background: var(--color-accent);
  border-color: var(--color-accent);
  box-shadow: 0 0 12px rgba(0, 174, 239, 0.4);
}

.geo-checkbox:checked::after {
  content: "";
  width: 6px;
  height: 12px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg) translateY(-2px);
}

/* Radio (Diamond) */
.geo-radio {
  width: 20px;
  height: 20px;
  border-radius: 0; 
  transform: rotate(45deg);
  cursor: pointer;
  position: relative;
  margin: 4px 6px; /* Offset to allow for 45deg rotation bounding box */
  vertical-align: middle;
}

.geo-radio:checked {
  background: var(--color-accent);
  border-color: var(--color-accent);
  box-shadow: 0 0 12px rgba(0, 174, 239, 0.4);
}

.geo-radio:checked::after {
  content: "";
  position: absolute;
  top: 4px; left: 4px; right: 4px; bottom: 4px;
  background: white;
}

/* Slider */
.geo-slider {
  width: 100%;
  height: 8px;
  border-radius: 0;
  cursor: pointer;
  border: none;
  background: var(--color-border);
}

.geo-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  background: var(--color-accent);
  clip-path: polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%); /* Diamond thumb */
  cursor: grab;
  box-shadow: 0 0 12px rgba(0, 174, 239, 0.6);
  transition: transform 0.2s var(--ease-spring);
}
.geo-slider::-webkit-slider-thumb:active {
  cursor: grabbing;
  transform: scale(1.3);
}

/* Stepper (Number Input) */
.geo-stepper {
  width: 50px;
  padding: 5px;
  margin: 0 10px;
  text-align: center;
  border-radius: 0;
  color: var(--color-text);
  font-family: inherit;
  font-weight: 600;
  border-bottom: 2px solid var(--color-border);
  border-top: none;
  border-left: none;
  border-right: none;
  background: transparent;
}

.geo-stepper:focus {
  border-bottom-color: var(--color-accent);
}

.geo-stepper::-webkit-inner-spin-button,
.geo-stepper::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.geo-stepper[type=number] {
  -moz-appearance: textfield;
}

/* Geometric Stepper Buttons */
.btn-stepper {
  background: var(--color-surface-translucent);
  border: 2px solid var(--color-border);
  color: var(--color-text);
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border-radius: 0;
  transition: all 0.2s var(--ease-spring);
  font-weight: bold;
}

.btn-stepper:hover {
  background: var(--color-border);
}
.btn-stepper:active {
  transform: scale(0.9);
}

/* ==========================================================================
   Print Styles (BOM Export)
   ========================================================================== */

.print-bom {
  display: none;
}

@media print {
  /* Hide the entire interactive app */
  header, main, #geo-bg, #toast-container {
    display: none !important;
  }

  /* Show the clean BOM */
  .print-bom {
    display: block !important;
    background: white;
    color: black;
    font-family: var(--gra-font-family-base, sans-serif);
    padding: 2rem;
  }

  .print-bom h1 {
    font-family: var(--gra-font-family-heading, sans-serif);
    font-weight: 800;
    margin-bottom: 0.5rem;
    color: black;
  }
  
  .print-bom table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 2rem;
    margin-bottom: 2rem;
  }

  .print-bom th, .print-bom td {
    border-bottom: 1px solid #ccc;
    padding: 12px 8px;
    text-align: left;
  }

  .print-bom th {
    font-weight: bold;
    background: #f8f9fa;
  }

  .print-bom .bom-price {
    text-align: right;
  }
  
  .print-bom .bom-qty {
    text-align: center;
  }

  .print-bom .bom-totals {
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 2px solid black;
    text-align: right;
  }
  .print-bom .bom-totals h3 {
    margin: 0.5rem 0;
  }
}

@media (prefers-reduced-motion: reduce) {

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ==========================================================================
   Responsive / Mobile Adjustments
   ========================================================================== */
@media (max-width: 768px) {
  /* Reduce container paddings */
  .header-inner,
  .app-container {
    padding: 0 1rem;
  }
  
  /* Fix category blocks */
  .category-block {
    padding: 1rem;
  }
  
  /* Fix header overlap spacing */
  .header {
    padding-bottom: 4rem;
  }
  .app-container {
    margin-top: -2.5rem;
    gap: 1rem;
  }
  
  /* Stack item rows */
  .item-row {
    grid-template-columns: 1fr auto;
    grid-template-areas: 
      "info info"
      "price control";
    gap: 0.75rem 0.5rem;
    padding: 1rem 0;
  }
  .item-info {
    grid-area: info;
  }
  .item-price {
    grid-area: price;
    text-align: left;
    display: flex;
    align-items: center;
  }
  .item-control {
    grid-area: control;
    justify-content: flex-end;
  }

  /* Make tier cards stack more elegantly */
  .tier-cards {
    gap: 0.75rem;
  }
  .tier-card {
    padding: 1rem;
  }
  
  /* Adjust totals card */
  .totals-card {
    padding: 1.25rem;
  }
}