/* Dog Hailow — Checkout Styles (Shopify-inspired) */

*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --pay-blue: #1773b0;
  --pay-blue-hover: #135e91;
  --bg: #fff;
  --bg-sidebar: #fafafa;
  --text: #333;
  --text-secondary: #707070;
  --text-muted: #999;
  --border: #d9d9d9;
  --border-focus: #1773b0;
  --field-bg: #fff;
  --radius: 6px;
  --success: #10b981;
  --error: #e22120;
  --error-bg: #fff0f0;
  --transition: 150ms ease;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

img { max-width: 100%; height: auto; display: block; }

a { color: var(--pay-blue); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ════════════════════════════════════════════════════════
   HEADER
   ════════════════════════════════════════════════════════ */

.checkout-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px;
  background: var(--bg);
  border-bottom: 1px solid #e5e5e5;
}

.checkout-logo {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
  letter-spacing: -.01em;
}

.checkout-secure {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: .8rem;
  color: var(--text-muted);
  font-weight: 400;
}
.checkout-secure svg { opacity: .6; }

/* ════════════════════════════════════════════════════════
   LOADING & ERROR
   ════════════════════════════════════════════════════════ */

.checkout-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 80px 24px;
  color: var(--text-secondary);
}

.spinner {
  width: 28px;
  height: 28px;
  border: 2.5px solid #e5e5e5;
  border-top-color: var(--pay-blue);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.checkout-error {
  margin: 0 auto;
  max-width: 660px;
  padding: 12px 16px;
  background: var(--error-bg);
  color: var(--error);
  border-radius: var(--radius);
  font-size: .9rem;
  margin-top: 16px;
}

/* ════════════════════════════════════════════════════════
   PLAN SELECTION
   ════════════════════════════════════════════════════════ */

.plans-container {
  max-width: 980px;
  margin: 0 auto;
  padding: 48px 24px 64px;
}

.plans-title {
  font-size: 1.6rem;
  font-weight: 700;
  text-align: center;
  margin-bottom: 6px;
}

.plans-subtitle {
  text-align: center;
  color: var(--text-secondary);
  font-size: .95rem;
  margin-bottom: 36px;
}

.plan-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
  gap: 20px;
}

.plan-card {
  position: relative;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 28px 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: border-color var(--transition), box-shadow var(--transition);
  cursor: pointer;
}
.plan-card:hover {
  border-color: var(--pay-blue);
  box-shadow: 0 0 0 1px var(--pay-blue);
}

.plan-card--featured {
  border-color: var(--pay-blue);
  box-shadow: 0 0 0 1px var(--pay-blue);
}

.plan-badge {
  position: absolute;
  top: -11px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--pay-blue);
  color: #fff;
  font-size: .7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
  padding: 3px 14px;
  border-radius: 20px;
  white-space: nowrap;
}

.plan-name { font-size: 1.15rem; font-weight: 600; }
.plan-desc { font-size: .9rem; color: var(--text-secondary); }
.plan-price { font-size: 1.8rem; font-weight: 700; margin: 4px 0; }

.plan-features {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
  flex-grow: 1;
}
.plan-features li {
  font-size: .88rem;
  color: var(--text-secondary);
  padding-left: 22px;
  position: relative;
}
.plan-features li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 4px;
  width: 14px;
  height: 14px;
  background: var(--success);
  border-radius: 50%;
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M5 8l2 2 4-4' stroke='white' stroke-width='2.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M5 8l2 2 4-4' stroke='white' stroke-width='2.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

.plan-select-btn {
  display: block;
  width: 100%;
  padding: 14px;
  border: none;
  border-radius: var(--radius);
  background: var(--pay-blue);
  color: #fff;
  font-size: .95rem;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--transition);
  margin-top: auto;
}
.plan-select-btn:hover { background: var(--pay-blue-hover); }

/* ════════════════════════════════════════════════════════
   CHECKOUT LAYOUT (Two-column, Shopify-style)
   ════════════════════════════════════════════════════════ */

.checkout-page {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.checkout-layout {
  display: grid;
  grid-template-columns: 1fr 420px;
  min-height: calc(100vh - 60px);
}

.checkout-main {
  padding: 32px 48px 48px;
  max-width: 660px;
  margin-left: auto;
  width: 100%;
}

.checkout-sidebar {
  background: var(--bg-sidebar);
  border-left: 1px solid #e5e5e5;
  padding: 32px 40px;
}

.sidebar-inner {
  position: sticky;
  top: 32px;
}

/* ── Breadcrumb back ─────────────────────────────── */

.breadcrumb-back {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: none;
  border: none;
  color: var(--pay-blue);
  font-size: .85rem;
  cursor: pointer;
  padding: 0;
  margin-bottom: 24px;
}
.breadcrumb-back:hover { text-decoration: underline; }

/* ── Sections ────────────────────────────────────── */

.checkout-section {
  margin-bottom: 28px;
}

.checkout-section__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.checkout-section__title {
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 14px;
}

.checkout-section__header .checkout-section__title {
  margin-bottom: 0;
}

.checkout-section__subtitle {
  font-size: .82rem;
  color: var(--text-muted);
  margin-top: 2px;
  margin-bottom: 16px;
}

.card-brands {
  display: flex;
  gap: 6px;
  align-items: center;
}
.card-brands svg {
  border-radius: 3px;
}

/* ── Floating-label fields ───────────────────────── */

.field {
  position: relative;
  margin-bottom: 12px;
}

.field input {
  width: 100%;
  height: 48px;
  padding: 18px 14px 6px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: .95rem;
  font-family: inherit;
  background: var(--field-bg);
  color: var(--text);
  transition: border-color var(--transition);
  outline: none;
}

.field label {
  position: absolute;
  top: 50%;
  left: 14px;
  transform: translateY(-50%);
  font-size: .95rem;
  color: var(--text-muted);
  pointer-events: none;
  transition: all .15s ease;
}

.field input:focus,
.field input:not(:placeholder-shown) {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 1px var(--border-focus);
}

.field input:focus + label,
.field input:not(:placeholder-shown) + label {
  top: 10px;
  transform: translateY(0);
  font-size: .7rem;
  color: var(--text-secondary);
}

/* ── Zenith Elements container ───────────────────── */

#zenith-payment-wrapper {
  position: relative;
  min-height: 120px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--field-bg);
}

#zenith-payment {
  min-height: 120px;
}

.zenith-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: var(--text-muted);
  font-size: .85rem;
  text-align: center;
  padding: 20px;
  background: #fafafa;
}
.zenith-placeholder.hidden { display: none; }

/* ── Pay button ──────────────────────────────────── */

.pay-button {
  display: block;
  width: 100%;
  height: 56px;
  border: none;
  border-radius: var(--radius);
  background: var(--pay-blue);
  color: #fff;
  font-size: 1.05rem;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--transition), opacity var(--transition);
  margin-top: 20px;
  letter-spacing: .01em;
}
.pay-button:hover:not(:disabled) { background: var(--pay-blue-hover); }
.pay-button:disabled {
  opacity: .55;
  cursor: not-allowed;
}
.pay-button:active:not(:disabled) { transform: scale(.995); }

.checkout-footer-text {
  text-align: center;
  font-size: .75rem;
  color: var(--text-muted);
  margin-top: 16px;
}
.checkout-footer-text strong { font-weight: 600; }

/* ════════════════════════════════════════════════════════
   ORDER SUMMARY (Right sidebar)
   ════════════════════════════════════════════════════════ */

/* Mobile toggle (hidden on desktop) */
.summary-toggle {
  display: none;
}

.summary-product {
  display: flex;
  align-items: center;
  gap: 14px;
  padding-bottom: 20px;
}

.summary-product__icon {
  position: relative;
  width: 50px;
  height: 50px;
  border-radius: 8px;
  border: 1px solid #e5e5e5;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.summary-product__badge {
  position: absolute;
  top: -7px;
  right: -7px;
  width: 20px;
  height: 20px;
  background: var(--text-secondary);
  color: #fff;
  font-size: .7rem;
  font-weight: 600;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.summary-product__info {
  flex: 1;
  min-width: 0;
}

.summary-product__name {
  display: block;
  font-size: .95rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.summary-product__desc {
  display: block;
  font-size: .8rem;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.summary-product__price {
  font-size: .95rem;
  font-weight: 500;
  white-space: nowrap;
}

.summary-features-list {
  list-style: none;
  padding: 0 0 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.summary-features-list li {
  font-size: .82rem;
  color: var(--text-secondary);
  padding-left: 18px;
  position: relative;
}
.summary-features-list li::before {
  content: '✓';
  position: absolute;
  left: 0;
  color: var(--success);
  font-weight: 700;
  font-size: .8rem;
}

.summary-divider {
  height: 1px;
  background: #e5e5e5;
  margin-bottom: 16px;
}

.summary-total {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.summary-total__label {
  font-size: .95rem;
  font-weight: 600;
}

.summary-total__value {
  text-align: right;
}

.summary-total__currency {
  display: block;
  font-size: .7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .04em;
}

.summary-total__price {
  font-size: 1.5rem;
  font-weight: 700;
}

/* ════════════════════════════════════════════════════════
   THANK YOU PAGE
   ════════════════════════════════════════════════════════ */

.thankyou-page {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.thankyou-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
  text-align: center;
  gap: 20px;
  max-width: 560px;
  margin: 0 auto;
}

.thankyou-icon {
  animation: pop .4s ease;
}
@keyframes pop {
  0% { transform: scale(0); }
  60% { transform: scale(1.1); }
  100% { transform: scale(1); }
}

.thankyou-title { font-size: 1.8rem; font-weight: 700; }

.thankyou-text {
  font-size: 1.05rem;
  color: var(--text-secondary);
  line-height: 1.7;
}

.thankyou-details {
  background: var(--bg-sidebar);
  padding: 16px 24px;
  border-radius: var(--radius);
  border: 1px solid #e5e5e5;
  font-size: .9rem;
  width: 100%;
}
.thankyou-details code {
  font-size: .8rem;
  background: #f0f0f0;
  padding: 2px 6px;
  border-radius: 3px;
}

.btn-thankyou {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 32px;
  border: none;
  border-radius: var(--radius);
  background: var(--pay-blue);
  color: #fff;
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: background var(--transition);
}
.btn-thankyou:hover { background: var(--pay-blue-hover); text-decoration: none; }

/* ════════════════════════════════════════════════════════
   PAGE FOOTER
   ════════════════════════════════════════════════════════ */

.checkout-page-footer {
  margin-top: auto;
  padding: 20px 24px;
  text-align: center;
  font-size: .8rem;
  color: var(--text-muted);
}

/* ════════════════════════════════════════════════════════
   RESPONSIVE
   ════════════════════════════════════════════════════════ */

@media (max-width: 860px) {
  .checkout-layout {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .checkout-main {
    padding: 24px 16px 32px;
    max-width: none;
    margin: 0;
  }

  .checkout-sidebar {
    border-left: none;
    border-bottom: 1px solid #e5e5e5;
    padding: 0;
    order: -1;
  }

  .sidebar-inner {
    position: static;
  }

  .summary-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 16px;
    border: none;
    background: var(--bg-sidebar);
    cursor: pointer;
    font-family: inherit;
    font-size: .9rem;
    color: var(--pay-blue);
  }
  .summary-toggle strong {
    margin-left: auto;
    font-size: .95rem;
    color: var(--text);
  }
  .summary-chevron {
    transition: transform .2s ease;
  }
  .summary-toggle[aria-expanded="true"] .summary-chevron {
    transform: rotate(180deg);
  }

  .summary-body {
    display: none;
    padding: 0 16px 16px;
    background: var(--bg-sidebar);
  }
  .summary-body.open {
    display: block;
  }
}

@media (min-width: 861px) {
  .summary-body {
    display: block !important;
  }
}

/* ════════════════════════════════════════════════════════
   UTILITIES
   ════════════════════════════════════════════════════════ */

.hidden {
  display: none !important;
}
