/* ============================================
   OFFER CAROUSEL - Simple Grid Layout
   ============================================ */

/* Main Wrapper */
.offer-carousel-wrapper {
  position: relative;
  width: 100%;
  overflow: visible;
  padding: 40px 20px;
  background: transparent;
  box-sizing: border-box;
  display: block;
}

/* Prevent any wrapping inside wrapper */
.offer-carousel-wrapper * {
  box-sizing: border-box;
}

/* Container that holds the items - now a grid with multiple rows */
.offer-carousel-wrapper .text-with-image__icons_container.offer-carousel-track {
  position: relative;
  display: grid !important;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  grid-auto-rows: min-content;
  gap: 30px;
  width: 100% !important;
  opacity: 1 !important;
  transition: none;
  will-change: auto;
  transform: none !important;
  overflow: visible !important;
  max-width: 100% !important;
}

/* Override any conflicting styles from main.css */
.offer-carousel-wrapper .text-with-image__icons-item.offer-carousel-item {
  flex: unset !important;
  flex-shrink: unset !important;
  flex-grow: unset !important;
}

/* Individual Carousel Items */
.offer-carousel-item {
  flex: unset !important;
  width: auto !important;
  min-width: unset !important;
  max-width: unset !important;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 35px 25px;
  box-sizing: border-box;
  opacity: 1;
  transform: none;
  transition: all 0.3s ease;
  position: relative;
  background: transparent;
  border-radius: 0;
  border: none;
  flex-shrink: 0 !important;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  height: auto;
  min-height: auto;
}

/* Remove separator - not needed in grid */
.offer-carousel-item::after {
  display: none;
}

/* Active item styling - all items are visible in grid */
.offer-carousel-item.is-active {
  opacity: 1;
  transform: none;
}

/* Hover effects */
.offer-carousel-item:hover {
  opacity: 1;
  transform: translateY(-5px);
  z-index: 2;
}

.offer-carousel-item:hover .icons-item__icon {
  transform: translateY(-3px);
  box-shadow: none;
}

/* Icon styling enhancements */
.offer-carousel-item .icons-item__icon {
  transition: all 0.4s ease;
  border-radius: 0;
  overflow: visible;
  box-shadow: none;
  background: transparent;
  padding: 0;
}

.offer-carousel-item .icons-item__icon img {
  border-radius: 0;
  transition: all 0.4s ease;
}

.offer-carousel-item:hover .icons-item__icon img {
  transform: scale(1.05);
  filter: brightness(1.05);
}

/* Text styling */
.offer-carousel-item h4 {
  transition: color 0.3s ease, transform 0.3s ease;
}

.offer-carousel-item:hover h4 {
  transform: translateY(-2px);
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

/* Responsive Grid Layout - Multiple rows based on screen size */
@media (min-width: 1200px) {
  .offer-carousel-wrapper .text-with-image__icons_container.offer-carousel-track {
    grid-template-columns: repeat(3, 1fr);
    grid-auto-rows: min-content;
  }

  .offer-carousel-wrapper {
    padding: 40px 40px;
  }
}

@media (min-width: 768px) and (max-width: 1199px) {
  .offer-carousel-wrapper .text-with-image__icons_container.offer-carousel-track {
    grid-template-columns: repeat(2, 1fr);
    grid-auto-rows: min-content;
  }

  .offer-carousel-wrapper {
    padding: 40px 30px;
  }

  .offer-carousel-wrapper .text-with-image__icons_container.offer-carousel-track {
    gap: 25px;
  }
}

@media (max-width: 767px) {
  .offer-carousel-wrapper {
    padding: 30px 20px;
  }

  .offer-carousel-wrapper .text-with-image__icons_container.offer-carousel-track {
    grid-template-columns: 1fr;
    grid-auto-rows: min-content;
    gap: 20px;
  }

  .offer-carousel-item {
    padding: 25px 20px;
  }
}

/* ============================================
   NAVIGATION BUTTONS - Hidden
   ============================================ */

.carousel-btn {
  display: none !important;
}

.carousel-btn-prev {
  display: none !important;
}

.carousel-btn-next {
  display: none !important;
}

/* ============================================
   DOTS NAVIGATION - Hidden
   ============================================ */

.carousel-dots {
  display: none !important;
}

.carousel-dot {
  display: none !important;
}

.carousel-dot.active {
  display: none !important;
}

/* ============================================
   LAYOUT & ALIGNMENT
   ============================================ */

.text-with-image__icons_container.offer-carousel-track {
  align-items: stretch;
  display: grid !important;
  gap: 30px;
  width: 100% !important;
  max-width: 100% !important;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  grid-auto-rows: min-content;
  overflow: visible !important;
}

/* Fix for nested structure */
.offer-carousel-item.text-with-image__icons-item {
  flex: unset !important;
  width: auto !important;
  min-width: unset !important;
  max-width: unset !important;
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  flex-shrink: 0 !important;
}

.offer-carousel-item .text-with-image__icons-item {
  width: 100%;
  margin: 0;
}

/* Ensure proper sizing for icons */
.offer-carousel-item .icons-item__icon {
  width: 100%;
  max-width: 200px;
  height: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
}

.offer-carousel-item .icons-item__icon img {
  width: 100%;
  height: auto;
  max-height: 150px;
  object-fit: contain;
}

/* Title spacing */
.offer-carousel-item h4 {
  width: 100%;
  margin: 15px 0;
  min-height: 60px !important;
  height: auto !important;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 0 10px;
  line-height: 1.4;
}

/* Force proper sizing for images */
.offer-carousel-item .icons-item__icon img[style*="height"] {
  height: auto !important;
}

/* Loading & Transitioning States */
.offer-carousel-wrapper[data-loading="true"] .carousel-btn,
.offer-carousel-wrapper[data-loading="true"] .carousel-dots {
  opacity: 0.4;
  pointer-events: none;
}

.offer-carousel-wrapper[data-transitioning="true"] .carousel-btn {
  pointer-events: none;
}

/* ============================================
   ACCESSIBILITY
   ============================================ */

.carousel-btn:focus-visible {
  outline: 3px solid rgba(255, 255, 255, 0.8);
  outline-offset: 3px;
}

.carousel-dot:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.8);
  outline-offset: 2px;
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  .offer-carousel-track,
  .offer-carousel-item,
  .carousel-btn,
  .carousel-dot {
    transition: none !important;
    animation: none !important;
  }
}

/* ============================================
   ENHANCED BUTTON & CONTENT STYLING
   ============================================ */

/* Offer Description Container */
.offer-carousel-item .offer-desc {
  margin-top: 25px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 15px;
  width: 100%;
  max-width: 280px;
  padding: 0;
  background: transparent;
  border-radius: 0;
  transition: all 0.4s ease;
  border: none;
  box-sizing: border-box;
}

.offer-carousel-item:hover .offer-desc {
  background: transparent;
  border: none;
  transform: none;
  box-shadow: none;
}

/* See More Button Enhancement */
.offer-desc .see-more-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 32px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-decoration: none;
  color: #fff;
  background: linear-gradient(135deg, rgba(216, 217, 188, 0.25), rgba(216, 217, 188, 0.15));
  border: 2px solid rgba(216, 217, 188, 0.35);
  border-radius: 30px;
  transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  position: relative;
  overflow: hidden;
  cursor: pointer;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  min-width: 140px;
  text-align: center;
}

.see-more-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.5s ease;
}

.see-more-btn:hover::before {
  left: 100%;
}

.see-more-btn:hover {
  background: linear-gradient(135deg, rgba(216, 217, 188, 0.35), rgba(216, 217, 188, 0.25));
  border-color: rgba(216, 217, 188, 0.5);
  box-shadow: 0 6px 25px rgba(0, 0, 0, 0.2);
  transform: translateY(-2px) scale(1.05);
  color: #fff;
}

.see-more-btn:active {
  transform: translateY(0) scale(0.98);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
}

/* Add arrow icon effect */
.see-more-btn::after {
  content: '→';
  margin-left: 8px;
  transition: transform 0.3s ease;
  display: inline-block;
}

.see-more-btn:hover::after {
  transform: translateX(4px);
}

/* RTL Support for Arabic */
[dir="rtl"] .see-more-btn::after {
  content: '←';
  margin-left: 0;
  margin-right: 8px;
}

[dir="rtl"] .see-more-btn:hover::after {
  transform: translateX(-4px);
}

/* ============================================
   RESPONSIVE ENHANCEMENTS
   ============================================ */

@media (max-width: 991px) {
  .offer-carousel-item .offer-desc {
    padding: 20px 15px;
    max-width: 260px;
  }

  .offer-desc .see-more-btn {
    padding: 12px 26px;
    font-size: 13px;
    min-width: 130px;
  }
}

@media (max-width: 767px) {
  .offer-carousel-item .offer-desc {
    padding: 20px 15px;
    margin-top: 15px;
    max-width: 100%;
  }

  .offer-desc .see-more-btn {
    padding: 12px 28px;
    font-size: 13px;
    width: auto;
    min-width: 150px;
    text-align: center;
  }
}

/* ============================================
   ADDITIONAL POLISH
   ============================================ */

/* Remove background - keep it clean and transparent */
.offer-carousel-wrapper {
  background: transparent !important;
}

/* Ensure images load properly */
.offer-carousel-item .icons-item__icon img {
  opacity: 1;
}

@keyframes fadeIn {
  to {
    opacity: 1;
  }
}

/* Smooth focus states for accessibility */
.offer-carousel-item:focus-within {
  outline: 2px solid rgba(216, 217, 188, 0.5);
  outline-offset: 4px;
  border-radius: 12px;
}

/* Enhance text readability */
.offer-carousel-item h4 {
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* No dragging state needed */
.offer-carousel-wrapper.is-dragging {
  cursor: default !important;
}

.offer-carousel-wrapper.is-dragging .offer-carousel-item {
  pointer-events: auto;
  user-select: auto;
}

.offer-carousel-wrapper.is-dragging .offer-carousel-track {
  transition: auto !important;
}

/* ============================================
   RESPONSIVE MOBILE ENHANCEMENTS
   ============================================ */

@media (max-width: 480px) {
  .offer-carousel-wrapper {
    padding: 30px 15px;
  }

  .offer-carousel-item {
    padding: 25px 15px;
  }

  .offer-carousel-item .icons-item__icon {
    max-width: 120px;
  }

  .offer-carousel-item h4 {
    font-size: 18px;
    min-height: 50px !important;
  }

  .offer-desc .see-more-btn {
    padding: 10px 22px;
    font-size: 12px;
    min-width: 120px;
  }
}

/* Tablet landscape optimization */
@media (min-width: 768px) and (max-width: 1024px) {
  .offer-carousel-wrapper {
    padding: 40px 25px;
  }

  .offer-carousel-item {
    padding: 30px 20px;
  }
}

/* Large desktop optimization */
@media (min-width: 1440px) {
  .offer-carousel-wrapper {
    padding: 50px 60px;
  }

  .offer-carousel-wrapper .text-with-image__icons_container.offer-carousel-track {
    gap: 40px;
  }
}
