/**
 * Coupon Slider Widget Styles
 * Version: 1.0.0
 * Date: 2025.12.05
 * Default styling to match original design
 */

/* Slider Wrapper */
.mg-coupon-slider-wrapper {
  width: 100%;
  position: relative;
}

.mg-coupon-slider {
  width: 100%;
  overflow: hidden;
}

.mg-coupon-slider .swiper-wrapper {
  display: flex;
  align-items: stretch;
}

.mg-coupon-slider .swiper-slide {
  height: auto;
  display: flex;
  width: 100%;
  flex-shrink: 0;
}

/* Coupon Card */
.mg-coupon-card {
  width: 100%;
  padding: 0.75rem;
  margin-bottom: 0.75rem;
  background-color: var(--mg-color-neutral-50, #e8e8e8);
  display: flex;
  flex-direction: column;
  height: 100%;
  border: none !important; /* Remove hard-coded border - use Elementor Style tab Border control instead */
}

.mg-coupon-card-inner {
  background-color: #ffffff;
  padding: 1.5rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.mg-coupon-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  /* min-height removed - let content determine height */
  justify-content: flex-start; /* Changed from space-between to allow margin controls to work */
}

/* Subtitle */
.mg-coupon-subtitle {
  margin: 0;
  color: var(--mg-color-secondary, #3ec8fd);
  font-size: 1.25rem;
  line-height: 1.75rem;
  font-weight: 400;
  text-transform: capitalize;
}

.mg-coupon-subtitle h3 {
  margin: 0;
  font-size: inherit;
  line-height: inherit;
  font-weight: inherit;
  color: inherit;
}

/* Title */
.mg-coupon-title {
  margin: 0;
  color: var(--mg-color-primary, #124780);
  font-size: 2.25rem;
  line-height: 2.25rem;
  font-weight: 700;
  display: block;
}

/* Button */
.mg-coupon-button {
  display: block;
  margin: 0 auto;
  padding: 0.75rem 2rem;
  background-color: var(--mg-color-primary, #124780);
  color: #ffffff;
  text-decoration: none;
  font-weight: 700;
  text-transform: uppercase;
  border: none;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.mg-coupon-button:hover {
  background-color: var(--mg-color-primary-dark, #0f3a68);
  color: #ffffff;
}

/* Expires Date */
.mg-coupon-expires {
  margin: 0;
  color: var(--mg-color-secondary, #3ec8fd);
  font-size: 1rem;
  line-height: 1.1875rem;
  font-weight: 400;
}

/* Fine Print */
.mg-coupon-fine-print {
  margin: 0;
  color: var(--mg-color-secondary, #3ec8fd);
  font-size: 0.875rem;
  line-height: 1.1875rem;
  font-weight: 300;
}

/* Pagination */
.mg-coupon-pagination {
  position: relative !important;
  margin-top: 1rem !important;
  text-align: center !important;
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
  height: auto !important;
  min-height: 20px !important;
}

.mg-coupon-pagination .swiper-pagination-bullet {
  width: 12px !important;
  height: 12px !important;
  background-color: var(--mg-color-neutral-400, #8c8c8c) !important;
  opacity: 0.5 !important;
  margin: 0 4px !important;
  transition: opacity 0.2s ease, background-color 0.2s ease !important;
  display: inline-block !important;
  visibility: visible !important;
}

.mg-coupon-pagination .swiper-pagination-bullet-active {
  opacity: 1 !important;
  background-color: var(--mg-color-primary, #124780) !important;
}

/* Grid Mode */
.mg-coupon-slider.mg-coupon-grid .swiper-wrapper {
  display: grid;
  grid-template-columns: repeat(var(--grid-columns, 3), 1fr);
  gap: 1.5rem;
  width: 100%;
}

.mg-coupon-slider.mg-coupon-grid .swiper-slide {
  width: 100% !important;
  height: auto;
}

.mg-coupon-slider.mg-coupon-grid .mg-coupon-card {
  margin-bottom: 0;
}

.mg-coupon-slider.mg-coupon-grid .mg-coupon-pagination {
  display: none !important;
}

@media (max-width: 1024px) {
  .mg-coupon-slider.mg-coupon-grid .swiper-wrapper {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.25rem;
  }
}

@media (max-width: 767px) {
  .mg-coupon-slider.mg-coupon-grid .swiper-wrapper {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
}

/* Clickable Card (for modal) */
.mg-coupon-clickable {
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.mg-coupon-clickable:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* Modal Styles */
.mg-coupon-modal {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  z-index: 999999 !important;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 0;
  overflow-y: auto;
  margin: 0 !important;
  max-width: none !important;
  max-height: none !important;
}

.mg-coupon-modal-overlay {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  background-color: rgba(0, 0, 0, 0.95);
  backdrop-filter: blur(5px);
  z-index: 999998 !important;
}

.mg-coupon-modal-content {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  background-color: #ffffff;
  border-radius: 0;
  padding: 3rem 2rem 2rem;
  margin: 0 !important;
  overflow-y: auto;
  z-index: 999999 !important;
  box-shadow: none;
  animation: mgModalFadeIn 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

@keyframes mgModalFadeIn {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.mg-coupon-modal-close {
  position: fixed !important;
  top: 1rem !important;
  right: 1rem !important;
  background: rgba(255, 255, 255, 0.9);
  border: 2px solid #333;
  font-size: 2.5rem;
  line-height: 1;
  color: #333;
  cursor: pointer;
  padding: 0.5rem;
  width: 3rem;
  height: 3rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  z-index: 1000000 !important;
  border-radius: 50%;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.mg-coupon-modal-close:hover {
  background: #fff;
  color: #000;
  transform: scale(1.1);
  border-color: #000;
}

.mg-coupon-modal-body {
  width: 100%;
  max-width: 800px;
  margin: 0 auto;
}

/* Modal uses same classes as coupon cards for consistent styling */
.mg-coupon-modal-body .mg-coupon-card-inner {
  background-color: transparent;
  padding: 2rem;
  box-shadow: none;
  border: none;
}

.mg-coupon-modal-body .mg-coupon-container {
  /* Inherits all styles from .mg-coupon-container via Elementor */
  /* Elementor styles will apply automatically */
  min-height: auto;
}

/* Ensure modal coupon elements inherit Elementor widget styles */
.mg-coupon-modal-body .mg-coupon-subtitle,
.mg-coupon-modal-body .mg-coupon-title,
.mg-coupon-modal-body .mg-coupon-expires,
.mg-coupon-modal-body .mg-coupon-fine-print,
.mg-coupon-modal-body .mg-coupon-button {
  /* All styles inherited from Elementor widget settings */
}

.mg-coupon-modal-form {
  margin-top: 1.5rem;
  width: 100%;
}

.mg-coupon-modal-form .gform_wrapper {
  margin: 0;
  padding: 0;
}

.mg-coupon-modal-form .gform_wrapper .gform_fields {
  grid-column-gap: 1rem;
  grid-row-gap: 1rem;
}

.mg-coupon-modal-form .gform_wrapper input[type="text"],
.mg-coupon-modal-form .gform_wrapper input[type="email"],
.mg-coupon-modal-form .gform_wrapper input[type="tel"],
.mg-coupon-modal-form .gform_wrapper textarea {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid #ddd;
  border-radius: 4px;
}

.mg-coupon-modal-form .gform_wrapper .gform_button,
.mg-coupon-modal-form .gform_wrapper input[type="submit"] {
  width: 100%;
  padding: 0.75rem 2rem;
  background-color: var(--mg-color-primary, #124780);
  color: #ffffff;
  border: none;
  border-radius: 4px;
  font-weight: 700;
  text-transform: uppercase;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.mg-coupon-modal-form .gform_wrapper .gform_button:hover,
.mg-coupon-modal-form .gform_wrapper input[type="submit"]:hover {
  background-color: var(--mg-color-primary-dark, #0f3a68);
}

@media (max-width: 767px) {
  .mg-coupon-modal-content {
    padding: 2rem 1rem 1rem;
  }
  
  .mg-coupon-modal-body {
    max-width: 100%;
  }
  
  .mg-coupon-modal-body .mg-coupon-card-inner {
    padding: 1rem;
  }
  
  .mg-coupon-modal-close {
    top: 0.5rem;
    right: 0.5rem;
    width: 2.5rem;
    height: 2.5rem;
    font-size: 2rem;
  }
  
  .mg-coupon-modal-title {
    font-size: 1.5rem;
    line-height: 1.75rem;
  }
  
  .mg-coupon-modal-subtitle {
    font-size: 1rem;
    line-height: 1.5rem;
  }
}

/* Responsive */
@media (max-width: 1024px) {
  /* min-height already removed */
  
  .mg-coupon-title {
    font-size: 1.875rem;
    line-height: 1.875rem;
  }
}

@media (max-width: 767px) {
  .mg-coupon-card-inner {
    padding: 1.5rem 1rem;
  }
  
  .mg-coupon-subtitle {
    font-size: 1rem;
    line-height: 1.5rem;
  }
  
  .mg-coupon-title {
    font-size: 1.5rem;
    line-height: 1.5rem;
  }
  
  .mg-coupon-button {
    padding: 0.625rem 1.5rem;
    font-size: 0.875rem;
  }
}

