/*
 * Emaktaba School Filter Stylesheet
 * Version: 1.1.0
 */

/* Main Wrapper */
.esf-finder-wrapper {
  padding: 20px;
  background-color: #f1f1ff;
  max-width: 500px;
  font-family: "Noto Kufi Arabic", "Droid Arabic Kufi", sans-serif;
  margin-bottom: 25px;
}

/* Form Styling */
.esf-selection-form {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
  flex-direction: column;
}

.esf-selection-form .esf-form-group {
  margin-bottom: 10px;
}

.esf-selection-form .esf-form-group label {
  font-weight: 500;
  font-size: 0.87rem;
  display: block;
  margin-bottom: 10px;
  color: #020202;
  font-family: "Noto Kufi Arabic", "Droid Arabic Kufi", sans-serif;
}

.esf-selection-form .esf-form-group .esf-select {
  border-radius: 4px;
  height: 48px;
  padding: 10px;
  border: 1px solid #e0e0e0;
  width: 100%;
  background: #fff;
  color: #777;
  padding-left: 30px;
  background-image: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNSIgaGVpZ2h0PSIyNSIgZmlsbD0ibm9uZSIgc3Ryb2tlLXdpZHRoPSIyIiBzdHJva2U9IiNiYmIiPjxwYXRoIGQ9Ik02IDlsNiA2IDYtNiIvPjwvc3ZnPg==);
  background-position: left 10px top 50%;
  background-size: auto 18px;
  background-repeat: no-repeat;
}

input[type="email"],
input[type="search"],
input[type="number"],
input[type="url"],
input[type="tel"],
input[type="text"],
input[type="password"],
textarea,
select {
  font-family: "Noto Kufi Arabic", "Droid Arabic Kufi", sans-serif;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
}

.esf-selection-form .esf-form-group .esf-select:focus {
  outline: none;
  transition: border-color 0.4s ease;
  border-color: #382673;
}

.esf-select:disabled {
  background-color: #e9e9e9;
  cursor: not-allowed;
}

.esf-button {
  padding: 10px 20px;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.9rem;
  transition: background-color 0.3s;
  height: 48px;
  background-color: #6a34c0;
  border-radius: 3px;
  min-width: 150px;

  font-family: "Noto Kufi Arabic", "Droid Arabic Kufi", sans-serif;
  outline: none;
}
.esf-button:hover {
  background-color: #4e17a5;
}
.esf-button:disabled {
  background-color: #6a34c0;
  cursor: not-allowed;
  user-select: none;
  pointer-events: none;
  opacity: 0.5;
}

.esf-loader {
  padding: 20px 0px 20px 0;
  font-family: "Noto Kufi Arabic", "Droid Arabic Kufi", sans-serif;
  color: #808080;
}

/* Results Area */
#list-box {
  margin-top: 40px;
  padding: 2.5rem 1.5rem;
  background-color: #ffffff;
  border: 1px dashed #c2c2c2;
  border-radius: 8px;
}
#esf-grand-total-wrapper > .esf-grand-total-container {
  font-weight: 700;
  font-size: 17px;
  color: #020202;
  border-top: 1px solid #eee;
  border-bottom: none;
  font-family: "Noto Kufi Arabic", "Droid Arabic Kufi", sans-serif;
  width: 500px;
  margin-left: auto;
  margin-top: 50px;
  padding: 25px 10px;
  text-align: center;
}

.esf-results-header {
  margin-bottom: 45px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
}

.esf-results-header h2 {
  margin: 0;
  font-size: 1.05rem;
  font-family: "Noto Kufi Arabic", "Droid Arabic Kufi", sans-serif;
}

.esf-header-school-info {
  text-align: right;
  margin-bottom: 15px;
}
.esf-header-school-info h4 {
  margin-top: 0;
  margin-bottom: 15px;
  font-size: 0.9rem;
}

.esf-error {
  font-family: "Noto Kufi Arabic", "Droid Arabic Kufi", sans-serif;
  background: #ffcedfa1;
  color: #c90346;
  padding: 15px;
  text-align: center;
}

.esf-remove-item-btn {
  font-family: "Noto Kufi Arabic", "Droid Arabic Kufi", sans-serif;
  color: #c90346;
}

.esf-header-school-info h6 {
  font-size: 0.85rem;
  margin-top: 0;
  margin-bottom: 0;
}

.esf-header-school-info h4,
.esf-header-school-info h6 {
  color: #020202;
  font-family: "Noto Kufi Arabic", "Droid Arabic Kufi", sans-serif;
}

/* Table Styles */
.esf-result-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.esf-result-table th,
.esf-result-table td {
  padding-left: 25px;
  padding-right: 25px;
  padding-top: 20px;
  padding-bottom: 20px;
  text-align: left;
  vertical-align: middle;
  border-bottom: 1px solid #eee;
  font-family: "Noto Kufi Arabic", "Droid Arabic Kufi", sans-serif;
}

.esf-result-table thead th {
  background-color: #fafafa;
  font-weight: 500;
  color: #808080;
  border: none;
}

.esf-result-table tbody tr {
  background-color: #ffffff;
}

/* Table Cell Content */
input[type="checkbox"] {
  accent-color: #6a34c0;
}

.custom-checkbox input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  border: 2px solid #ccc;
  border-radius: 3px;
  background-color: white;
  position: relative;
  cursor: pointer;
}

.custom-checkbox input[type="checkbox"]:checked {
  background-color: #6a34c0;
  border-color: #6a34c0;
}

.custom-checkbox input[type="checkbox"]:checked::after {
  content: "";
  position: absolute;
  left: 4px;
  top: 1px;
  width: 2px;
  height: 6px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.esf-product-checkbox-col {
  width: 24px;
}

.esf-product-image-col {
  width: 150px;
}

.esf-product-image {
  width: 96px;
}

.esf-product-title-cell {
  line-height: 1.4;
  width: 350px;
}

.esf-product-name {
  font-weight: bold;
  color: #020202;
  margin: 0;
  font-size: 0.97rem;
  font-family: "Noto Kufi Arabic", "Droid Arabic Kufi", sans-serif;
}

.esf-remove-item-btn {
  background: none;
  border: none;
  color: #a00;
  cursor: pointer;
  font-size: 12px;
  padding: 2px 0;
  display: block;
  margin-top: 7px;
  font-weight: 400;
}
.esf-remove-item-btn:hover {
  color: #d00;
}

/* Quantity Input in Table */
.esf-product-qty {
  display: flex;
  align-items: center;
}
.esf-qty-btn {
  width: 28px;
  height: 28px;
  border: 1px solid #fff;
  background-color: #fff;
  color: #020202;
  cursor: pointer;
}
input.esf-qty-input {
  width: 28px;
  height: 28px;
  text-align: center;
  line-height: 28px;
  border: 1px solid #b8b8b8;
  background-color: #ffffff;
  color: #978d8d;
  margin-left: 5px;
  margin-right: 5px;
  user-select: none;
  pointer-events: none;
  border-radius: 2px;
  -moz-appearance: textfield;
}
input.esf-qty-input::-webkit-inner-spin-button,
input.esf-qty-input::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.esf-unit-price,
.esf-row-total {
  font-weight: 500;
  font-family: "Noto Kufi Arabic", "Droid Arabic Kufi", sans-serif;
  font-size: 0.97rem;
}

/* Table Footer */
.esf-result-table tfoot td {
  font-weight: 700;
  font-size: 16px;
  color: #020202;
  border-top: 1px solid #eee;
  border-bottom: none;
}
.esf-grand-total-label {
  text-align: right !important;
}

#esf-grand-total {
  font-weight: 700;
  font-size: 16px;
  color: #020202;
}

.esf-table-total-label {
  text-align: right !important;
}

/* Add to Cart Button */
.add-to-cart-container {
  text-align: center;
}

.esf-add-all-button {
  display: inline-block;
  margin-top: 35px;
  padding: 15px;
  font-size: 0.85em;
  background-color: #6a34c0;
  height: auto;
  min-width: 300px;
  font-weight: 400;
  font-family: "Noto Kufi Arabic", "Droid Arabic Kufi", sans-serif;
  text-transform: uppercase;
}
.esf-add-all-button:hover {
  background-color: #4e17a5;
}

/* PACK SEPARATE PAGE */
.esf-pack-selector-wrapper {
  display: flex;
  gap: 20px;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 30px;
  min-height: 100px;
}

.esf-pack-box {
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  padding: 20px;
  text-align: center;
  flex: 1;
  min-width: 200px;
  max-width: 250px;
  cursor: pointer;
  transition: all 0.3s ease;
  background-color: #fafafa;
}
.esf-pack-box h3 {
  font-size: 0.85rem;
  font-family: "Noto Kufi Arabic", "Droid Arabic Kufi", sans-serif;
}

.esf-pack-box .esf-checkbox {
  width: 24px;
  height: 24px;
  border: 2px solid #ccc;
  border-radius: 50%;
  margin: 0 auto 15px;
  position: relative;
  transition: all 0.3s ease;
}

.esf-pack-box.selected .esf-checkbox {
  background-color: #6a34c0;
  border-color: #6a34c0;
}

.esf-pack-box.selected .esf-checkbox::after {
  content: "";
  position: absolute;
  left: 8px;
  top: 4px;
  width: 5px;
  height: 10px;
  border: solid white;
  border-width: 0 3px 3px 0;
  transform: rotate(45deg);
}

.esf-pack-box:hover {
  border-color: #6a34c0;
  transform: translateY(-5px);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.esf-pack-box.selected {
  border-color: #6a34c0;
  background-color: #f1f1ff;
  box-shadow: 0 4px 15px rgba(106, 52, 192, 0.2);
  transform: translateY(-5px);
}

.esf-pack-box h3 {
  margin-top: 0;
  color: #333;
  font-family: "Noto Kufi Arabic", "Droid Arabic Kufi", sans-serif;
}

.esf-pack-box p {
  color: #666;
  font-size: 14px;
  font-family: "Noto Kufi Arabic", "Droid Arabic Kufi", sans-serif;
  margin-bottom: 0;
}

#esf-pack-page-results .esf-result-table {
  margin-top: 20px;
}

/* RTL SUPPORT  */
.esf-rtl-support .esf-finder-wrapper,
.esf-rtl-support .esf-pack-section {
  direction: rtl;
}

.esf-rtl-support #esf-results-container {
  direction: rtl;
}

.esf-rtl-support .esf-table-total-label {
  text-align: left !important;
}

.esf-rtl-support #esf-grand-total-wrapper > .esf-grand-total-container {
  margin-left: 0;
  margin-right: auto;
}

.esf-result-table th,
.esf-result-table td {
  text-align: right;
}

/* media queries */
@media (max-width: 1090px) {
  .esf-result-table .esf-product-image-col {
    width: 48px;
  }

  .esf-result-table .esf-product-image-col .esf-product-image {
    width: 48px;
  }

  .esf-result-table .esf-product-title-cell {
    width: 200px;
  }

  .esf-product-name {
    font-size: 0.85rem;
  }

  .esf-unit-price,
  .esf-row-total {
    font-size: 0.85rem;
  }

  .esf-result-table thead th {
    font-size: 0.85rem;
  }

  .esf-result-table tfoot td {
    font-size: 0.87rem;
  }
}
@media (max-width: 827px) {
  .esf-result-table thead {
    display: none;
  }

  .esf-result-table tr {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    border: 1px solid #ddd;
    border-radius: 5px;
    margin-bottom: 15px;
    background-color: #fff;
    padding: 10px;
  }

  .esf-result-table tbody tr:hover {
    background-color: #f9f9f9;
  }

  .esf-result-table td {
    border: none;
    padding: 8px 0;
  }

  .esf-result-table td.esf-product-checkbox-col {
    flex-basis: 30px;
    flex-grow: 0;
  }

  .esf-result-table td.esf-product-image-col {
    flex-basis: 60px;
    flex-grow: 0;
  }

  .esf-result-table td.esf-product-title-cell {
    flex-grow: 1;
    padding-left: 15px;
  }

  .esf-result-table td.esf-product-checkbox-col:before,
  .esf-result-table td.esf-product-image-col:before,
  .esf-result-table td.esf-product-title-cell:before {
    display: none;
  }

  .esf-result-table
    td:not(.esf-product-checkbox-col):not(.esf-product-image-col):not(
      .esf-product-title-cell
    ) {
    flex-basis: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid #eee;
    margin-top: 8px;
    padding-top: 8px;
  }

  .esf-result-table
    td:not(.esf-product-checkbox-col):not(.esf-product-image-col):not(
      .esf-product-title-cell
    ):before {
    content: attr(data-label);
    font-weight: bold;
    color: #333;
    text-align: left;
  }

  .esf-result-table tfoot {
    display: contents;
  }

  .esf-result-table tfoot tr {
    border: none;
    margin: 0;
    padding: 0;
    padding-top: 10px;
    width: 50%;
    margin-right: auto;
  }

  .esf-result-table tfoot td {
    width: 100%;
    display: flex;
    justify-content: space-between;
    font-size: 18px;
    padding: 8px 0;
  }

  .esf-table-total-label {
    border-top: none !important;
    font-weight: bold;
  }

  .esf-results-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
  .esf-header-school-info {
    text-align: left;
  }
  .add-to-cart-container {
    text-align: center;
    margin-top: 20px;
  }
  .esf-add-all-button {
    width: 100%;
  }

  .esf-result-table tfoot tr td {
    justify-content: center !important;
    font-size: 0.97rem;
  }
}
