/* ══════════════════════════════════════════════════
   OkaziaMart | okazia.css v2.0
   Auth Modal + Profile Button + Translate + Hearts
   ══════════════════════════════════════════════════ */

/* ─── Modal Overlay ──────────────────────────────── */
#okazia-auth-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 99999;
  font-family: 'Cairo', 'Tajawal', sans-serif;
  direction: rtl;
}
#okazia-auth-modal.active {
  display: block;
}

#okazia-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 26, 13, 0.6);
  backdrop-filter: blur(4px);
  animation: okaziaFadeIn 0.2s ease;
}

@keyframes okaziaFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* ─── Modal Box ──────────────────────────────────── */
#okazia-box {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 420px;
  max-width: calc(100vw - 24px);
  max-height: 92vh;
  overflow-y: auto;
  background: #FDFAF3;
  border-radius: 18px;
  box-shadow: 0 24px 80px rgba(0,0,0,0.28);
  animation: okaziaSlideUp 0.3s cubic-bezier(0.34,1.56,0.64,1);
}

@keyframes okaziaSlideUp {
  from { opacity: 0; transform: translate(-50%, -42%); }
  to   { opacity: 1; transform: translate(-50%, -50%); }
}

/* ─── Modal Header (brand bar) ──────────────────── */
#okazia-modal-head {
  background: #003a1f;
  border-radius: 18px 18px 0 0;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

#okazia-modal-logo-wrap {
  display: flex;
  align-items: baseline;
  gap: 4px;
}

#okazia-modal-brand-ok {
  font-family: 'Leckerli One', cursive;
  font-size: 22px;
  color: #FDFAF3;
  letter-spacing: -0.5px;
}

#okazia-modal-brand-mart {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 14px;
  font-weight: 600;
  color: #c9a84c;
  letter-spacing: 2px;
  text-transform: uppercase;
}

#okazia-close-btn {
  background: none;
  border: none;
  color: rgba(255,255,255,0.6);
  font-size: 18px;
  cursor: pointer;
  line-height: 1;
  padding: 4px 6px;
  border-radius: 6px;
  transition: color 0.2s, background 0.2s;
}
#okazia-close-btn:hover {
  color: #fff;
  background: rgba(255,255,255,0.1);
}

/* ─── Form Panel ─────────────────────────────────── */
#okazia-form-panel {
  padding: 24px 28px 28px;
}

#okazia-title {
  margin: 0 0 4px;
  font-size: 20px;
  font-weight: 700;
  color: #003a1f;
}

#okazia-subtitle {
  margin: 0 0 20px;
  font-size: 13px;
  color: #666;
}

/* ─── Social Buttons ─────────────────────────────── */
#okazia-social {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 18px;
}

.okazia-social-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 11px 16px;
  border: none;
  border-radius: 10px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s, filter 0.15s;
}
.okazia-social-btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.06);
  box-shadow: 0 4px 14px rgba(0,0,0,0.15);
}
.okazia-social-btn:active {
  transform: translateY(0);
}

.okazia-google {
  background: #fff;
  border: 1.5px solid #ddd;
  color: #333;
}
.okazia-facebook {
  background: #1877F2;
  color: #fff;
}
.okazia-twitter {
  background: #000;
  color: #fff;
}

/* ─── Divider ────────────────────────────────────── */
#okazia-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  color: #aaa;
  font-size: 12px;
}
#okazia-divider::before,
#okazia-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: #e0dcd1;
}

/* ─── Inputs ─────────────────────────────────────── */
.okazia-input {
  width: 100%;
  box-sizing: border-box;
  padding: 12px 14px;
  margin-bottom: 10px;
  border: 1.5px solid #ddd;
  border-radius: 10px;
  background: #fff;
  font-family: inherit;
  font-size: 14px;
  color: #222;
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
  text-align: right;
}
.okazia-input:focus {
  border-color: #00532c;
  box-shadow: 0 0 0 3px rgba(0,83,44,0.1);
}
.okazia-input::placeholder { color: #aaa; }

.okazia-pass-row {
  position: relative;
  margin-bottom: 10px;
}
.okazia-pass-row .okazia-input {
  margin-bottom: 0;
  padding-left: 42px;
}
.okazia-eye {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: #888;
  opacity: 0.5;
  padding: 4px;
  line-height: 1;
  transition: opacity 0.2s;
}
.okazia-eye:hover { opacity: 1; }

/* ─── Error / Success message ────────────────────── */
#okazia-error {
  min-height: 18px;
  margin: 2px 0 10px;
  font-size: 12px;
  text-align: center;
  border-radius: 6px;
  padding: 0 4px;
}
#okazia-error.okazia-err {
  color: #c0392b;
  background: #fdecea;
  padding: 6px 10px;
}
#okazia-error.okazia-ok {
  color: #00532c;
  background: #e8f5ef;
  padding: 6px 10px;
}

/* ─── Submit button ──────────────────────────────── */
#okazia-submit {
  width: 100%;
  padding: 13px;
  background: linear-gradient(135deg, #00532c, #007a43);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
  margin-bottom: 16px;
}
#okazia-submit:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(0,83,44,0.3);
}
#okazia-submit:active { transform: translateY(0); }

/* ─── Mode switch + forgot ───────────────────────── */
#okazia-switch {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: #555;
  margin-bottom: 10px;
}
#okazia-switch-btn {
  background: none;
  border: none;
  color: #00532c;
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: underline;
}

#okazia-forgot {
  display: block;
  width: 100%;
  text-align: center;
  background: none;
  border: none;
  color: #888;
  font-family: inherit;
  font-size: 12px;
  cursor: pointer;
  transition: color 0.2s;
}
#okazia-forgot:hover { color: #00532c; }

/* ─── Signed-In Panel ────────────────────────────── */
#okazia-user-panel {
  padding: 28px;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 8px;
}

#okazia-avatar-wrap {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  overflow: hidden;
  border: 3px solid #c9a84c;
  margin-bottom: 4px;
}
#okazia-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
#okazia-avatar-initials {
  width: 100%;
  height: 100%;
  background: #003a1f;
  color: #c9a84c;
  font-size: 28px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

#okazia-user-displayname {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
  color: #003a1f;
}
#okazia-user-emailtext {
  margin: 0;
  font-size: 12px;
  color: #888;
  direction: ltr;
}

#okazia-user-links {
  display: flex;
  gap: 10px;
  margin-top: 12px;
}
.okazia-user-link {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 9px 16px;
  background: #f0ede4;
  border-radius: 10px;
  color: #003a1f;
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  transition: background 0.2s;
}
.okazia-user-link:hover { background: #e3dece; }

#okazia-signout-btn {
  margin-top: 8px;
  padding: 9px 20px;
  background: none;
  border: 1.5px solid #ddd;
  border-radius: 10px;
  font-family: inherit;
  font-size: 13px;
  color: #888;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
}
#okazia-signout-btn:hover { border-color: #c0392b; color: #c0392b; }

/* ─── Profile Button in Header ───────────────────── */
#okazia-profile-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #FDFAF3;
  border: 2px solid #e8e2d3;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s;
  overflow: hidden;
}
#okazia-profile-btn:hover {
  border-color: #c9a84c;
  box-shadow: 0 2px 10px rgba(201,168,76,0.3);
}

/* ─── Translate Widget ───────────────────────────── */
#okazia-translate-wrap {
  display: flex;
  align-items: center;
}
#okazia-translate-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #FDFAF3;
  border: 2px solid #e8e2d3;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: border-color 0.2s;
}
#okazia-translate-btn:hover { border-color: #c9a84c; }

/* ─── Favorite Heart Button on Product Cards ──────── */
.okazia-heart-btn {
  position: absolute;
  top: 10px;
  left: 10px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(253,250,243,0.92);
  border: 1.5px solid #e0dcd1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10;
  transition: border-color 0.2s, transform 0.2s;
  padding: 0;
}
.okazia-heart-btn svg {
  width: 16px;
  height: 16px;
  stroke: #aaa;
  transition: stroke 0.2s, fill 0.2s;
}
.okazia-heart-btn:hover {
  border-color: #c9a84c;
  transform: scale(1.1);
}
.okazia-heart-btn:hover svg { stroke: #c9a84c; }
.okazia-heart-btn.okazia-heart-active svg {
  fill: #c9a84c;
  stroke: #c9a84c;
}

/* ─── Mobile adjustments ─────────────────────────── */
@media (max-width: 480px) {
  #okazia-box {
    width: calc(100vw - 16px);
    max-height: 88vh;
    top: auto;
    bottom: 0;
    left: 0;
    right: 0;
    transform: none;
    border-radius: 20px 20px 0 0;
    animation: okaziaSlideUpMobile 0.3s cubic-bezier(0.34,1.2,0.64,1);
  }
  @keyframes okaziaSlideUpMobile {
    from { transform: translateY(100%); }
    to   { transform: translateY(0); }
  }
  #okazia-overlay {
    top: 0; left: 0; right: 0; bottom: 0;
  }
  #okazia-user-links { flex-direction: column; width: 100%; }
  .okazia-user-link { justify-content: center; }
}

/* ─── Floating Social Contact Menu ───────────────── */
#okazia-float-menu {
  position: fixed;
  left: 16px;
  bottom: 80px;
  z-index: 99990;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  font-family: sans-serif;
}

/* Social links container */
#okazia-float-contacts {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  /* Hidden by default */
  opacity: 0;
  pointer-events: none;
  transform: translateY(20px) scale(0.85);
  transition: opacity 0.25s ease, transform 0.25s cubic-bezier(0.34,1.4,0.64,1);
}
#okazia-float-contacts.okazia-float-open {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

/* Each social icon link */
.okazia-float-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--fc-bg, #555);
  box-shadow: 0 3px 12px rgba(0,0,0,0.22);
  text-decoration: none;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
  flex-shrink: 0;
}
.okazia-float-link:hover {
  transform: scale(1.12) translateX(4px);
  box-shadow: 0 6px 20px rgba(0,0,0,0.28);
}
.okazia-float-link svg {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  display: block;
}

/* Staggered animation for each icon */
#okazia-float-contacts.okazia-float-open .okazia-float-link:nth-child(1) { transition-delay: 0.03s; }
#okazia-float-contacts.okazia-float-open .okazia-float-link:nth-child(2) { transition-delay: 0.07s; }
#okazia-float-contacts.okazia-float-open .okazia-float-link:nth-child(3) { transition-delay: 0.11s; }
#okazia-float-contacts.okazia-float-open .okazia-float-link:nth-child(4) { transition-delay: 0.15s; }

/* Toggle button */
#okazia-float-toggle {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: linear-gradient(135deg, #00532c, #007a43);
  border: none;
  box-shadow: 0 4px 18px rgba(0,83,44,0.45);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
#okazia-float-toggle:hover {
  transform: scale(1.08);
  box-shadow: 0 6px 24px rgba(0,83,44,0.5);
}
#okazia-float-toggle.okazia-float-rotated {
  background: linear-gradient(135deg, #555, #333);
}
#okazia-float-toggle svg {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
}

/* Mobile: move slightly further from edge */
@media (max-width: 480px) {
  #okazia-float-menu { left: 12px; bottom: 70px; }
  .okazia-float-link  { width: 42px; height: 42px; }
  .okazia-float-link svg { width: 20px; height: 20px; }
  #okazia-float-toggle { width: 48px; height: 48px; }
}
