/* EventKart Public Styles */
:root {
  --ek-primary:   #1B3A6B;
  --ek-blue:      #2E75B6;
  --ek-green:     #2E7D32;
  --ek-red:       #C62828;
  --ek-gray:      #757575;
  --ek-light:     #F5F7FA;
  --ek-border:    #E0E0E0;
  --ek-white:     #FFFFFF;
  --ek-shadow:    0 2px 12px rgba(0,0,0,0.12);
  --ek-radius:    6px;
  --ek-font:      -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
}

/* ── Add to Cart Buttons ─────────────────────────────────────────────────── */
.ek-btn-wrap { margin-top: 10px; display: inline-flex; flex-direction: column; gap: 4px; }

.ek-cart-btn {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--ek-primary); color: var(--ek-white);
  padding: 10px 20px; border-radius: var(--ek-radius);
  border: none; cursor: pointer;
  font-family: var(--ek-font); font-size: 15px; font-weight: 600;
  transition: background 0.2s, transform 0.1s;
  text-decoration: none;
}
.ek-cart-btn:hover  { background: var(--ek-blue); transform: translateY(-1px); }
.ek-cart-btn.ek-in-cart  { background: var(--ek-green); cursor: default; }
.ek-cart-btn.ek-sold-out { background: #9E9E9E; cursor: not-allowed; opacity: 0.7; }
.ek-cart-btn--compact { font-size: 12px; padding: 5px 12px; }
.ek-cart-btn--mini    { font-size: 11px; padding: 3px 8px; }
.ek-price-badge { font-size: 12px; color: var(--ek-gray); font-weight: 400; }
.ek-sold-out-msg { font-size: 12px; color: var(--ek-red); margin-top: 4px; }

/* ── Cart Icon in Header ─────────────────────────────────────────────────── */
.ek-cart-icon-link { position: relative; display: inline-flex; align-items: center; text-decoration: none; padding: 4px; }
.ek-cart-badge {
  position: absolute; top: -6px; right: -6px;
  background: #E53935; color: #fff;
  font-size: 11px; font-weight: 700;
  width: 18px; height: 18px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
}
.ek-hidden { display: none !important; }

/* ── Cart Drawer ─────────────────────────────────────────────────────────── */
.ek-cart-drawer { position: fixed; top: 0; right: 0; bottom: 0; z-index: 99999; pointer-events: none; }
.ek-cart-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.4); opacity: 0;
  transition: opacity 0.3s; pointer-events: none;
}
.ek-cart-panel {
  position: absolute; top: 0; right: 0; bottom: 0;
  width: 380px; max-width: 95vw;
  background: var(--ek-white); box-shadow: var(--ek-shadow);
  display: flex; flex-direction: column;
  transform: translateX(100%); transition: transform 0.3s ease;
}
.ek-cart-drawer.ek-open { pointer-events: all; }
.ek-cart-drawer.ek-open .ek-cart-overlay { opacity: 1; pointer-events: all; }
.ek-cart-drawer.ek-open .ek-cart-panel   { transform: translateX(0); }

.ek-cart-panel-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; border-bottom: 1px solid var(--ek-border);
}
.ek-cart-panel-header h2 { margin: 0; font-size: 18px; }
.ek-cart-close { background: none; border: none; font-size: 20px; cursor: pointer; color: var(--ek-gray); padding: 4px 8px; }
.ek-cart-close:hover { color: var(--ek-red); }

.ek-cart-panel-body { flex: 1; overflow-y: auto; padding: 16px 20px; }
.ek-cart-empty { text-align: center; color: var(--ek-gray); padding: 40px 0; }

.ek-cart-item {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 12px 0; border-bottom: 1px solid var(--ek-border);
}
.ek-cart-item-info { flex: 1; }
.ek-cart-item-name { font-weight: 600; font-size: 14px; line-height: 1.3; }
.ek-cart-item-date { font-size: 12px; color: var(--ek-gray); margin-top: 3px; }
.ek-cart-item-price { font-size: 14px; font-weight: 600; white-space: nowrap; }
.ek-remove-item { background: none; border: none; color: var(--ek-gray); cursor: pointer; font-size: 14px; padding: 2px 4px; flex-shrink: 0; }
.ek-remove-item:hover { color: var(--ek-red); }

.ek-cart-panel-footer { padding: 16px 20px; border-top: 1px solid var(--ek-border); background: var(--ek-light); }
.ek-cart-totals { margin-bottom: 12px; }
.ek-cart-row { display: flex; justify-content: space-between; padding: 4px 0; font-size: 14px; }
.ek-total-row { font-size: 16px; font-weight: 700; border-top: 1px solid var(--ek-border); padding-top: 8px; margin-top: 4px; }
.ek-green { color: var(--ek-green); }

/* ── Checkout Page ───────────────────────────────────────────────────────── */
.ek-checkout-wrap { display: grid; grid-template-columns: 1fr 340px; gap: 32px; max-width: 1000px; margin: 0 auto; }
@media (max-width: 768px) { .ek-checkout-wrap { grid-template-columns: 1fr; } }

.ek-checkout-title { font-size: 24px; margin-bottom: 24px; }
.ek-attendee-section, .ek-billing-section, .ek-payment-section {
  background: var(--ek-white); border: 1px solid var(--ek-border);
  border-radius: var(--ek-radius); padding: 20px 24px; margin-bottom: 20px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.05);
}
.ek-attendee-heading { margin: 0 0 16px; font-size: 16px; display: flex; align-items: baseline; gap: 10px; }
.ek-event-date { font-size: 12px; color: var(--ek-gray); font-weight: 400; }

.ek-attendee-fields, .ek-billing-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.ek-field-half  { grid-column: span 1; }
.ek-field-full  { grid-column: span 2; }
.ek-field-third { grid-column: span 1; }
@media (max-width: 520px) { .ek-attendee-fields, .ek-billing-fields { grid-template-columns: 1fr; } .ek-field-full, .ek-field-half, .ek-field-third { grid-column: span 1; } }

.ek-attendee-fields label, .ek-billing-fields label { display: block; font-size: 12px; font-weight: 600; color: #555; margin-bottom: 4px; }
.ek-attendee-fields input, .ek-billing-fields input, .ek-billing-fields select {
  width: 100%; padding: 8px 12px; border: 1px solid var(--ek-border);
  border-radius: 4px; font-size: 14px; box-sizing: border-box;
  transition: border-color 0.2s;
}
.ek-attendee-fields input:focus, .ek-billing-fields input:focus { border-color: var(--ek-blue); outline: none; box-shadow: 0 0 0 2px rgba(46,117,182,0.2); }

.ek-stripe-field { border: 1px solid var(--ek-border); border-radius: 4px; padding: 12px; min-height: 44px; }

.ek-submit-btn {
  width: 100%; padding: 14px; font-size: 16px; font-weight: 700;
  background: var(--ek-primary); color: var(--ek-white);
  border: none; border-radius: var(--ek-radius); cursor: pointer;
  transition: background 0.2s;
}
.ek-submit-btn:hover:not(:disabled) { background: var(--ek-blue); }
.ek-submit-btn:disabled { opacity: 0.7; cursor: not-allowed; }

/* Order summary sidebar */
.ek-checkout-summary {
  background: var(--ek-light); border: 1px solid var(--ek-border);
  border-radius: var(--ek-radius); padding: 20px 24px; align-self: start;
}
.ek-checkout-summary h3 { margin: 0 0 16px; font-size: 16px; }
.ek-summary-item { display: flex; justify-content: space-between; padding: 8px 0; font-size: 14px; border-bottom: 1px solid var(--ek-border); }
.ek-summary-totals { margin-top: 12px; }
.ek-summary-row { display: flex; justify-content: space-between; padding: 6px 0; font-size: 14px; }
.ek-summary-total { border-top: 2px solid var(--ek-border); padding-top: 10px; margin-top: 4px; font-size: 16px; }
.ek-secure-note { font-size: 11px; color: var(--ek-gray); text-align: center; margin-top: 12px; }

.ek-promo-section { margin-top: 16px; display: flex; gap: 8px; flex-wrap: wrap; }
.ek-promo-section input { flex: 1; min-width: 0; padding: 8px 10px; border: 1px solid var(--ek-border); border-radius: 4px; font-size: 13px; }
.ek-promo-msg { width: 100%; font-size: 12px; margin-top: 4px; }
.ek-red { color: var(--ek-red); }

.ek-error-msg { background: #FFEBEE; color: var(--ek-red); padding: 10px 14px; border-radius: 4px; font-size: 13px; margin-bottom: 12px; }

/* ── Confirmation Page ───────────────────────────────────────────────────── */
.ek-confirmation-wrap { max-width: 720px; margin: 0 auto; }
.ek-confirmation-banner { text-align: center; padding: 40px 20px; }
.ek-confirmation-icon { font-size: 56px; margin-bottom: 12px; }
.ek-confirmation-banner h1 { color: var(--ek-green); margin-bottom: 8px; }

.ek-confirmation-event-card {
  background: var(--ek-light); border-radius: var(--ek-radius);
  border-left: 4px solid var(--ek-green);
  padding: 14px 18px; margin-bottom: 12px;
}
.ek-conf-event-name { font-weight: 700; font-size: 16px; }
.ek-conf-event-date { color: var(--ek-gray); font-size: 13px; margin-top: 4px; }
.ek-conf-attendee-id { font-size: 12px; color: var(--ek-gray); margin-top: 6px; }

.ek-conf-table { width: 100%; border-collapse: collapse; margin-top: 12px; }
.ek-conf-table th, .ek-conf-table td { padding: 10px 14px; border-bottom: 1px solid var(--ek-border); font-size: 14px; text-align: left; }
.ek-conf-table th { width: 40%; color: var(--ek-gray); }
.ek-conf-total { font-size: 16px; }

.ek-confirmation-actions { margin-top: 32px; text-align: center; }

/* ── Buttons ─────────────────────────────────────────────────────────────── */
.ek-btn { display: inline-flex; align-items: center; gap: 6px; padding: 10px 20px; border-radius: var(--ek-radius); font-size: 14px; font-weight: 600; cursor: pointer; text-decoration: none; border: 2px solid transparent; transition: all 0.2s; }
.ek-btn-primary { background: var(--ek-primary); color: var(--ek-white); }
.ek-btn-primary:hover { background: var(--ek-blue); }
.ek-btn-outline  { background: transparent; color: var(--ek-primary); border-color: var(--ek-primary); }
.ek-btn-outline:hover { background: var(--ek-primary); color: var(--ek-white); }
.ek-btn-ghost { background: transparent; color: var(--ek-gray); border-color: var(--ek-border); }
.ek-btn-ghost:hover { color: var(--ek-primary); border-color: var(--ek-primary); }

/* ── Hide native BT register button (when toggle is on) ──────────────────── */
.ek-hide-native-register .tribe-event-url,
.ek-hide-native-register .tribe-events-event-url,
.ek-hide-native-register a.tribe-event-url { display: none !important; }

/* Body scroll lock when cart is open */
body.ek-cart-open { overflow: hidden; }
