/* =========================================================
   Kansallistukku Kuitti
   ========================================================= */

.kk-kuitti-wrap {
  width: 100%;
  font-family: inherit;
}

/* =========================================================
   Layout – 6/12 + 6/12 CSS Grid
   ========================================================= */
.kk-layout {
  display: grid !important;
  grid-template-columns: 5fr 7fr !important;
  gap: 40px !important;
  align-items: start !important;
  width: 100% !important;
  box-sizing: border-box !important;
}

.kk-form-col {
  min-width: 0;
  box-sizing: border-box;
}

.kk-preview-col {
  min-width: 0;
  position: sticky;
  top: calc(var(--flatsome--header--sticky-height, 80px) + 20px);
  box-sizing: border-box;
}

/* =========================================================
   Virheboksi
   ========================================================= */
.kk-errors {
  border: 1px solid #cfcfcf;
  padding: 12px 16px;
  margin-bottom: 20px;
  color: #c53030;
  background: #fff0f0;
}
.kk-errors ul { margin: 6px 0 0 18px; }
.kk-errors li { margin-bottom: 4px; }

/* =========================================================
   Osiot
   ========================================================= */
.kk-section {
  margin-bottom: 24px;
}

/* Osio-otsikot: vain väri, koot teemasta */
.kk-section h4 {
  margin: 0 0 12px !important;
  color: #2a4a96 !important;
}

/* =========================================================
   Kenttärivit
   ========================================================= */
.kk-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 10px;
  box-sizing: border-box;
  width: 100%;
}
.kk-row:last-child { margin-bottom: 0; }

/* Kaikki kentät 100% leveiksi oletuksena */
.kk-field {
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  flex: 1 1 100%;
  min-width: 0;
  width: 100%;
}

/* Kaksi kenttää vierekkäin */
.kk-row-2 .kk-field {
  flex: 1 1 calc(50% - 5px);
  min-width: 80px;
}
.kk-field--grow { flex: 1 1 calc(50% - 5px) !important; }
.kk-field--zip  { flex: 1 1 calc(50% - 5px) !important; min-width: 80px !important; }

/* Labelit piilotetaan kokonaan */
.kk-field label {
  display: none !important;
  visibility: hidden !important;
  height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: hidden !important;
  position: absolute !important;
}

/* =========================================================
   Inputit – Ninja Forms -tyyli, kaikki 100% leveyksiä
   ========================================================= */
.kk-field input[type="text"],
.kk-field input[type="date"],
.kk-field input[type="number"],
.kk-field select,
.kk-product-filter select,
textarea#kk-message {
  font-family: inherit !important;
  font-size: 15px !important;
  width: 100% !important;
  max-width: 100% !important;
  margin: 0 !important;
  padding: 12px !important;
  height: 50px !important;
  background-color: #ffffff !important;
  border: 1px solid #cfcfcf !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  color: #000000 !important;
  transition: border-color .3s !important;
  box-sizing: border-box !important;
  -webkit-appearance: none !important;
  appearance: none !important;
  outline: none !important;
  display: block !important;
}

textarea#kk-message {
  height: auto !important;
  resize: vertical;
  min-height: 80px;
}

.kk-field input:focus,
.kk-field select:focus,
.kk-product-filter select:focus,
textarea#kk-message:focus {
  border-color: #2a4a96 !important;
  box-shadow: none !important;
  outline: none !important;
}

/* kk-product-filter poistettu – ei enää käytössä */

/* =========================================================
   Tuotetaulukko
   ========================================================= */
.kk-rows-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 10px;
}
.kk-rows-table th {
  padding: 6px 5px;
  border-bottom: none;
  font-weight: normal;
  color: #000000;
  font-size: 15px;
  text-transform: none !important;
  letter-spacing: 0 !important;
}
.kk-rows-table td {
  padding: 4px 5px;
  border-bottom: 1px solid #cfcfcf;
  vertical-align: middle;
}

.kk-th-qty,   .kk-td-qty   { width: 50px; text-align: center; vertical-align: middle; }
.kk-th-price, .kk-td-price { width: 78px; text-align: right; vertical-align: middle; }
.kk-th-total, .kk-td-total { width: 70px; text-align: right; vertical-align: middle; }
.kk-th-remove              { width: 22px; text-align: center; }
.kk-td-remove              { width: 22px; text-align: center; vertical-align: middle !important; padding: 0 !important; }

.kk-rows-table input[type="number"],
.kk-rows-table input[type="text"] {
  width: 100% !important;
  padding: 3px 4px !important;
  border: 1px solid #cfcfcf !important;
  border-radius: 0 !important;
  font-family: inherit !important;
  font-size: 15px !important;
  height: auto !important;
  box-sizing: border-box !important;
  background: #fff !important;
  box-shadow: none !important;
  display: block !important;
}
.kk-td-qty  input { text-align: center; }
.kk-td-price input { text-align: right; }

.kk-td-name { min-width: 0; }
.kk-td-name select {
  width: 100% !important;
  padding: 3px 4px !important;
  border: 1px solid #cfcfcf !important;
  border-radius: 0 !important;
  font-family: inherit !important;
  font-size: 15px !important;
  height: auto !important;
  background: #fff !important;
  box-sizing: border-box !important;
  box-shadow: none !important;
  display: block !important;
}

.kk-remove-btn {
  background: none !important;
  border: none !important;
  box-shadow: none !important;
  cursor: pointer !important;
  color: #c53030 !important;
  padding: 0 !important;
  margin: 0 auto !important;
  line-height: 1 !important;
  min-height: auto !important;
  height: auto !important;
  width: auto !important;
  display: block !important;
  text-transform: none !important;
  letter-spacing: 0 !important;
  font-weight: normal !important;
  font-size: 14px !important;
}
.kk-remove-btn:hover { color: #9b1c1c !important; }

/* Summarivi */
.kk-rows-table tfoot td {
  padding: 7px 5px 2px;
  border-top: 1px solid #cfcfcf;
  border-bottom: none;
}
.kk-total-label { text-align: right; font-weight: 600; color: #000000; }
.kk-total-value { text-align: right; font-weight: 600; color: #000000; }

.kk-add-row-wrap { margin-top: 8px; }

/* =========================================================
   Napit – Flatsome .button.primary -tyyli
   ========================================================= */
.kk-btn {
  display: inline-block !important;
  border-radius: 0 !important;
  box-sizing: border-box !important;
  cursor: pointer !important;
  font-family: inherit !important;
  line-height: 2.4em !important;
  max-width: 100% !important;
  min-height: 2.5em !important;
  padding: 0 1.2em !important;
  text-align: center !important;
  text-decoration: none !important;
  text-shadow: none !important;
  text-transform: none !important;
  letter-spacing: 0 !important;
  vertical-align: middle !important;
  font-size: inherit !important;
  -webkit-font-smoothing: antialiased;
  position: relative !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
}

.kk-btn--primary {
  background-color: #6699cc !important;
  border: none !important;
  color: #fff !important;
  margin-bottom: 1em !important;
  box-shadow: none !important;
}
.kk-btn--primary:hover,
.kk-btn--primary:focus {
  background-color: #4d7db3 !important;
  color: #fff !important;
  box-shadow: none !important;
}
/* Tulosta kuitti -nappi erikseen */
#kk-generate {
  background-color: #2a4a96 !important;
}
#kk-generate:hover,
#kk-generate:focus {
  background-color: #1e3a7a !important;
}

.kk-btn--secondary {
  background-color: #f0f0f0 !important;
  border: 1px solid #cfcfcf !important;
  color: #333 !important;
  text-transform: none !important;
  font-weight: 600 !important;
  letter-spacing: 0 !important;
  line-height: 2em !important;
  padding: 0 1em !important;
  margin-bottom: 0 !important;
  box-shadow: none !important;
  font-size: inherit !important;
}
.kk-btn--secondary:hover {
  background-color: #e0e0e0 !important;
  color: #333 !important;
}

.kk-actions { padding-top: 4px; }

/* =========================================================
   Esikatselu
   ========================================================= */
.kk-preview-label {
  color: #999;
  margin-bottom: 8px;
  display: block;
  font-size: inherit;
}

.kk-preview-box {
  border: 1px solid #cfcfcf;
  background: #fff;
  padding: 24px 28px;
  color: #111;
  font-family: 'Fira Sans', Arial, Helvetica, sans-serif;
  font-size: 15px;
}

.kk-preview-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 16px;
}

.kk-preview-box h2 {
  font-size: 20px !important;
  font-weight: 700 !important;
  margin: 0 !important;
  color: #111 !important;
  font-family: 'Fira Sans', Arial, Helvetica, sans-serif !important;
}

.kk-preview-date {
  color: #555;
  font-size: 13px;
}

.kk-preview-parties {
  display: flex;
  gap: 24px;
  margin-bottom: 60px;
}
.kk-preview-party { flex: 1; }
.kk-preview-party strong {
  display: block;
  padding-bottom: 2px;
  margin-bottom: 6px;
  font-size: 13px;
}
.kk-preview-party p {
  margin: 0;
  line-height: 1.8;
  min-height: 40px;
  color: #333;
  font-size: 13px;
}

.kk-preview-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 8px;
}
.kk-preview-table th {
  padding: 5px 4px;
  border-bottom: 1px solid #ccc !important;
  font-weight: 700 !important;
  font-size: 12px !important;
  text-transform: none !important;
  letter-spacing: 0 !important;
  color: #111 !important;
  text-align: left;
}
.kk-preview-table td {
  padding: 5px 4px;
  border-bottom: 1px solid #e0e0e0;
  font-size: 13px;
}
.kk-preview-table .r { text-align: right; }
.kk-preview-total td {
  border-top: 1px solid #ccc;
  border-bottom: none;
  font-weight: 700;
  padding-top: 6px;
  font-size: 13px;
}

.kk-preview-msg {
  margin-top: 12px;
  line-height: 1.65;
  font-size: 12px;
  color: #444;
}

.kk-preview-alv {
  margin-top: 18px;
  padding: 0;
  color: #555;
  line-height: 1.65;
  font-size: 11px;
}

.kk-preview-footer {
  margin-top: 12px;
  text-align: left;
  color: #999999;
  font-size: 10px;
}

/* Piilotettu print-iframe */
#kk-print-frame {
  position: fixed !important;
  top: -9999px !important;
  left: -9999px !important;
  width: 1px !important;
  height: 1px !important;
  border: none !important;
  visibility: hidden !important;
}

/* =========================================================
   Responsiivisuus
   ========================================================= */
@media (max-width: 900px) {
  .kk-layout {
    grid-template-columns: 1fr !important;
  }
  .kk-preview-col {
    position: static !important;
    order: -1;
  }
}
@media (max-width: 600px) {
  .kk-row-2 .kk-field { flex: 1 1 100%; }
  .kk-field--zip { flex: 1 1 100% !important; }
}
