/**
 * Freelance Mentors Product Explorer (FMPE) - Public CSS
 *
 * @package FMPE
 * @since 0.1.0
 */

/*--------------------------------------------------------------
# Variables (from Branding Style Guide)
--------------------------------------------------------------*/
:root {
  --fmpe-primary-red: #DE3B44;
  --fmpe-secondary-gold: #FFD166;
  --fmpe-dark-charcoal: #221D23;
  --fmpe-light-gray: #ECEBF3;
  --fmpe-middle-gray: #A0ACAD;
  --fmpe-white: #FFFFFF;

  --fmpe-info-bg: #E1F5FE;
  --fmpe-info-border: #29B6F6;
  --fmpe-info-text: #0277BD;

  --fmpe-text-on-red: var(--fmpe-white);
  --fmpe-text-on-gold: var(--fmpe-dark-charcoal);
  --fmpe-text-on-light-gray: var(--fmpe-dark-charcoal);
  --fmpe-text-on-white: var(--fmpe-dark-charcoal);

  --fmpe-font-family-primary: 'Roboto', sans-serif;
    --fmpe-font-weight-light: 200;
  --fmpe-font-weight-normal: 400;
  --fmpe-font-weight-bold: 700;

  --fmpe-font-size-body: 16px;
  --fmpe-font-size-h1: 24px;
  --fmpe-font-size-h2: 20px;
  --fmpe-font-size-h3: 18px;
  --fmpe-font-size-small: 14px;
  --fmpe-font-size-xsmall: 12px;

  --fmpe-border-radius: 4px;
  --fmpe-box-shadow: 0 2px 4px rgba(34, 29, 35, 0.1);
  --fmpe-hover-shadow: 0 4px 8px rgba(34, 29, 35, 0.15);

  --fmpe-spacing-unit: 15px;
  --fmpe-spacing-small: calc(var(--fmpe-spacing-unit) * 0.5);
  --fmpe-spacing-medium: var(--fmpe-spacing-unit);
  --fmpe-spacing-large: calc(var(--fmpe-spacing-unit) * 2);
  --fmpe-spacing-xlarge: calc(var(--fmpe-spacing-unit) * 3);
}

/*--------------------------------------------------------------
# Base & Typography
--------------------------------------------------------------*/
.fmpe-product-archive,
.fmpe-single-product,
.fmpe-modal-content {
  font-family: var(--fmpe-font-family-primary);
  font-size: var(--fmpe-font-size-body);
  line-height: 1.6;
  color: var(--fmpe-text-on-white);
}

.fmpe-product-archive a,
.fmpe-single-product a,
.fmpe-modal-content a {
  color: var(--fmpe-primary-red);
  text-decoration: none;
}

.fmpe-product-archive a:hover,
.fmpe-single-product a:hover,
.fmpe-modal-content a:hover {
  text-decoration: underline;
}

/* Headings */
.fmpe-product-archive h1, .fmpe-product-archive h2, .fmpe-product-archive h3,
.fmpe-single-product h3, /* h1 for single product is now in header card */
.fmpe-modal-content h1, .fmpe-modal-content h2, .fmpe-modal-content h3 {
  font-weight: var(--fmpe-font-weight-bold);
  color: var(--fmpe-primary-red);
  margin-top: 0;
  margin-bottom: var(--fmpe-spacing-medium);
}

.fmpe-product-archive h1 { font-size: var(--fmpe-font-size-h1); }
.fmpe-product-archive h2 { font-size: var(--fmpe-font-size-h2); }
.fmpe-product-archive h3,
.fmpe-single-product h3,
.fmpe-modal-content h3 { font-size: var(--fmpe-font-size-h3); }


/*--------------------------------------------------------------
# Helper Classes
--------------------------------------------------------------*/
.fmpe-required {
  color: var(--fmpe-primary-red);
  margin-left: 2px;
}

.screen-reader-text {
	border: 0;
	clip: rect(1px, 1px, 1px, 1px);
	clip-path: inset(50%);
	height: 1px;
	margin: -1px;
	overflow: hidden;
	padding: 0;
	position: absolute;
	width: 1px;
	word-wrap: normal !important;
}

/*--------------------------------------------------------------
# General UI Components
--------------------------------------------------------------*/

/* Buttons */
.fmpe-button,
button.fmpe-button {
  display: inline-flex; /* Changed to inline-flex for icon alignment */
  align-items: center; /* Vertically align icon and text */
  justify-content: center; /* Horizontally center icon and text */
  gap: var(--fmpe-spacing-small); /* Space between icon and text */
  background-color: var(--fmpe-primary-red);
  color: var(--fmpe-text-on-red);
  border: 1px solid var(--fmpe-primary-red);
  padding: var(--fmpe-spacing-small) var(--fmpe-spacing-medium);
  border-radius: var(--fmpe-border-radius);
  font-weight: var(--fmpe-font-weight-normal);
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

.fmpe-button .dashicons,
button.fmpe-button .dashicons {
  line-height: 1; /* Ensure icon aligns well */
  text-decoration: none;
  font-size: 1.2em; /* Adjust icon size if needed */
}


.fmpe-button:hover,
button.fmpe-button:hover {
  background-color: var(--fmpe-white);
  color: var(--fmpe-primary-red);
  border: 1px solid var(--fmpe-primary-red);
  text-decoration: none;
}

.fmpe-button-link {
    display: inline-block;
    padding: var(--fmpe-spacing-small) var(--fmpe-spacing-medium);
    color: var(--fmpe-primary-red);
    text-decoration: none;
    border: 1px solid transparent;
    border-radius: var(--fmpe-border-radius);
    transition: background-color 0.3s ease, color 0.3s ease;
}
.fmpe-button-link .dashicons {
    margin-left: var(--fmpe-spacing-small);
    line-height: inherit;
    text-decoration: none;
    vertical-align: middle;
}
.fmpe-button-link:hover {
    background-color: var(--fmpe-light-gray);
    text-decoration: none;
}
/* Center the submit button within its paragraph */
#fmpe-submission-form > p:has(> #fmpe-submit-product-button) {
  text-align: center;
}

/* Forms */
.fmpe-form-field {
  margin-bottom: var(--fmpe-spacing-medium);
}

.fmpe-form-field label {
  display: block;
  font-weight: var(--fmpe-font-weight-light);
  font-size: var(--fmpe-font-size-small);
  margin-bottom: var(--fmpe-spacing-small);
  color: var(--fmpe-dark-charcoal);
}

/* Ensure form elements are block-level and take full width */
.fmpe-form-field input[type="text"],
.fmpe-form-field input[type="url"],
.fmpe-form-field input[type="email"],
.fmpe-form-field input[type="search"],
.fmpe-form-field select,
.fmpe-form-field textarea,
.fmpe-form-field input[type="file"] { /* Ensuring file input is included */
  display: block; /* Make it a block element */
  width: 100%;
  padding: var(--fmpe-spacing-small);
  border: 1px solid var(--fmpe-dark-charcoal);
  border-radius: var(--fmpe-border-radius);
  background-color: var(--fmpe-white);
  box-sizing: border-box;
  font-size: var(--fmpe-font-size-body);
  color: var(--fmpe-dark-charcoal);
  margin-bottom: var(--fmpe-spacing-small); /* Add some space below each field */
}
#fmpe-submission-form p.fmpe-form-field {
    /* If it was display: flex or inline-block from theme, override: */
    display: block;
    clear: both; /* If floats were involved */
}

.fmpe-form-field input[type="text"]:focus,
.fmpe-form-field input[type="url"]:focus,
.fmpe-form-field input[type="email"]:focus,
.fmpe-form-field input[type="search"]:focus,
.fmpe-form-field select:focus,
.fmpe-form-field textarea:focus 
.fmpe-form-field input[type="file"]:focus {
  border-color: var(--fmpe-primary-red);
  outline: none;
  box-shadow: 0 0 0 2px rgba(222, 59, 68, 0.2);
}

.fmpe-form-field small,
.fmpe-scrape-message {
  display: block;
  font-size: var(--fmpe-font-size-xsmall);
  color: var(--fmpe-middle-gray);
  margin-top: var(--fmpe-spacing-small);
  clear: both;
}

.fmpe-form-message,
.fmpe-submission-message {
  padding: var(--fmpe-spacing-medium);
  margin-bottom: var(--fmpe-spacing-medium);
  border-radius: var(--fmpe-border-radius);
  border: 1px solid transparent;
}
.fmpe-form-message.success,
.fmpe-submission-message.success {
  background-color: var(--fmpe-info-bg);
  border-color: var(--fmpe-info-border);
  color: var(--fmpe-info-text);
}
.fmpe-form-message.error,
.fmpe-submission-message.error {
  background-color: #ffebee;
  border-color: var(--fmpe-primary-red);
  color: var(--fmpe-primary-red);
}

/* Dynamic Content Area (Introductions) */
.fmpe-dynamic-content-area {
    padding: var(--fmpe-spacing-medium);
    margin-bottom: var(--fmpe-spacing-medium); /* Adjusted from large */
    border-radius: var(--fmpe-border-radius);
}
.fmpe-dynamic-content-area p:last-child {
    margin-bottom: 0;
}
.fmpe-directory-intro-content.fmpe-dynamic-content-area {
    background-color: var(--fmpe-white); /* This is the white box */
    border: 1px solid var(--fmpe-light-gray);
    /* Removed margin-bottom, as toolbar will be inside */
    padding-bottom: 0; /* Padding will be on toolbar or elements inside */
}
.fmpe-category-intro-content.fmpe-dynamic-content-area {
    background-color: var(--fmpe-light-gray);
    border: 1px solid var(--fmpe-light-gray);
}

/* CPT Intro Text Styling in Submission Modal */
.fmpe-above-submission-form-content p {
  font-size: .8rem !important; /* Smaller text, !important to override block editor if needed */
  color: var(--fmpe-dark-charcoal) !important; /* Override inline style from block editor. Use your preferred dark gray */
  font-style: normal !important; /* Override the em tag's italic style if you don't want italics */
  margin-bottom: 10px !important; /* Space below this intro text */
  line-height: 1.5;
}

/* If you want to remove italics specifically from the <em> tag inside: */
.fmpe-above-submission-form-content p em {
  font-style: normal !important;
  /* The color and font-size will be inherited from the <p> tag */
}

/* Adjusting margin-top of the form itself if it's directly after this div */
#fmpe-submission-modal-content-area > div.fmpe-above-submission-form-content + form#fmpe-submission-form {
  margin-top: 0; /* Remove default top margin of the form if it's too much */
}

/* Alternative for spacing: just control the bottom margin of the div wrapper */
.fmpe-above-submission-form-content {
  margin-bottom: 0px; /* This will be the space before the form starts */
}


/*--------------------------------------------------------------
# Product List / Archive
--------------------------------------------------------------*/
.fmpe-product-archive {
  padding: var(--fmpe-spacing-medium) 0;
}

/* NEW: Archive Header Section (contains intro and toolbar) */
.fmpe-archive-header-section {
  background-color: var(--fmpe-white); /* This is the white box */
  border: 1px solid var(--fmpe-light-gray);
  border-radius: var(--fmpe-border-radius);
  padding: var(--fmpe-spacing-medium);
  margin-bottom: var(--fmpe-spacing-large);
}

.fmpe-directory-intro-content { /* This is now just for the text part */
    margin-bottom: var(--fmpe-spacing-medium); /* Space between intro text and toolbar */
}
.fmpe-directory-intro-content.fmpe-dynamic-content-area {
    border: none; /* Remove border from inner text div if parent .fmpe-archive-header-section has it */
    padding: 0; /* Remove padding from inner text div */
    background-color: transparent; /* Make inner div transparent */
    margin-bottom: var(--fmpe-spacing-medium);
}


/* NEW: Archive Toolbar Styles */
.fmpe-archive-toolbar {
  display: flex;
  flex-wrap: wrap; /* Allow items to wrap on smaller screens */
  align-items: center;
  gap: var(--fmpe-spacing-medium);
  padding-top: var(--fmpe-spacing-small); /* Space above toolbar elements */
  /* border-top: 1px solid var(--fmpe-light-gray); /* Optional: separator line from intro text */
}

.fmpe-archive-toolbar .fmpe-ajax-search-form {
  flex: 2 1 300px; /* Grow, shrink, base width */
  margin-bottom: 0; /* Reset margin from original form style */
  max-width: none; /* Allow flex to control width */
}

.fmpe-archive-toolbar .fmpe-category-filter {
  flex: 1 1 200px; /* Grow, shrink, base width */
}
.fmpe-archive-toolbar .fmpe-category-filter select {
  width: 100%; /* Make select take full width of its flex item */
}

.fmpe-archive-toolbar .fmpe-add-product-action {
  flex: 0 1 auto; /* Don't grow, shrink if needed, base on content */
  margin-left: auto; /* Pushes button to the right if space allows and other items are not growing much */
}

@media (max-width: 767px) {
  .fmpe-archive-toolbar {
    flex-direction: column;
    align-items: stretch; /* Make items full width when stacked */
  }
  .fmpe-archive-toolbar .fmpe-add-product-action {
    margin-left: 0; /* Reset margin for stacked layout */
    margin-top: var(--fmpe-spacing-medium); /* Add space when stacked */
  }
  .fmpe-archive-toolbar .fmpe-ajax-search-form,
  .fmpe-archive-toolbar .fmpe-category-filter {
    flex-basis: auto; /* Reset basis */
  }
}


/* Original .fmpe-archive-actions is now .fmpe-add-product-action or similar if needed elsewhere */
/* If .fmpe-archive-actions was only for the button, it might be removed or merged */

.fmpe-category-header {
  margin-bottom: var(--fmpe-spacing-large);
  padding-bottom: var(--fmpe-spacing-medium);
  border-bottom: 1px solid var(--fmpe-light-gray);
}
.fmpe-category-header h2 {
  display: flex;
  align-items: center;
  gap: var(--fmpe-spacing-small);
  font-size: var(--fmpe-font-size-h1);
  color: var(--fmpe-dark-charcoal);
}
.fmpe-category-header .dashicons,
.fmpe-category-header .fmpe-category-icon-img {
  font-size: 28px;
  width: 28px;
  height: 28px;
  color: var(--fmpe-primary-red);
}
.fmpe-category-header .fmpe-category-icon-img {
    object-fit: contain;
}
.fmpe-category-description {
    font-size: var(--fmpe-font-size-body);
    color: var(--fmpe-middle-gray);
    margin-top: var(--fmpe-spacing-small);
}

/* Search form styling (already present, adjustments might be needed if toolbar affects it) */
.fmpe-ajax-search-form input[type="search"] {
  flex-grow: 1;
}

.fmpe-product-list-container {
    /* Wrapper for AJAX-loaded results */
}
.fmpe-product-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--fmpe-spacing-large);
}

/* Product Card */
.fmpe-product-card {
  background-color: var(--fmpe-white);
  border: 1px solid var(--fmpe-light-gray);
  border-radius: var(--fmpe-border-radius);
  padding: var(--fmpe-spacing-medium);
  display: flex;
  flex-direction: column;
  transition: box-shadow 0.3s ease;
  position: relative; /* For featured sticker positioning */
}
.fmpe-product-card:hover {
  box-shadow: var(--fmpe-hover-shadow);
}

.fmpe-featured-sticker {
    position: absolute;
    top: 8px; /* Adjust as needed for desired spacing from the top edge */
    right: 8px; /* Adjust as needed for desired spacing from the right edge */
    z-index: 10; /* Ensures the sticker is above other content in the card */
    line-height: 0; /* Helps if there's any weird spacing around the image */
}

.fmpe-featured-sticker img {
    width: 40px;
    height: 40px;
    display: block; /* Removes any extra space below the image if it's inline */
}

/* Product Card Logo Styling (square container, SVG fix) */
.fmpe-product-card-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 200px;
  height: 200px;
  margin-left: auto;
  margin-right: auto;
  margin-bottom: var(--fmpe-spacing-medium);
  overflow: hidden;
}

.fmpe-product-card-logo img { /* Common for all images in card logo */
  display: block;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  flex-shrink: 0;
  min-width: 0;
  width: auto;
  height: auto;
}

.fmpe-product-card-logo img[src$=".svg"] { /* SVG specific */
  width: 100%;
  height: 100%;
}

.fmpe-product-card-content {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}
.fmpe-product-card-name {
  font-size: var(--fmpe-font-size-h3);
  margin-bottom: var(--fmpe-spacing-small);
}
.fmpe-product-card-name a {
  color: var(--fmpe-primary-red);
}
.fmpe-product-card-category {
  font-size: var(--fmpe-font-size-small);
  color: var(--fmpe-middle-gray);
  margin-bottom: var(--fmpe-spacing-small);
}
.fmpe-product-card-desc {
  font-size: var(--fmpe-font-size-body);
  color: var(--fmpe-dark-charcoal);
  margin-bottom: var(--fmpe-spacing-medium);
  flex-grow: 1;
  line-height: 1.5;
}
.fmpe-product-card-rating {
  font-size: var(--fmpe-font-size-small);
  color: var(--fmpe-middle-gray);
  margin-top: auto;
  padding-top: var(--fmpe-spacing-small);
  border-top: 1px solid var(--fmpe-light-gray);
}

/* Pagination - Styles Updated for Specificity */
.fmpe-pagination {
    margin-top: var(--fmpe-spacing-large);
    text-align: center;
}
.fmpe-pagination ul.page-numbers { /* Target the UL specifically */
    list-style: none;
    padding: 0;
    margin: 0;
    display: inline-flex; /* Use inline-flex for better centering if ul is block */
    flex-wrap: wrap; /* Allow pagination to wrap on small screens */
    justify-content: center;
    gap: var(--fmpe-spacing-small);
}
.fmpe-pagination ul.page-numbers li {
    display: inline; /* List items themselves don't need much styling */
    margin: 0; /* Reset li margin if any */
}
/* Target both <a> and <span> elements with .page-numbers class inside li */
.fmpe-pagination ul.page-numbers li .page-numbers {
    display: inline-block;
    padding: var(--fmpe-spacing-small) calc(var(--fmpe-spacing-small) * 1.5);
    border: 1px solid var(--fmpe-light-gray);
    border-radius: var(--fmpe-border-radius);
    text-decoration: none;
    color: var(--fmpe-primary-red);
    background-color: var(--fmpe-white);
    line-height: 1.3; /* Adjust if needed for vertical alignment */
    /* Reset potential theme button styles */
    box-shadow: none;
    text-transform: none;
    font-weight: var(--fmpe-font-weight-normal);
    min-width: 30px; /* Ensure a decent tap target */
    text-align: center;
    transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}
.fmpe-pagination ul.page-numbers li .page-numbers:hover,
.fmpe-pagination ul.page-numbers li span.page-numbers.current {
    background-color: var(--fmpe-primary-red);
    color: var(--fmpe-text-on-red);
    border-color: var(--fmpe-primary-red);
    font-weight: var(--fmpe-font-weight-bold); /* Emphasize current/hover */
}
.fmpe-pagination ul.page-numbers li .page-numbers.dots {
    border: none;
    background: none;
    padding: var(--fmpe-spacing-small) calc(var(--fmpe-spacing-small) * 0.5);
    color: var(--fmpe-middle-gray);
}


/*--------------------------------------------------------------
# Single Product View
--------------------------------------------------------------*/
.fmpe-single-product {
  max-width: 960px;
  margin: var(--fmpe-spacing-large) auto;
}

.fmpe-product-header-card {
  display: flex;
  gap: var(--fmpe-spacing-medium);
  align-items: flex-start;
  background-color: var(--fmpe-white);
  border: 1px solid var(--fmpe-light-gray);
  border-radius: var(--fmpe-border-radius);
  padding: var(--fmpe-spacing-medium);
  margin-bottom: var(--fmpe-spacing-large);
}
.fmpe-product-header-card__logo-wrapper {
  flex: 2;
  display: flex;
  justify-content: center;
  align-items: center;
  min-width: 0;
}
.fmpe-product-header-card__logo-wrapper img {
  display: block;
  max-width: 100%;
  max-height: 150px;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: var(--fmpe-border-radius);
}
.fmpe-product-header-card__info {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.fmpe-product-header-card__info h1 {
  color: var(--fmpe-primary-red);
  font-size: var(--fmpe-font-size-h1);
  margin-top: 0;
  margin-bottom: var(--fmpe-spacing-medium);
  line-height: 1.2;
}
.fmpe-product-header-card__info .fmpe-product-website {
  margin-top: 0;
}
.fmpe-product-header-card__info .fmpe-product-website a {
  display: inline-block;
  background-color: var(--fmpe-secondary-gold);
  color: var(--fmpe-text-on-gold);
  padding: var(--fmpe-spacing-small) var(--fmpe-spacing-medium);
  border-radius: var(--fmpe-border-radius);
  font-weight: var(--fmpe-font-weight-bold);
  text-decoration: none;
  border: 1px solid var(--fmpe-secondary-gold);
  transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}
.fmpe-product-header-card__info .fmpe-product-website a:hover {
  background-color: var(--fmpe-white);
  color: var(--fmpe-dark-charcoal);
  border: 1px solid var(--fmpe-secondary-gold);
  text-decoration: none;
}

.fmpe-single-product-layout-wrapper {
  display: flex;
  flex-wrap: wrap;
  gap: var(--fmpe-spacing-large);
}
.fmpe-single-product-main-details {
  flex: 2;
  min-width: 300px;
}
.fmpe-single-product-reviews-sidebar {
  flex: 1;
  min-width: 280px;
  background-color: var(--fmpe-light-gray);
  padding: var(--fmpe-spacing-medium);
  border-radius: var(--fmpe-border-radius);
}

.fmpe-product-category,
.fmpe-product-short-description,
.fmpe-product-long-description {
  margin-bottom: var(--fmpe-spacing-medium);
}
.fmpe-product-category strong,
.fmpe-product-short-description strong,
.fmpe-product-long-description strong {
    color: var(--fmpe-dark-charcoal);
}
.fmpe-product-date-added,
.fmpe-product-submitter {
    margin-bottom: var(--fmpe-spacing-small);
    font-size: var(--fmpe-font-size-xsmall);
    color: var(--fmpe-middle-gray);
}
.fmpe-product-date-added strong,
.fmpe-product-submitter strong {
    color: var(--fmpe-middle-gray);
    font-weight: var(--fmpe-font-weight-normal);
}
.fmpe-product-long-description div {
  line-height: 1.7;
}

.fmpe-review-area h3 {
  color: var(--fmpe-dark-charcoal);
  border-bottom: 1px solid var(--fmpe-middle-gray);
  padding-bottom: var(--fmpe-spacing-small);
  font-size: var(--fmpe-font-size-h3);
}
.fmpe-average-rating-display p,
.fmpe-review-area p {
  margin-bottom: var(--fmpe-spacing-medium);
}
.fmpe-legal-disclaimer {
  font-size: var(--fmpe-font-size-xsmall);
  color: var(--fmpe-middle-gray);
  font-style: italic;
  padding: var(--fmpe-spacing-medium);
  margin-top: var(--fmpe-spacing-large);
  border-top: 1px solid var(--fmpe-light-gray);
  text-align: center;
}

/*--------------------------------------------------------------
# Modals
--------------------------------------------------------------*/
.fmpe-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(34, 29, 35, 0.7); /* From your CSS */
  display: flex; /* Apply flex here for centering child */
  align-items: center; /* Vertically center .fmpe-modal-content */
  justify-content: center; /* Horizontally center .fmpe-modal-content */
  z-index: 1000;
  padding: var(--fmpe-spacing-medium); /* From your CSS */
  box-sizing: border-box; /* From your CSS */

  /* For smooth fade effect */
  opacity: 0;
  visibility: hidden;
  /* Transition opacity, and delay visibility change until opacity transition is done */
  transition: opacity 0.3s ease-in-out, visibility 0s linear 0.3s;
}
.fmpe-modal.fmpe-modal-is-visible {
  opacity: 1;
  visibility: visible;
  transition-delay: 0s; /* Ensure visibility transition applies immediately when class is added */
}
.fmpe-modal-content {
  background-color: var(--fmpe-white); /* From your CSS */
  padding: var(--fmpe-spacing-large); /* From your CSS */
  border-radius: var(--fmpe-border-radius); /* From your CSS */
  box-shadow: var(--fmpe-box-shadow); /* From your CSS */
  width: 100%; /* From your CSS */
  max-width: 600px; /* From your CSS */
  max-height: 90vh; /* From your CSS */
  overflow-y: auto; /* From your CSS */
  position: relative; /* From your CSS */

  /* Optional: Add a slight scale effect for entry */
  transform: scale(0.95);
  transition: transform 0.3s ease-in-out; /* Add this if you want the scale effect */
}
.fmpe-modal.fmpe-modal-is-visible .fmpe-modal-content {
  transform: scale(1); /* Bring to full size when visible */
}
/* Modal Close Button - Enhanced Specificity */
.fmpe-modal .fmpe-modal-header .fmpe-modal-close {
  background: none !important; /* Override theme background */
  border: none !important; /* Override theme border */
  padding: 0 !important; /* Override theme padding */
  color: var(--fmpe-middle-gray); /* Your desired color */
  font-size: 28px; /* Your desired size */
  font-weight: var(--fmpe-font-weight-bold);
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
  position: absolute; /* Keep existing positioning */
  top: var(--fmpe-spacing-medium);
  right: var(--fmpe-spacing-medium);
  /* Remove any box-shadow or text-shadow from theme if necessary */
  box-shadow: none !important;
  text-shadow: none !important;
  /* Ensure it's just the text/icon */
  display: inline-block; 
  width: auto; 
  height: auto;
  min-width: 0;
}
.fmpe-modal .fmpe-modal-header .fmpe-modal-close:hover {
  color: var(--fmpe-dark-charcoal); /* Your desired hover color */
  background: none !important; /* Ensure hover doesn't bring back theme bg */
}
/* CPT Intro Text in Submission Modal */
#fmpe-submission-modal-content-area > p:first-child {
  font-size: var(--fmpe-font-size-small); /* Makes it smaller */
  color: var(--fmpe-middle-gray);    /* Darker gray, adjust as needed from your variables */
  margin-bottom: 10px; /* Addresses the next point (space reduction) */
  line-height: 1.5; /* Adjust for readability if needed */
}
.fmpe-modal-content h3 {
  margin-top: 0;
  margin-bottom: var(--fmpe-spacing-medium);
  padding-bottom: var(--fmpe-spacing-small);
  border-bottom: 1px solid var(--fmpe-light-gray);
  color: var(--fmpe-primary-red);
}

/* Star Rating System (Static & Interactive) */
.fmpe-static-star-rating .fmpe-star,
.fmpe-star-rating-input .fmpe-star {
  font-size: 20px;
  color: var(--fmpe-light-gray);
  position: relative;
  display: inline-block;
  line-height: 1;
}
.fmpe-star-rating-input .fmpe-star {
  cursor: pointer;
}

.fmpe-star-rating-input .fmpe-star.fmpe-star-filled,
.fmpe-star-rating-input .fmpe-star.fmpe-star-hover,
.fmpe-static-star-rating .fmpe-star.fmpe-star-filled,
.fmpe-star-rating-input .fmpe-star.rated {
  color: var(--fmpe-secondary-gold);
}

.fmpe-star-rating-input .fmpe-star.fmpe-star-half,
.fmpe-static-star-rating .fmpe-star.fmpe-star-half,
.fmpe-star-rating-input .fmpe-star.rated.fmpe-star-half {
  color: var(--fmpe-light-gray);
}
.fmpe-star-rating-input .fmpe-star.fmpe-star-half::before,
.fmpe-static-star-rating .fmpe-star.fmpe-star-half::before,
.fmpe-star-rating-input .fmpe-star.rated.fmpe-star-half::before {
  content: '\2605'; /* Filled star character ★ */
  color: var(--fmpe-secondary-gold);
  position: absolute;
  left: 0;
  top: 0;
  width: 50%;
  overflow: hidden;
  z-index: 1;
}

.fmpe-half-star-info {
    font-size: var(--fmpe-font-size-xsmall);
    color: var(--fmpe-middle-gray);
    display: block;
    margin-top: var(--fmpe-spacing-small);
}

/* Submission form specifics */
#fmpe-scraped-logo-preview-container img {
    max-width: 150px;
    max-height: 60px;
    border: 1px solid var(--fmpe-light-gray);
    border-radius: var(--fmpe-border-radius);
    margin-top: var(--fmpe-spacing-small);
}
#fmpe-url-scrape-message {
    font-style: italic;
}

/* Read Reviews Modal & Review Item */
#fmpe-reviews-list-container {
  margin-top: var(--fmpe-spacing-medium);
}
.fmpe-reviews-loading,
.fmpe-loading-message, /* Unified loading message style */
.fmpe-loading-text {
    text-align: center;
    padding: var(--fmpe-spacing-large);
    color: var(--fmpe-middle-gray);
}

.fmpe-review-item {
  padding: var(--fmpe-spacing-medium) 0;
  border-bottom: 1px solid var(--fmpe-light-gray);
}
.fmpe-review-item:last-child {
  border-bottom: none;
}
.fmpe-review-item-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--fmpe-spacing-small);
}
.fmpe-review-item-reviewer {
  font-weight: var(--fmpe-font-weight-bold);
  color: var(--fmpe-dark-charcoal);
}
.fmpe-review-item-date {
  font-size: var(--fmpe-font-size-xsmall);
  color: var(--fmpe-middle-gray);
}
.fmpe-review-item-rating {
  margin-bottom: var(--fmpe-spacing-small);
}
.fmpe-review-item-rating .fmpe-rating-text {
    font-size: var(--fmpe-font-size-small);
    color: var(--fmpe-middle-gray);
    margin-left: var(--fmpe-spacing-small);
}
.fmpe-review-item-title {
  font-size: var(--fmpe-font-size-body);
  font-weight: var(--fmpe-font-weight-bold);
  color: var(--fmpe-dark-charcoal);
  margin-bottom: var(--fmpe-spacing-small);
}
.fmpe-review-item-body {
  color: var(--fmpe-dark-charcoal);
  line-height: 1.5;
  margin-bottom: var(--fmpe-spacing-small);
}
.fmpe-review-item-body p:last-child {
    margin-bottom: 0;
}
.fmpe-review-item-actions {
  margin-top: var(--fmpe-spacing-small);
  font-size: var(--fmpe-font-size-xsmall);
}
.fmpe-review-item-actions .fmpe-flag-review-trigger {
  color: var(--fmpe-middle-gray);
}
.fmpe-review-item-actions .fmpe-flag-review-trigger:hover {
  color: var(--fmpe-primary-red);
}
.fmpe-review-item-actions .fmpe-flag-review-trigger .dashicons {
  font-size: 14px;
  margin-right: 3px;
  vertical-align: middle;
}
.fmpe-flagged-text {
    color: var(--fmpe-middle-gray);
    font-style: italic;
}

/* Generic/Signup Prompt Modal */
#fmpe-generic-modal-content-area {
    /* Styles for AJAX loaded content */
}

/*--------------------------------------------------------------
# Responsiveness
--------------------------------------------------------------*/
@media (max-width: 767px) { /* Mobile */
  .fmpe-product-list {
    grid-template-columns: 1fr;
  }

  .fmpe-product-header-card {
    flex-direction: column;
    align-items: center;
  }
  .fmpe-product-header-card__logo-wrapper { 
    order: 1; 
    flex-basis: auto; 
    width: 60%;
    max-width: 200px;
    margin-bottom: var(--fmpe-spacing-medium); 
  }
  .fmpe-product-header-card__info { 
    order: 2; 
    flex-basis: auto; 
    width: 100%;
    text-align: center;
    align-items: center;
  }

  .fmpe-single-product-layout-wrapper {
    /* flex-direction: column; This is implicit by flex-wrap */
  }
  .fmpe-single-product-main-details,
  .fmpe-single-product-reviews-sidebar {
    flex-basis: 100%; 
    min-width: 100%; 
  }

  .fmpe-modal-content {
    padding: var(--fmpe-spacing-medium);
    max-height: 95vh;
  }

  .fmpe-product-header-card__info h1 {
    font-size: calc(var(--fmpe-font-size-h1) * 0.9);
  }
  .fmpe-product-archive h2,
  .fmpe-modal-content h3 {
    font-size: calc(var(--fmpe-font-size-h2) * 0.9);
  }

  /* Toolbar stacking already handled by .fmpe-archive-toolbar media query */
}

/* Tablet adjustments */
@media (min-width: 768px) and (max-width: 1023px) {
    .fmpe-archive-toolbar {
        /* Allow more items per row than mobile but maybe not full desktop spread */
    }
    .fmpe-archive-toolbar .fmpe-ajax-search-form {
        flex-basis: 250px; /* Adjust as needed */
    }
    .fmpe-archive-toolbar .fmpe-category-filter {
        flex-basis: 180px; /* Adjust as needed */
    }
}

/* Desktop and larger (1024px and above) */
@media (min-width: 1024px) {
  /* Styles for larger screens, if defaults aren't sufficient */
}