/**
 * Forms & Form Components
 * ibtikar-store theme
 * ─────────────────────────────────────────────
 */

/* =============================================
   Form Layout
   ============================================= */

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

@media (max-width: 640px) {
  .form-row {
    grid-template-columns: 1fr;
  }
}

.form-group {
  margin-bottom: 1.25rem;
}

.form-group:last-of-type {
  margin-bottom: 0;
}

/* =============================================
   Labels
   ============================================= */

.form-group label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: #334155;
  margin-bottom: 0.375rem;
  line-height: 1.4;
}

.form-group label .required {
  color: #ef4444;
  margin-inline-start: 0.125rem;
}

/* =============================================
   Controls (input, textarea, select)
   ============================================= */

.form-control {
  display: block;
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1.5px solid #e2e8f0;
  border-radius: 0.625rem;
  font-size: 1rem;
  font-family: inherit;
  color: #1e293b;
  background-color: #ffffff;
  line-height: 1.5;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
  outline: none;
  box-sizing: border-box;
}

.form-control:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
  background-color: #fafcff;
}

.form-control:hover:not(:focus) {
  border-color: #cbd5e1;
}

.form-control::placeholder {
  color: #94a3b8;
  font-weight: 400;
}

.form-control:disabled,
.form-control[readonly] {
  background-color: #f8fafc;
  color: #94a3b8;
  cursor: not-allowed;
}

/* Textarea */
textarea.form-control {
  resize: vertical;
  min-height: 120px;
  line-height: 1.6;
}

/* Select */
select.form-control {
  cursor: pointer;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: left 0.875rem center;
  padding-left: 2.5rem;
  padding-right: 1rem;
}

/* RTL: flip select arrow position */
[dir="rtl"] select.form-control,
html[lang^="ar"] select.form-control {
  background-position: right 0.875rem center;
  padding-right: 2.5rem;
  padding-left: 1rem;
}

/* =============================================
   Validation States
   ============================================= */

.form-control.is-valid {
  border-color: #10b981;
}

.form-control.is-valid:focus {
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.12);
}

.form-control.is-invalid {
  border-color: #ef4444;
}

.form-control.is-invalid:focus {
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.12);
}

.form-error-msg {
  display: block;
  font-size: 0.8125rem;
  color: #ef4444;
  margin-top: 0.375rem;
}

.form-hint {
  display: block;
  font-size: 0.8125rem;
  color: #64748b;
  margin-top: 0.375rem;
}

/* =============================================
   Checkboxes & Radio Custom Labels
   ============================================= */

.solution-type-checkboxes {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.5rem;
}

@media (max-width: 480px) {
  .solution-type-checkboxes {
    grid-template-columns: 1fr;
  }
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.625rem 0.875rem;
  border: 1.5px solid #e2e8f0;
  border-radius: 0.625rem;
  cursor: pointer;
  font-size: 0.9rem;
  color: #475569;
  font-weight: 500;
  transition: border-color 0.2s ease, background-color 0.2s ease, color 0.2s ease;
  user-select: none;
  line-height: 1.4;
}

.checkbox-label:hover {
  border-color: #93c5fd;
  background-color: #f8faff;
}

.checkbox-label:has(input:checked) {
  border-color: #2563eb;
  background-color: #eff6ff;
  color: #1d4ed8;
}

.checkbox-label input[type="checkbox"],
.checkbox-label input[type="radio"] {
  accent-color: #2563eb;
  width: 1rem;
  height: 1rem;
  flex-shrink: 0;
  cursor: pointer;
}

/* =============================================
   Quote Form Section Titles
   ============================================= */

.quote-form-section-title {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.quote-form-section-title h2 {
  font-size: 1.125rem;
  font-weight: 700;
  color: #1e293b;
  margin: 0;
}

.quote-step-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  background: #2563eb;
  color: white;
  border-radius: 50%;
  font-size: 0.875rem;
  font-weight: 700;
  flex-shrink: 0;
}

/* =============================================
   WhatsApp CTA Card
   ============================================= */

.whatsapp-cta-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: #25D366;
  border-radius: 1rem;
  padding: 1.25rem 1.5rem;
  color: #ffffff;
  text-decoration: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  margin-top: 1.25rem;
}

.whatsapp-cta-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(37, 211, 102, 0.35);
  color: #ffffff;
  text-decoration: none;
}

.whatsapp-cta-card .whatsapp-icon {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 3rem;
  height: 3rem;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 0.75rem;
}

.whatsapp-cta-card .whatsapp-text {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
}

.whatsapp-cta-card .whatsapp-text strong {
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.3;
}

.whatsapp-cta-card .whatsapp-text span {
  font-size: 0.8125rem;
  opacity: 0.85;
}

/* =============================================
   Contact Info Card
   ============================================= */

.contact-info-card {
  padding: 1.5rem;
  background: #ffffff;
  border: 1.5px solid #e2e8f0;
  border-radius: 1rem;
}

.contact-info-card h2 {
  font-size: 1.125rem;
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 1.5px solid #f1f5f9;
}

.contact-info-item {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 0.875rem 0;
  border-bottom: 1px solid #f1f5f9;
}

.contact-info-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.contact-info-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  background: #eff6ff;
  border-radius: 0.625rem;
  flex-shrink: 0;
}

.contact-info-details strong {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: #1e293b;
  margin-bottom: 0.125rem;
}

.contact-info-details p {
  font-size: 0.9rem;
  color: #475569;
  margin: 0;
}

.contact-info-details a {
  color: #2563eb;
  text-decoration: none;
  transition: color 0.2s;
}

.contact-info-details a:hover {
  color: #1d4ed8;
  text-decoration: underline;
}

/* =============================================
   Contact Layout
   ============================================= */

.contact-layout {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 2rem;
  align-items: start;
}

@media (max-width: 900px) {
  .contact-layout {
    grid-template-columns: 1fr;
  }
}

.contact-form-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1.5px solid #f1f5f9;
}

/* =============================================
   Quote Form Wrap
   ============================================= */

.quote-form-wrap {
  max-width: 720px;
  margin: 0 auto;
}

/* =============================================
   Why Quote Strip
   ============================================= */

.quote-why-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
}

@media (max-width: 768px) {
  .quote-why-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 480px) {
  .quote-why-grid {
    grid-template-columns: 1fr;
  }
}

.quote-why-item {
  display: flex;
  align-items: flex-start;
  gap: 0.875rem;
}

.quote-why-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  background: #eff6ff;
  border-radius: 0.625rem;
  flex-shrink: 0;
}

.quote-why-item strong {
  display: block;
  font-size: 0.9rem;
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 0.125rem;
}

.quote-why-item p {
  font-size: 0.8125rem;
  color: #64748b;
  margin: 0;
}

/* =============================================
   Search Results Page
   ============================================= */

.search-results-header {
  background: linear-gradient(135deg, #1e3a5f 0%, #1e40af 60%, #2563eb 100%);
  padding: 3rem 0;
  color: #ffffff;
}

.search-header-content {
  text-align: center;
}

.search-results-label {
  font-size: 0.9375rem;
  opacity: 0.8;
  margin-bottom: 0.5rem;
}

.search-query {
  font-size: clamp(1.5rem, 4vw, 2.25rem);
  font-weight: 800;
  color: #ffffff;
  margin-bottom: 0.5rem;
  word-break: break-word;
}

.search-results-count {
  font-size: 1rem;
  opacity: 0.85;
  margin-bottom: 1.5rem;
}

.search-results-count strong {
  font-weight: 700;
  color: #ffffff;
}

/* Search refine form */
.search-refine-form {
  max-width: 600px;
  margin: 0 auto;
}

.search-type-filters {
  display: flex;
  gap: 1rem;
  justify-content: center;
  margin-top: 0.75rem;
  flex-wrap: wrap;
}

.search-type-filters label {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.85);
  cursor: pointer;
}

.search-type-filters input[type="radio"] {
  accent-color: #ffffff;
}

/* Results sections */
.search-results-section {
  margin-bottom: 3rem;
}

.search-section-heading {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1.25rem;
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 1.5rem;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid #f1f5f9;
}

.search-result-type-badge {
  display: inline-block;
  padding: 0.25rem 0.625rem;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.search-result-type-badge.badge-product {
  background: #dcfce7;
  color: #166534;
}

.search-result-type-badge.badge-page {
  background: #dbeafe;
  color: #1d4ed8;
}

/* Page results list */
.search-results-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.search-result-page-item {
  padding: 1.25rem 1.5rem;
  border: 1.5px solid #e2e8f0;
  border-radius: 0.875rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.search-result-page-item:hover {
  border-color: #93c5fd;
  box-shadow: 0 2px 12px rgba(37, 99, 235, 0.08);
}

.search-result-type {
  margin-bottom: 0.5rem;
}

.search-result-title {
  font-size: 1.0625rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.search-result-title a {
  color: #1e293b;
  text-decoration: none;
  transition: color 0.2s;
}

.search-result-title a:hover {
  color: #2563eb;
}

.search-result-excerpt {
  font-size: 0.9rem;
  color: #475569;
  line-height: 1.6;
  margin-bottom: 0.75rem;
}

.search-result-link {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: #2563eb;
  text-decoration: none;
  transition: gap 0.2s;
}

.search-result-link:hover {
  gap: 0.6rem;
}

/* Pagination */
.search-pagination {
  margin-top: 3rem;
  display: flex;
  justify-content: center;
}

/* No Results */
.search-no-results {
  text-align: center;
  padding: 4rem 2rem;
}

.no-results-icon {
  margin-bottom: 1.5rem;
}

.search-no-results h2 {
  font-size: 1.5rem;
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 0.5rem;
}

.search-no-results > p {
  color: #64748b;
  margin-bottom: 1.5rem;
}

.no-results-suggestions {
  display: inline-block;
  text-align: start;
  background: #f8fafc;
  border: 1.5px solid #e2e8f0;
  border-radius: 0.875rem;
  padding: 1rem 1.5rem;
  margin-bottom: 2rem;
}

.no-results-suggestions h3 {
  font-size: 0.9375rem;
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 0.5rem;
}

.no-results-suggestions ul {
  margin: 0;
  padding-inline-start: 1.25rem;
}

.no-results-suggestions li {
  font-size: 0.9rem;
  color: #475569;
  line-height: 1.8;
}

.no-results-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

/* =============================================
   404 Page Styles
   ============================================= */

.error-404-page {
  min-height: calc(100vh - 200px);
  display: flex;
  align-items: center;
}

.error-404-wrap {
  width: 100%;
  padding: 4rem 0;
}

.error-404-content {
  text-align: center;
  max-width: 680px;
  margin: 0 auto;
}

.error-404-code {
  font-size: clamp(6rem, 18vw, 9rem);
  font-weight: 900;
  line-height: 1;
  color: #2563eb;
  opacity: 0.1;
  margin-bottom: -1.5rem;
  letter-spacing: -0.05em;
  user-select: none;
}

.error-404-icon {
  margin-bottom: 1rem;
}

.error-404-title {
  font-size: clamp(1.25rem, 4vw, 1.75rem);
  font-weight: 800;
  color: #1e293b;
  margin-bottom: 0.375rem;
}

.error-404-subtitle {
  font-size: 0.9375rem;
  color: #94a3b8;
  font-style: italic;
  margin-bottom: 0.875rem;
}

.error-404-desc {
  font-size: 1rem;
  color: #64748b;
  line-height: 1.7;
  margin-bottom: 2rem;
  max-width: 480px;
  margin-left: auto;
  margin-right: auto;
}

.error-404-search {
  display: flex;
  gap: 0.75rem;
  max-width: 520px;
  margin: 0 auto 2rem;
  flex-wrap: wrap;
}

.error-404-search form {
  display: flex;
  gap: 0.75rem;
  width: 100%;
  flex-wrap: wrap;
}

.error-404-search .search-input-wrapper {
  flex: 1;
  min-width: 200px;
}

.error-404-links {
  margin-top: 2.5rem;
}

.error-404-links h2 {
  font-size: 1rem;
  font-weight: 600;
  color: #64748b;
  margin-bottom: 1rem;
}

.error-links-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.875rem;
}

@media (max-width: 600px) {
  .error-links-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 360px) {
  .error-links-grid {
    grid-template-columns: 1fr;
  }
}

.error-link-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding: 1rem 0.75rem;
  background: #f8fafc;
  border: 1.5px solid #e2e8f0;
  border-radius: 0.875rem;
  text-decoration: none;
  color: #334155;
  font-size: 0.875rem;
  font-weight: 500;
  transition: border-color 0.2s, background-color 0.2s, transform 0.2s, color 0.2s;
}

.error-link-card:hover {
  border-color: #93c5fd;
  background-color: #eff6ff;
  color: #1d4ed8;
  transform: translateY(-2px);
  text-decoration: none;
}

.error-link-icon {
  color: #64748b;
  transition: color 0.2s;
}

.error-link-card:hover .error-link-icon {
  color: #2563eb;
}

/* =============================================
   Utility
   ============================================= */

.w-full {
  width: 100%;
}

.mt-4 {
  margin-top: 1rem;
}

.form-disclaimer {
  font-size: 0.8125rem;
  color: #94a3b8;
  text-align: center;
  margin-top: 0.75rem;
}
