.pcc-calculator,
.pcc-calculator * {
  box-sizing: border-box;
}

.pcc-calculator {
  --pcc-navy: #263946;
  --pcc-red: #cf1749;
  --pcc-white: #ffffff;
  --pcc-ink: #111820;
  --pcc-muted: #a9b1bd;
  width: min(100%, 900px);
  margin: 24px auto;
  padding: 44px 36px 40px;
  color: var(--pcc-white);
  background: linear-gradient(180deg, #263946 0%, #263946 34%, #6a2b43 69%, #cf1749 100%);
  border: 1px solid rgba(255, 255, 255, .16);
  border-radius: 18px;
  box-shadow: 0 20px 48px rgba(12, 25, 34, .24);
  direction: rtl;
  text-align: right;
  font-family: Tahoma, Arial, sans-serif;
  line-height: 1.7;
}

.pcc-title {
  margin: 0;
  color: var(--pcc-white);
  font-size: clamp(24px, 3.2vw, 34px);
  font-weight: 800;
  text-align: center;
}

.pcc-rule {
  height: 1px;
  margin: 22px 0 34px;
  background: rgba(255, 255, 255, .3);
}

.pcc-top-fields,
.pcc-freight-field,
.pcc-items {
  width: 100%;
}

.pcc-field {
  min-width: 0;
  margin-bottom: 24px;
}

.pcc-field label,
.pcc-conditional label {
  display: block;
  margin: 0 0 8px;
  color: var(--pcc-white);
  font-size: 18px;
  font-weight: 700;
}

.pcc-field label span {
  color: #ffd3df;
}

.pcc-input {
  display: block;
  width: 100%;
  min-height: 58px;
  padding: 11px 18px;
  color: var(--pcc-ink);
  background: var(--pcc-white);
  border: 1px solid rgba(0, 0, 0, .08);
  border-radius: 11px;
  outline: 0;
  font: inherit;
  font-size: 17px;
  text-align: right;
  transition: border-color .2s, box-shadow .2s;
}

.pcc-input::placeholder {
  color: var(--pcc-muted);
}

.pcc-input:focus {
  border-color: #ff789c;
  box-shadow: 0 0 0 4px rgba(255, 255, 255, .22);
}

.pcc-input:disabled {
  color: #838d98;
  background: #e9edf1;
  cursor: not-allowed;
}

.pcc-selected-currency,
.pcc-freight-amount-wrap small {
  display: block;
  min-height: 20px;
  margin-top: 6px;
  color: rgba(255, 255, 255, .84);
  font-size: 13px;
}

.pcc-freight-amount-wrap {
  margin: -6px 0 24px;
}

.pcc-item-card {
  margin: 28px 0;
  padding: 24px;
  background: rgba(9, 24, 36, .25);
  border: 1px solid rgba(255, 255, 255, .25);
  border-radius: 15px;
  backdrop-filter: blur(2px);
}

.pcc-item-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 22px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(255, 255, 255, .22);
}

.pcc-item-heading h3 {
  margin: 0;
  color: var(--pcc-white);
  font-size: 22px;
}

.pcc-remove-item {
  padding: 6px 12px;
  color: var(--pcc-white);
  background: rgba(207, 23, 73, .72);
  border: 1px solid rgba(255, 255, 255, .35);
  border-radius: 8px;
  cursor: pointer;
  font: inherit;
}

.pcc-item-grid,
.pcc-conditional-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
}

.pcc-option-row {
  display: flex;
  align-items: center;
  min-height: 60px;
  margin: 12px 0;
  padding: 12px 16px;
  color: var(--pcc-ink);
  background: rgba(255, 255, 255, .94);
  border: 1px solid rgba(255, 255, 255, .8);
  border-radius: 11px;
  cursor: pointer;
  font-weight: 700;
}

.pcc-option-row input[type="checkbox"] {
  width: 22px;
  height: 22px;
  margin: 0 0 0 10px;
  accent-color: var(--pcc-red);
}

.pcc-tax-row {
  justify-content: space-between;
  gap: 18px;
}

.pcc-tax-row label {
  display: flex;
  align-items: center;
  cursor: pointer;
}

.pcc-tax-row .pcc-input {
  width: min(45%, 270px);
  min-height: 48px;
  background: #f2f4f6;
}

.pcc-conditional {
  margin: 14px 0 22px;
  padding: 18px;
  background: rgba(8, 21, 32, .24);
  border: 1px solid rgba(255, 255, 255, .2);
  border-radius: 12px;
}

.pcc-conditional[hidden] {
  display: none !important;
}

.pcc-add-item {
  width: 100%;
  min-height: 62px;
  margin: 2px 0 30px;
  padding: 12px 20px;
  color: var(--pcc-red);
  background: var(--pcc-white);
  border: 0;
  border-radius: 11px;
  cursor: pointer;
  font: inherit;
  font-size: 18px;
  font-weight: 800;
}

.pcc-add-item span {
  font-size: 24px;
  vertical-align: -2px;
}

.pcc-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  direction: rtl;
}

.pcc-button {
  min-height: 60px;
  padding: 12px;
  background: var(--pcc-white);
  border: 0;
  border-radius: 11px;
  cursor: pointer;
  font: inherit;
  font-size: 18px;
  font-weight: 800;
}

.pcc-calculate {
  color: var(--pcc-red);
}

.pcc-reset {
  color: #66727d;
}

.pcc-print {
  grid-column: 1 / -1;
  color: #24516d;
}

.pcc-button[hidden] {
  display: none;
}

/* Keep action labels readable when the active WordPress theme forces white button text. */
.pcc-calculator .pcc-add-item,
.pcc-calculator .pcc-button {
  color: #000 !important;
}

/* English pages use the same component with a left-to-right reading flow. */
.pcc-calculator[dir="ltr"] {
  direction: ltr;
  text-align: left;
}

.pcc-calculator[dir="ltr"] .pcc-input,
.pcc-calculator[dir="ltr"] .pcc-results-table th {
  text-align: left;
}

.pcc-calculator[dir="ltr"] .pcc-option-row input[type="checkbox"] {
  margin: 0 10px 0 0;
}

.pcc-calculator[dir="ltr"] .pcc-actions {
  direction: ltr;
}

.pcc-errors {
  margin: -12px 0 24px;
  padding: 12px 16px;
  color: #8d102f;
  background: #fff0f4;
  border: 1px solid #ffd0dc;
  border-radius: 10px;
}

.pcc-results {
  margin-top: 30px;
  overflow: hidden;
  background: var(--pcc-white);
  border-radius: 12px;
  scroll-margin-top: 30px;
}

.pcc-results[hidden] {
  display: none;
}

.pcc-results-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 16px;
}

.pcc-results-table th {
  padding: 14px 18px;
  color: var(--pcc-white);
  background: #263946;
  text-align: right;
}

.pcc-results-table th:last-child,
.pcc-results-table td:last-child {
  text-align: center;
}

.pcc-results-table td {
  padding: 12px 18px;
  color: var(--pcc-ink);
  background: var(--pcc-white);
  border-bottom: 1px solid #e4e8ec;
}

.pcc-result-item-heading td {
  font-weight: 800;
  text-align: center !important;
  background: #f1f4f6;
}

.pcc-results-table .pcc-item-total td {
  color: var(--pcc-white);
  background: #263946;
  font-weight: 800;
}

.pcc-grand-total {
  padding: 15px 20px;
  color: var(--pcc-red);
  background: var(--pcc-white);
  border-top: 3px solid var(--pcc-red);
  font-size: 19px;
  font-weight: 800;
  text-align: center;
}

@media (max-width: 700px) {
  .pcc-calculator {
    margin: 10px auto;
    padding: 30px 18px;
    border-radius: 12px;
  }

  .pcc-title {
    font-size: 23px;
  }

  .pcc-item-card {
    padding: 18px 14px;
  }

  .pcc-actions {
    grid-template-columns: 1fr;
  }

  .pcc-print {
    grid-column: auto;
  }

  .pcc-results {
    overflow-x: auto;
  }

  .pcc-results-table {
    min-width: 560px;
  }
}

@media print {
  body.pcc-printing * {
    visibility: hidden !important;
  }

  body.pcc-printing .pcc-print-target,
  body.pcc-printing .pcc-print-target * {
    visibility: visible !important;
  }

  body.pcc-printing .pcc-print-target {
    position: absolute;
    inset: 0 auto auto 0;
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 0;
    background: #fff;
    box-shadow: none;
  }

  body.pcc-printing .pcc-print-target .pcc-form,
  body.pcc-printing .pcc-print-target .pcc-title,
  body.pcc-printing .pcc-print-target .pcc-rule {
    display: none !important;
  }

  body.pcc-printing .pcc-print-target .pcc-results {
    display: block !important;
  }
}
