.gift_modal {
  --primary-color: #29951d;
  --primary-hover: #218838;
  --bg-overlay: rgba(0, 0, 0, 0.4);
  --modal-bg: #ffffff;
  --text-main: #1d1d1f;
  --text-muted: #86868b;
  --border-color: #e5e5e7;
  --pill-bg: #f5f5f7;
  --pill-active-bg: #29951d;
  --card-bg: #ffffff;
  --shadow-premium: 0 10px 30px rgba(0, 0, 0, 0.08);
  --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  background-color: #f0f2f5;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
}

.gift_modal .page-container {
  text-align: center;
}

.gift_modal .btn-primary {
  background-color: var(--primary-color);
  color: white;
  border: none;
  padding: 12px 24px;
  border-radius: 12px;
  font-size: 18px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-smooth);
  box-shadow: 0 4px 12px rgba(40, 167, 69, 0.2);
}

.gift_modal .btn-primary:hover {
  background-color: var(--primary-hover);
  transform: translateY(-2px);
}

/* Modal Overlay */
.gift_modal .modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: var(--bg-overlay);
  backdrop-filter: blur(4px);
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition-smooth);
  z-index: 1000;
}

.gift_modal .modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

/* Modal Content */
.gift_modal .modal-content {
  background-color: var(--modal-bg);
  width: 90%;
  max-width: 900px;
  border-radius: 24px;
  padding: 32px;
  position: relative;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
  transform: scale(0.95);
  transition: var(--transition-smooth);
  max-height: 90vh;
  display: flex;
  flex-direction: column;
}

.gift_modal .modal-overlay.active .modal-content {
  transform: scale(1);
}

/* Close Button */
.gift_modal .close-btn {
  position: absolute;
  top: 24px;
  left: 24px;
  /* Image shows it on the left */
  background: #f5f5f7;
  border: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  color: var(--text-muted);
  transition: var(--transition-smooth);
}

.gift_modal .close-btn:hover {
  background: #e5e5e7;
  color: var(--text-main);
}

/* Header */
.gift_modal .modal-header {
  margin-bottom: 24px;
  text-align: right;
  /* Title is on the right in RTL image */
}

.gift_modal .modal-header h2 {
  font-size: 24px;
  font-weight: 700;
  color: var(--text-main);
}

/* Categories */
.categories-wrapper {
  margin-bottom: 24px; 
  scrollbar-width: none;
  /* Hide scrollbar Firefox */
}

.gift_modal .categories-wrapper::-webkit-scrollbar {
  display: none;
  /* Hide scrollbar Chrome/Safari */
}

.gift_modal .categories-scroll {
  display: flex;
  gap: 12px;
  padding-bottom: 4px;
  min-width: max-content;
  flex-direction: row;
  /* Ensure row flow */
}

.gift_modal .category-pill {
  background: white;
  border: 1px solid var(--primary-color);
  padding: 8px 18px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition-smooth);
  color: #444;
}

.gift_modal .category-pill.active {
  background: var(--primary-color);
  color: white;
  border-color: var(--primary-color);
}

.gift_modal .category-pill:hover:not(.active) {
  background: #cbe4c7;
  border-color: #cbe4c7;
}

/* Carousel/Grid Area */
.gift_modal .products-carousel {
  position: relative;
  margin-bottom: 32px;
  box-shadow: rgba(100, 100, 111, 0.2) 0px 7px 29px 0px;
  border-radius: 30px;
  padding: 20px;
  overflow: hidden;
}

.gift_modal .icon-reyal {
  width: 18px;
  height: 18px;
  object-fit: contain;
}

.gift_modal .productSwiper {
  width: 100%;
  overflow: visible;
}

.gift_modal .custom-nav {
  color: var(--primary-color) !important;
  background: white;
  width: 38px !important;
  height: 38px !important;
  border-radius: 50%;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
  transition: var(--transition-smooth);
}

.gift_modal .custom-nav:after {
  font-size: 16px !important;
  font-weight: bold;
}

.gift_modal .custom-nav:hover {
  transform: scale(1.1);
  background-color: #f5f5f7;
}

.gift_modal .swiper-button-prev {
  right: -19px !important;
  /* In RTL prev is right arrow but usually Swiper handles this */
  left: auto !important;
}

.gift_modal .swiper-button-next {
  left: -19px !important;
  right: auto !important;
}

/* Product Card - Swiper Slide adjustment */
.gift_modal .swiper-slide {
  height: auto;
  /* Allow card to define height */
}

.gift_modal .product-card {
  width: 100%;
  /* Take full slide width */
  background: #f6f6f6;
  border: 1px solid #f0f0f0;
  border-radius: 18px;
  padding: 12px;
  text-align: center;
  transition: var(--transition-smooth);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.02);
  height: 100%;
}

.gift_modal .product-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-premium);
}

.gift_modal .product-image {
  width: 100%;
  aspect-ratio: 1/1;
  border-radius: 14px;
  overflow: hidden;
  background: #f9f9f9;
  margin-bottom: 12px;
}

.gift_modal .product-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.gift_modal .product-info {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: flex-start;
}

.gift_modal .product-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-main);
}

.gift_modal .product-price {
  font-size: 16px;
  font-weight: 700;
  color: #333;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.gift_modal .currency-icon {
  width: 18px;
  height: 18px;
  color: var(--text-muted);
}

.gift_modal .add-btn {
  margin-top: 8px;
  background: white;
  border: 1px solid var(--pill-active-bg);
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 600;
  width: 100%;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.gift_modal .add-btn:hover {
  background: #f5f5f7;
  border-color: #ccc;
}

/* Footer Action */
.gift_modal .modal-footer {
  display: flex;
  justify-content: center;
}

.gift_modal .continue-btn {
  background: var(--primary-color);
  color: white;
  border: none;
  width: 200px;
  padding: 10px;
  border-radius: 20px;
  font-size: 18px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-smooth);
  box-shadow: 0 8px 20px rgba(40, 167, 69, 0.2);
}

.gift_modal .continue-btn:hover {
  background: var(--primary-hover);
  transform: translateY(-2px);
  box-shadow: 0 10px 25px rgba(40, 167, 69, 0.3);
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .gift_modal .modal-content {
    padding: 24px 16px;
    width: 100%;
    max-width: 100%;
    border-radius: 24px 24px 0 0;
    position: fixed;
    bottom: 0;
    margin: 0;
    transform: translateY(100%);
    max-height: 85vh;
  }
  .gift_modal .products-carousel {
    border-radius: 15px;
    padding: 10px;
  }
  .modal-overlay.active .modal-content {
    transform: translateY(0);
  }

  .gift_modal .modal-overlay {
    align-items: flex-end;
  }

  .gift_modal .modal-header h2 {
    font-size: 20px;
    margin-top: 20px;
  }

  .gift_modal .close-btn {
    top: 16px;
    left: 16px;
    width: 32px;
    height: 32px;
  }

  .gift_modal .product-card {
    padding: 8px;
  }

  .gift_modal .product-title {
    font-size: 13px;
  }

  .gift_modal .product-price {
    font-size: 14px;
  }

  .gift_modal .currency-icon {
    width: 14px;
    height: 14px;
  }

  .gift_modal .add-btn {
    padding: 4px 12px;
    font-size: 13px;
  }

  .gift_modal .continue-btn {
    width: 100%;
    border-radius: 12px;
    font-size: 14px;
  }

  .gift_modal .nav-arrow,
  .gift_modal .custom-nav {
    display: none !important;
  }
}

@media (max-width: 480px) {
  .gift_modal .modal-header h2 {
    font-size: 18px;
  }

  .gift_modal .category-pill {
    padding: 6px 14px;
    font-size: 13px;
  }

  .gift_modal .products-carousel {
    margin-bottom: 24px;
  }
}
