html {
  scroll-behavior: smooth;
}

body {
  text-transform: capitalize;
  font-family: var(--font-family);
  font-size: var(--normal-font-size);
  background-color: var(--body-color);
  color: var(--text-color);
  transition: 0.3s;
  margin: 0;
  padding: 0;
}

h1,
h2,
h3 {
  color: #F4AB20;
  font-weight: var(--font-semi-bold);
}

.container {
  max-width: 1024px;
  margin-left: 1.5rem;
  margin-right: 1.5rem;
}

.grid {
  display: grid;
}

.section:first-of-type {
  padding: 7.5rem 0 2rem;
}

.section {
  padding: 6rem 0 2rem;
}

.section-title {
  font-size: var(--h2-font-size);
  direction: rtl;
  color: #F4AB20;
}

.section-title span {
  color: #2F3B39;
  direction: rtl;
}

.dark-theme .section-title span {
  color: var(--max-second-color);
}

.section-subtitle {
  display: block;
  font-size: var(--small-font-size);
  color: var(--second-color);
  direction: rtl;
}

.main {
  overflow: hidden;
  margin-top: 60px;
}

img {
  max-width: 100%;
  height: auto;
  aspect-ratio: 1;
  object-fit: cover;
}

input,
button {
  font-family: var(--body-font);
  outline: none;
  border: none;
}

/* ====================== THEME ====================== */
.change-theme {
  font-size: 1.25rem;
  color: white;
  cursor: pointer;
  transition: 0.3s;
}

.dark-theme .change-theme {
  color: #F4AB20;
}

body.dark-theme {
  --first-color: #f9e0bb;
  --second-color: #cc7f47;
  --title-color: hsl(228, 8%, 95%);
  --text-color: hsl(228, 8%, 70%);
  --border-color: hsl(228, 16%, 14%);
  --body-color: black;
  --container-color: hsl(228, 16%, 12%);
}

.dark-theme .home-search,
.dark-theme .swiper-button-next,
.dark-theme .swiper-button-prev {
  border: 3px solid var(--border-color);
}

.dark-theme .nav-menu,
.dark-theme .home-img,
.dark-theme .popular-card:hover,
.dark-theme .accordion-open,
.dark-theme .accordion-open .value-accordion-icon,
.dark-theme .value-accordion-arrow,
.dark-theme .contact-card-box:hover,
.dark-theme .scrollup {
  box-shadow: none;
}

.dark-theme .value-orbe,
.dark-theme .contact-orbe,
.dark-theme .contact-card i,
.dark-theme .contact-card-button,
.dark-theme .subscribe-container {
  background-color: var(--container-color);
}

.dark-theme .subscribe-container {
  border: 6px solid var(--border-color);
}

.dark-theme .subscribe-description {
  color: var(--text-color);
}

.dark-theme::-webkit-scrollbar {
  background-color: hsl(228, 4%, 15%);
}

.dark-theme::-webkit-scrollbar-thumb {
  background-color: hsl(228, 4%, 25%);
}

.dark-theme::-webkit-scrollbar-thumb:hover {
  background-color: hsl(228, 4%, 35%);
}

/* ====================== GLOBAL ====================== */
* {
  padding: 0;
  margin: 0;
  list-style: none;
  text-decoration: none;
  box-sizing: border-box;
}

:root {
  --dardashat-main-color: #283993;
  --dardashat-second-color: #be9e6d;
  --cb-main-color: #73bca8;
  --cb-brown-color: #563f2d;
  --cb-offwhite-color: #ece6c2;
  --cb-yellow-color: #efbd66;
  --eng-font: "Poppins", sans-serif;
  --font-family: "El Messiri", sans-serif;
  --header-height: 3.5rem;
  --first-color: #8e3200;
  --first-color-alt: hsl(228, 66%, 47%);
  --first-color-light: hsl(228, 62%, 59%);
  --first-color-lighten: hsl(228, 100%, 97%);
  --second-color: hsl(25, 83%, 53%);
  --title-color: hsl(228, 57%, 28%);
  --text-color: hsl(228, 15%, 50%);
  --text-color-light: hsl(228, 12%, 75%);
  --border-color: hsl(228, 99%, 98%);
  --body-color: #fff;
  --container-color: #fff;
  --biggest-font-size: 2.25rem;
  --h1-font-size: 1.5rem;
  --h2-font-size: 1.25rem;
  --h3-font-size: 1rem;
  --normal-font-size: 0.938rem;
  --small-font-size: 0.813rem;
  --smaller-font-size: 0.75rem;
  --font-medium: 500;
  --font-semi-bold: 600;
  --z-tooltip: 10;
  --z-fixed: 100;
}

/* ====================== HEADER & NAVIGATION ====================== */
.header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  background-color: transparent;
  z-index: var(--z-fixed);
  transition: 0.3s;
  font-family: "Poppins", sans-serif;
}

.nav {
  height: var(--header-height);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* Top Navigation Styles (moved from PHP) */
.topnav {
  overflow: hidden;
  background-color: #2F3B39;
  position: relative;
  width: 100%;
  margin: auto;
  font-family: var(--font-family);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.dark-theme .topnav {
  background-color: black;
  color: white;
}

.dark-theme .topnav .icon {
  color: var(--max-main-color);
}

.topnav #myLinks {
  display: none;
  direction: rtl;
  height: calc(100vh - 200px);
  overflow-y: auto;
  background-color: var(--dardashat-main-color);
}

.dark-theme .topnav .x-scroller {
  background-color: black;
}

.dark-theme .topnav .x-scroller a {
  background-color: black;
}

.topnav a {
  color: white;
  padding: 14px 16px;
  text-decoration: none;
  font-size: 17px;
  display: block;
  background-color: #2F3B39;
}

.dark-theme .topnav a {
  background-color: black;
  color: white;
}

.topnav .icon {
  color: white;
}

.topnav a.icon {
  display: block;
  position: absolute;
  right: 0;
  top: 0;
}

.active {
  background-color: #F9F9EA;
  color: white;
}

.dark-theme .active {
  background-color: black;
  color: var(--dardashat-second-color);
}

/* X-Scroller */
.x-scroller {
  overflow-x: scroll;
  overflow-y: hidden;
  height: 50px;
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  white-space: nowrap;
  scrollbar-width: thin;
  font-family: var(--font-family);
}

.x-scroller a {
  font-size: 16px;
  background-color: white;
  border-radius: 2px;
  padding: 10px 15px;
  border-left: 1px solid #7777771f;
  border-right: 1px solid #7777771f;
  color: black;
}

.dark-theme .x-scroller a {
  background-color: #000;
  color: white;
  border-left: 1px solid #7f7f7f;
  border-right: 1px solid #7f7f7f;
}

.header-logo {
  width: 50px;
}

/* Search Styles */
.search {
  background: white;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  outline: none;
  transition: all 0.3s ease;
  background-color: white;
  color: #2F3B39;
  font-size: 16px;
}

.dark-theme .search {
  background-color: var(--body-color);
}

#search-bar {
  direction: rtl;
  width: 80%;
  max-width: 400px;
  padding: 10px;
  font-family: var(--font-family);
  transition: all 0.3s ease;
}

.dark-theme #search-bar {
  background-color: var(--body-color);
  color: white;
  border-color: var(--dardashat-main-color);
}

.bx-search {
  color: #F4AB20;
}

/* ====================== MAIN CONTENT ====================== */
/* No Results Message */
.no-results {
  text-align: center;
  padding: 2rem;
  padding-top: 6rem;
  display: none;
}

/* Popular Cards */
.popular-container {
  padding: 1rem 0 1rem;
  direction: rtl;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  row-gap: 10px;
}

.popular-card {
  background-color: var(--container-color);
  border-radius: 1rem;
  direction: rtl;
  box-shadow: 0px 0px 8px #444343;
  width: 140px;
  height: fit-content;
  padding: 0.2rem 0.5rem 0.1rem;
  margin: 5px auto;
  transition: 0.4s;
  cursor: pointer;
  max-height: 280px;
  min-height: 280px;
  overflow: hidden;
}

.dark-theme .popular-card {
  box-shadow: none;
}

.popular-img {
  border-radius: 1rem;
  margin-bottom: 1rem;
}

.popular-data {
  padding: 0 1rem 0 0.5rem;
}

.popular-price {
  color: #F4AB20;
  margin-bottom: 0.25rem;
  font-family: var(--eng-font);
  font-size: 14px;
}

.dark-theme .popular-price {
  color: white;
}

.popular-price span {
  color: var(--text-color);
  font-family: var(--font-family);
}

.popular-title {
  margin-bottom: 0.75rem;
  color: #2F3B39;
  font-size: 16px;
}

.dark-theme .popular-title {
  color: white;
}

.popular-description {
  font-size: 12px;
  max-height: 40px;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

/* ====================== POPUP MODAL ====================== */
.popup-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(6px);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

.popup-box {
  background: white;
  padding: 25px;
  border-radius: 14px;
  width: 85%;
  max-width: 420px;
  text-align: center;
  position: relative;
}

.dark-theme .popup-box {
  background: #111;
  color: white;
}

.popup-close {
  position: absolute;
  top: 0px;
  right: 7px;
  font-size: 28px;
  cursor: pointer;
}

/* ====================== FOOTER ====================== */
.footer {
  background-color: #44434308;
  padding: 70px 0 0;
  text-align: center;
  font-family: var(--font-family);
  direction: rtl;
}

.dark-theme .footer {
  background: linear-gradient(170deg, hsl(0, 0%, 22%) 0%, hsl(0, 0%, 6%) 30%);
}

.footer .container {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 50px;
}

.footer .box h3 {
  color: #c38154;
  font-size: 40px;
  margin: 0 0 10px;
  text-align: center;
  letter-spacing: 1px;
}

.dark-theme .footer .box h3 {
  color: white;
}

.footer .box .social {
  display: flex;
  justify-content: center;
}

.footer .box .social li {
  margin-right: 10px;
}

.footer .box .social li a {
  justify-content: center;
  align-items: center;
  display: inline-flex;
  color: white;
  font-size: 20px;
  width: 35px;
  height: 35px;
  transition: 0.3s;
  border-radius: 12px;
}

.footer .box .social .facebook,
.dark-theme .footer .box .social .facebook {
  background-color: #F4AB20;
}

.footer .box .social .instagram,
.dark-theme .footer .box .social .instagram {
  background-color: #F4AB20;
}

.footer .box .text {
  margin-top: 15px;
  margin-bottom: 15px;
  line-height: 1.6;
  color: #777;
}

.dark-theme .footer .box .text {
  color: white;
}

.footer .box .line {
  display: flex;
  align-items: center;
  margin-bottom: 40px;
  margin-top: 10px;
  color: #777;
  flex-direction: column;
}

.dark-theme .footer .box .line {
  color: white;
}

.footer .box .line:last-child {
  margin-bottom: 0;
}

.footer .box .line i {
  margin-right: 10px;
  color: #F4AB20;
  font-size: 40px;
  margin-bottom: 15px;
}

.dark-theme .footer .box .line i {
  color: #F4AB20;
}

.footer .box .line .info {
  line-height: 1.7;
  font-size: 16px;
}

.footer .box .line .info span {
  display: block;
  font-family: var(--eng-font);
  direction: ltr;
}

.whatsapp-contact {
  font-family: var(--font-family) !important;
  direction: ltr;
}

.footer .copyright {
  padding: 25px 0;
  text-align: center;
  color: #777;
  margin: 20px 0 0;
  border-top: 1px solid #777;
  font-size: 16px;
  padding-bottom: 100px;
  font-family: var(--eng-font);
}

.dark-theme .footer .copyright {
  color: white;
  border-color: white;
}

.footer .copyright i {
  color: #F4AB20;
  margin: 0 3px;
}

.dark-theme .footer .copyright i {
  color: white;
}

/* ====================== SCROLLBAR ====================== */
::-webkit-scrollbar {
  width: 0;
  border-radius: 0.5rem;
  background-color: hsl(228, 8%, 96%);
}

::-webkit-scrollbar-thumb {
  border-radius: 0.5rem;
  background-color: hsl(228, 8%, 64%);
}

::-webkit-scrollbar-thumb:hover {
  background-color: hsl(228, 8%, 54%);
}

/* ====================== SCROLL UP ====================== */
.scrollup {
  position: fixed;
  right: 1rem;
  bottom: -30%;
  background-color: var(--container-color);
  box-shadow: 0 8px 12px hsla(228, 66%, 45%, 0.1);
  display: inline-flex;
  padding: 0.35rem;
  border-radius: 0.25rem;
  color: #F4AB20;
  font-size: 1.25rem;
  z-index: var(--z-tooltip);
  transition: 0.3s;
}

.show-scroll {
  bottom: 8rem;
}

/* ====================== RESPONSIVE ====================== */
@media screen and (max-width: 350px) {
  .container {
    margin-left: 1rem;
    margin-right: 1rem;
  }

  .section {
    padding: 3.5rem 0 1rem;
  }
}

@media screen and (max-width: 320px) {
  .nav-menu {
    padding: 1.3rem 1.5rem;
  }

  .popular-card {
    width: 230px;
    padding: 0.5rem 0.5rem 0.75rem;
  }
}

@media screen and (min-width: 1023px) {
  .section {
    padding: 7.5rem 0 1rem;
  }

  .section-title {
    font-size: 2.25rem;
  }

  .section-subtitle {
    font-size: var(--normal-font-size);
  }

  .nav {
    height: calc(var(--header-height) + 1.5rem);
  }

  .nav-menu {
    width: initial;
    margin-left: auto;
  }

  .nav-list {
    display: flex;
    column-gap: 3rem;
  }

  .nav-link {
    color: var(--text-color-light);
  }

  .nav-link i {
    display: none;
  }

  .nav-boutton {
    display: block;
  }

  .active-link {
    background: none;
    box-shadow: none;
    color: var(--first-color);
    font-weight: var(--font-medium);
  }

  .change-theme {
    margin: 0 3rem;
    color: var(--text-color-light);
  }

  .scroll-header .nav-link,
  .scroll-header .change-theme {
    color: var(--text-color);
  }

  .scroll-header .active-link {
    color: var(--first-color);
  }

  .popular-container {
    padding-top: 3rem;
  }

  .popular-card {
    width: 320px;
    padding: 0.75rem 0.75rem 2rem;
  }

  .popular-data {
    padding: 0 0.25rem 0 0.75rem;
  }

  .show-scroll {
    bottom: 3rem;
    right: 3rem;
  }
}

@media screen and (min-width: 1040px) {
  .container {
    margin-left: auto;
    margin-right: auto;
  }
}

@media screen and (min-width: 2048px) {
  body {
    zoom: 1.5;
  }
}

@media screen and (min-width: 3840px) {
  body {
    zoom: 2;
  }
}