* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

header {
  padding-block: calc(0.1rem + 0.7vw);
  padding-inline: 1rem 0.3rem; /* start (LTR: left) → end (LTR: right) */
}

:root {
  --primary-color: #465122;
  --secondary-color: #b5b58d;
}

body {
  background-color: var(--primary-color);
  width: 100%;
  overflow-x: hidden;
}

header {
  padding-top: 1.3vw;
}

@media (max-width: 768px) {
  header {
    border-bottom: 1px solid #7a8d3e;
  }
}

footer {
  border-top: 1px solid #7a8d3e;
}

/* Add this to your CSS file */
.overflow-hidden {
  overflow: hidden !important;
}

.preloader {
  height: 100vh;
  width: 100vw;
  background-color: var(--primary-color);
  position: fixed;   /* <-- Use fixed instead of absolute */
  top: 0;
  left: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 1;
  transition: opacity 0.5s cubic-bezier(0.77, 0, 0.175, 1), visibility 0.5s;
  /* smooth fade out */
}

.preloader.hide {
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
}

.preloader svg {
  width: calc(8rem + 8vw);
}

.preloader-svg path {
  stroke: #b5b58d;
  stroke-width: 7;
  fill: transparent;
  animation: draw 2s forwards;
  transition: fill 0.5s ease-in-out;
}

.preloader-svg path.filled {
  fill: #b5b58d;
}

@keyframes draw {
  to {
    stroke-dashoffset: 0;
  }
}

.page-content {
display: none;  
transition: opacity 0.5s cubic-bezier(0.77, 0, 0.175, 1);
}

.page-content.visible {
  opacity: 1;
}

.logo {
  width: calc(2rem + 1.5vw);
}

.ic {
  font-size: 1.5rem;
}

#searchInput {
  border-radius: 1000px;
}

#searchInput::placeholder {
  color: var(--primary-color); /* Change to your desired placeholder color */
  opacity: 1; /* Optional: ensure full visibility */
}
#searchInput {
  color: var(--primary-color); /* Change to your desired placeholder color */
}

.languageModal {
  background-color: var(--secondary-color);
}

.bg-primary-custom {
  background-color: var(--primary-color);
}

.bg-secondary-custom {
  background-color: var(--secondary-color);
}
.text-primary-custom {
  color: var(--primary-color);
}
.text-secondary-custom {
  color: var(--secondary-color);
}
.border-primary-custom {
  border-color: var(--primary-color);
}
.border-secondary-custom {
  border-color: var(--secondary-color);
}

.category-scroll {
  padding-inline-start: 1rem !important;
  padding-inline-end: 1rem !important;

  scrollbar-width: thin;
  scrollbar-color: rgba(181, 181, 141, 0.5) rgba(70, 81, 34, 0.1);
}

.category-scroll::-webkit-scrollbar {
  height: 6px;
}

.category-scroll::-webkit-scrollbar-track {
  background: rgba(70, 81, 34, 0.1);
  border-radius: 3px;
}

.category-scroll::-webkit-scrollbar-thumb {
  background: rgba(181, 181, 141, 0.5);
  border-radius: 3px;
}

.category-active {
  background-color: #b5b58d !important;
  color: #465122 !important;
  font-weight: 600;
  transform: scale(1.05);
  box-shadow: 0 4px 8px rgba(70, 81, 34, 0.3);
}

.category-inactive {
  background-color: rgba(181, 181, 141, 0.2);
  color: #b5b58d;
  border: 1px solid rgba(181, 181, 141, 0.3);
}

.category-inactive img {
  filter: invert(87%) sepia(11%) saturate(296%) hue-rotate(34deg)
    brightness(91%) contrast(85%);
}

.category-active img {
  filter: invert(24%) sepia(29%) saturate(607%) hue-rotate(33deg)
    brightness(89%) contrast(86%);
}

.category-inactive:hover {
  background-color: rgba(181, 181, 141, 0.3);
  transform: translateY(-1px);
}

.rtl {
  direction: rtl;
}
.line-clamp-2 {
  display: -webkit-box;
  /* -webkit-line-clamp: 2; */
  -webkit-box-orient: vertical;
  overflow: hidden;
}

#allCategoriesContainer h2 {
  padding-inline-start: 1rem !important;
  padding-inline-end: 1rem !important;
}

.items-scroll {
  padding-inline-start: 1rem !important;
  padding-inline-end: 1rem !important;
  scrollbar-width: thin;
  scrollbar-color: rgba(181, 181, 141, 0.5) rgba(70, 81, 34, 0.1);
}

.items-scroll::-webkit-scrollbar {
  height: 6px;
}

.items-scroll::-webkit-scrollbar-track {
  background: rgba(70, 81, 34, 0.1);
  border-radius: 3px;
}

.items-scroll::-webkit-scrollbar-thumb {
  background: rgba(181, 181, 141, 0.5);
  border-radius: 3px;
}

.imgItems {
  width: calc(3rem + 4vw);
  height: calc(3rem + 4vw);

  min-width: 90px;
  min-height: 90px;
}

/* General transitions for all buttons and elements with cursor-pointer */
button,
.cursor-pointer {
  transition: all 0.3s ease-in-out;
}

/* Specific transitions for category images' filter property */
.category-inactive img,
.category-active img {
  transition: filter 0.3s ease-in-out;
}

/* Ensure category active/inactive states transition smoothly */
.category-active,
.category-inactive {
  transition: background-color 0.3s ease-in-out, color 0.3s ease-in-out,
    font-weight 0.3s ease-in-out, transform 0.3s ease-in-out,
    box-shadow 0.3s ease-in-out, border 0.3s ease-in-out;
}

/* Ensure item cards transition smoothly and add a subtle hover effect */
.items-scroll > div {
  /* Targeting the card div inside items-scroll */
  transition: background-color 0.3s ease-in-out, border-color 0.3s ease-in-out,
    transform 0.1s ease-in-out;
}

.items-scroll > div:hover {
  transform: translateY(-2px);
}

/* MODAL STYLES */
.modal-overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.7); /* Darker overlay */
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease-in-out, visibility 0.3s ease-in-out;
}

.modal-overlay.is-active {
  opacity: 1;
  visibility: visible;
}

.modal-content {
  background-color: var(
    --primary-color
  ); /* Use primary color for modal background */
  border: 1px solid var(--secondary-color);
  border-radius: 1rem; /* Larger border-radius */
  padding: 1.5rem; /* More padding */
  max-width: 28rem; /* Max width for consistency */
  width: 100%;
  margin: 0 1rem; /* Margin for smaller screens */
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3); /* Stronger shadow */
  transform: translateY(20px);
  opacity: 0;
  transition: transform 0.3s ease-in-out, opacity 0.3s ease-in-out;
}

.modal-overlay.is-active .modal-content {
  transform: translateY(0);
  opacity: 1;
}

/* Close button styling within modals */
.modal-close-button {
  color: var(--primary-color);
  height: 35px;
  width: 35px;
  border-radius: 9999px; /* Full rounded */
    background-color: var(--secondary-color);
  color: var(--primary-color);
  transition: background-color 0.2s ease-in-out, color 0.2s ease-in-out;
  border: 1px solid var(--primary-color);
}

.modal-close-button:hover {
  background-color: var(--secondary-color);
  color: var(--primary-color);
}

/* General button styles within modals */
.modal-button-primary {
  background-color: var(--secondary-color);
  color: var(--primary-color);
  padding: 0.65rem 1.25rem; /* Slightly more padding */
  border-radius: 0.5rem; /* More rounded */
  font-weight: 600; /* Semibold */
  transition: background-color 0.2s ease-in-out, transform 0.1s ease-in-out;
}

.modal-button-primary:hover {
  background-color: rgba(181, 181, 141, 0.9);
  transform: translateY(-1px);
}

.modal-button-secondary {
  border: 1px solid var(--secondary-color);
  color: var(--secondary-color);
  padding: 0.65rem 1.25rem; /* Slightly more padding */
  border-radius: 0.5rem; /* More rounded */
  font-weight: 500; /* Medium */
  transition: background-color 0.2s ease-in-out, color 0.2s ease-in-out,
    transform 0.1s ease-in-out;
}

.modal-button-secondary:hover {
  background-color: rgba(181, 181, 141, 0.2);
  transform: translateY(-1px);
}

/* Input/textarea styles within modals */
.modal-input {
  background-color: rgba(181, 181, 141, 0.2);
  border: 1px solid var(--secondary-color);
  color: var(--secondary-color);
  padding: 0.75rem;
  border-radius: 0.5rem; /* More rounded */
  width: 100%;
  transition: border-color 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

.modal-input::placeholder {
  color: rgba(181, 181, 141, 0.7);
}

.modal-input:focus {
  outline: none;
  border-color: var(--secondary-color);
  box-shadow: 0 0 0 2px rgba(181, 181, 141, 0.3);
}

.ggg {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
/* New style for active language button */
.secondary-modal-btn {
  background-color: var(--secondary-color) !important;
  color: var(--primary-color) !important;
  font-weight: 600;
  transform: scale(1.02); /* Slightly larger to indicate active */
  box-shadow: 0 2px 4px rgba(70, 81, 34, 0.2);
  padding: 0.7rem 0;
  border-radius: 100px;
  max-width: 150px;
  margin: auto;
  display: flex;
  justify-content: center;
  align-items: center;
}
.secondary-modal-btn:hover {
  background-color: #9f9f7b !important;
}

.modal-button-secondary-edit {
  display: block;
  border: none;
  border-radius: 100px;
  max-width: 150px;

  background-color: rgba(181, 181, 141, 0.2);
  color: #b5b58d;
  border: 1px solid rgba(181, 181, 141, 0.3);
}

.modal-button-secondary-edit:hover {
  background-color: var(--secondary-color);
  color: var(--primary-color);
}

@media (max-width: 768px) {
  .mobile-scroll {
    overflow-x: auto;

    display: grid;
    grid-auto-flow: column;
    /* Items flow in columns first */
    grid-template-rows: repeat(2, minmax(0, 1fr));
    /* Two rows, equal height */
    gap: 0.7rem;
    /* Corresponds to Tailwind's gap-4 */
    /* Ensure items have a minimum width to enable horizontal scroll */
    grid-auto-columns: minmax(280px, 1fr);
  }

  .mobile-scroll > div {
    flex: 0 0 280px;
  }

  .category-scroll {
    overflow: hidden;
    scrollbar-width: none; /* Firefox */
  }

  .category-scroll::-webkit-scrollbar {
    display: none; /* Chrome, Safari */
  }

  .items-scroll {
    scrollbar-width: none; /* Firefox */
  }

  .items-scroll::-webkit-scrollbar {
    display: none; /* Chrome, Safari */
  }
}



/* Modal background */
#itemModal .modal-content {
  background-color: #465122 !important;
}

/* Cards inside modal */
#modalItemsContainer > div {
  background-color: #b5b58d !important;
  color: #465122 !important;
  /* Optional: for consistent look */
  border-radius: 16px;
  box-shadow: 0 2px 16px 0 rgba(0,0,0,0.07);
  border: none;
}

/* Card text color */
#modalItemsContainer > div,
#modalItemsContainer > div * {
  color: #465122 !important;
}

/* Close button icon (if needed) */
#itemModal .modal-close-button i {
  color: #465122 !important;
}

/* (Optional) Change input or badge colors if needed */
#modalItemsContainer .bg-yellow-600 {
  background-color: #c09c3c !important;
}
#modalItemsContainer .text-yellow-100 {
  color: #fffbe6 !important;
}


/* Scrollbar Styles */
.scrollbar-thin::-webkit-scrollbar {
  width: 6px;
}
.scrollbar-thin::-webkit-scrollbar-thumb {
  background-color: var(--secondary-color); /* slate-500 */
  border-radius: 9999px;
}
.scrollbar-thin::-webkit-scrollbar-track {
  background-color: transparent;
}
