/* ============================================================
   IMAGINE FIRST — ORDER & CONTACT FLOWS
   ============================================================ */

/* Overlay backdrop */
.if-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: none;
  justify-content: flex-end;
}
.if-overlay.if-open { display: flex; }

.if-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.if-modal-overlay.if-open { display: flex; }

.if-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  backdrop-filter: blur(2px);
  animation: ifFadeIn 0.2s ease;
}
@keyframes ifFadeIn { from { opacity:0 } to { opacity:1 } }

/* Drawer */
.if-drawer {
  position: relative;
  z-index: 1001;
  width: 480px;
  max-width: 100vw;
  height: 100vh;
  background: #ffffff;
  display: flex;
  flex-direction: column;
  box-shadow: -8px 0 40px rgba(0,0,0,0.14);
  animation: ifSlideIn 0.32s cubic-bezier(0.34,1.1,0.64,1);
  overflow: hidden;
}
@keyframes ifSlideIn { from { transform:translateX(100%) } to { transform:translateX(0) } }

/* Modal */
.if-modal {
  position: relative;
  z-index: 1001;
  width: 100%;
  max-width: 600px;
  max-height: 90vh;
  background: #ffffff;
  border-radius: 24px;
  display: flex;
  flex-direction: column;
  box-shadow: 0 24px 64px rgba(0,0,0,0.18);
  animation: ifScaleIn 0.25s cubic-bezier(0.34,1.1,0.64,1);
  overflow: hidden;
}
@keyframes ifScaleIn { from { opacity:0; transform:scale(0.95) } to { opacity:1; transform:scale(1) } }

/* Header */
.if-header {
  padding: 20px 24px 0;
  flex-shrink: 0;
  background: #fff;
}
.if-header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.if-header-label {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 12px;
  font-weight: 700;
  color: #4d4732;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.if-close-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: none;
  background: #f0edee;
  color: #1b1b1c;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
  flex-shrink: 0;
  line-height: 1;
}
.if-close-btn:hover { background: #e5e2e3; }
.if-close-btn:focus-visible { outline: 2px solid #705d00; outline-offset: 2px; }

/* Progress bar */
.if-progress-wrap { margin-bottom: 6px; }
.if-progress-steps {
  display: flex;
  gap: 4px;
  margin-bottom: 6px;
}
.if-progress-step {
  flex: 1;
  height: 4px;
  border-radius: 2px;
  background: #e5e2e3;
  transition: background 0.3s;
}
.if-progress-step.done { background: #ffd700; }
.if-progress-step.active { background: #705d00; }
.if-progress-label {
  font-size: 11px;
  color: #4d4732;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 600;
}

/* Scrollable body */
.if-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px 24px 12px;
}

/* Step typography */
.if-step-title {
  font-family: 'Rubik', sans-serif;
  font-size: 21px;
  font-weight: 700;
  color: #1b1b1c;
  margin: 0 0 6px;
  line-height: 1.3;
}
.if-step-subtitle {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 14px;
  color: #4d4732;
  margin: 0 0 20px;
  line-height: 1.5;
}

/* Product card */
.if-product-card {
  background: #f6f3f4;
  border: 2px solid #ffd700;
  border-radius: 16px;
  padding: 18px 20px;
  margin-bottom: 20px;
}
.if-product-card h3 {
  font-family: 'Rubik', sans-serif;
  font-size: 17px;
  font-weight: 700;
  color: #1b1b1c;
  margin: 0 0 4px;
}
.if-product-price {
  font-family: 'Rubik', sans-serif;
  font-size: 28px;
  font-weight: 800;
  color: #1b1b1c;
  margin: 0 0 12px;
  display: flex;
  align-items: baseline;
  gap: 6px;
}
.if-product-price span {
  font-size: 13px;
  font-weight: 500;
  color: #4d4732;
  font-family: 'Plus Jakarta Sans', sans-serif;
}
.if-product-features {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.if-product-features li {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 13px;
  color: #4d4732;
  display: flex;
  align-items: center;
  gap: 8px;
}
.if-product-features li::before {
  content: '';
  width: 16px;
  height: 16px;
  border-radius: 50%;
  flex-shrink: 0;
  background: #ffd700 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 8l2.5 2.5L12 5' stroke='%23705e00' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/contain no-repeat;
}

/* Form fields */
.if-field { margin-bottom: 16px; }
.if-label {
  display: block;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 13px;
  font-weight: 700;
  color: #1b1b1c;
  margin-bottom: 6px;
}
.if-label-opt {
  font-weight: 400;
  color: #7e775f;
  font-size: 12px;
  margin-left: 3px;
}
.if-input,
.if-textarea,
.if-select {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid #d0c6ab;
  border-radius: 10px;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 14px;
  color: #1b1b1c;
  background: #ffffff;
  transition: border-color 0.15s, box-shadow 0.15s;
  outline: none;
  box-sizing: border-box;
}
.if-input:focus,
.if-textarea:focus,
.if-select:focus {
  border-color: #705d00;
  box-shadow: 0 0 0 3px rgba(112,93,0,0.1);
}
.if-input.if-err,
.if-textarea.if-err { border-color: #ba1a1a; }
.if-textarea { min-height: 90px; resize: vertical; }
.if-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%234d4732' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
  cursor: pointer;
}
.if-err-msg {
  font-size: 12px;
  color: #ba1a1a;
  margin-top: 4px;
  display: none;
  font-family: 'Plus Jakarta Sans', sans-serif;
}
.if-err-msg.if-show { display: block; }
.if-hint {
  font-size: 12px;
  color: #4d4732;
  margin-top: 4px;
  font-family: 'Plus Jakarta Sans', sans-serif;
  line-height: 1.5;
}

/* Checkbox */
.if-check-wrap {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 14px 16px;
  border: 1.5px solid #d0c6ab;
  border-radius: 12px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  user-select: none;
}
.if-check-wrap:hover { border-color: #705d00; background: #f6f3f4; }
.if-check-wrap.if-checked { border-color: #705d00; background: #fffde8; }
.if-check-wrap input[type="checkbox"] {
  appearance: none;
  width: 18px;
  height: 18px;
  border: 2px solid #d0c6ab;
  border-radius: 5px;
  cursor: pointer;
  flex-shrink: 0;
  margin-top: 1px;
  transition: all 0.15s;
  background: #fff;
  position: relative;
}
.if-check-wrap.if-checked input[type="checkbox"] {
  background: #705d00;
  border-color: #705d00;
}
.if-check-wrap.if-checked input[type="checkbox"]::after {
  content: '';
  position: absolute;
  left: 3px;
  top: 0;
  width: 5px;
  height: 9px;
  border: 2px solid #fff;
  border-top: none;
  border-left: none;
  transform: rotate(45deg);
}
.if-check-label {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 14px;
  color: #1b1b1c;
  line-height: 1.4;
}

/* Radio cards */
.if-radio-grid {
  display: grid;
  grid-template-columns: repeat(2,1fr);
  gap: 8px;
  margin-top: 6px;
}
.if-radio-grid.g1 { grid-template-columns: 1fr; }
.if-radio-card {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 11px 13px;
  border: 1.5px solid #d0c6ab;
  border-radius: 12px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 13px;
  color: #1b1b1c;
  font-weight: 600;
  user-select: none;
}
.if-radio-card:hover { border-color: #705d00; background: #f6f3f4; }
.if-radio-card.if-sel { border-color: #705d00; background: #fffde8; }
.if-radio-card input[type="radio"] { display: none; }
.if-rdot {
  width: 16px;
  height: 16px;
  border: 2px solid #d0c6ab;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.15s;
}
.if-radio-card.if-sel .if-rdot { border-color: #705d00; }
.if-radio-card.if-sel .if-rdot::after {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #705d00;
}

/* Add-on items */
.if-addon {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 13px 15px;
  border: 1.5px solid #d0c6ab;
  border-radius: 12px;
  cursor: pointer;
  margin-bottom: 8px;
  transition: border-color 0.15s, background 0.15s;
  user-select: none;
}
.if-addon:hover { border-color: #705d00; background: #f6f3f4; }
.if-addon.if-sel { border-color: #705d00; background: #fffde8; }
.if-addon-box {
  width: 18px;
  height: 18px;
  border: 2px solid #d0c6ab;
  border-radius: 5px;
  flex-shrink: 0;
  margin-top: 2px;
  position: relative;
  transition: all 0.15s;
  background: #fff;
}
.if-addon.if-sel .if-addon-box { background: #705d00; border-color: #705d00; }
.if-addon.if-sel .if-addon-box::after {
  content: '';
  position: absolute;
  left: 3px;
  top: 0;
  width: 5px;
  height: 9px;
  border: 2px solid #fff;
  border-top: none;
  border-left: none;
  transform: rotate(45deg);
}
.if-addon-info { flex: 1; }
.if-addon-name {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 14px;
  font-weight: 700;
  color: #1b1b1c;
}
.if-addon-desc {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 12px;
  color: #4d4732;
  margin-top: 2px;
}
.if-addon-price {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 13px;
  font-weight: 700;
  color: #705d00;
  flex-shrink: 0;
}

/* Order summary */
.if-summary-box {
  background: #f6f3f4;
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 20px;
}
.if-sum-row {
  display: flex;
  justify-content: space-between;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 13px;
  color: #4d4732;
  padding: 3px 0;
}
.if-sum-total {
  display: flex;
  justify-content: space-between;
  font-family: 'Rubik', sans-serif;
  font-size: 18px;
  font-weight: 700;
  color: #1b1b1c;
  padding-top: 10px;
  margin-top: 8px;
  border-top: 1.5px solid #d0c6ab;
}

/* Policy box */
.if-policy {
  background: #f6f3f4;
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 10px;
}
.if-policy-title {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 12px;
  font-weight: 700;
  color: #1b1b1c;
  margin: 0 0 5px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.if-policy-text {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 13px;
  color: #4d4732;
  margin: 0;
  line-height: 1.55;
}

/* File upload */
.if-file-zone {
  border: 2px dashed #d0c6ab;
  border-radius: 12px;
  padding: 20px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  position: relative;
}
.if-file-zone:hover { border-color: #705d00; background: #f6f3f4; }
.if-file-zone input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
}
.if-file-zone-text {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 13px;
  color: #4d4732;
}
.if-file-zone-text strong { color: #705d00; }
.if-file-list { margin-top: 8px; }
.if-file-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 10px;
  background: #f0edee;
  border-radius: 8px;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 12px;
  color: #1b1b1c;
  margin-top: 4px;
  gap: 8px;
}
.if-file-item span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.if-file-rm {
  background: none;
  border: none;
  cursor: pointer;
  color: #7e775f;
  font-size: 16px;
  padding: 0;
  line-height: 1;
  flex-shrink: 0;
}
.if-file-rm:hover { color: #ba1a1a; }

/* Note box */
.if-note {
  background: #fffde8;
  border-left: 3px solid #ffd700;
  border-radius: 0 8px 8px 0;
  padding: 10px 14px;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 12px;
  color: #4d4732;
  margin-bottom: 16px;
  line-height: 1.5;
}
.if-note a { color: #705d00; text-decoration: underline; cursor: pointer; }

/* Divider */
.if-divider { height: 1px; background: #e5e2e3; margin: 18px 0; }

/* Footer */
.if-footer {
  padding: 14px 24px;
  border-top: 1px solid #e5e2e3;
  display: flex;
  gap: 10px;
  flex-shrink: 0;
  background: #fff;
}

/* Buttons */
.if-btn {
  padding: 12px 22px;
  border-radius: 9999px;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  border: none;
  transition: transform 0.15s, background 0.15s, box-shadow 0.15s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  line-height: 1;
}
.if-btn:active { transform: scale(0.96); }
.if-btn:focus-visible { outline: 2px solid #705d00; outline-offset: 2px; }
.if-btn-primary {
  background: #ffd700;
  color: #705e00;
  flex: 1;
  box-shadow: 0 4px 12px rgba(255,215,0,0.3);
}
.if-btn-primary:hover { background: #f5ce00; }
.if-btn-secondary { background: #f0edee; color: #1b1b1c; }
.if-btn-secondary:hover { background: #e5e2e3; }
.if-btn-paypal {
  background: #003087;
  color: #fff;
  flex: 1;
  font-size: 14px;
  box-shadow: 0 4px 12px rgba(0,48,135,0.25);
}
.if-btn-paypal:hover { background: #002070; }

/* Confirmation screen */
.if-confirm-screen {
  text-align: center;
  padding: 40px 20px;
}
.if-confirm-icon { font-size: 52px; margin-bottom: 14px; }
.if-confirm-icon svg { display: block; margin: 0 auto; }

@keyframes if-arrow-drop {
  0%, 100% { transform: translateY(0px); }
  50%       { transform: translateY(8px); }
}
.if-inbox-arrow {
  animation: if-arrow-drop 1s ease-in-out infinite;
  transform-box: fill-box;
  transform-origin: top center;
}
.if-confirm-title {
  font-family: 'Rubik', sans-serif;
  font-size: 22px;
  font-weight: 700;
  color: #1b1b1c;
  margin: 0 0 10px;
}
.if-confirm-text {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 15px;
  color: #4d4732;
  line-height: 1.6;
  margin: 0 0 24px;
}

/* Close-confirm dialog */
.if-cdialog {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(4px);
}
.if-cdialog-box {
  background: #fff;
  border-radius: 20px;
  padding: 28px;
  max-width: 340px;
  width: 100%;
  text-align: center;
  box-shadow: 0 20px 50px rgba(0,0,0,0.2);
}
.if-cdialog-title {
  font-family: 'Rubik', sans-serif;
  font-size: 18px;
  font-weight: 700;
  color: #1b1b1c;
  margin: 0 0 8px;
}
.if-cdialog-text {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 14px;
  color: #4d4732;
  margin: 0 0 20px;
  line-height: 1.5;
}
.if-cdialog-btns { display: flex; gap: 10px; }

/* Prevent iOS scroll-chain from triggering address-bar show/hide during form scroll */
.if-body { overscroll-behavior: contain; }

/* Sheet handle (contact modal on mobile) */
.if-sheet-handle { display: none; }

/* Mobile */
@media (max-width: 768px) {
  .if-overlay { justify-content: stretch; }
  .if-drawer {
    width: 100vw;
    border-radius: 0;
    height: 100vh;      /* fallback */
    height: 100dvh;     /* tracks real visible area including address bar */
    padding-top: env(safe-area-inset-top, 0px);
    box-sizing: border-box;
  }
  .if-modal-overlay {
    padding: 0;
    align-items: stretch;
  }
  .if-modal {
    max-width: 100%;
    border-radius: 0;
    height: 100vh;      /* fallback */
    height: 100dvh;     /* tracks real visible area */
    max-height: none;
    padding-top: env(safe-area-inset-top, 0px);
    padding-bottom: env(safe-area-inset-bottom, 0px);
    box-sizing: border-box;
  }
  .if-radio-grid { grid-template-columns: 1fr; }
  .if-btn { font-size: 13px; padding: 11px 16px; }
  /* Bigger, high-contrast close button — always tappable */
  .if-close-btn {
    width: 44px;
    height: 44px;
    font-size: 20px;
    background: #1b1b1c;
    color: #ffffff;
  }
  .if-close-btn:hover { background: #333333; }
  /* Sheet handle visible on mobile */
  .if-sheet-handle {
    display: block;
    width: 36px;
    height: 4px;
    background: #d0c6ab;
    border-radius: 2px;
    margin: 12px auto 0;
  }
}
