/*
 * Gindi Innovations — drawers: the service enquiry drawer and the quotation
 * form (a <dialog> sliding in from the inline end; full screen on phones).
 * Loaded by every page that has one.
 */

/* ---------- Drawer ---------- */
.drawer {
  inset-block: 0;
  inset-inline: auto 0;
  width: min(30rem, 100vw);
  max-width: none;
  height: 100vh;
  height: 100dvh;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: var(--bg);
  color: var(--fg);
  box-shadow: -1rem 0 3rem rgb(28 44 74 / 0.18);
}

[dir="rtl"] .drawer {
  inset-inline: auto 0;
  box-shadow: 1rem 0 3rem rgb(28 44 74 / 0.18);
}

.drawer::backdrop {
  background: rgb(28 44 74 / 0.55);
}

.drawer[open] {
  animation: drawer-in 360ms var(--ease-out);
}

.drawer[open]::backdrop {
  animation: drawer-fade 360ms var(--ease-out);
}

@keyframes drawer-in {
  from { transform: translateX(100%); }
}

@keyframes drawer-fade {
  from { opacity: 0; }
}

[dir="rtl"] .drawer[open] {
  animation-name: drawer-in-rtl;
}

@keyframes drawer-in-rtl {
  from { transform: translateX(-100%); }
}

.drawer__panel {
  display: grid;
  align-content: start;
  gap: 1.25rem;
  min-height: 100%;
  padding: 1.5rem clamp(1.25rem, 4vw, 2.25rem) 2.5rem;
}

.drawer__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.drawer__title {
  font-family: var(--font-heading);
  font-size: var(--fs-h3);
  font-weight: var(--fw-regular);
}

.drawer__close {
  display: grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  border: 1px solid var(--line);
  transition: border-color var(--dur-fast) var(--ease-out);
}

.drawer__close:hover {
  border-color: var(--gindi-gold);
}

.drawer__close svg {
  width: 1.25rem;
  height: 1.25rem;
}

.drawer__about {
  display: grid;
  gap: 0.25rem;
  padding-block: 0.875rem;
  border-block: 1px solid var(--line);
}

.drawer__about .label {
  color: var(--muted);
}

.drawer__about strong {
  font-family: var(--font-heading);
  font-size: 1.375rem;
  font-weight: var(--fw-medium);
}

.enquiry-form {
  display: grid;
  gap: 1rem;
}

.enquiry-form__field {
  display: grid;
  gap: 0.375rem;
}

.enquiry-form__field label {
  font-size: var(--fs-small);
  font-weight: var(--fw-medium);
}

.enquiry-form__req {
  font-weight: var(--fw-regular);
  color: var(--muted);
}

.enquiry-form input,
.enquiry-form select,
.enquiry-form textarea {
  width: 100%;
  min-height: 2.875rem;
  padding: 0.625rem 0.75rem;
  border: 1px solid var(--navy-15);
  border-radius: 0;
  background: #fff;
  color: var(--fg);
  font: inherit;
  transition: border-color var(--dur-fast) var(--ease-out);
}

.enquiry-form textarea {
  resize: vertical;
}

.enquiry-form input:focus-visible,
.enquiry-form select:focus-visible,
.enquiry-form textarea:focus-visible {
  border-color: var(--gindi-navy);
  outline: 2px solid var(--gindi-navy);
  outline-offset: 1px;
}

.enquiry-form__notice {
  padding: 0.875rem 1rem;
  border-inline-start: 2px solid var(--gindi-gold);
  background: var(--navy-08);
  font-size: var(--fs-small);
  line-height: 1.55;
}

.enquiry-form__notice a {
  font-weight: var(--fw-medium);
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

.enquiry-form__send:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

/* "Chat with Us on WhatsApp": the site's button shape, as an outline. */
.drawer__whatsapp {
  justify-self: start;
  border-color: var(--gindi-navy);
  color: var(--gindi-navy);
  transition:
    background-color var(--dur-fast) var(--ease-out),
    border-color var(--dur-fast) var(--ease-out);
}

.drawer__whatsapp svg {
  width: 1.25rem;
  height: 1.25rem;
  flex: none;
}

.drawer__whatsapp:hover {
  border-color: var(--gindi-gold);
  background-color: var(--navy-08);
}

/* ---------- Quotation form ---------- */
.drawer--quote {
  --quote-error: #a1301f; /* brick red: 6.5:1 on ivory */
  width: min(34rem, 100vw); /* the whole screen on phones */
  overflow-y: auto;
  overscroll-behavior: contain;
}

.drawer--quote .drawer__panel {
  gap: 1rem;
  padding-block-start: 0;
}

/* The title and close button stay in view while the form scrolls. */
.quote__head {
  position: sticky;
  inset-block-start: 0;
  z-index: 1;
  padding-block: 1.25rem 0.75rem;
  border-block-end: 1px solid var(--line);
  background: var(--bg);
}

.quote__intro {
  color: var(--muted);
}

.quote-form {
  gap: 1.125rem;
}

/* [hidden] must win over the fields' own display. */
.quote-form [hidden] {
  display: none !important;
}

.quote-form__hint,
.quote-form__error {
  font-size: 0.8125rem;
  line-height: 1.5;
}

.quote-form__hint {
  color: var(--muted);
}

.quote-form__error {
  color: var(--quote-error);
  font-weight: var(--fw-medium);
}

.quote-form .is-invalid input,
.quote-form .is-invalid select,
.quote-form .is-invalid textarea {
  border-color: var(--quote-error);
}

/* Numbers, addresses and links stay left-to-right, aligned with the page. */
[dir="rtl"] .quote-form input[dir="ltr"] {
  text-align: right;
}

.quote-form__group {
  display: grid;
  gap: 0.75rem;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.quote-form__group legend {
  margin-block-end: 0.5rem;
  padding: 0;
  font-size: var(--fs-small);
  font-weight: var(--fw-medium);
}

.quote-form__group .enquiry-form__field label {
  font-weight: var(--fw-regular);
}

/* Area with its unit. */
.quote-form__unit {
  display: flex;
}

.quote-form__unit input {
  flex: 1 1 auto;
  min-width: 0;
}

.quote-form__unit-label {
  display: grid;
  place-items: center;
  min-width: 3rem;
  padding-inline: 0.75rem;
  border: 1px solid var(--navy-15);
  border-inline-start: 0;
  background: var(--navy-08);
  font-size: var(--fs-small);
}

/* Preferred contact method: three bordered choices. */
.quote-form__choices {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.quote-form__choice {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 2.75rem;
  padding: 0.5rem 0.875rem;
  border: 1px solid var(--navy-15);
  background: #fff;
  font-size: var(--fs-small);
  cursor: pointer;
}

.quote-form .quote-form__choice input {
  width: 1rem;
  height: 1rem;
  min-height: 0;
  margin: 0;
  padding: 0;
  accent-color: var(--gindi-navy);
}

.quote-form__choice:has(input:checked) {
  border-color: var(--gindi-navy);
  box-shadow: inset 0 0 0 1px var(--gindi-navy);
}

.quote-form__choice:has(input:focus-visible) {
  outline: 2px solid var(--gindi-navy);
  outline-offset: 2px;
}

.quote-form .quote-form__choice input:focus-visible {
  outline: none;
}

.quote-form .is-invalid .quote-form__choice {
  border-color: var(--quote-error);
}

/* The two ways to send, each with its explanation. */
.quote-form__actions {
  display: grid;
  gap: 1rem;
  padding-block-start: 1.25rem;
  border-block-start: 1px solid var(--line);
}

.quote-form__send {
  display: grid;
  gap: 0.375rem;
}

.quote-form__send .btn {
  width: 100%;
}

.quote-form__whatsapp {
  border-color: var(--gindi-navy);
  color: var(--gindi-navy);
  transition:
    background-color var(--dur-fast) var(--ease-out),
    border-color var(--dur-fast) var(--ease-out);
}

.quote-form__whatsapp:hover:not(:disabled) {
  border-color: var(--gindi-gold);
  background-color: var(--navy-08);
}

.quote-form__send .btn:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.quote-form__status {
  padding: 0.875rem 1rem;
  border-inline-start: 2px solid var(--gindi-gold);
  background: var(--navy-08);
  font-size: var(--fs-small);
  line-height: 1.55;
}

.quote-form__status:empty {
  display: none;
}
@media (prefers-reduced-motion: reduce) {
  .drawer[open],
  .drawer[open]::backdrop {
    animation: none;
  }
}
