* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg-page: #ffffff;
  --bg-subtle: #f5f5f7;
  /* Align with product PNG/WebP backdrops (Apple store–style light gray) */
  --bg-gallery: #f5f5f7;
  --text: #1d1d1f;
  --text-secondary: #424245;
  --muted: #6e6e73;
  --blue: #0071e3;
  --blue-ring: #0071e3;
  --nav-h: 44px;
  --toolbar-sticky-h: 88px;
  --font-apple:
    -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Helvetica Neue", Helvetica, Arial, sans-serif;
}

body {
  font-family: var(--font-apple);
  background: var(--bg-page);
  color: var(--text);
  font-size: 17px;
  line-height: 1.47;
  letter-spacing: -0.022em;
  -webkit-font-smoothing: antialiased;
}

.top-nav {
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: saturate(180%) blur(18px);
  border-bottom: 1px solid #d2d2d7;
  position: sticky;
  top: 0;
  z-index: 20;
}

.nav-wrap {
  max-width: 1200px;
  margin: 0 auto;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 0 22px;
}

.brand {
  color: #1d1d1f;
  text-decoration: none;
  font-size: 12px;
  font-weight: 400;
  letter-spacing: -0.01em;
  display: inline-flex;
  align-items: center;
  line-height: 0;
}

.brand-logo {
  display: block;
  height: 27px;
  width: auto;
  max-width: min(210px, 48vw);
}

.menu {
  display: flex;
  align-items: center;
  gap: 16px;
  overflow-x: auto;
  scrollbar-width: none;
}

.menu::-webkit-scrollbar {
  display: none;
}

.menu a {
  color: #1d1d1fcc;
  text-decoration: none;
  font-size: 12px;
  font-weight: 400;
  white-space: nowrap;
  letter-spacing: -0.01em;
}

.menu a.is-active {
  color: #1d1d1f;
  font-weight: 500;
}

.nav-icons {
  display: flex;
  align-items: center;
  gap: 2px;
}

.nav-icon-btn,
.nav-menu-toggle {
  border: none;
  background: transparent;
  color: #1d1d1f;
  cursor: pointer;
  padding: 0;
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.nav-menu-toggle {
  display: none;
}

.nav-menu-bars {
  position: relative;
  width: 17px;
  height: 11px;
  display: block;
}

.nav-menu-bars::before,
.nav-menu-bars::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  height: 1px;
  border-radius: 1px;
  background: #1d1d1f;
}

.nav-menu-bars::before {
  top: 2px;
}

.nav-menu-bars::after {
  bottom: 2px;
}

/* Sticky product bar (Apple buy page) */
.buyiphone-toolbar {
  position: sticky;
  top: var(--nav-h);
  z-index: 15;
  background: var(--bg-page);
  border-bottom: 1px solid #d2d2d7;
}

.buyiphone-toolbar-inner {
  max-width: 1220px;
  margin: 0 auto;
  padding: 14px 22px 12px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}

.buyiphone-toolbar-title {
  font-size: 19px;
  font-weight: 600;
  letter-spacing: 0.011em;
  line-height: 1.3;
  color: var(--text);
}

.buyiphone-toolbar-right {
  text-align: right;
  min-width: 0;
}

.buyiphone-toolbar-price {
  font-size: 14px;
  font-weight: 400;
  color: var(--muted);
  letter-spacing: -0.016em;
  line-height: 1.35;
}

.buyiphone-toolbar-meta {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 6px;
  flex-wrap: wrap;
}

.buyiphone-meta-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: var(--muted);
  letter-spacing: -0.01em;
}

.buyiphone-meta-item svg {
  opacity: 0.85;
  flex-shrink: 0;
}

.buyiphone-meta-divider {
  width: 1px;
  height: 12px;
  background: #d2d2d7;
}

.iphone-main {
  max-width: 1220px;
  margin: 0 auto;
  padding: 28px 22px 80px;
}

.iphone-config-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, 400px);
  gap: 44px;
  align-items: start;
}

/* Sticky gallery card */
.iphone-visual-panel {
  position: sticky;
  top: calc(var(--nav-h) + var(--toolbar-sticky-h));
  align-self: start;
}

.iphone-visual-stage {
  background: var(--bg-gallery);
  border-radius: 18px;
  width: 100%;
  aspect-ratio: 1 / 1;
  max-height: min(640px, 85vh);
  min-height: 0;
  overflow: hidden;
  display: block;
  position: relative;
}

.iphone-visual-stage img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  display: block;
}

.iphone-config-panel {
  display: flex;
  flex-direction: column;
  gap: 32px;
  padding-bottom: 40px;
}

.config-block {
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 0;
}

.config-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.01em;
  margin-bottom: 8px;
}

.config-block select {
  width: 100%;
  max-width: 100%;
  border: 1px solid #d2d2d7;
  border-radius: 10px;
  font-size: 17px;
  color: var(--text);
  font-family: inherit;
  padding: 11px 14px;
  background: var(--bg-page);
  letter-spacing: -0.022em;
}

.config-heading {
  font-size: 28px;
  line-height: 1.1;
  letter-spacing: 0.007em;
  font-weight: 600;
  margin-bottom: 16px;
}

.config-heading span {
  color: var(--muted);
  font-weight: 400;
}

.choice-list {
  display: flex;
  flex-direction: column;
  gap: 11px;
}

.choice-item {
  width: 100%;
  border: 1px solid #d2d2d7;
  border-radius: 12px;
  background: var(--bg-page);
  text-align: left;
  padding: 14px 16px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  font-family: inherit;
}

.choice-item:hover {
  border-color: #86868b;
}

.choice-item.is-selected {
  border-color: var(--blue);
  box-shadow: 0 0 0 1px var(--blue);
}

.choice-main {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.choice-title {
  font-size: 21px;
  line-height: 1.15;
  letter-spacing: 0.011em;
  font-weight: 600;
  color: var(--text);
}

.choice-sub {
  font-size: 14px;
  line-height: 1.35;
  font-weight: 400;
  color: var(--text-secondary);
  letter-spacing: -0.016em;
}

.choice-price {
  text-align: right;
  font-size: 12px;
  font-weight: 400;
  color: var(--text-secondary);
  line-height: 1.35;
  letter-spacing: -0.01em;
}

/* Finish / color */
.finish-color-label {
  font-size: 14px;
  color: var(--text);
  margin-bottom: 14px;
  letter-spacing: -0.016em;
}

.finish-color-dash {
  color: var(--muted);
}

#finishColorName {
  font-weight: 400;
}

.finish-swatches {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
}

.finish-swatch {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid rgba(0, 0, 0, 0.08);
  padding: 0;
  cursor: pointer;
  background-clip: padding-box;
  box-sizing: border-box;
  flex-shrink: 0;
  transition:
    box-shadow 0.15s ease,
    transform 0.15s ease;
}

.finish-swatch:hover {
  transform: scale(1.05);
}

.finish-swatch.is-selected {
  box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--blue-ring);
}

.finish-swatch:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 3px;
}

.checkout-panel {
  background: var(--bg-subtle);
  border-radius: 14px;
  padding: 20px 18px;
  border: none;
}

.checkout-panel p {
  font-size: 15px;
  color: var(--text);
  line-height: 1.4;
  letter-spacing: -0.016em;
}

.checkout-panel button {
  margin-top: 14px;
  width: 100%;
  border: none;
  border-radius: 980px;
  background: var(--blue);
  color: #fff;
  font-size: 17px;
  font-weight: 400;
  font-family: inherit;
  letter-spacing: -0.022em;
  padding: 12px 24px;
  cursor: pointer;
}

.checkout-panel button:disabled {
  cursor: not-allowed;
  opacity: 0.4;
}

.checkout-panel small {
  display: block;
  margin-top: 12px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
  letter-spacing: -0.01em;
  text-align: center;
}

.checkout-panel small.buyiphone-pricing-note {
  margin-top: 8px;
  font-size: 11px;
}

/* Checkout modals (Paystack + customer details) */
body.checkout-modal-open {
  overflow: hidden;
}

.checkout-modal {
  position: fixed;
  inset: 0;
  z-index: 10050;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px 16px;
}

.checkout-modal[hidden] {
  display: none !important;
}

.checkout-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.42);
  backdrop-filter: blur(4px);
}

.checkout-modal-panel {
  position: relative;
  width: min(100%, 520px);
  max-height: min(92vh, 720px);
  overflow: auto;
  background: var(--bg-page);
  border-radius: 18px;
  box-shadow:
    0 4px 24px rgba(0, 0, 0, 0.12),
    0 0 1px rgba(0, 0, 0, 0.08);
  padding: 22px 22px 24px;
  z-index: 1;
}

.checkout-modal-panel--narrow {
  max-width: 400px;
}

.checkout-modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.checkout-modal-title {
  font-size: 28px;
  font-weight: 600;
  letter-spacing: 0.007em;
  line-height: 1.1;
  color: var(--text);
}

.checkout-modal-close {
  border: none;
  background: transparent;
  font-size: 28px;
  line-height: 1;
  color: var(--muted);
  cursor: pointer;
  padding: 0 4px;
  margin: -4px -4px 0 0;
}

.checkout-modal-close:hover {
  color: var(--text);
}

.checkout-modal-lead {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.4;
  margin-bottom: 16px;
}

.checkout-order-card {
  background: var(--bg-subtle);
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 20px;
}

.checkout-order-label {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin-bottom: 6px;
}

.checkout-order-preview {
  font-size: 15px;
  color: var(--text);
  line-height: 1.35;
}

.checkout-amount-display {
  margin-top: 10px;
  font-size: 17px;
  font-weight: 600;
  color: var(--text);
}

.checkout-field {
  margin-bottom: 14px;
}

.checkout-field label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.checkout-field input,
.checkout-field textarea {
  width: 100%;
  border: 1px solid #d2d2d7;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 16px;
  font-family: inherit;
  background: #fff;
  color: var(--text);
}

.checkout-field textarea {
  resize: vertical;
  min-height: 64px;
}

.checkout-field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.checkout-fieldset {
  border: none;
  padding: 0;
  margin: 0 0 16px;
}

.checkout-fieldset legend {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 10px;
}

.checkout-radio {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 15px;
  color: var(--text);
  margin-bottom: 10px;
  cursor: pointer;
}

.checkout-radio input {
  margin-top: 3px;
}

.checkout-radio--disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.checkout-badge {
  display: inline-block;
  margin-left: 6px;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
  background: #e8e8ed;
  color: var(--text-secondary);
}

.checkout-delivery-panel {
  padding-top: 4px;
  margin-bottom: 8px;
}

.checkout-delivery-intro {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.4;
  margin-bottom: 10px;
}

.checkout-btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid #d2d2d7;
  background: #fff;
  font-size: 14px;
  font-family: inherit;
  cursor: pointer;
  color: var(--text);
}

.checkout-btn-secondary:hover {
  border-color: var(--blue);
  color: var(--blue);
}

.checkout-location-hint {
  font-size: 13px;
  color: #0a7b34;
  margin-bottom: 12px;
}

.checkout-form-error {
  font-size: 13px;
  color: #b00020;
  margin-bottom: 12px;
}

.checkout-submit {
  width: 100%;
  margin-top: 6px;
  border: none;
  border-radius: 980px;
  background: var(--blue);
  color: #fff;
  font-size: 17px;
  font-weight: 500;
  font-family: inherit;
  letter-spacing: -0.022em;
  padding: 12px 24px;
  cursor: pointer;
}

.checkout-submit:hover {
  background: #0077ed;
}

.checkout-success-text {
  font-size: 15px;
  line-height: 1.45;
  color: var(--text);
  margin-bottom: 18px;
}

@media (max-width: 480px) {
  .checkout-field-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 980px) {
  :root {
    --toolbar-sticky-h: 0px;
  }

  .iphone-config-layout {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .iphone-visual-panel {
    position: relative;
    top: auto;
  }

  .buyiphone-toolbar-inner {
    flex-direction: column;
    align-items: flex-start;
  }

  .buyiphone-toolbar-right {
    text-align: left;
  }

  .buyiphone-toolbar-meta {
    justify-content: flex-start;
  }

  .iphone-visual-stage {
    max-height: min(92vw, 560px);
    aspect-ratio: 1 / 1;
  }
}

@media (max-width: 760px) {
  body.nav-drawer-open {
    overflow: hidden;
  }

  /* Keep page layers under the drawer (sticky header + backdrop can trap fixed children). */
  body.nav-drawer-open .buyiphone-toolbar,
  body.nav-drawer-open .iphone-main {
    position: relative;
    z-index: 0;
  }

  .nav-menu-toggle {
    display: inline-flex;
  }

  .brand-logo {
    height: 24px;
    max-width: min(190px, 52vw);
  }

  .top-nav .menu {
    position: fixed;
    left: 0;
    right: 0;
    top: var(--nav-h);
    bottom: 0;
    background: #fff;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    padding: 8px 18px 28px;
    transform: translateX(100%);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.25s ease, opacity 0.2s ease;
    overflow-y: auto;
    z-index: 10001;
  }

  .top-nav.is-open {
    z-index: 10000;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    background: #fff;
  }

  .top-nav.is-open .nav-wrap {
    position: relative;
    z-index: 10002;
  }

  .top-nav.is-open .menu {
    transform: translateX(0);
    opacity: 1;
    pointer-events: auto;
  }

  .top-nav .menu a {
    width: 100%;
    font-size: 27px;
    line-height: 1.22;
    padding: 10px 2px;
    color: #1d1d1f;
  }

  .iphone-main {
    padding: 20px 18px 64px;
  }

  .config-heading {
    font-size: 24px;
  }

  .choice-title {
    font-size: 19px;
  }
}
