/**
 * Discount Shortcodes Styles
 * Styles for featured discounts and category discounts shortcodes
 */

/* Common discount card styles */
.discount-card {
  background: #fff;
  border-radius: 0;
  border: 1px solid var(--hgea-color-dark-green);
  overflow: hidden;
  position: relative;
  max-width: 374px;
  width: 100%;
}

.discount-card-link {
  display: block;
  text-decoration: none;
  color: inherit;
}

.discount-card-link:hover {
  text-decoration: none;
  color: inherit;
}

/* Discount image styles */
.discount-image {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #f8f9fa;
}

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

.no-image-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  background: var(--hgea-color-light-grey);
  color: var(--hgea-color-dark-green);
  font-size: 0.9rem;
  font-weight: 500;
}

/* Discount details styles */
.discount-details {
  padding: 1.5rem;
}

.discount-title {
  margin: 0 0 0.75rem 0;
  font-size: 20px;
  font-weight: 700;
  line-height: 1.2;
  color: var(--hgea-color-dark-green);
  text-align: center;
}

.discount-description {
  margin: 0;
  color: var(--hgea-color-black);
  line-height: 1.2;
  font-size: 16px;
  text-align: center;
  text-wrap: balance;
}

/* Special styling for featured discount cards */
.discount-card.featured-discount {
  border: 1px solid var(--hgea-color-dark-green);
}

.discount-card.featured-discount .discount-title {
  color: var(--hgea-color-dark-green);
}

/* Category Discounts Container */
.discounts-by-category-container,
.featured-discounts-container {
  margin: 2rem 0;
  width: 100%;
}

.category-discounts-grid,
.featured-discounts-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  justify-content: start;
}

/* No discounts message */
.no-discounts {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--hgea-color-dark-green);
  font-size: 1.1rem;
  background: var(--hgea-color-light-grey);
  border-radius: 0;
  border: 2px dashed var(--hgea-color-mid-green);
}

.error {
  text-align: center;
  padding: 2rem 1rem;
  color: var(--hgea-color-dark-green);
  font-size: 1rem;
  background: var(--hgea-color-light-grey);
  border-radius: 0;
  border: 1px solid var(--hgea-color-dark-green);
}

.wp-block-aab-group-accordion {
  width: 100%;
}

/**
 * Single Discount Page Styles
 */

/* Discount image container styling */
.discount-image-container {
  flex: 0 0 auto !important;
  max-width: 410px;
  width: 100%;
  justify-content: flex-start !important;
}

.discount-image-container img {
  width: 100%;
  height: auto;
  object-fit: contain !important;
}

/* Add Font Awesome icons above address and phone shortcodes */
/* fas fa-map-marker-alt for address */
.discount-address-phone-url-grid .address-link:before {
  font-family: "Font Awesome 5 Free";
  font-weight: 900;
  content: "\f3c5";
  font-size: 1.5rem;
  color: var(--hgea-color-mid-green);
  display: block;
  width: 100%;
  text-align: left;
  margin-bottom: 0.5rem;
}

/* fas fa-phone for phone */
.discount-address-phone-url-grid .phone-link:before {
  font-family: "Font Awesome 5 Free";
  font-weight: 900;
  content: "\f095";
  font-size: 1.5rem;
  color: var(--hgea-color-mid-green);
  display: block;
  width: 100%;
  text-align: left;
  margin-bottom: 0.5rem;
}

/* fas fa-globe for website */
.discount-address-phone-url-grid .field-website_url:before {
  font-family: "Font Awesome 5 Free";
  font-weight: 900;
  content: "\f0ac";
  font-size: 1.5rem;
  color: var(--hgea-color-mid-green);
  display: block;
  width: 100%;
  text-align: left;
  margin-bottom: 0.5rem;
}

/* fas fa-envelope for email */
.discount-address-phone-url-grid .field-email:before {
  font-family: "Font Awesome 5 Free";
  font-weight: 900;
  content: "\f0e0";
  font-size: 1.5rem;
  color: var(--hgea-color-mid-green);
  display: block;
  width: 100%;
  text-align: left;
  margin-bottom: 0.5rem;
}

.discount-address-phone-url-grid .phone-link a,
.discount-address-phone-url-grid .address-link a,
.discount-address-phone-url-grid p,
.discount-address-phone-url-grid a {
  color: var(--hgea-color-dark-green) !important;
}

.field-discount_content {
  font-family: var(--hgea-font-montserrat);
  font-size: 16px;
  font-weight: 400;
}

.field-discount_content p {
  margin: 0px;
}

@media (max-width: 768px) {
  .category-discounts-grid,
  .featured-discounts-grid {
    grid-template-columns: repeat(1, 1fr);
  }

  .discount-image-container {
    max-width: 100%;
    margin-right: 0;
    text-align: center;
    justify-content: center !important;
  }

  .discount-image-container img {
    max-width: 100%;
  }

  .grid-container {
    width: 100%;
  }

  .discount-address-phone-url-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
    text-align: left;
    padding: 0px 0px 25px 0px;
  }

  .discount-address-phone-url-grid>div:first-child {
    grid-column: 1;
    margin-bottom: 0.5rem;
  }
}

@media (max-width: 480px) {

  .featured-discounts-grid,
  .category-discounts-grid {
    gap: 0.75rem;
  }

  .discount-details {
    padding: 1rem;
  }

  .discount-title {
    font-size: 1rem;
  }

  .featured-badge {
    font-size: 0.7rem;
    padding: 0.2rem 0.6rem;
  }

  .discount-address-phone-url-grid>div {
    font-size: 14px;
  }
}