/* ================================
   RESET & BASE STYLES
================================ */
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { 
  font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial; 
  color: #222; 
  background: #fff; 
}

/* ================================
   HEADER
================================ */
.main-header { position: sticky; top: 0; background: #fff; border-bottom: 1px solid #eee; z-index: 1000; }
.header-inner { display: flex; align-items: center; justify-content: space-between; max-width: 1400px; margin: 0 auto; padding: 12px 20px; gap: 16px; }
.logo .logo-text { font-weight: 700; font-size: 1.25rem; color: #222; text-decoration: none; }
.logo .logo-text span { color: #007bff; }
.tagline { font-size: 0.86rem; color: #555; margin-top: 3px; display: block; }

/* ================================
   SEARCH BAR
================================ */
.search-bar { flex: 1; max-width: 640px; margin: 0 18px; position: relative; }
.search-form input[type="text"], .search-form select { 
  padding: 10px 14px; 
  border-radius: 28px; 
  border: 1px solid #ddd; 
  font-size: 0.95rem; 
  margin-right: 8px; 
}
.search-form .search-city { width: 180px; }
.search-form .search-country { width: 140px; }
.btn-search { 
  position: absolute; 
  right: 5px; top: 50%; transform: translateY(-50%); 
  background: #007bff; border: none; color: #fff; 
  padding: 8px 12px; border-radius: 50%; cursor: pointer; 
}

/* ================================
   HEADER ACTIONS
================================ */
.header-actions { display: flex; gap: 10px; align-items: center; }
.btn-auth { border: 1px solid #007bff; color: #007bff; background: transparent; padding: 8px 14px; border-radius: 22px; cursor: pointer; }
.btn-auth.outline { background: transparent; }
.header-user { color: #007bff; cursor: default; position: relative; padding: 6px 10px; border-radius: 8px; }
.header-user .user-menu { 
  display: none; 
  position: absolute; right: 0; top: 36px; 
  background: #fff; border: 1px solid #eee; 
  box-shadow: 0 8px 20px rgba(0,0,0,0.08); border-radius: 8px; overflow: hidden; 
}
.header-user:hover .user-menu { display: block; }
.user-menu a { display: block; padding: 10px 14px; color: #333; text-decoration: none; }
.user-menu a:hover { background: #f7f7f7; }

/* ================================
   PREMIUM / GRIDS
================================ */
.premium-heading { margin-top: 22px; font-size: 18px; }
.premium-grid { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 12px; }
.premium-box { 
  width: calc(25% - 12px); 
  background: #fafafa; 
  padding: 12px; 
  border-radius: 10px; 
  text-decoration: none; 
  color: #222; 
  border: 1px solid #f0f0f0; 
}
.premium-box h4 { margin-bottom: 6px; font-size: 15px; }

/* ================================
   SPONSORED / FEATURED GRID
================================ */
.ad-box { 
  display: block; 
  background: #fff; 
  border: 1px solid #eee; 
  padding: 10px; 
  border-radius: 8px; 
  text-decoration: none; 
  color: #222; 
  margin-bottom: 10px; 
}
.featured-section { max-width: 1200px; margin: 22px auto; padding: 0 20px; }
.featured-grid { display: grid; grid-template-columns: repeat(auto-fill,minmax(210px,1fr)); gap: 12px; margin-top: 12px; }
.product-card { 
  display: block; 
  border: 1px solid #eee; 
  padding: 10px; 
  border-radius: 8px; 
  text-decoration: none; 
  color: #222; 
  background: #fff; 
}
.product-card img { 
  width: 100%; 
  height: 120px; 
  object-fit: cover; 
  border-radius: 6px; 
  margin-bottom: 8px; 
}

/* ================================
   FOOTER
================================ */
.main-footer { margin-top: 36px; padding: 18px 20px; border-top: 1px solid #eee; background: #fafafa; }
.footer-container { max-width: 1200px; margin: 0 auto; display: flex; justify-content: space-between; align-items: center; }

/* ================================
   MODALS
================================ */
.modal { 
  display: none; 
  position: fixed; left: 0; top: 0; width: 100%; height: 100%; 
  background: rgba(0,0,0,0.45); 
  z-index: 9999; 
  align-items: center; justify-content: center; padding: 20px; 
}
.modal .modal-content { 
  background: #fff; padding: 18px; border-radius: 10px; width: 100%; max-width: 720px; position: relative; 
}
.closeModal { position: absolute; top: 8px; right: 12px; border: none; background: transparent; font-size: 20px; cursor: pointer; }
.modal input[type="text"], .modal input[type="email"], .modal input[type="password"], .modal textarea, .modal select { width: 100%; padding: 10px 12px; border-radius: 8px; border: 1px solid #ddd; margin-bottom: 10px; }
.modal .btn { background: #007bff; color: #fff; border: none; padding: 8px 14px; border-radius: 8px; cursor: pointer; }

/* ================================
   TOAST
================================ */
#toast-root { position: fixed; top: 20px; left: 50%; transform: translateX(-50%); z-index: 100000; }
.toast { min-width: 260px; max-width: 520px; padding: 12px 14px; border-radius: 10px; color: #fff; box-shadow: 0 10px 30px rgba(0,0,0,0.12); display: flex; justify-content: space-between; align-items: center; margin-top: 8px; }
.toast.success { background: linear-gradient(90deg,#116536,#2f9d58); }
.toast.error { background: linear-gradient(90deg,#8b0f0f,#d64545); }
.toast .toast-close { background: transparent; border: 0; color: rgba(255,255,255,0.95); font-size: 18px; cursor: pointer; }

/* ================================
   RESPONSIVE
================================ */
@media(max-width: 900px) {
  .premium-box { width: calc(50% - 12px); }
  .hero { flex-direction: column; }
  .search-form .search-city, .search-form .search-country { display: none; }
}
.register-modal-content {
    width: 90%;
    max-width: 450px;
    max-height: 90vh; /* Prevent full screen overflow */
    display: flex;
    flex-direction: column;
    background: #fff;
    position: relative;
    padding: 20px;
    border-radius: 8px;
    overflow: hidden; /* Important */
}

.register-form-scroll {
    flex: 1;
    overflow-y: auto;
    padding-right: 10px;
    max-height: calc(90vh - 100px); /* Adjust for header & close button */
}

.register-form-scroll .form-group {
    margin-bottom: 15px;
}

.register-modal-content .closeModal {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 24px;
    cursor: pointer;
}
/* Ensure modal content fits on screen with internal scrolling */
.register-modal-content {
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* Make the form scrollable */
.register-form-scroll {
    overflow-y: auto;
    padding-right: 10px; /* avoid scrollbar covering text */
    flex: 1;
}

/* Optional: better spacing for small screens */
@media (max-height: 700px) {
    .register-modal-content {
        max-height: 85vh;
    }
}/* Limit modal height */
.register-modal-content {
    max-height: 90vh;     /* modal height fits screen */
    overflow: hidden;
    display: flex;
    flex-direction: column;
    padding-bottom: 15px; /* ensure bottom visible */
}

/* Make only the form area scrollable */
.register-form-scroll {
    flex: 1;              /* take available height */
    overflow-y: auto;     /* enable scrolling */
    padding-right: 10px;  /* avoid scrollbar overlap */
    margin-top: 10px;
}

/* Optional: for very small screens */
@media (max-height: 700px) {
    .register-modal-content {
        max-height: 85vh;
    }
}
/* Register Modal Content */
.register-modal-content {
    width: 90%;
    max-width: 450px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    position: relative;
}

/* Scroll only inside form wrapper */
.register-form-wrapper {
    overflow-y: auto;
    max-height: calc(90vh - 80px); /* leaves room for heading & close button */
    padding-right: 10px;
}

/* Form fields spacing */
.register-form-scroll .form-group {
    margin-bottom: 15px;
}

/* Close button */
.register-modal-content .closeModal {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 24px;
    cursor: pointer;
}

