/* Wrapper */
.afpc-container {
  width: 100%;
  max-width: 1140px;
  margin: 0 auto;
  direction: rtl;
  font-family: Arial, sans-serif;
}

/* Project selector */
#afpc-project-select {
  width: 100%;
  max-width: 100%;
  padding: 10px 40px 10px 12px; /* leave space for custom arrow */
  font-size: 14px;
  border: 1px solid #003948;
  border-radius: 4px;
  color: #003948;
  background: #fff;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  direction: rtl;
  box-sizing: border-box;
}

/* Custom arrow */
#afpc-project-select-wrapper {
  position: relative;
  width: 70%;
  max-width: 540px;
  margin: 0 auto;
}
#afpc-project-select-wrapper::after {
  content: "▼";
  position: absolute;
  top: 50%;
  left: 12px;
  transform: translateY(-50%);
  pointer-events: none;
  color: #003948;
  font-size: 12px;
}

/* Controls */
.afpc-controls {
  width: 60%;
  max-width: 720px;
  min-width: 280px;
  margin: 20px auto;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  align-items: center;
  direction: rtl;
}
.afpc-filters-holder { width: 100%; }

/* Smooth animation for filters */
.afpc-filters {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  animation: afpcFadeSlide 0.35s ease forwards;
  width: 70%;
  max-width: 540px;
  margin: 0 auto;
}
@keyframes afpcFadeSlide {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Preloader */
#afpc-preloader {
  display: none;
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(255,255,255,0.7);
  z-index: 99999;
}
#afpc-preloader.active { display:block; }

/* Loading bar */
#afpc-loading-bar {
  position: fixed;
  top:0; left:0;
  width:0%; height:4px;
  background:#003948;
  z-index:100000;
  transition: width 0.3s ease;
}

/* Floorplan checkboxes */
.afpc-floorplans {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  margin: 15px auto;
  overflow-x: auto;
  white-space: nowrap;
  max-width: 100%;
  box-sizing: border-box;
}
.afpc-floorplans::-webkit-scrollbar { height: 6px; }
.afpc-floorplans::-webkit-scrollbar-thumb { background: #003948; border-radius: 3px; }
.afpc-floorplans label.afpc-plan-label {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  margin: 0;
}
.afpc-floorplans input[type="checkbox"] { display: none !important; }
.afpc-floorplans input[type="checkbox"] + span {
  cursor: pointer;
  background: #e0d9d0;
  color: #003948;
  border-radius: 4px;
  padding: 14px;
  font-size: 12px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: 0.2s;
  white-space: nowrap;
  margin: 0;
}
.afpc-floorplans input[type="checkbox"]:checked + span,
.afpc-floorplans label.afpc-plan-label:hover {
  background: #003948 !important;
  color: #e0d9d0 !important;
}

/* Filters */
.afpc-filters select {
  padding: 8px 12px;
  font-size: 14px;
  border-radius: 4px;
  border: 1px solid #003948;
  background: #fff;
  color: #003948;
  appearance: none;
  direction: rtl;
}

/* Table */
.afpc-table-wrapper { width: 100%; overflow-x: auto; }
#afpc-compare-table {
  width: 100%;
  border-collapse: collapse;
  margin: 20px auto;
  table-layout: fixed;
  direction: rtl;
}
#afpc-compare-table th, #afpc-compare-table td {
  border: 0.5px solid #ddd;
  padding: 12px;
  text-align: center;
  font-size: 14px;
  vertical-align: middle;
  white-space: normal;
}
#afpc-compare-table th {
  background: #003948;
  color: #fff;
  font-weight: 600;
}
#afpc-compare-table img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 0 auto;
  border-radius: 4px;
}

/* Mobile responsive cards with RTL */
@media screen and (max-width:768px){
  #afpc-compare-table, #afpc-compare-table thead, #afpc-compare-table tbody, #afpc-compare-table th, #afpc-compare-table td, #afpc-compare-table tr {
    display: block;
    width: 100%;
    text-align: right;
  }
  #afpc-compare-table thead tr { display: none; }
  #afpc-compare-table tbody tr {
    margin-bottom: 20px;
    border: 1px solid #ddd;
    padding: 10px;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 3px 10px rgba(0,0,0,0.05);
    direction: rtl;
  }
  #afpc-compare-table tbody td {
    display: flex;
    justify-content: space-between;
    padding: 6px 10px;
    border: none;
    text-align: right;
    font-size: 14px;
    white-space: normal;
  }
  #afpc-compare-table tbody td::before {
    content: attr(data-label);
    font-weight: bold;
    flex: 0 0 120px;
    padding-right: 10px;
    text-align: right;
  }
  #afpc-compare-table tbody td img {
    max-width: 100px;
    margin-left: 10px;
  }
}

/* PDF button */
#afpc-download-pdf {
  margin-top: 20px;
  background: #003948;
  color: #e0d9d0;
  border: none;
  padding: 10px 20px;
  font-size: 14px;
  cursor: pointer;
  border-radius: 4px;
  transition: 0.2s;
}
#afpc-download-pdf:hover { background: #002734; }

/* Popup modal */
.afpc-open-btn {
  font-family: inherit!important;
}

 
/* Popup modal – FIXED */
.afpc-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 100002;
  background-color: rgba(0,0,0,0.8);
  overflow-y: auto;
}

/* Active state */
.afpc-modal.active {
  display: block;
  animation: afpcModalFade 0.3s ease forwards;
}

/* Animation */
@keyframes afpcModalFade {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* Modal content */
.afpc-modal-content {
  background: #fff;
  margin: 0 auto;
  padding: 20px 50px;
  width: 100%;
  max-width: 1140px;
  min-height: 100vh;
  box-sizing: border-box;
  position: relative;
}


/* Close button */
.afpc-close {
  color: #fff;
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
  width: 40px;
  height: 40px;
  background-color: #003948;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  position: absolute;
  top: 25px;
  right: 15px;
  z-index: 10001;
  transition: 0.2s;
}
.afpc-close:hover {
  background-color: #e0d9d0;
  color: #003948;
}

/* Magnific Popup */
.mfp-wrap {
  z-index: 100000 !important;
  background: rgba(0,0,0,0.7);
}

/* Spinner / skeleton loader */
.lds-dual-ring {
  display: inline-block;
  width: 64px;
  height: 64px;
}
.lds-dual-ring:after {
  content: " ";
  display: block;
  width: 46px;
  height: 46px;
  margin: 1px;
  border-radius: 50%;
  border: 5px solid #003948;
  border-color: #003948 transparent #003948 transparent;
  animation: lds-dual-ring 1.2s linear infinite;
}
@keyframes lds-dual-ring {0%{transform:rotate(0deg);}100%{transform:rotate(360deg);}}
