/* ============================================
   OJ Claims – Reklamationsformulär (full CSS)
   Premium, ren och mobilanpassad
   ============================================ */

/* YTTRE WRAP – samma bredd som övrig reklamationslayout */
.ojc-wrap {
  max-width: 1100px;
  margin: 32px auto 64px;
  padding: 0 16px;
}

/* Rubriker och introtext i wrapen */
.ojc-wrap h2 {
  margin: 0 0 8px;
  font-size: 22px;
  font-weight: 600;
  color: #000000;
}

.ojc-wrap > p {
  margin: 0 0 6px;
  font-size: 14px;
  color: #4b5563;
  line-height: 1.5;
}

/* FORMKORTET */
#ojc-form {
  margin-top: 18px;
  padding: 20px 24px 18px;
  border-radius: 22px;
  border: 1px solid #e5e7eb;
  background: #ffffff;
  box-shadow: 0 22px 60px rgba(15, 23, 42, 0.06);
  font-size: 14px;
  color: #111827;
}

/* Behåll standard WP-formbeteende */
#ojc-form fieldset {
  border: 0;
  padding: 0;
  margin: 0;
}

/* PRODUKTRADER-CONTAINER */
#ojc-rows {
  display: grid;
  gap: 14px;
  margin-bottom: 18px;
}

/* EN PRODUKTRAD – DESKTOP-LAYOUT
   SKU | Antal | Skadeorsak | Beskrivning | Filer | Ta bort
*/
.ojc-row {
  display: grid;
  gap: 12px;
  grid-template-columns: 2.4fr 0.7fr 1.6fr 2.3fr 1.8fr 0.6fr;
  align-items: start;
}

/* KOLUMNWRAPPER */
.ojc-col {
  min-width: 0;
}

/* LABELS */
.ojc-col label {
  display: block;
  font-weight: 600;
  margin-bottom: 6px;
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #6b7280;
}

/* ALLA TEXTFÄLT / SELECT / TEXTAREA */
.ojc-col input[type="text"],
.ojc-col input[type="number"],
.ojc-col select,
.ojc-col textarea {
  width: 100%;
  font-size: 14px;
  padding: 2px 12px;
  border-radius: 999px;
  border: 1px solid #d1d5db;
  background: #ffffff;
  color: #111827;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
  box-sizing: border-box;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

/* NUMBER INPUT – centrera texten */
.ojc-col input[type="number"] {
  text-align: center;
  max-width: 80px;
}

/* SELECT (SKADEORSAK) – extra tydlig text */
.ojc-col select {
  font-weight: 600;
  color: #111827;
  background-color: #ffffff;
}

/* TEXTAREA (BESKRIVNING) – lite högre men fortfarande "pill" */
.ojc-col textarea {
  min-height: 44px;
  border-radius: 14px;
  resize: vertical;
}

/* PLACEHOLDER-TEXT */
.ojc-col input::placeholder,
.ojc-col textarea::placeholder {
  color: #9ca3af;
}

/* FOKUSSTATES */
.ojc-col input[type="text"]:focus,
.ojc-col input[type="number"]:focus,
.ojc-col select:focus,
.ojc-col textarea:focus {
  outline: none;
  border-color: #ad9b61;
  box-shadow:
    0 0 0 1px #ad9b61,
    0 6px 18px rgba(0, 0, 0, 0.08);
  background: #ffffff;
}

/* FILUPPLADDNING */
.ojc-col.files input[type="file"] {
  width: 100%;
  padding: 7px 10px;
  font-size: 12px;
  border-radius: 999px;
  border: 1px solid #d1d5db;
  background: #f3f4f6;
  cursor: pointer;
}

.ojc-col.files input[type="file"]:hover {
  background: #e5e7eb;
}

/* TA-BORT-KOLUMN */
.ojc-col.remove {
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
}

/* Ta bort-knappen – liten, enkel pill */
.ojc-col.remove .button {
  min-width: auto;
  padding: 7px 12px;
  border-radius: 999px;
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: #f3f4f6;
  color: #374151;
  border: 1px solid #e5e7eb;
  box-shadow: none;
  white-space: nowrap;
}

.ojc-col.remove .button:hover {
  background: #e5e7eb;
}

/* ACTION-KNAPPAR UNDER RADEN */
#ojc-form .ojc-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: flex-start;
  margin-top: 18px;
}

/* Bas för alla .button inne i formuläret */
#ojc-form .button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 18px;
  border-radius: 999px;
  border-width: 1px;
  border-style: solid;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.12);
  transition:
    background-color 0.15s ease,
    color 0.15s ease,
    border-color 0.15s ease,
    box-shadow 0.15s ease,
    transform 0.1s ease;
}

/* Lägg till produkt – svart */
#ojc-form .ojc-add-row.button {
  background: #000000;
  color: #ffffff;
  border-color: #000000;
}

#ojc-form .ojc-add-row.button:hover {
  background: #111827;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.25);
  transform: translateY(-1px);
}

/* Skicka reklamation – guld */
#ojc-form .ojc-submit.button,
#ojc-form .ojc-submit.button-primary {
  background: #ad9b61;
  color: #000000;
  border-color: #ad9b61;
}

#ojc-form .ojc-submit.button:hover,
#ojc-form .ojc-submit.button-primary:hover {
  background: #c1ae73;
  border-color: #c1ae73;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.25);
  transform: translateY(-1px);
}

/* DISABLED STATE */
#ojc-form .button[disabled],
#ojc-form .button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

/* RESULTMEDDELANDE */
#ojc-result {
  margin-top: 10px;
  font-size: 13px;
  color: #b91c1c;
}

#ojc-result.ojc-success {
  background: #ecfdf5;
  border: 1px solid #10b981;
  color: #065f46;
  padding: 8px 10px;
  border-radius: 10px;
}

/* ===============================
   Produkt-sök – suggestion dropdown
   =============================== */

.ojc-col.sku {
  position: relative;
}

.ojc-sku-status {
  display: block;
  min-height: 16px;
  margin-top: 6px;
  font-size: 12px;
  line-height: 1.35;
  color: #6b7280;
  visibility: hidden;
}

.ojc-sku-status--info {
  visibility: visible;
}

.ojc-sku-status--success {
  visibility: visible;
  color: #065f46;
}

.ojc-sku-status--error {
  visibility: visible;
  color: #b91c1c;
}

.ojc-sku-invalid {
  border-color: #dc2626 !important;
  box-shadow: 0 0 0 1px #dc2626, 0 6px 18px rgba(220, 38, 38, 0.12) !important;
}

.ojc-suggest {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 99999;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-top: none;
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.18);
  max-height: 320px;
  overflow: auto;
  display: none;
  border-radius: 0 0 14px 14px;
}

.ojc-suggest-list {
  list-style: none;
  margin: 0;
  padding: 4px 0;
}

.ojc-suggest-item {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 8px 12px;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.4;
  font-size: 13px;
}

.ojc-suggest-item .sku {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Courier New", monospace;
  font-weight: 600;
  color: #111827;
  min-width: 90px;
}

.ojc-suggest-item .name {
  opacity: 0.9;
  color: #4b5563;
  flex: 1;
}

.ojc-suggest-item:hover,
.ojc-suggest-item.active {
  background: #f3f4f6;
}

.ojc-suggest-item--info,
.ojc-suggest-item--info:hover {
  cursor: default;
  background: #ffffff;
  color: #6b7280;
}

/* ===============================
   RESPONSIVE
   =============================== */

@media (max-width: 1024px) {
  .ojc-row {
    grid-template-columns: 2fr 0.8fr 1.6fr 2.2fr;
    grid-template-areas:
      "sku sku sku sku"
      "qty reason files remove"
      "note note note note";
  }

  .ojc-col.sku    { grid-area: sku; }
  .ojc-col.qty    { grid-area: qty; }
  .ojc-col.reason { grid-area: reason; }
  .ojc-col.note   { grid-area: note; }
  .ojc-col.files  { grid-area: files; }
  .ojc-col.remove { grid-area: remove; justify-content: flex-start; }
}

@media (max-width: 768px) {
  .ojc-wrap {
    margin-top: 24px;
    margin-bottom: 40px;
  }

  #ojc-form {
    padding: 16px 14px 14px;
    border-radius: 18px;
  }

  .ojc-row {
    grid-template-columns: 1fr;
    grid-template-areas:
      "sku"
      "qty"
      "reason"
      "note"
      "files"
      "remove";
    gap: 10px;
  }

  .ojc-col.remove {
    justify-content: flex-start;
  }

  #ojc-form .button {
    width: auto;
  }
}

/* ============================
   Finjustering av högerkanten
   ============================ */

/* Öka avståndet mellan "Bilder"-kolumnen och "Ta bort" */
.ojc-row .ojc-col.files {
  margin-right: 14px; /* ger visuellt andrum */
}

/* Justera Ta bort-kolumnen */
.ojc-row .ojc-col.remove {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  padding-left: 6px; /* ger ännu mer spacing */
}

/* Perfekt, clean pill-knapp */
.ojc-col.remove .button {
  height: 34px;               /* konsekvent höjd */
  padding: 0 16px;            /* centrerad text */
  border-radius: 999px;       /* helt rundad */
  font-size: 12px;            /* lite större för balans */
  font-weight: 600;           /* premium */
  letter-spacing: .05em;
  text-transform: uppercase;
  color: #374151;
  background: #f3f4f6;
  border: 1px solid #e5e7eb;
  box-shadow: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  line-height: 1;
}

/* Hover: lätt highlight */
.ojc-col.remove .button:hover {
  background: #e5e7eb;
  border-color: #d1d5db;
}

/* Flytta hela knappen lite längre från bilderna */
.ojc-col.remove {
  margin-left: 10px;
}

/* ============================
   SKU-sök – visa hela produktnamnet
   ============================ */

/* Tillåt radbrytning istället för ellipsis */
.ojc-suggest-item {
  align-items: flex-start;
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
}

/* SKU-kod i egen kolumn, namnet får resten av bredden */
.ojc-suggest-item .sku {
  min-width: 90px;
}

.ojc-suggest-item .name {
  flex: 1;
  white-space: normal;
}

/* Lite högre maxhöjd när listan kan bryta rader */
.ojc-suggest {
  max-height: 420px;
}
