/* Creative Covers - Quote page styles
 * File: wp-content/mu-plugins/cc-quote-assets/cc-quote.css
 */

.cc-echo {
  display: block;
  font-size: 12.5px;
  color: #8d959f;
  margin-top: 4px;
}
.cc-echo-bad { color: #c0392b; }
.cc-echo-warn { color: #5c646f; }

/* Reserve height so the page doesn't jump when GF/Nested Forms
   initialise (CLS target < 0.1 per Section 5). Tune this once you've
   measured the real rendered height on staging. */
.gform_wrapper { min-height: 480px; }

/* GP File Upload Pro "select files" control: renders as plain text with
   no visual affordance that it's clickable (no border/background) -
   style it to actually look like a button, matching the rest of the
   form's look. */
.cc-photo-field .gpfup__select-files-container {
  display: inline-block;
}
.cc-photo-field .gpfup__select-files {
  display: inline-flex;
  align-items: center;
  padding: 9px 16px;
  border: 1px solid #1666e0;
  border-radius: 7px;
  background: #ffffff;
  color: #1666e0;
  font: inherit;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
}
.cc-photo-field .gpfup__select-files:hover {
  background: #1666e0;
  color: #ffffff;
}

/* Section 4.4.3: Nested Forms entry list restyled as the prototype's summary
   cards, scoped under #gform_wrapper_89 (parent form). Real markup
   confirmed from DevTools:
     table.gpnf-nested-entries
       thead (column headers: Items, Size Summary, Photo Count, actions)
       tbody
         tr[data-entryid]
           td.gpnf-field[data-heading="Items"]        <- field 35
           td.gpnf-field[data-heading="Size Summary"] <- field 36
           td.gpnf-field[data-heading="Photo Count"]  <- field 37
           td.gpnf-row-actions > ul > li.edit / li.delete (GPNF's own
             Edit/Delete buttons - kept as-is, only restyled to look
             like small text links instead of full buttons)
   This is a pure CSS transform of that real table into cards - no
   markup change, no JS DOM rewrite, so it stays intact across any
   GPNF version bump that keeps this table structure. */

#gform_wrapper_89 .gpnf-nested-entries {
  display: block;
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 20px;
  border: 0;
}

/* Column headers aren't part of the card look (the prototype has no
   header row) - hide them visually but keep them for screen readers
   rather than display:none, since they're still meaningful table
   semantics for assistive tech reading the underlying markup. */
#gform_wrapper_89 .gpnf-nested-entries thead {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

#gform_wrapper_89 .gpnf-nested-entries tbody {
  display: block;
}

/* One card per row */
#gform_wrapper_89 .gpnf-nested-entries tbody tr[data-entryid] {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 14px;
  background: #ffffff;
  border: 1px solid #dfe3e9;
  border-radius: 10px;
  padding: 16px 18px;
  margin-bottom: 10px;
  position: relative;
}

/* Items (field 35) - the card title, full width on its own line */
#gform_wrapper_89 .gpnf-nested-entries tbody tr[data-entryid] td[data-heading="Items"] {
  display: block;
  flex: 1 1 100%;
  order: 1;
  font-weight: 650;
  font-size: 15.5px;
  color: #171a1f;
  padding-right: 90px; /* keep clear of the Edit/Delete actions positioned top-right */
}

/* Size Summary + Photo Count (fields 36, 37) - secondary line, muted,
   with a small label prefix since the header row is visually hidden */
#gform_wrapper_89 .gpnf-nested-entries tbody tr[data-entryid] td[data-heading="Size Summary"] {
  display: inline-block;
  order: 2;
  font-size: 13.5px;
  color: #5c646f;
}

/* Photo Count (field 37) - GF renders the raw number as text; hide that
   text node and substitute a labeled version via ::before instead, so
   it reads "2 photo(s)" rather than a bare, unexplained "2" (the
   header row that would normally explain the column is hidden above). */
#gform_wrapper_89 .gpnf-nested-entries tbody tr[data-entryid] td[data-heading="Photo Count"] {
  display: inline-block;
  order: 3;
  font-size: 0;
  color: #5c646f;
  margin-left: 4px;
}
#gform_wrapper_89 .gpnf-nested-entries tbody tr[data-entryid] td[data-heading="Photo Count"]::before {
  content: attr(data-value) " photo(s)";
  font-size: 13.5px;
}

/* Edit / Delete actions (GPNF's own controls, kept functionally as-is -
   just restyled to look like the prototype's small text links instead
   of full buttons) - pinned top-right of the card */
#gform_wrapper_89 .gpnf-nested-entries tbody tr[data-entryid] td.gpnf-row-actions {
  position: absolute;
  top: 16px;
  right: 18px;
}
#gform_wrapper_89 .gpnf-nested-entries tbody tr[data-entryid] td.gpnf-row-actions ul {
  display: flex;
  gap: 14px;
  margin: 0;
  padding: 0;
  list-style: none;
}
#gform_wrapper_89 .gpnf-nested-entries tbody tr[data-entryid] td.gpnf-row-actions button {
  background: none;
  border: 0;
  padding: 0;
  font-size: 14px;
  font-weight: 550;
  cursor: pointer;
  color: #1666e0;
}
#gform_wrapper_89 .gpnf-nested-entries tbody tr[data-entryid] td.gpnf-row-actions .delete button {
  color: #8d959f;
  font-weight: 450;
}
#gform_wrapper_89 .gpnf-nested-entries tbody tr[data-entryid] td.gpnf-row-actions button:hover {
  text-decoration: underline;
}

/* Empty-state row ("There are no Items.") - keep it plain, not card-styled */
#gform_wrapper_89 .gpnf-nested-entries tbody .gpnf-no-entries td {
  display: block;
  color: #8d959f;
  font-size: 13.5px;
  padding: 12px 0;
}


/* Section 4.6 confirmation - keep this simple and readable; the exact
   visual polish can follow the prototype once you see it rendered.
   Important: nothing here should affect layout BEFORE this element
   exists (it's injected after AJAX submit), so it needs no reserved
   height/CLS consideration like the form fields above. */
.cc-confirmation {
  max-width: 560px;
  margin: 40px auto;
  padding: 32px 28px;
  text-align: center;
}
.cc-confirmation .subtitle {
  display: block;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #1666e0;
  margin-bottom: 8px;
}
.cc-confirmation h3 {
  font-size: 26px;
  margin: 0 0 14px;
}
.cc-confirmation p {
  color: #5c646f;
  margin: 0 0 10px;
}

/* =========================================================
 * Section 1 - tile icons (category/item/configuration choices).
 * No Spellbook "Image Choices" perk on this licence, so the radio
 * markup stays 100% native GF (icons are prepended into each choice's
 * own <label> by cc-quote.js) - this just turns each .gchoice into a
 * card and hides the raw radio dot rather than restyling it, so the
 * native input/label click + keyboard behaviour is untouched.
 * ========================================================= */
.cc-category-field .gfield_radio,
.cc-item-field .gfield_radio,
.cc-config-field .gfield_radio {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  list-style: none;
  margin: 0;
  padding: 0;
}
@media (min-width: 600px) {
  .cc-category-field .gfield_radio {
    grid-template-columns: repeat(5, 1fr);
  }
  .cc-item-field .gfield_radio,
  .cc-config-field .gfield_radio {
    grid-template-columns: repeat(3, 1fr);
  }
}
@media (min-width: 900px) {
  .cc-item-field .gfield_radio,
  .cc-config-field .gfield_radio {
    grid-template-columns: repeat(4, 1fr);
  }
}

.cc-category-field .gchoice,
.cc-item-field .gchoice,
.cc-config-field .gchoice {
  margin: 0;
}

/* Visually hidden, not display:none - stays focusable/keyboard-operable,
   the label (full card, native for="") remains the click target.
   !important because Gravity Forms' own Orbital-theme CSS also targets
   these inputs and can load after this stylesheet. */
.cc-category-field .gchoice input[type="radio"],
.cc-item-field .gchoice input[type="radio"],
.cc-config-field .gchoice input[type="radio"] {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  opacity: 0 !important;
  overflow: hidden !important;
  margin: 0 !important;
}

/* Confirmed from real markup (2026-09-25): Gravity Forms draws the radio
   circle as a ::before pseudo-element directly on
   label.gform-field-label--type-inline, not as a separate DOM element -
   hiding the real <input> above was never going to touch this. Kill the
   pseudo-element instead, scoped to our three field types only. */
.cc-category-field .gchoice label.gform-field-label::before,
.cc-item-field .gchoice label.gform-field-label::before,
.cc-config-field .gchoice label.gform-field-label::before {
  content: none !important;
  display: none !important;
}

.cc-category-field .gchoice label,
.cc-item-field .gchoice label,
.cc-config-field .gchoice label {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 8px !important;
  width: 100% !important;
  height: 100% !important;
  margin: 0 !important;
  padding: 14px 10px !important;
  border: 1.5px solid #dfe3e9;
  border-radius: 10px;
  background: #ffffff;
  text-align: center !important;
  font-size: 13.5px;
  font-weight: 550;
  color: #171a1f;
  cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease;
  box-sizing: border-box;
}
.cc-category-field .gchoice label:hover,
.cc-item-field .gchoice label:hover,
.cc-config-field .gchoice label:hover {
  border-color: #b7c0cc;
}
.cc-category-field .gchoice input[type="radio"]:checked + label,
.cc-item-field .gchoice input[type="radio"]:checked + label,
.cc-config-field .gchoice input[type="radio"]:checked + label {
  border-color: #1666e0;
  border-width: 2px;
  background: #f2f6ff;
}
.cc-category-field .gchoice input[type="radio"]:focus-visible + label,
.cc-item-field .gchoice input[type="radio"]:focus-visible + label,
.cc-config-field .gchoice input[type="radio"]:focus-visible + label {
  outline: 2px solid #1666e0;
  outline-offset: 2px;
}

.cc-tile-icon {
  display: block !important;
  width: 40px !important;
  height: 40px !important;
  margin: 0 auto !important;
  object-fit: contain;
}

/* =========================================================
 * Section 1 - measurement guide image. The field (CSS class cc-guide,
 * see form 88 setup) sits right before the first measurement field;
 * floating its wrapper right lets the measurement fields that follow
 * fill the remaining left column on desktop, and stack below it on
 * phones (the float only kicks in from the breakpoint below). The Qty
 * field clears it so anything after the measurement/guide group goes
 * back to full width. ========================================== */
figure.cc-guide {
  margin: 0 0 20px;
  display: none; /* shown by cc-quote.js once a src resolves */
}
figure.cc-guide figcaption {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: #5c646f;
  margin-bottom: 8px;
}
figure.cc-guide img {
  display: block;
  width: 100%;
  max-width: 480px;
  height: auto;
  border: 1px solid #dfe3e9;
  border-radius: 10px;
}

@media (min-width: 700px) {
  .gform_wrapper .gfield.cc-guide {
    float: right;
    width: 42%;
    margin-left: 24px;
  }
  .gform_wrapper .cc-qty-field {
    clear: both;
  }
}

/* Round 2 fix: Add Item button + mobile cards */
#gform_wrapper_89 .gpnf-add-entry {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 44px; padding: 12px 20px; margin-top: 6px;
  background: #31368c; color: #f8f8f8; border: 2px solid #31368c; border-radius: 0;
  font-size: 14px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase;
  line-height: 1.2; cursor: pointer; text-decoration: none;
}
#gform_wrapper_89 .gpnf-add-entry:hover,
#gform_wrapper_89 .gpnf-add-entry:focus-visible { background: #262a70; border-color: #262a70; outline: none; }
#gform_wrapper_89 .gpnf-add-entry[disabled] { opacity: 0.5; cursor: default; }
#gform_wrapper_89 .gpnf-nested-entries td,
#gform_wrapper_89 .gpnf-nested-entries tr { border: 0; box-shadow: none; }
#gform_wrapper_89 .gpnf-nested-entries tbody tr[data-entryid] { border: 1px solid #dfe3e9; }
#gform_wrapper_89 .gpnf-nested-entries tbody tr[data-entryid] td[data-heading="Photo Count"]::before {
  content: attr(data-value) " photos"; position: static; width: auto; display: inline;
  font-size: 13.5px; font-weight: 400; white-space: normal; overflow: visible;
}
#gform_wrapper_89 .gpnf-nested-entries tbody tr[data-entryid] td[data-heading="Photo Count"][data-value="1"]::before { content: "1 photo"; }
#gform_wrapper_89 .gpnf-nested-entries tbody tr[data-entryid] td[data-heading="Photo Count"][data-value="0"]::before { content: "no photos"; }
@media only screen and (max-width: 760px), (min-device-width: 760px) and (max-device-width: 1024px) {
  #gform_wrapper_89 form .gpnf-nested-entries tbody tr[data-entryid] {
    display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 12px;
    background: #fff; border: 1px solid #dfe3e9; border-radius: 10px;
    padding: 14px 16px 10px; margin-bottom: 10px; position: relative;
  }
  #gform_wrapper_89 form .gpnf-nested-entries tbody tr[data-entryid] td { border: 0; padding: 0; position: static; background: none; }
  #gform_wrapper_89 form .gpnf-nested-entries tbody tr[data-entryid] td::before { content: none; display: none; }
  #gform_wrapper_89 form .gpnf-nested-entries tbody tr[data-entryid] td[data-heading="Items"] {
    display: block; flex: 1 1 100%; padding-right: 0; margin-bottom: 2px;
    font-weight: 650; font-size: 15.5px; color: #171a1f;
  }
  #gform_wrapper_89 form .gpnf-nested-entries tbody tr[data-entryid] td[data-heading="Size Summary"] { display: inline-block; font-size: 13.5px; color: #5c646f; }
  #gform_wrapper_89 form .gpnf-nested-entries tbody tr[data-entryid] td[data-heading="Photo Count"] { display: inline-block; font-size: 0; color: #5c646f; margin-left: 0; }
  #gform_wrapper_89 form .gpnf-nested-entries tbody tr[data-entryid] td[data-heading="Photo Count"]::before { content: attr(data-value) " photos"; display: inline; font-size: 13.5px; }
  #gform_wrapper_89 form .gpnf-nested-entries tbody tr[data-entryid] td[data-heading="Photo Count"][data-value="1"]::before { content: "1 photo"; }
  #gform_wrapper_89 form .gpnf-nested-entries tbody tr[data-entryid] td[data-heading="Photo Count"][data-value="0"]::before { content: "no photos"; }
  #gform_wrapper_89 form .gpnf-nested-entries tbody tr[data-entryid] td.gpnf-row-actions {
    display: block; position: static; flex: 1 1 100%; order: 9;
    margin-top: 10px; padding-top: 8px; border-top: 1px solid #eef0f3;
  }
  #gform_wrapper_89 form .gpnf-nested-entries tbody tr[data-entryid] td.gpnf-row-actions::before { content: none; display: none; }
  #gform_wrapper_89 form .gpnf-nested-entries tbody tr[data-entryid] td.gpnf-row-actions ul { display: flex; gap: 22px; margin: 0; padding: 0; list-style: none; }
  #gform_wrapper_89 form .gpnf-nested-entries tbody tr[data-entryid] td.gpnf-row-actions button {
    background: none; border: 0; padding: 6px 0; min-height: 36px;
    font-size: 15px; font-weight: 550; color: #1666e0; cursor: pointer;
  }
  #gform_wrapper_89 form .gpnf-nested-entries tbody tr[data-entryid] td.gpnf-row-actions .delete button { color: #8d959f; font-weight: 450; }
  #gform_wrapper_89 form .gpnf-nested-entries tbody .gpnf-no-entries td { padding: 12px 0; border: 0; }
}

/* native selects + no iOS zoom */
#gform_wrapper_89 select,
#gform_wrapper_88 select {
  width: 100%; height: 44px; padding: 0 12px;
  border: 1px solid #c7cdd6; border-radius: 7px; background-color: #fff;
}
@media (max-width: 760px) {
  #gform_wrapper_89 input, #gform_wrapper_89 select, #gform_wrapper_89 textarea,
  #gform_wrapper_88 input, #gform_wrapper_88 select, #gform_wrapper_88 textarea { font-size: 16px !important; }
}

/* State field (89/10): keep the field at half width in the form grid, but
   make the select fill all of that half. The Address field's inner grid row
   (.gform-grid-row > .gform-grid-col) otherwise gives State only half of the
   field, i.e. a quarter of the form. */
#gform_wrapper_89 #field_89_10 .ginput_complex.gform-grid-row { display: block; }
#gform_wrapper_89 #field_89_10 .ginput_address_state { display: block; width: 100%; max-width: 100%; float: none; }

/* Nested Forms modal: Cancel turns into a clear "discard" confirmation */
.tingle-modal-box__footer .gpnf-btn-cancel.tingle-btn--danger,
.tingle-modal-box__footer .gpnf-btn-cancel-mobile.tingle-btn--danger {
  background: #b3261e; color: #fff; border-color: #b3261e; font-weight: 600;
}

/* Nested Forms modal: own spinner for Add / Edit Item. GPNF hides the label
   while .gpnf-spinner is set, but its spinner is invisible on this site
   (theme button reset), leaving an empty button. Draw it ourselves. */
.tingle-modal-box__footer .tingle-btn.gpnf-spinner {
  position: relative !important; color: transparent !important; pointer-events: none;
  background: #31368c !important; border-color: #31368c !important;
}
.tingle-modal-box__footer .tingle-btn.gpnf-spinner::after {
  content: "" !important; display: block !important; position: absolute !important;
  top: 50% !important; left: 50% !important; width: 18px !important; height: 18px !important;
  margin: -9px 0 0 -9px !important; box-sizing: border-box !important;
  border: 2px solid rgba(255, 255, 255, 0.35) !important; border-top-color: #fff !important;
  border-radius: 50% !important; background: none !important; opacity: 1 !important;
  animation: cc-spin 0.7s linear infinite !important;
}
@keyframes cc-spin { to { transform: rotate(360deg); } }

/* 2026-10-06: item panel footer. Add Item / Edit Item as the primary button
   (navy, outlined like Submit on the page), Cancel as a text link.
   The panel is appended to <body>, outside the form wrapper. */
.tingle-modal .tingle-modal-box__footer .gpnf-btn-submit {
  background: #31368c;
  color: #f8f8f8;
  border: 2px solid #31368c;
  border-radius: 0;
  outline: 1px solid #31368c;
  outline-offset: 3px;
  padding: 12px 26px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  line-height: 1.2;
  min-height: 44px;
  cursor: pointer;
}
.tingle-modal .tingle-modal-box__footer .gpnf-btn-submit:hover,
.tingle-modal .tingle-modal-box__footer .gpnf-btn-submit:focus-visible {
  background: #262a70;
  border-color: #262a70;
  outline-color: #262a70;
}
.tingle-modal .tingle-modal-box__footer .gpnf-btn-cancel,
.tingle-modal .tingle-modal-box__footer .gpnf-btn-cancel-mobile {
  background: none;
  border: 0;
  color: #5c646f;
  text-decoration: underline;
  padding: 12px 16px;
}

/* 2026-10-06: desktop cards, keep long item names clear of Edit / Delete */
@media (min-width: 761px) {
  #gform_wrapper_89 .gpnf-nested-entries tbody tr[data-entryid] td[data-heading="Items"] {
    padding-right: 120px;
  }
}

/* 2026-10-07: the item form is fetched after page load; on a slow server
   request the panel opens before it arrives. Show a loading state instead
   of an empty panel. Disappears as soon as the form is inserted. */
.gpnf-modal .tingle-modal-box__content:not(:has(.gform_wrapper)) {
  min-height: 220px;
  position: relative;
}
.gpnf-modal .tingle-modal-box__content:not(:has(.gform_wrapper))::after {
  content: "Loading the item form\2026";
  position: absolute;
  left: 0;
  right: 0;
  top: 110px;
  text-align: center;
  font-size: 15px;
  color: #5c646f;
  animation: cc-pulse 1.2s ease-in-out infinite;
}
@keyframes cc-pulse { 0%, 100% { opacity: 0.35; } 50% { opacity: 1; } }

/* 2026-10-07: panel button while photos upload */
.tingle-modal .tingle-modal-box__footer .gpnf-btn-submit.cc-uploading {
  opacity: 0.6;
  cursor: progress;
}

/* 2026-10-08: main form "Add Item" as a full-width gold button with a plus icon */
#gform_wrapper_89 .gpnf-add-entry {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 48px;
  padding: 12px 20px;
  margin-top: 8px;
  background: linear-gradient(180deg, #ffd84d 0%, #f6bd16 100%);
  color: #31368c;
  border: 0;
  outline: 0;
  border-radius: 2px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
}
#gform_wrapper_89 .gpnf-add-entry::before {
  content: "+";
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #5c4a00;
  color: #ffd84d;
  font-size: 18px;
  font-weight: 700;
  line-height: 1;
}
#gform_wrapper_89 .gpnf-add-entry:hover,
#gform_wrapper_89 .gpnf-add-entry:focus-visible {
  background: linear-gradient(180deg, #ffd23a 0%, #eeb208 100%);
  border: 0;
  outline: 2px solid #31368c;
  outline-offset: 2px;
}
