:root {
  --oc-orange: #f58220;
}

/* =========================
   HEADER
========================= */
.oc-wrapper {
  max-width: 1100px;
  margin: 0 auto 25px;
  padding: 20px 15px 0;
  font-family: Arial, Helvetica, sans-serif;
  position: relative;
}
.oc-header-wrap {
  width: 100%;
  min-width: 1100px;
}
.oc-header-inner {
  position: relative;
  max-width: 1100px;
  margin: 0 auto 25px;
  padding: 22px 15px 0;
  font-family: Arial, Helvetica, sans-serif;
}

.oc-brand-bar {
  position: absolute;
  top: 0;
  left: 15px;              /* aligns with content padding */
  right: 15px;
  height: 6px;
  background: var(--oc-orange);
}
.oc-title {
  margin: 18px 0 6px;
  font-size: 26px;
  font-weight: 700;
  color: #222;
}
.oc-subtitle {
  margin: 0;
  font-size: 15px;
  color: #555;
}
/* =========================
   FORM WRAPPER
========================= */
.cpi-order-form {
  max-width: 1100px;
  margin: 0 auto 40px;
  padding: 0 15px;
  font-family: Arial, Helvetica, sans-serif;
  color: #333;
}

/* =========================
   CUSTOMER INPUTS
========================= */
.cpi-customer {
  display: flex;
  gap: 20px;
  margin: 25px 0;
}

.cpi-customer input {
  flex: 1;
  padding: 14px 16px;
  border: 1px solid #d0d0d0;
  border-radius: 4px;
  font-size: 15px;
}

/* =========================
   TABLE (CRITICAL FIX)
========================= */
.cpi-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  border: 1px solid #e0e0e0;
  background: #fff;
}

.cpi-table th,
.cpi-table td {
  padding: 14px 16px;
  font-size: 14px;
  text-align: left;
  border-right: 1px solid #e0e0e0;
  border-bottom: 1px solid #ededed;
}

.cpi-table th:last-child,
.cpi-table td:last-child {
  border-right: none;
}

.cpi-table thead th {
  background: #fafafa;
  font-weight: 700;
  color: #555;
}

/* =========================
   CATEGORY ROW
========================= */
.cpi-category td {
  background: #f2f2f2;
  font-weight: 700;
  color: #000;
  border-bottom: 1px solid #d9d9d9;
}

/* =========================
   QUANTITY INPUT
========================= */
.cpi-qty {
  width: 100px;
  padding: 8px;
  border: 1px solid #cfcfcf;
  border-radius: 4px;
  font-size: 14px;
  text-align: center;
}

/* =========================
   OTHER PRODUCTS
========================= */
.cpi-other-products {
  margin-top: 35px;
}

.cpi-other-products h4 {
  font-size: 18px;
  margin-bottom: 6px;
}

.cpi-other-products p {
  font-size: 14px;
  margin-bottom: 16px;
}

.cpi-custom-row {
  display: flex;
  gap: 15px;
  margin-bottom: 12px;
}

.cpi-custom-name {
  flex: 3;
}

.cpi-custom-qty {
  flex: 1;
  text-align: center;
}

.cpi-custom-row input {
  padding: 12px 14px;
  border: 1px solid #cfcfcf;
  border-radius: 4px;
  font-size: 15px;
}

/* ADD BUTTON */
#cpi_add_custom {
  margin-top: 10px;
  padding: 8px 16px;
  border: 1px dashed var(--oc-orange);
  background: transparent;
  color: var(--oc-orange);
  font-weight: 700;
  border-radius: 4px;
  cursor: pointer;
}

/* =========================
   FOOTER
========================= */
.cpi-footer {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 30px;
  margin-top: 40px;
  align-items: stretch;
}

/* SUBTOTAL CARD */
.cpi-subtotal-box {
  background: #16222b;
  border-radius: 10px;
  padding: 30px 20px;
  text-align: center;
  color: #fff;
}

.cpi-subtotal-label {
  font-size: 14px;
  opacity: 0.85;
  margin-bottom: 10px;
}

.cpi-subtotal-amount {
  font-size: 34px;
  font-weight: 800;
  color: var(--oc-orange);
}

/* RIGHT FORM */
.cpi-footer-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.cpi-footer-form input,
.cpi-footer-form textarea {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid #d9e1ea;
  border-radius: 6px;
  font-size: 15px;
  font-family: inherit;
}

.cpi-footer-form textarea {
  resize: vertical;
  min-height: 80px;
}

/* BUTTON */
.cpi-submit-btn {
  background: var(--oc-orange);
  color: #fff;
  border: none;
  padding: 16px;
  font-size: 16px;
  font-weight: 700;
  border-radius: 6px;
  cursor: pointer;
}

.cpi-error {
    color: red;        
    font-weight: bold;   
    margin-top: 10px;     
}

/* =========================
   TABLET (<= 1024px)
========================= */
@media (max-width: 1024px) {

  .oc-header-wrap,
  .oc-header-inner,
  .oc-wrapper,
  .cpi-order-form {
    max-width: 100%;
    min-width: 0;
    padding-left: 15px;
    padding-right: 15px;
  }

  .cpi-customer {
    gap: 15px;
  }

  .cpi-table th,
  .cpi-table td {
    padding: 12px;
    font-size: 13px;
  }

  .cpi-subtotal {
    font-size: 22px;
  }
}

/* =========================
   MOBILE (<= 768px)
========================= */
@media (max-width: 768px) {

  /* HEADER */
  .oc-header-wrap {
    min-width: 0;
  }

  .oc-title {
    font-size: 22px;
  }

  .oc-subtitle {
    font-size: 14px;
  }

  /* CUSTOMER INFO */
  .cpi-customer {
    flex-direction: column;
    gap: 12px;
  }

  /* TABLE — SCROLL SAFELY */
  .cpi-table {
    display: block;
    width: 100%;
    overflow-x: auto;
    white-space: nowrap;
  }

  .cpi-table thead {
    display: table-header-group;
  }

  .cpi-qty {
    width: 70px;
    padding: 6px;
    font-size: 13px;
  }

  /* OTHER PRODUCTS */
  .cpi-custom-row {
    flex-direction: column;
    gap: 8px;
  }

  .cpi-custom-qty {
    text-align: left;
  }

  /* FOOTER */
  .cpi-footer {
    flex-direction: column;
    align-items: stretch;
  }

  .cpi-subtotal {
    width: 100%;
    font-size: 20px;
    padding: 16px;
  }

  #cpi_submit {
    width: 100%;
    padding: 16px;
  }
}
