/* ================================================================
   Photo Order Plugin — Madama Style
   Warm tones: deep espresso, burnt orange, cream
   ================================================================ */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@600;700;800&family=Lato:wght@300;400;600;700&display=swap');

:root {
  --po-espresso:   #1a0a00;
  --po-dark:       #2b1200;
  --po-surface:    #fff9f4;
  --po-surface2:   #fff3ea;
  --po-border:     #e8d5c4;
  --po-orange:     #d4541a;
  --po-orange2:    #e8682e;
  --po-orange-lt:  #fff0e6;
  --po-cream:      #fdf6ef;
  --po-text:       #2b1200;
  --po-text-dim:   #7a5c44;
  --po-success:    #2d7a4f;
  --po-radius:     14px;
  --po-font-head:  'Playfair Display', serif;
  --po-font-body:  'Lato', sans-serif;
  --po-shadow:     0 4px 24px rgba(43,18,0,.10);
  --po-shadow-lg:  0 8px 40px rgba(43,18,0,.15);
}

/* ── App wrapper ───────────────────────────────────────────────── */
.po-app {
  font-family: var(--po-font-body);
  color: var(--po-text);
  max-width: 820px;
  margin: 0 auto;
  padding: 0 16px 80px;
}

/* ── Progress bar ──────────────────────────────────────────────── */
.po-progress {
  display: flex; align-items: center; justify-content: center;
  padding: 36px 0 44px; gap: 0;
}
.po-step {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  opacity: .3; transition: opacity .3s;
}
.po-step.active { opacity: 1; }
.po-step.done   { opacity: .65; }
.po-step-icon {
  width: 46px; height: 46px;
  display: flex; align-items: center; justify-content: center;
  background: var(--po-surface2);
  border: 2px solid var(--po-border);
  border-radius: 50%; font-size: 18px;
  transition: border-color .3s, box-shadow .3s, background .3s;
}
.po-step.active .po-step-icon {
  border-color: var(--po-orange);
  background: var(--po-orange-lt);
  box-shadow: 0 0 0 4px rgba(212,84,26,.12);
}
.po-step.done .po-step-icon {
  border-color: var(--po-success);
  background: #edfaf3;
}
.po-step-label {
  font-family: var(--po-font-body); font-size: 11px; font-weight: 700;
  letter-spacing: .06em; text-transform: uppercase; color: var(--po-text-dim);
}
.po-step.active .po-step-label { color: var(--po-orange); }
.po-step-line {
  flex: 1; height: 2px; max-width: 70px;
  background: var(--po-border); margin-bottom: 24px;
}

/* ── Section ───────────────────────────────────────────────────── */
.po-section {
  background: #fff;
  border-radius: var(--po-radius);
  border: 1px solid var(--po-border);
  padding: 40px;
  box-shadow: var(--po-shadow);
  animation: po-fadein .35s ease;
}
.po-hidden { display: none !important; }
@keyframes po-fadein {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: none; }
}
.po-section-header { margin-bottom: 32px; border-bottom: 1px solid var(--po-border); padding-bottom: 20px; }
.po-section-header h2 {
  font-family: var(--po-font-head);
  font-size: 28px; font-weight: 700;
  color: var(--po-espresso); margin: 0 0 6px;
}
.po-section-header p { margin: 0; color: var(--po-text-dim); font-size: 14px; }
.po-section-footer {
  display: flex; justify-content: flex-end; gap: 12px;
  margin-top: 32px; padding-top: 24px; border-top: 1px solid var(--po-border);
}

/* ── Buttons ───────────────────────────────────────────────────── */
.po-btn {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--po-font-body); font-size: 14px; font-weight: 700;
  padding: 12px 28px; border-radius: 8px; border: none;
  cursor: pointer; transition: all .2s; letter-spacing: .02em;
  text-decoration: none;
}
.po-btn:disabled { opacity: .4; cursor: not-allowed; }
.po-btn-primary {
  background: var(--po-orange); color: #fff;
  box-shadow: 0 3px 14px rgba(212,84,26,.35);
}
.po-btn-primary:not(:disabled):hover {
  background: var(--po-orange2);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(212,84,26,.4);
}
.po-btn-ghost {
  background: transparent; color: var(--po-text-dim);
  border: 1px solid var(--po-border);
}
.po-btn-ghost:hover { border-color: var(--po-orange); color: var(--po-orange); }

/* ── Dropzone ──────────────────────────────────────────────────── */
.po-dropzone {
  border: 2px dashed var(--po-border);
  border-radius: var(--po-radius); cursor: pointer;
  transition: all .2s; position: relative; overflow: hidden;
  background: var(--po-cream);
}
.po-dropzone:hover, .po-dropzone.drag-over {
  border-color: var(--po-orange);
  background: var(--po-orange-lt);
}
.po-dropzone-inner {
  padding: 52px 24px;
  display: flex; flex-direction: column; align-items: center; gap: 14px; text-align: center;
}
.po-dropzone-icon { font-size: 52px; line-height: 1; }
.po-dropzone-text {
  font-family: var(--po-font-head); font-size: 18px;
  font-weight: 600; color: var(--po-espresso); margin: 0;
}
.po-dropzone-text span {
  display: block; font-family: var(--po-font-body);
  font-size: 13px; color: var(--po-orange); font-weight: 400; margin-top: 4px;
}
.po-dropzone-badge {
  font-size: 12px; color: var(--po-text-dim);
  background: var(--po-surface2); border-radius: 20px;
  padding: 4px 12px; border: 1px solid var(--po-border);
}
#po-file-input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; }

/* ── Upload list ───────────────────────────────────────────────── */
.po-upload-list { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }
.po-upload-item {
  width: 96px; background: var(--po-cream); border-radius: 10px;
  overflow: hidden; border: 1px solid var(--po-border);
  position: relative; animation: po-fadein .25s ease;
}
.po-upload-item img { width: 100%; height: 78px; object-fit: cover; display: block; }
.po-upload-meta { padding: 5px 7px; font-size: 10px; color: var(--po-text-dim); }
.po-upload-remove {
  position: absolute; top: 4px; right: 4px;
  width: 20px; height: 20px; border-radius: 50%;
  background: rgba(26,10,0,.65); border: none;
  color: #fff; font-size: 13px; cursor: pointer;
  display: flex; align-items: center; justify-content: center; line-height: 1;
}
.po-upload-progress {
  position: absolute; bottom: 0; left: 0; height: 3px;
  background: var(--po-orange); transition: width .3s;
}

/* ── Size grid ─────────────────────────────────────────────────── */
.po-size-grid { display: flex; flex-direction: column; gap: 18px; }
.po-size-card {
  background: var(--po-cream); border: 1px solid var(--po-border);
  border-radius: 12px; padding: 18px;
  display: grid; grid-template-columns: 84px 1fr; gap: 18px; align-items: start;
}
.po-size-card .po-preview { width: 84px; height: 66px; object-fit: cover; border-radius: 8px; }
.po-size-options { display: flex; gap: 8px; flex-wrap: wrap; }
.po-size-option {
  flex: 1; min-width: 90px;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 12px 8px; border-radius: 8px;
  border: 2px solid var(--po-border);
  background: #fff; cursor: pointer; transition: all .2s; text-align: center;
}
.po-size-option:hover { border-color: var(--po-orange); background: var(--po-orange-lt); }
.po-size-option.selected {
  border-color: var(--po-orange); background: var(--po-orange-lt);
  box-shadow: 0 0 0 3px rgba(212,84,26,.12);
}
.po-size-name { font-family: var(--po-font-head); font-size: 14px; font-weight: 700; color: var(--po-espresso); }
.po-size-dims { font-size: 11px; color: var(--po-text-dim); }
.po-size-price { font-size: 13px; font-weight: 700; color: var(--po-orange); margin-top: 3px; }
.po-size-required { font-size: 11px; color: #c0392b; margin-top: 6px; display: none; }

/* ── Subtotal card ─────────────────────────────────────────────── */
.po-subtotal-card {
  margin-top: 28px; background: var(--po-espresso);
  border-radius: 12px; padding: 22px 26px;
}
.po-subtotal-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 7px 0; color: rgba(255,255,255,.6); font-size: 14px;
}
.po-total-row {
  font-family: var(--po-font-head); font-weight: 700; font-size: 22px;
  color: #fff; border-top: 1px solid rgba(255,255,255,.15);
  padding-top: 14px; margin-top: 6px;
}
.po-total-row span:last-child { color: var(--po-orange2); }

/* ── Address ───────────────────────────────────────────────────── */
.po-address-wrapper { display: flex; flex-direction: column; gap: 16px; }
.po-label { font-size: 11px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--po-text-dim); display: block; margin-bottom: 7px; }
.po-input {
  width: 100%; box-sizing: border-box;
  background: var(--po-cream); border: 1.5px solid var(--po-border);
  color: var(--po-text); border-radius: 8px;
  padding: 13px 16px; font-size: 15px; font-family: var(--po-font-body);
  transition: border-color .2s;
}
.po-input:focus { outline: none; border-color: var(--po-orange); background: #fff; }
.po-autocomplete-wrap { position: relative; }
.po-suggestions {
  position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 200;
  background: #fff; border: 1.5px solid var(--po-border); border-radius: 10px;
  overflow: hidden; list-style: none; margin: 0; padding: 4px 0;
  box-shadow: var(--po-shadow-lg);
}
.po-suggestions li {
  padding: 11px 16px; cursor: pointer; font-size: 14px; color: var(--po-text);
  border-bottom: 1px solid var(--po-border); transition: background .15s;
}
.po-suggestions li:last-child { border-bottom: none; }
.po-suggestions li:hover { background: var(--po-orange-lt); color: var(--po-orange); }
.po-suggestions.po-hidden { display: none !important; }
.po-map {
  width: 100%; height: 300px; border-radius: 12px;
  overflow: hidden; border: 1.5px solid var(--po-border); position: relative;
}
.po-map-crosshair {
  position: absolute; top: 50%; left: 50%;
  transform: translate(-50%, -60%); width: 36px; height: 36px; z-index: 10; pointer-events: none;
}
.po-map-crosshair svg { filter: drop-shadow(0 2px 4px rgba(0,0,0,.3)); }
.po-map-hint { font-size: 12px; color: var(--po-text-dim); margin: 0; text-align: center; }
.po-address-display {
  display: flex; align-items: flex-start; gap: 10px;
  background: var(--po-orange-lt); border: 1.5px solid rgba(212,84,26,.3);
  border-radius: 10px; padding: 14px 16px; font-size: 14px;
}
.po-address-icon { font-size: 18px; flex-shrink: 0; }

/* ── Checkout / Payment ────────────────────────────────────────── */
.po-order-summary {
  display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-bottom: 28px;
}
.po-summary-photos { display: flex; flex-wrap: wrap; gap: 8px; align-content: flex-start; }
.po-summary-thumb {
  width: 70px; border-radius: 8px; overflow: hidden;
  border: 1px solid var(--po-border); position: relative;
}
.po-summary-thumb img { width: 100%; height: 58px; object-fit: cover; display: block; }
.po-summary-thumb .po-sum-size {
  font-size: 9px; font-weight: 700; text-align: center;
  padding: 3px; background: var(--po-orange); color: #fff;
  text-transform: uppercase; letter-spacing: .04em;
}
.po-summary-details { display: flex; flex-direction: column; gap: 14px; }
.po-summary-address {
  background: var(--po-cream); border-radius: 10px; padding: 14px;
  font-size: 13px; color: var(--po-text-dim); border: 1px solid var(--po-border); line-height: 1.5;
}
.po-summary-total { display: flex; flex-direction: column; gap: 6px; }
.po-summary-line { display: flex; justify-content: space-between; font-size: 14px; color: var(--po-text-dim); }
.po-summary-grand {
  font-family: var(--po-font-head); font-weight: 700; font-size: 20px;
  color: var(--po-espresso); border-top: 1px solid var(--po-border); padding-top: 10px;
}
.po-summary-grand span:last-child { color: var(--po-orange); }

/* ── Payment methods section ───────────────────────────────────── */
.po-payment-section { margin-top: 8px; }
.po-payment-title {
  font-family: var(--po-font-head); font-size: 18px; font-weight: 700;
  color: var(--po-espresso); margin: 0 0 18px;
  display: flex; align-items: center; gap: 10px;
}
.po-payment-title::after {
  content: ''; flex: 1; height: 1px; background: var(--po-border);
}

/* Tab selector */
.po-pay-tabs {
  display: flex; gap: 8px; margin-bottom: 20px; flex-wrap: wrap;
}
.po-pay-tab {
  display: flex; align-items: center; gap: 7px;
  padding: 10px 18px; border-radius: 8px; cursor: pointer;
  border: 1.5px solid var(--po-border); background: var(--po-cream);
  font-size: 13px; font-weight: 600; color: var(--po-text-dim);
  transition: all .2s;
}
.po-pay-tab:hover { border-color: var(--po-orange); color: var(--po-orange); }
.po-pay-tab.active {
  border-color: var(--po-orange); background: var(--po-orange-lt);
  color: var(--po-orange);
}
.po-pay-tab img { height: 18px; }
.po-pay-tab svg { width: 18px; height: 18px; }

/* Payment panels */
.po-pay-panel { display: none; }
.po-pay-panel.active { display: block; animation: po-fadein .25s ease; }

/* PayPal buttons container */
#po-paypal-buttons-container,
#po-applepay-container,
#po-googlepay-container { min-height: 50px; }

/* Card fields */
.po-card-fields { display: flex; flex-direction: column; gap: 14px; }
.po-card-field-wrap { background: var(--po-cream); border: 1.5px solid var(--po-border); border-radius: 8px; padding: 2px; overflow: hidden; }
.po-card-field-wrap:focus-within { border-color: var(--po-orange); }
.po-card-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.po-pay-submit {
  width: 100%; padding: 15px; border-radius: 8px;
  background: var(--po-orange); color: #fff; border: none;
  font-family: var(--po-font-body); font-size: 16px; font-weight: 700;
  cursor: pointer; transition: all .2s; margin-top: 4px;
  display: flex; align-items: center; justify-content: center; gap: 8px;
}
.po-pay-submit:hover { background: var(--po-orange2); transform: translateY(-1px); box-shadow: 0 4px 16px rgba(212,84,26,.35); }
.po-pay-submit:disabled { opacity: .5; cursor: not-allowed; transform: none; }

/* Secure badge */
.po-secure-badge {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  font-size: 12px; color: var(--po-text-dim); margin-top: 14px;
}

/* ── Success state ─────────────────────────────────────────────── */
.po-success-state {
  text-align: center; padding: 40px 20px;
}
.po-success-icon { font-size: 64px; margin-bottom: 16px; animation: po-bounce .5s ease; }
@keyframes po-bounce {
  0%,100% { transform: scale(1); }
  50%      { transform: scale(1.15); }
}
.po-success-state h3 {
  font-family: var(--po-font-head); font-size: 26px;
  color: var(--po-espresso); margin: 0 0 10px;
}
.po-success-state p { color: var(--po-text-dim); font-size: 15px; margin: 0; }
.po-success-state .po-order-ref {
  display: inline-block; margin-top: 16px;
  background: var(--po-orange-lt); border: 1px solid rgba(212,84,26,.3);
  border-radius: 8px; padding: 10px 20px;
  font-weight: 700; color: var(--po-orange); font-size: 15px;
}

/* ── Loading ───────────────────────────────────────────────────── */
.po-loading-state { text-align: center; padding: 32px; color: var(--po-text-dim); }
.po-spinner {
  width: 32px; height: 32px; border: 3px solid var(--po-border);
  border-top-color: var(--po-orange); border-radius: 50%;
  animation: po-spin .7s linear infinite; margin: 0 auto 12px;
}
@keyframes po-spin { to { transform: rotate(360deg); } }

/* ── Error banner ──────────────────────────────────────────────── */
.po-error-banner {
  background: #fdf0f0; border: 1px solid #f5c6c6; color: #c0392b;
  border-radius: 8px; padding: 12px 16px; font-size: 14px;
  margin-bottom: 16px; display: none;
}

/* ── Responsive ────────────────────────────────────────────────── */
@media (max-width: 640px) {
  .po-section { padding: 22px 16px; }
  .po-order-summary { grid-template-columns: 1fr; }
  .po-size-card { grid-template-columns: 70px 1fr; }
  .po-step-line { max-width: 24px; }
  .po-section-header h2 { font-size: 22px; }
  .po-card-row { grid-template-columns: 1fr; }
  .po-pay-tabs { gap: 6px; }
  .po-pay-tab { padding: 8px 12px; font-size: 12px; }
}
