/* ================================================
   N360 Mortgage Calculator - CSS
   מחשבון משכנתא - עיצוב מלא
   גרסה: 2.0 - מתוקן ומושלם!
   ================================================ */

/* === מיכל כללי === */
.n360-mortgage-wrap {
  background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
  border-radius: 16px;
  padding: 40px;
  margin: 40px 0;
  box-shadow: 0 10px 40px rgba(0,0,0,0.2);
  direction: rtl;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
}

/* === פריסה ראשית: מחשבון + באנר === */
.n360-mortgage-main {
  display: grid;
  grid-template-columns: 2fr 1fr; /* מחשבון 2/3, באנר 1/3 */
  gap: 30px;
  align-items: start;
}

@media (max-width: 1024px) {
  .n360-mortgage-main {
    grid-template-columns: 1fr; /* מחשבון ובאנר בעמודה */
  }
}

/* === כותרת === */
.n360-m-title {
  grid-column: 1 / -1; /* משתרע על כל הרוחב */
  color: #ffffff;
  font-size: 28px;
  font-weight: 700;
  margin: 0 0 30px 0;
  text-align: center;
}

/* === אזור המחשבון (2/3) === */
.n360-m-calculator {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* === פריסה פנימית: תוצאות + סליידרים === */
.n360-m-inner {
  display: grid;
  grid-template-columns: 1fr 1.5fr; /* תוצאות (שמאל), סליידרים (ימין) */
  gap: 24px;
  align-items: start;
}

@media (max-width: 768px) {
  .n360-m-inner {
    grid-template-columns: 1fr;
  }
}

/* === תיבת תוצאות (שמאל) === */
.n360-m-offer {
  background: rgba(255, 255, 255, 0.95);
  border-radius: 12px;
  padding: 24px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.1);
  display: flex;
  flex-direction: column;
  gap: 20px;
  height: 100%;
}

.n360-m-monthly {
  text-align: center;
  padding: 20px;
  background: linear-gradient(135deg, #ffd700 0%, #ffed4e 100%);
  border-radius: 12px;
  color: #1e3c72;
}

.n360-m-sub {
  display: block;
  font-size: 14px;
  margin-bottom: 8px;
  opacity: 0.95;
  font-weight: 500;
}

.n360-m-amount {
  display: block;
  font-size: 36px;
  font-weight: 800;
  letter-spacing: -1px;
}

.n360-m-details {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px 0;
  border-top: 1px solid #e5e5e5;
}

.n360-m-details > span {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 14px;
  color: #666;
}

.n360-m-details strong {
  color: #1e3c72;
  font-weight: 700;
  font-size: 15px;
}

.n360-m-btn {
  display: block;
  background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
  color: white;
  text-align: center;
  padding: 14px 24px;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
  font-size: 16px;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(30, 60, 114, 0.3);
  margin-top: auto;
}

.n360-m-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(30, 60, 114, 0.4);
  color: white;
  text-decoration: none;
}

/* === אזור הסליידרים (ימין) === */
.n360-m-controls {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* === שורת סליידר === */
.n360-m-row {
  background: rgba(255, 255, 255, 0.95);
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.08);
}

.n360-grid-row {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 20px;
  align-items: center;
}

@media (max-width: 640px) {
  .n360-grid-row {
    grid-template-columns: 1fr;
  }
}

/* === תיבת ערך (משמאל) === */
.n360-m-valuebox {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  padding: 16px;
  border-radius: 10px;
  text-align: center;
  min-height: 90px;
}

.n360-m-value-label {
  font-size: 12px;
  color: #666;
  margin-bottom: 4px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.n360-m-value {
  font-size: 24px;
  font-weight: 800;
  color: #1e3c72;
  direction: ltr;
  white-space: nowrap;
}

/* === תיבת סליידר (מימין) === */
.n360-m-sliderbox {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.n360-m-label {
  font-size: 15px;
  color: #1e3c72;
  font-weight: 600;
  margin: 0;
}

/* === עיצוב הסליידר עצמו === */
.n360-m-range {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 8px;
  border-radius: 8px;
  background: #e5e5e5; /* ברירת מחדל - יוחלף ב-JS */
  outline: none;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  z-index: 1;
  pointer-events: auto;
}

.n360-m-range:hover {
  opacity: 0.95;
}

/* === כפתור הגרירה (thumb) === */
.n360-m-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: linear-gradient(135deg, #ffd700 0%, #ffed4e 100%);
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(255, 122, 0, 0.5);
  border: 3px solid white;
  transition: all 0.2s ease;
  position: relative;
  z-index: 2;
}

.n360-m-range::-moz-range-thumb {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: linear-gradient(135deg, #ffd700 0%, #ffed4e 100%);
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(255, 122, 0, 0.5);
  border: 3px solid white;
  transition: all 0.2s ease;
  position: relative;
  z-index: 2;
}

.n360-m-range::-webkit-slider-thumb:hover {
  transform: scale(1.15);
  box-shadow: 0 3px 12px rgba(255, 122, 0, 0.7);
}

.n360-m-range::-moz-range-thumb:hover {
  transform: scale(1.15);
  box-shadow: 0 3px 12px rgba(255, 122, 0, 0.7);
}

.n360-m-range::-webkit-slider-thumb:active {
  transform: scale(1.05);
}

.n360-m-range::-moz-range-thumb:active {
  transform: scale(1.05);
}

/* === מגבלות (min/max) === */
.n360-m-limits {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: #999;
  margin-top: 4px;
  direction: rtl;
}

.n360-m-limits .n360-max {
  order: 2; /* מקסימום משמאל */
}

.n360-m-limits .n360-min {
  order: 1; /* מינימום מימין */
}

/* === באנר צד (1/3) === */
.n360-m-banner {
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0,0,0,0.15);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  height: 100%;
  min-height: 400px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.05);
}

.n360-m-banner:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 30px rgba(0,0,0,0.25);
}

.n360-m-banner img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.n360-m-banner a {
  display: block;
  width: 100%;
  height: 100%;
}

/* === Disclaimer === */
.n360-m-disclaimer {
  grid-column: 1 / -1;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.8);
  text-align: center;
  padding: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.2);
  margin-top: 20px;
  line-height: 1.6;
}

/* === רספונסיביות נוספת === */
@media (max-width: 640px) {
  .n360-mortgage-wrap {
    padding: 24px 16px;
  }
  
  .n360-m-title {
    font-size: 22px;
  }
  
  .n360-m-amount {
    font-size: 28px;
  }
  
  .n360-m-offer {
    padding: 20px;
  }
  
  .n360-m-row {
    padding: 16px;
  }
  
  .n360-m-banner {
    min-height: 250px;
  }
}

/* === אנימציות === */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.n360-mortgage-wrap {
  animation: fadeIn 0.5s ease;
}

/* === Accessibility === */
.n360-m-range:focus {
  outline: 2px solid #ffd700;
  outline-offset: 2px;
}

.n360-m-btn:focus {
  outline: 2px solid white;
  outline-offset: 2px;
}

/* === Fix למניעת כיסוי === */
.n360-m-range {
  touch-action: none; /* למובייל */
  user-select: none;
}

.n360-m-sliderbox {
  position: relative;
  z-index: 1;
}

/* === סגנון מיוחד לתצוגה ריקה של באנר === */
.n360-m-banner-empty {
  background: linear-gradient(135deg, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0.05) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255,255,255,0.5);
  font-size: 14px;
  text-align: center;
  padding: 40px 20px;
}

.n360-m-banner-empty::before {
  content: "📷";
  display: block;
  font-size: 48px;
  margin-bottom: 12px;
}