/* Rice Requirement Form — contact page.
   Styled from the site's own design tokens so it reads as native Jashn Foods,
   not a bolted-on prototype. Accent = brand gold (--cta-color #d69738),
   text = --d-color, borders = --border-color. All selectors scoped to .rice-form. */

.rice-form {
  --rf-gold: var(--cta-color, #d69738);
  --rf-ink: var(--d-color, #39373a);
  --rf-line: var(--border-color, #e0e0e1);
  --rf-muted: #7a787c;
  --rf-soft: #faf8f4;         /* warm off-white to echo the gold accent */
  font-size: 15px;
  color: var(--rf-ink);
  line-height: 1.4;
}
.rice-form, .rice-form *, .rice-form *::before, .rice-form *::after { box-sizing: border-box; }

/* ── Tabs ── */
.rice-form .tab-bar { display: flex; flex-wrap: wrap; gap: 6px; border-bottom: 2px solid var(--rf-line); margin-bottom: 26px; }
.rice-form .tab-btn {
  font: inherit; font-size: 15px; font-weight: 500; color: var(--rf-muted);
  background: transparent; border: none; border-bottom: 3px solid transparent;
  padding: 12px 20px 14px; margin-bottom: -2px; cursor: pointer;
  transition: color .18s, border-color .18s; white-space: nowrap;
}
.rice-form .tab-btn:hover { color: var(--rf-ink); }
.rice-form .tab-btn.active { color: var(--rf-ink); border-bottom-color: var(--rf-gold); font-weight: 600; }
.rice-form .tab-pane { display: none; }
.rice-form .tab-pane.active { display: block; animation: rf-fade .25s ease; }
@keyframes rf-fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* ── Section headers: gold rule + uppercase eyebrow ── */
.rice-form .section-title {
  font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .12em;
  color: var(--rf-ink); padding: 0 0 8px 12px; margin: 26px 0 16px;
  border-left: 3px solid var(--rf-gold); line-height: 1;
  border-bottom: 1px solid var(--rf-line); padding-bottom: 10px;
}
.rice-form .tab-pane > .section-title:first-child { margin-top: 4px; }

/* ── Grid + fields ── */
.rice-form .rf-row { display: grid; gap: 18px; margin-bottom: 18px; }
.rice-form .rf-col-2 { grid-template-columns: 1fr 1fr; }
.rice-form .rf-col-1 { grid-template-columns: 1fr; }
.rice-form .rf-field { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.rice-form .rf-field > * { margin: 0 !important; }
.rice-form p { margin: 0; }
.rice-form label { font-size: 13px; font-weight: 600; color: var(--rf-ink); display: block; }
.rice-form label .req { color: #d64545; font-weight: 700; }

/* ── Controls ── */
.rice-form input[type="text"], .rice-form input[type="email"], .rice-form input[type="tel"],
.rice-form select, .rice-form textarea {
  font: inherit; font-size: 15px; color: var(--rf-ink); background: #fff;
  border: 1px solid var(--rf-line); border-radius: 8px; height: 46px;
  /* The brand font (PF Bague Sans Pro) sits high in its line box, so we bias the
     padding (15 top / 11 bottom around an 18px line = 44px content) to centre it. */
  line-height: 18px; padding: 15px 14px 11px;
  width: 100%; outline: none; transition: border-color .15s, box-shadow .15s; appearance: none;
}
.rice-form textarea { height: auto; min-height: 96px; padding: 12px 14px; resize: vertical; line-height: 1.5; }
/* The site forces an 18px placeholder globally (common.css) — override so it matches
   the 15px input text and sits vertically centred. */
.rice-form input::placeholder, .rice-form textarea::placeholder,
.rice-form input::-webkit-input-placeholder, .rice-form textarea::-webkit-input-placeholder {
  color: #b3b1b4 !important; font-size: 15px !important; line-height: normal;
}
.rice-form input:focus, .rice-form select:focus, .rice-form textarea:focus {
  border-color: var(--rf-gold); box-shadow: 0 0 0 3px rgba(214, 151, 56, .15);
}
/* Disabled controls read as clearly non-interactive until their parent selection loads. */
.rice-form select:disabled { background: #f4f2ee; color: #a7a5a8; cursor: not-allowed; }
.rice-form .select2-container--disabled .select2-selection--single { background: #f4f2ee !important; cursor: not-allowed; }
.rice-form .select2-container--disabled .select2-selection__rendered,
.rice-form .select2-container--disabled .select2-selection__placeholder { color: #a7a5a8 !important; }
.rice-form .select2-container--disabled .select2-selection__arrow { opacity: .4; }
.rice-form .sel-wrap { position: relative; }
/* Fallback arrow for a native <select> only while select2 hasn't wrapped it yet
   (select2 renders its own arrow, so suppress ours once it's present). */
.rice-form .sel-wrap::after {
  content: ""; position: absolute; right: 16px; top: 50%; width: 8px; height: 8px;
  border-right: 2px solid var(--rf-muted); border-bottom: 2px solid var(--rf-muted);
  transform: translateY(-70%) rotate(45deg); pointer-events: none;
}
.rice-form .sel-wrap:has(.select2-container)::after { display: none; }
.rice-form .sel-wrap select { padding-right: 34px; cursor: pointer; }
.rice-form .rf-hint { font-size: 12px; color: var(--rf-muted); }
.rice-form .rf-error { font-size: 12px; color: #d64545; }
.rice-form .rf-error:empty, .rice-form .rf-hint:empty { display: none; }

/* ── Phone ── */
.rice-form .phone-row { display: flex; align-items: stretch; border: 1px solid var(--rf-line); border-radius: 8px; overflow: hidden; transition: border-color .15s, box-shadow .15s; }
.rice-form .phone-row:focus-within { border-color: var(--rf-gold); box-shadow: 0 0 0 3px rgba(214, 151, 56, .15); }
.rice-form .code-badge {
  background: var(--rf-soft); border-right: 1px solid var(--rf-line); padding: 0 14px;
  font-size: 15px; font-weight: 600; color: var(--rf-ink); display: none;
  align-items: center; white-space: nowrap; min-width: 58px; justify-content: center;
}
.rice-form .phone-input { border: none !important; border-radius: 0 !important; box-shadow: none !important; flex: 1; min-width: 0; }
.rice-form .phone-row:focus-within .phone-input { box-shadow: none !important; }

/* ── Slider ── */
.rice-form .slider-wrap { display: flex; flex-direction: column; gap: 8px; padding-top: 4px; }
.rice-form .slider-row { display: flex; align-items: center; gap: 14px; }
.rice-form input[type="range"] {
  flex: 1; -webkit-appearance: none; appearance: none; height: 6px; border-radius: 6px;
  cursor: pointer; padding: 0; border: none; outline: none;
  /* JS sets a gold→grey gradient for the filled portion; this is the fallback. */
  background: linear-gradient(to right, var(--rf-gold) 0%, var(--rf-gold) 100%, var(--rf-line) 100%);
}
.rice-form input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none; width: 18px; height: 18px; border-radius: 50%;
  background: var(--rf-gold); border: 2px solid #fff; box-shadow: 0 0 0 1px var(--rf-gold); cursor: pointer; margin-top: -1px;
}
.rice-form input[type="range"]::-moz-range-thumb { width: 18px; height: 18px; border-radius: 50%; background: var(--rf-gold); border: 2px solid #fff; cursor: pointer; }
.rice-form input[type="range"]::-moz-range-track { height: 6px; border-radius: 6px; background: var(--rf-line); }
.rice-form input[type="range"]::-moz-range-progress { height: 6px; border-radius: 6px; background: var(--rf-gold); }
.rice-form input[type="range"]:focus { box-shadow: 0 0 0 3px rgba(214,151,56,.15); }
.rice-form .slider-val { font-size: 14px; font-weight: 700; color: var(--rf-gold); min-width: 58px; text-align: right; }
.rice-form .slider-labels { display: flex; justify-content: space-between; font-size: 11px; color: var(--rf-muted); }

/* ── Product blocks ── */
.rice-form .product-fieldset { border: 1px solid var(--rf-line); border-radius: 12px; padding: 22px 20px 10px; margin-bottom: 16px; position: relative; background: var(--rf-soft); }
.rice-form .product-fieldset legend { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--rf-gold); background: #fff; padding: 4px 12px; border: 1px solid var(--rf-line); border-radius: 20px; margin-left: 2px; }
.rice-form .remove-product-btn { position: absolute; top: 14px; right: 14px; background: #fff; border: 1px solid var(--rf-line); border-radius: 6px; color: var(--rf-muted); font: inherit; font-size: 12px; font-weight: 600; padding: 5px 10px; cursor: pointer; transition: color .15s, border-color .15s; }
.rice-form .remove-product-btn:hover { color: #d64545; border-color: #d64545; }
.rice-form .add-product-btn { font: inherit; font-size: 14px; font-weight: 600; color: var(--rf-gold); background: #fff; border: 1.5px dashed var(--rf-gold); border-radius: 8px; padding: 12px 20px; cursor: pointer; width: 100%; margin-bottom: 18px; transition: background .15s; }
.rice-form .add-product-btn:hover { background: var(--rf-soft); }
.rice-form .block-error-msg { color: #d64545; font-size: 12px; margin-top: 8px; }

/* ── Footer / submit ── */
.rice-form .rf-footer { margin-top: 26px; display: flex; justify-content: center; }
.rice-form #riceAlert { margin-top: 18px; text-align: center; }
.rice-form #riceAlert .alert { display: inline-block; padding: 10px 18px; border-radius: 8px; font-size: 14px; }
.rice-form #riceAlert .alert-success { background: #edf7ee; color: #256029; }
.rice-form #riceAlert .alert-error { background: #fcebea; color: #a3271f; }

/* ── select2 alignment (site loads select2) ── */
.rice-form .select2-container { width: 100% !important; }
.rice-form .select2-container--default .select2-selection--single {
  height: 46px; border: 1px solid var(--rf-line); border-radius: 8px; display: flex; align-items: center; padding: 0 14px; background: #fff;
}
/* Container flex-centres the box; the 3px top pad offsets the brand font's
   high glyph so the text reads as vertically centred (matches the inputs). */
.rice-form .select2-container--default .select2-selection--single .select2-selection__rendered { color: var(--rf-ink); font-size: 15px; line-height: normal; padding: 3px 0 0; }
.rice-form .select2-container--default .select2-selection--single .select2-selection__placeholder { color: #b3b1b4; }
.rice-form .select2-container--default .select2-selection--single .select2-selection__arrow { height: 44px; right: 12px; }
.rice-form .select2-container--default.select2-container--focus .select2-selection--single,
.rice-form .select2-container--default.select2-container--open .select2-selection--single { border-color: var(--rf-gold); box-shadow: 0 0 0 3px rgba(214, 151, 56, .15); }
/* dropdown menu (rendered under .sel-wrap / body, so scope by container class) */
.select2-container .select2-results__options { list-style: none !important; margin: 0 !important; padding: 4px 0 !important; }
.select2-container .select2-results__option { list-style: none !important; font-size: 15px; padding: 8px 14px; }
.select2-container .select2-results__option::marker { content: none; }
.select2-container .select2-results__option--highlighted[aria-selected] { background-color: var(--cta-color, #d69738) !important; color: #fff !important; }
.select2-container .select2-results__option[aria-selected=true] { background-color: #f7efe0 !important; color: var(--d-color, #39373a) !important; }
.select2-container .select2-search--dropdown .select2-search__field { border: 1px solid var(--border-color, #e0e0e1); border-radius: 6px; padding: 8px 10px; font-size: 14px; outline: none; }
.select2-container--open .select2-dropdown { border-color: var(--cta-color, #d69738); }

/* ── Responsive ── */
@media (max-width: 640px) {
  .rice-form .rf-col-2 { grid-template-columns: 1fr; }
  .rice-form .tab-btn { padding: 10px 14px 12px; font-size: 14px; }
}

/* Accessibility: honour reduced motion */
@media (prefers-reduced-motion: reduce) {
  .rice-form .tab-pane.active { animation: none; }
}

/* ============================================================
   Site-wide enquiry POPUP (wizard) — follows rice_form_popup.html
   structure, in the brand's gold styling. Reuses .rice-form field
   styles above; adds the modal / tabs / steps / footer chrome.
   ============================================================ */
.rice-pop-trigger {
  position: fixed; right: 22px; bottom: 22px; z-index: 9998;
  font: inherit; font-size: 14px; font-weight: 600; color: #fff;
  background: var(--cta-color, #d69738); border: none; border-radius: 30px;
  padding: 13px 24px; cursor: pointer; box-shadow: 0 6px 18px rgba(214,151,56,.4);
  display: inline-flex; align-items: center; gap: 8px; transition: background .15s, transform .15s;
}
.rice-pop-trigger:hover { background: #b97f27; transform: translateY(-1px); }

.rice-pop-overlay {
  display: none; position: fixed; inset: 0; background: rgba(0,0,0,.55);
  z-index: 9999; justify-content: center; align-items: center; padding: 14px;
}
.rice-pop-overlay.active { display: flex; }

/* the form IS the modal box */
.rice-popup {
  --rf-gold: var(--cta-color, #d69738); --rf-ink: var(--d-color, #39373a);
  --rf-line: var(--border-color, #e0e0e1); --rf-muted: #7a787c; --rf-soft: #faf8f4;
  color: var(--rf-ink); background: #fff; border-radius: 12px; width: 100%;
  max-width: 620px; max-height: 92vh; display: flex; flex-direction: column;
  overflow: hidden; box-shadow: 0 16px 56px rgba(0,0,0,.25);
}
.rice-popup .popup-header { padding: 16px 20px 12px; border-bottom: 1px solid var(--rf-line); display: flex; justify-content: space-between; align-items: flex-start; flex-shrink: 0; }
.rice-popup .popup-title { font-size: 17px; font-weight: 700; color: var(--rf-ink); }
.rice-popup .popup-sub { font-size: 10px; color: var(--rf-muted); letter-spacing: .08em; margin-top: 3px; text-transform: uppercase; }
.rice-popup .close-btn { background: none; border: none; font-size: 18px; color: var(--rf-muted); cursor: pointer; padding: 2px 6px; line-height: 1; }
.rice-popup .close-btn:hover { color: var(--rf-ink); }

.rice-popup .pop-tabs { display: flex; border-bottom: 2px solid var(--rf-line); flex-shrink: 0; }
.rice-popup .pop-tab { flex: 1; font: inherit; font-size: 13px; font-weight: 600; color: var(--rf-muted); background: #faf9f7; border: none; border-bottom: 3px solid transparent; padding: 12px 8px; cursor: pointer; margin-bottom: -2px; transition: color .15s, background .15s; }
.rice-popup .pop-tab:hover { color: var(--rf-ink); }
.rice-popup .pop-tab.active { color: var(--rf-ink); background: #fff; border-bottom-color: var(--rf-gold); }

.rice-popup .pop-flow { flex: 1; display: flex; min-height: 0; overflow: hidden; }
.rice-popup .tab-pane { display: none; }
.rice-popup .tab-pane.active { display: flex; flex-direction: column; flex: 1; min-height: 0; animation: none; }

.rice-popup .steps-bar { display: flex; align-items: center; padding: 12px 20px 10px; flex-shrink: 0; border-bottom: 1px solid #f4f2ee; }
.rice-popup .sc { width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--rf-line); background: #fff; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; color: var(--rf-muted); flex-shrink: 0; transition: all .2s; }
.rice-popup .sc.active { border-color: var(--rf-gold); background: var(--rf-gold); color: #fff; }
.rice-popup .sc.done { border-color: #4caf50; background: #4caf50; color: #fff; }
.rice-popup .sl { font-size: 11px; color: var(--rf-muted); margin-left: 6px; font-weight: 500; }
.rice-popup .sl.active { color: var(--rf-ink); font-weight: 600; }
.rice-popup .sl.done { color: #4caf50; }
.rice-popup .sline { flex: 1; height: 2px; background: var(--rf-line); margin: 0 10px; transition: background .2s; }
.rice-popup .sline.done { background: #4caf50; }

.rice-popup .popup-body { flex: 1; overflow-y: auto; padding: 16px 20px; min-height: 0; }
.rice-popup .popup-body .tab-pane > .section-title:first-child,
.rice-popup .popup-body .section-title { margin-top: 14px; }
.rice-popup .step-pane { display: none; }
.rice-popup .step-pane.active { display: block; }

/* reCAPTCHA now lives inside the scrollable step body (left-aligned, in flow). */
.rice-popup .pop-captcha { margin-top: 4px; }
.rice-popup .pop-captcha .g-recaptcha { overflow: hidden; }
@media (max-width: 360px) {
  .rice-popup .pop-captcha .g-recaptcha { transform: scale(0.85); transform-origin: top left; }
}

.rice-popup .popup-footer { border-top: 1px solid var(--rf-line); padding: 12px 20px; display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-shrink: 0; background: #fff; }
.rice-popup .pop-alert { flex: 1; text-align: center; }
.rice-popup .pop-alert .alert { display: inline-block; padding: 6px 12px; border-radius: 6px; font-size: 12px; }
.rice-popup .pop-alert .alert-success { background: #edf7ee; color: #256029; }
.rice-popup .pop-alert .alert-error { background: #fcebea; color: #a3271f; }
.rice-popup .btn-back { font: inherit; font-size: 13px; font-weight: 600; color: var(--rf-muted); background: none; border: 1px solid var(--rf-line); border-radius: 8px; padding: 10px 20px; cursor: pointer; }
.rice-popup .btn-back:hover { border-color: var(--rf-muted); color: var(--rf-ink); }
.rice-popup .btn-next, .rice-popup .btn-submit { font: inherit; font-size: 13px; font-weight: 700; letter-spacing: .3px; color: #fff; background: var(--rf-gold); border: none; border-radius: 8px; padding: 10px 26px; cursor: pointer; transition: background .15s; }
.rice-popup .btn-next:hover, .rice-popup .btn-submit:hover { background: #b97f27; }

@media (max-width: 640px) {
  .rice-popup { max-width: 100%; max-height: 94vh; }
  .rice-popup .rf-col-2 { grid-template-columns: 1fr; }
  .rice-pop-trigger { right: 14px; bottom: 14px; padding: 11px 18px; font-size: 13px; }
}

/* select2 dropdowns are appended to <body> (see rice-form.js) so they escape the
   popup's scroll clipping — lift them above the modal overlay (z-index 9999). */
.select2-container--open { z-index: 10050; }

/* Character counter under textareas (rf-field flex gap handles spacing). */
.rice-form .rf-counter { font-size: 11px; color: var(--rf-muted); text-align: right; }
.rice-form .rf-counter.near { color: var(--rf-gold); }
.rice-form .rf-counter.max { color: #d64545; font-weight: 600; }

/* "Enquiring about <product>" banner in the popup (shown when opened from a product card). */
.rice-popup .pop-product-note { padding: 9px 20px; background: var(--rf-soft); border-bottom: 1px solid var(--rf-line); font-size: 13px; color: var(--rf-ink); flex-shrink: 0; }
.rice-popup .pop-product-note strong { color: var(--rf-gold); font-weight: 600; }
