/* ═══════════════════════════════════════════════════════════
   EMS Collection — Shared Component Styles
   Account modal, cart drawer, toasts, my designs
═══════════════════════════════════════════════════════════ */

/* ─── OVERLAY ─── */
.ems-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.6);
  z-index: 500; opacity: 0; pointer-events: none;
  transition: opacity 0.25s;
}
.ems-overlay.active { opacity: 1; pointer-events: all; }

/* ─── ACCOUNT MODAL ─── */
.account-modal {
  position: fixed; top: 0; right: 0; bottom: 0;
  width: 380px; max-width: 100vw;
  background: #0d1b2e; border-left: 1px solid #1e3a5f;
  z-index: 600; transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.4,0,0.2,1);
  display: flex; flex-direction: column; overflow: hidden;
}
.account-modal.open { transform: translateX(0); }
.modal-header {
  padding: 20px 20px 0; display: flex;
  align-items: center; justify-content: space-between; flex-shrink: 0;
}
.modal-title { font-size: 17px; font-weight: 700; color: #e8dcc8; letter-spacing: 0.03em; }
.modal-close {
  width: 32px; height: 32px; display: flex; align-items: center; justify-content: center;
  background: #1a3050; border: 1px solid #1e3a5f; border-radius: 6px;
  cursor: pointer; color: #8899aa; font-size: 16px; transition: all 0.15s;
}
.modal-close:hover { border-color: #c9a54e; color: #c9a54e; }

/* Auth tabs */
.auth-tabs {
  display: flex; margin: 16px 20px 0; gap: 0;
  border: 1px solid #1e3a5f; border-radius: 6px; overflow: hidden;
}
.auth-tab {
  flex: 1; padding: 9px; text-align: center; cursor: pointer;
  font-size: 12px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.05em; background: #0d1b2e; color: #7888a0;
  border: none; font-family: 'Barlow', sans-serif; transition: all 0.15s;
}
.auth-tab.active { background: rgba(201,165,78,0.12); color: #c9a54e; }

/* Auth form */
.auth-form { padding: 20px; display: flex; flex-direction: column; gap: 12px; }
.auth-form input {
  width: 100%; padding: 10px 12px; background: #1a3050;
  border: 1px solid #1e3a5f; border-radius: 6px;
  color: #e8dcc8; font-size: 14px; font-family: 'Barlow', sans-serif;
  outline: none; box-sizing: border-box; transition: border-color 0.15s;
}
.auth-form input:focus { border-color: #c9a54e; }
.auth-form input::placeholder { color: #4a6080; }
.auth-submit {
  width: 100%; padding: 11px; background: #c9a54e; color: #0d1b2e;
  border: none; border-radius: 6px; font-size: 14px; font-weight: 700;
  cursor: pointer; font-family: 'Barlow', sans-serif; letter-spacing: 0.03em;
  transition: background 0.15s;
}
.auth-submit:hover { background: #d4b060; }
.auth-submit:disabled { opacity: 0.6; cursor: wait; }
.auth-error {
  font-size: 12px; color: #e05555; background: rgba(224,85,85,0.1);
  border: 1px solid rgba(224,85,85,0.3); border-radius: 4px;
  padding: 8px 10px; display: none;
}
.auth-error.visible { display: block; }
.auth-divider {
  text-align: center; font-size: 11px; color: #4a6080;
  margin: 4px 0;
}

/* ─── MY DESIGNS PANEL (inside account modal when logged in) ─── */
.mydesigns-panel { flex: 1; overflow-y: auto; padding: 16px 20px; }
.mydesigns-panel::-webkit-scrollbar { width: 4px; }
.mydesigns-panel::-webkit-scrollbar-thumb { background: #1e3a5f; border-radius: 2px; }
.user-greeting {
  font-size: 13px; color: #8899aa; margin-bottom: 14px; padding-bottom: 12px;
  border-bottom: 1px solid #1e3a5f;
}
.user-greeting strong { color: #e8dcc8; }
.designs-grid { display: flex; flex-direction: column; gap: 10px; }
.design-card {
  background: #1a3050; border: 1px solid #1e3a5f;
  border-radius: 8px; padding: 10px; display: flex; gap: 10px;
  align-items: center; transition: border-color 0.15s;
}
.design-card:hover { border-color: #2a5080; }
.design-thumb {
  width: 70px; height: 40px; flex-shrink: 0; border-radius: 4px;
  background: #0d1b2e; object-fit: cover; border: 1px solid #1e3a5f;
}
.design-thumb-placeholder {
  width: 70px; height: 40px; flex-shrink: 0; border-radius: 4px;
  background: #0d1b2e; border: 1px solid #1e3a5f;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; color: #2a4060;
}
.design-info { flex: 1; min-width: 0; }
.design-name { font-size: 13px; font-weight: 600; color: #e8dcc8; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.design-meta { font-size: 11px; color: #5a7090; margin-top: 2px; }
.design-actions { display: flex; gap: 5px; flex-shrink: 0; }
.design-btn {
  padding: 4px 8px; border-radius: 4px; font-size: 10px; font-weight: 600;
  cursor: pointer; font-family: 'Barlow', sans-serif; letter-spacing: 0.04em;
  text-transform: uppercase; border: 1px solid; transition: all 0.15s;
}
.design-btn-load { background: rgba(201,165,78,0.1); border-color: #c9a54e; color: #c9a54e; }
.design-btn-load:hover { background: rgba(201,165,78,0.2); }
.design-btn-dup { background: rgba(42,90,140,0.2); border-color: #2a5a8c; color: #7899bb; }
.design-btn-dup:hover { border-color: #4a7aac; color: #99bbdd; }
.design-btn-del { background: transparent; border-color: #2a3a50; color: #4a6080; }
.design-btn-del:hover { border-color: #e05555; color: #e05555; }
.designs-empty { text-align: center; padding: 32px 16px; color: #4a6080; font-size: 13px; }
.designs-empty strong { display: block; color: #7888a0; font-size: 15px; margin-bottom: 6px; }

/* Save bar at bottom of modal */
.modal-save-bar {
  padding: 14px 20px; border-top: 1px solid #1e3a5f; flex-shrink: 0;
  display: flex; gap: 8px;
}
.btn-save-design {
  flex: 1; padding: 10px; background: #c9a54e; color: #0d1b2e;
  border: none; border-radius: 6px; font-size: 13px; font-weight: 700;
  cursor: pointer; font-family: 'Barlow', sans-serif; transition: background 0.15s;
}
.btn-save-design:hover { background: #d4b060; }
.btn-logout {
  padding: 10px 14px; background: transparent; color: #5a7090;
  border: 1px solid #1e3a5f; border-radius: 6px; font-size: 12px;
  cursor: pointer; font-family: 'Barlow', sans-serif; transition: all 0.15s;
}
.btn-logout:hover { border-color: #e05555; color: #e05555; }

/* ─── CART DRAWER ─── */
.cart-drawer {
  position: fixed; top: 0; right: 0; bottom: 0;
  width: 420px; max-width: 100vw;
  background: #0d1b2e; border-left: 1px solid #1e3a5f;
  z-index: 600; transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.4,0,0.2,1);
  display: flex; flex-direction: column;
}
.cart-drawer.open { transform: translateX(0); }
.cart-header {
  padding: 20px; border-bottom: 1px solid #1e3a5f;
  display: flex; align-items: center; justify-content: space-between; flex-shrink: 0;
}
.cart-title { font-size: 17px; font-weight: 700; color: #e8dcc8; }
.cart-items-wrap { flex: 1; overflow-y: auto; padding: 12px; }
.cart-items-wrap::-webkit-scrollbar { width: 4px; }
.cart-items-wrap::-webkit-scrollbar-thumb { background: #1e3a5f; border-radius: 2px; }
.cart-item {
  background: #1a3050; border: 1px solid #1e3a5f; border-radius: 8px;
  padding: 12px; margin-bottom: 10px; display: flex; gap: 10px;
}
.cart-item-thumb {
  width: 80px; height: 45px; flex-shrink: 0; border-radius: 4px;
  background: #0d1b2e; object-fit: cover; border: 1px solid #1e3a5f;
}
.cart-item-info { flex: 1; min-width: 0; }
.cart-item-name { font-size: 13px; font-weight: 600; color: #e8dcc8; margin-bottom: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cart-item-meta { font-size: 11px; color: #5a7090; margin-bottom: 6px; }
.cart-item-controls { display: flex; align-items: center; gap: 8px; }
.qty-btn {
  width: 24px; height: 24px; background: #0d1b2e; border: 1px solid #1e3a5f;
  border-radius: 4px; color: #8899aa; cursor: pointer; font-size: 14px;
  display: flex; align-items: center; justify-content: center; transition: all 0.15s;
}
.qty-btn:hover { border-color: #c9a54e; color: #c9a54e; }
.qty-val { font-size: 13px; color: #e8dcc8; font-weight: 600; min-width: 20px; text-align: center; }
.cart-item-velcro { font-size: 11px; color: #5a7090; display: flex; align-items: center; gap: 5px; cursor: pointer; }
.cart-item-velcro input { accent-color: #c9a54e; cursor: pointer; }
.cart-item-price { font-size: 14px; font-weight: 700; color: #c9a54e; flex-shrink: 0; align-self: flex-start; }
.cart-item-del { font-size: 16px; color: #2a4060; cursor: pointer; flex-shrink: 0; align-self: flex-start; transition: color 0.15s; }
.cart-item-del:hover { color: #e05555; }
.cart-empty { text-align: center; padding: 48px 20px; color: #4a6080; }
.cart-empty strong { display: block; font-size: 15px; color: #7888a0; margin-bottom: 8px; }
.cart-footer {
  padding: 16px 20px; border-top: 1px solid #1e3a5f; flex-shrink: 0;
}
.cart-totals { margin-bottom: 14px; }
.cart-total-row { display: flex; justify-content: space-between; font-size: 13px; color: #8899aa; margin-bottom: 4px; }
.cart-total-row.grand { font-size: 16px; font-weight: 700; color: #e8dcc8; margin-top: 8px; padding-top: 8px; border-top: 1px solid #1e3a5f; }
.cart-total-row.grand span:last-child { color: #c9a54e; }
.btn-checkout {
  width: 100%; padding: 13px; background: #c9a54e; color: #0d1b2e;
  border: none; border-radius: 8px; font-size: 15px; font-weight: 700;
  cursor: pointer; font-family: 'Barlow', sans-serif; letter-spacing: 0.02em;
  transition: background 0.15s;
}
.btn-checkout:hover { background: #d4b060; }
.btn-checkout:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-add-another {
  width: 100%; padding: 9px; background: transparent; color: #8899aa;
  border: 1px solid #1e3a5f; border-radius: 6px; font-size: 13px;
  cursor: pointer; font-family: 'Barlow', sans-serif; margin-top: 8px; transition: all 0.15s;
}
.btn-add-another:hover { border-color: #2a5080; color: #aabbcc; }

/* ─── TOAST ─── */
.ems-toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(80px);
  background: #1a3050; border: 1px solid #1e3a5f; border-radius: 8px;
  padding: 12px 20px; font-size: 13px; font-weight: 600; color: #e8dcc8;
  z-index: 900; transition: transform 0.3s, opacity 0.3s; opacity: 0;
  white-space: nowrap; box-shadow: 0 8px 32px rgba(0,0,0,0.4);
}
.ems-toast.show { transform: translateX(-50%) translateY(0); opacity: 1; }
.ems-toast.success { border-color: #c9a54e; color: #c9a54e; }
.ems-toast.error   { border-color: #e05555; color: #e05555; }

/* ─── DESIGN NAME INPUT (save dialog) ─── */
.save-name-bar {
  display: flex; gap: 8px; align-items: center;
  padding: 12px 20px; border-top: 1px solid #1e3a5f;
  background: #0d1b2e;
}
.save-name-input {
  flex: 1; padding: 8px 10px; background: #1a3050;
  border: 1px solid #1e3a5f; border-radius: 5px;
  color: #e8dcc8; font-size: 13px; font-family: 'Barlow', sans-serif; outline: none;
}
.save-name-input:focus { border-color: #c9a54e; }

/* ─── COUPON CODE ─── */
.coupon-row {
  display: flex; gap: 8px; margin-bottom: 10px;
}
.coupon-input {
  flex: 1; padding: 9px 12px;
  background: #1a3050; border: 1px solid #1e3a5f;
  border-radius: 6px; color: #e8dcc8;
  font-size: 13px; font-family: 'Barlow', sans-serif;
  outline: none; text-transform: uppercase; letter-spacing: 0.05em;
  transition: border-color 0.15s;
}
.coupon-input:focus { border-color: #c9a54e; }
.coupon-input::placeholder { text-transform: none; letter-spacing: 0; color: #4a6080; }
.btn-apply-coupon {
  padding: 9px 14px; background: var(--navy-700, #1a3050);
  border: 1px solid #1e3a5f; border-radius: 6px;
  color: #8899aa; font-size: 12px; font-weight: 600;
  cursor: pointer; font-family: 'Barlow', sans-serif;
  letter-spacing: 0.04em; text-transform: uppercase;
  transition: all 0.15s; white-space: nowrap;
}
.btn-apply-coupon:hover { border-color: #c9a54e; color: #c9a54e; }
.btn-apply-coupon:disabled { opacity: 0.5; cursor: wait; }
.coupon-result {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 10px; border-radius: 5px; font-size: 12px;
  margin-bottom: 10px;
}
.coupon-result.success {
  background: rgba(201,165,78,0.1); border: 1px solid rgba(201,165,78,0.3);
  color: #c9a54e;
}
.coupon-result.error {
  background: rgba(224,85,85,0.08); border: 1px solid rgba(224,85,85,0.25);
  color: #e05555;
}
.coupon-remove {
  cursor: pointer; font-size: 14px; color: #c9a54e; margin-left: 8px;
  opacity: 0.7; transition: opacity 0.15s;
}
.coupon-remove:hover { opacity: 1; }
.cart-total-row.discount { color: #c9a54e; }
