/* =============================================
   ORDER CONFIRMATION PAGE
   Consistent with checkout.css & global.css
   ============================================= */

.order-confirmation-page {
  padding-top: var(--nav-height-mobile);
  min-height: 100vh;
  background: var(--beige);
  display: flex;
  align-items: flex-start;
  justify-content: center;
}

/* ── Container ────────────────────────────────── */

.oc-container {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 60px 5vw 80px;
  text-align: center;
}

/* ── Success / Error icon ─────────────────────── */

.oc-icon {
  width: 64px;
  height: 64px;
  border: 1.5px solid #111;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  margin: 0 auto 30px;
  color: #111;
  transition: transform 0.4s ease;
}

.oc-error .oc-icon {
  border-color: #b04040;
  color: #b04040;
}

/* ── Headings ─────────────────────────────────── */

.oc-container h1 {
  font-family: var(--font-serif), serif;
  font-size: clamp(28px, 5vw, 42px);
  font-weight: 400;
  color: #111;
  margin-bottom: 12px;
  letter-spacing: 0.3px;
}

.oc-subtitle {
  font-size: 14px;
  color: var(--muted);
  margin-bottom: 40px;
  letter-spacing: 0.2px;
}

/* ── Order Number badge ───────────────────────── */

.oc-order-number {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  background: #fff;
  border: 1px solid #e8e8e8;
  padding: 14px 28px;
  margin-bottom: 50px;
  font-size: 13px;
}

.oc-order-number span {
  text-transform: uppercase;
  letter-spacing: 2px;
  font-size: 10px;
  color: var(--muted);
}

.oc-order-number strong {
  font-family: var(--font-serif), serif;
  font-size: 18px;
  font-weight: 600;
  color: #111;
}

/* ── Two-column details grid ──────────────────── */

.oc-details {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2px;
  text-align: left;
  margin-bottom: 40px;
}

/* ── Section card ─────────────────────────────── */

.oc-section {
  background: #fff;
  border: 1px solid #eee;
  padding: 30px;
}

.oc-section h3 {
  font-family: var(--font-serif), serif;
  font-size: 22px;
  font-weight: 400;
  color: #111;
  margin-bottom: 24px;
  padding-bottom: 14px;
  border-bottom: 1px solid #eee;
}

/* ── Order items list ─────────────────────────── */

.oc-items {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 28px;
}

.oc-item {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  font-size: 14px;
}

.oc-item-name {
  flex: 1;
  color: #333;
}

.oc-item-name em {
  font-style: normal;
  color: var(--muted);
  font-size: 12px;
  margin-left: 6px;
}

.oc-item-price {
  font-size: 14px;
  font-weight: 500;
  color: #111;
  white-space: nowrap;
}

/* WooCommerce price markup */

.oc-item-price .woocommerce-Price-amount,
.oc-total-row .woocommerce-Price-amount {
  color: inherit;
  font: inherit;
}

.oc-item-price .woocommerce-Price-currencySymbol,
.oc-total-row .woocommerce-Price-currencySymbol {
  color: inherit;
}

/* ── Totals ───────────────────────────────────── */

.oc-totals {
  border-top: 1px solid #eee;
  padding-top: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.oc-total-row {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  font-size: 14px;
  color: #555;
}

.oc-total-row.total {
  font-size: 17px;
  color: #111;
  font-weight: 600;
  margin-top: 10px;
  padding-top: 14px;
  border-top: 1px solid #ddd;
}

.oc-total-row.total strong {
  font-family: var(--font-serif), serif;
  font-size: 20px;
  font-weight: 600;
}

/* ── Delivery address ─────────────────────────── */

.oc-address {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.oc-address p {
  font-size: 14px;
  color: #444;
  line-height: 1.6;
  overflow-wrap: anywhere;
}

/* ── Action buttons ───────────────────────────── */

.oc-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  width: 100%;
  margin-top: 40px;
}

.oc-btn-home,
.oc-btn-download {
  min-height: 50px;
  width: 100%;
  padding: 16px 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;

  font-family: var(--font-sans), sans-serif;
  font-size: 10px;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: 1.8px;
  text-align: center;
  text-transform: uppercase;
  text-decoration: none;

  border: 1px solid #111;
  border-radius: 0;
  cursor: pointer;

  transition:
    background 0.3s ease,
    color 0.3s ease;
}

/* Download confirmation */

.oc-btn-download {
  background: transparent;
  color: #111;
}

.oc-btn-download:hover {
  background: #111;
  color: #fff;
}

/* Continue shopping */

.oc-btn-home {
  margin-top: 40px;
  background: #111;
  color: #fff;
  padding: 18px 52px;
}

.oc-btn-home:hover {
  background: transparent;
  color: #111;
}

/*
 * Kada je Continue Shopping unutar novog .oc-actions bloka,
 * margin kontroliše parent, a ne samo dugme.
 */

.oc-actions .oc-btn-home {
  margin-top: 0;
  padding: 16px 24px;
}

/* ── Error state ──────────────────────────────── */

.oc-error {
  text-align: center;
}

.oc-error h1 {
  color: #b04040;
}

/* =============================================
   RESPONSIVE — TABLET
   ============================================= */

@media (min-width: 600px) {
  .oc-details {
    grid-template-columns: 1fr 1fr;
  }

  .oc-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    max-width: 560px;
    margin-right: auto;
    margin-left: auto;
  }
}

/* =============================================
   RESPONSIVE — DESKTOP
   ============================================= */

@media (min-width: 1024px) {
  .order-confirmation-page {
    padding-top: var(--nav-height-desktop);
  }

  .oc-container {
    padding: 80px 40px 100px;
  }

  .oc-icon {
    width: 72px;
    height: 72px;
    font-size: 30px;
    margin-bottom: 36px;
  }

  .oc-section {
    padding: 36px 40px;
  }

  .oc-actions {
    margin-top: 44px;
  }

  .oc-btn-home,
  .oc-btn-download {
    min-height: 52px;
  }
}

/* =============================================
   PRINT-ONLY CONFIRMATION ELEMENTS
   Hidden on the normal website
   ============================================= */

.oc-print-watermark,
.oc-print-brand {
  display: none;
}


/* =============================================
   PRINT / SAVE AS PDF
   ============================================= */

@media print {
  @page {
    size: A4 portrait;
    margin: 10mm;
  }

  html,
  body {
    width: 100%;
    min-height: 0;
    margin: 0 !important;
    padding: 0 !important;
    overflow: visible !important;
    background: #fff !important;
  }

  body * {
    visibility: hidden !important;
  }

  .order-confirmation-page,
  .order-confirmation-page * {
    visibility: visible !important;
  }

  .order-confirmation-page {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    min-height: 0;
    margin: 0 !important;
    padding: 0 !important;
    background: #fff !important;
  }

  .oc-container {
    position: relative;
    width: 100%;
    max-width: 190mm;
    margin: 0 auto !important;
    padding: 8mm 8mm 7mm !important;
    border: 1px solid #d9d5d1;
    background: #fff !important;
    box-shadow: none !important;
    overflow: visible !important;
    text-align: center;
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }


  .oc-icon {
    width: 13mm;
    height: 13mm;
    margin: 0 auto 4mm;
    border: 1px solid #111;
    font-size: 18px;
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }

  .oc-container h1 {
    margin: 0 0 2mm;
    color: #111;
    font-size: 25px;
    line-height: 1.15;
  }

  .oc-subtitle {
    margin: 0 0 5mm;
    color: #666;
    font-size: 9px;
    line-height: 1.45;
  }

  .oc-order-number {
    margin: 0 0 6mm;
    padding: 3mm 6mm;
    border: 1px solid #ddd;
    background: #fff !important;
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }

  .oc-order-number span {
    font-size: 7px;
    letter-spacing: 1.4px;
  }

  .oc-order-number strong {
    font-size: 13px;
  }

  .oc-details {
    display: grid;
    grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr);
    gap: 3mm;
    width: 100%;
    margin: 0;
  }

  .oc-section {
    min-width: 0;
    padding: 5mm;
    border: 1px solid #ddd;
    background: #fff !important;
    break-inside: avoid;
    page-break-inside: avoid;
  }

  .oc-section h3 {
    margin: 0 0 4mm;
    padding: 0 0 3mm;
    border-bottom: 1px solid #ddd;
    font-size: 15px;
    line-height: 1.2;
  }

  .oc-items {
    gap: 2.4mm;
    margin-bottom: 4mm;
  }

  .oc-item {
    align-items: flex-start;
    gap: 4mm;
    color: #222;
    font-size: 8px;
    line-height: 1.35;
    break-inside: avoid;
    page-break-inside: avoid;
  }

  .oc-item-name {
    min-width: 0;
    padding-right: 2mm;
    overflow-wrap: anywhere;
  }

  .oc-item-name em {
    display: inline;
    margin-left: 1mm;
    font-size: 7px;
  }

  .oc-item-price {
    flex: 0 0 auto;
    font-size: 8px;
    font-weight: 600;
    white-space: nowrap;
  }

  .oc-totals {
    gap: 2mm;
    padding-top: 4mm;
    border-top: 1px solid #ddd;
  }

  .oc-total-row {
    gap: 4mm;
    font-size: 8px;
    line-height: 1.3;
    break-inside: avoid;
    page-break-inside: avoid;
  }

  .oc-total-row.total {
    margin-top: 1mm;
    padding-top: 3mm;
    border-top: 1px solid #ccc;
    font-size: 10px;
  }

  .oc-total-row.total strong {
    font-size: 12px;
  }

  .oc-address {
    gap: 1.5mm;
  }

  .oc-address p {
    margin: 0;
    color: #333;
    font-size: 8px;
    line-height: 1.45;
    overflow-wrap: anywhere;
  }

  /*
   * Watermark je stvarni HTML element smješten unutar .oc-details.
   * Tako Chrome mora da ga iscrtava u istom sloju kao obje kartice.
   */

  .oc-details {
    position: relative;
    isolation: isolate;
  }

  .oc-section {
    position: relative;
    z-index: 1;
  }

  .oc-print-watermark {
    position: absolute;
    top: 50%;
    left: 50%;
    z-index: 20;

    display: flex !important;
    visibility: visible !important;
    align-items: center;
    justify-content: center;

    width: 165mm;
    height: auto;

    color: rgba(196, 196, 196, 0.5) !important;

    background: transparent !important;

    font-family: Arial, sans-serif;
    font-size: 52px;
    font-weight: 700;
    line-height: 1;
    letter-spacing: 0.12em;

    text-align: center;
    text-transform: uppercase;
    white-space: nowrap;

    pointer-events: none;

    transform:
      translate(-50%, -50%) rotate(-25deg);

    transform-origin: center;

    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }

  .oc-print-brand {
    position: relative;
    z-index: 2;
    display: flex !important;
    visibility: visible !important;
    flex-direction: column;
    align-items: center;
    width: 100%;
    margin-top: 5mm;
    padding-top: 4mm;
    border-top: 1px solid #d7d7d7;
    text-align: center;
    break-inside: avoid;
    page-break-inside: avoid;
  }

  .oc-print-brand img {
    display: block !important;
    visibility: visible !important;
    width: 44mm;
    max-width: none;
    height: auto;
    margin: 0 auto 3mm;
    filter: none !important;
    opacity: 1 !important;
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }

  .oc-print-document-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1mm;
    color: #555;
    font-family: Arial, sans-serif;
    font-size: 6.5px;
    line-height: 1.4;
    letter-spacing: 0.03em;
    text-align: center;
  }

  .oc-print-document-info p {
    margin: 0;
  }

  .oc-print-document-info strong {
    color: #111;
    font-size: 6.8px;
    font-weight: 700;
    letter-spacing: 0.09em;
  }

  .oc-print-document-note {
    max-width: 115mm;
    margin-top: 1mm !important;
    color: #777;
    font-size: 5.8px;
    line-height: 1.4;
  }

  .oc-actions,
  .cookie-consent,
  .cart-overlay,
  .cart-drawer,
  .site-header,
  .site-footer,
  .navbar,
  header,
  footer,
  #wpadminbar {
    display: none !important;
  }

  .oc-details,
  .oc-section,
  .oc-items,
  .oc-item,
  .oc-totals,
  .oc-total-row,
  .oc-print-brand {
    break-inside: avoid;
    page-break-inside: avoid;
  }

  a {
    color: #111 !important;
    text-decoration: none !important;
  }
}