:root { --primary-color: #008577; --accent-color: #FF6801; --border-color: #e0e0e0; }
.mp-marketplace-container { max-width: 1200px; margin: 2em auto; }
.mp-filters { display: flex; flex-wrap: wrap; gap: 10px; border-bottom: 2px solid var(--border-color); padding-bottom: 15px; margin-bottom: 30px; }
.mp-filter-btn { background: #f5f5f5; border: 1px solid var(--border-color); padding: 10px 20px; font-weight: bold; cursor: pointer; border-radius: 5px; transition: all 0.2s ease; }
.mp-filter-btn:hover { background: #e0e0e0; }
.mp-filter-btn.active { background: var(--primary-color); color: white; border-color: var(--primary-color); }
.mp-item-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 30px; }
.mp-grid-loader { text-align: center; font-size: 1.5em; padding: 50px; }
.mp-item-card { border: 1px solid var(--border-color); border-radius: 8px; overflow: hidden; box-shadow: 0 4px 8px rgba(0,0,0,0.05); transition: transform 0.2s, box-shadow 0.2s; display: flex; flex-direction: column; }
.mp-item-card:hover { transform: translateY(-5px); box-shadow: 0 8px 16px rgba(0,0,0,0.1); }
.mp-item-card a { text-decoration: none; color: inherit; }
.mp-item-image { background: #f9f9f9; cursor: pointer; }
.mp-item-image img { width: 100%; height: 200px; object-fit: cover; display: block; }
.mp-item-content { padding: 20px; text-align: center; display: flex; flex-direction: column; flex-grow: 1; }
.mp-item-content h3 { font-size: 1.25em; margin: 0 0: 10px; }
.mp-item-content .price { font-size: 1.1em; font-weight: bold; color: #555; }
.mp-item-content .product-short-description { color: #555; flex-grow: 1; margin: 15px 0; }
.product-short-description p { margin: 0; font-size: 0.9em; line-height: 1.5; }
.mp-btn { display: inline-block; background: var(--accent-color); color: white !important; padding: 12px 25px; font-weight: bold; text-decoration: none; border-radius: 5px; margin-top: 15px; transition: background-color 0.2s; }
.mp-btn:hover { background: #e65e01; }
.mp-item-footer { margin-top: auto; padding-top: 15px; border-top: 1px solid #f0f0f0; display: flex; justify-content: space-between; align-items: center; gap: 15px; }
.mp-item-footer .price { margin: 0; text-align: left; }
.mp-item-footer .mp-details-btn { flex-shrink: 0; }
.mp-details-btn { background: transparent; border: 2px solid var(--primary-color); color: var(--primary-color); padding: 10px 20px; border-radius: 5px; font-weight: bold; cursor: pointer; transition: all 0.2s ease; }
.mp-details-btn.resource { margin-top: auto; }
.mp-details-btn:hover { background: var(--primary-color); color: white; }

/* --- Locked Overlay Styles --- */
.mp-locked-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.7); z-index: 10000; display: flex; justify-content: center; align-items: center; }
.mp-locked-content { background: white; padding: 40px; border-radius: 8px; text-align: center; max-width: 500px; position: relative; }
.mp-close-overlay { position: absolute; top: 10px; right: 15px; background: none; border: none; font-size: 2em; cursor: pointer; }

/* --- Resource Details Modal Styles --- */
.mp-resource-modal { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.7); z-index: 10001; display: flex; justify-content: center; align-items: center; padding: 20px; box-sizing: border-box; }
.mp-resource-modal .mp-modal-content { display: flex; flex-direction: column; background: white; border-radius: 8px; max-width: 800px; width: 100%; max-height: 90vh; overflow: hidden; position: relative; }
.mp-resource-modal .mp-modal-close { position: absolute; top: 10px; right: 15px; background: none; border: none; font-size: 2em; cursor: pointer; z-index: 10; }
.mp-resource-modal #mp-modal-image { width: 100%; height: 300px; object-fit: cover; }
.mp-resource-modal .mp-modal-text-content { padding: 30px; overflow-y: auto; }
.mp-resource-modal #mp-modal-title { margin-top: 0; }

/* --- Product Details Modal Styles --- */
.mp-product-modal { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.7); z-index: 10002; display: flex; justify-content: center; align-items: center; padding: 20px; box-sizing: border-box; }
.mp-product-modal .mp-modal-content { background: white; border-radius: 8px; max-width: 900px; width: 100%; max-height: 90vh; overflow: hidden; position: relative; }
.mp-product-modal .mp-modal-close { position: absolute; top: 10px; right: 15px; background: none; border: none; font-size: 2em; cursor: pointer; z-index: 10; }
.mp-product-modal .mp-modal-inner-content { padding: 30px; overflow-y: auto; max-height: 90vh; box-sizing: border-box;}
.mp-product-modal .mp-modal-loader { text-align: center; padding: 5em 0; font-size: 1.2em; }
.mp-product-modal-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 30px; align-items: start;}
.mp-product-modal-image img { width: 100%; height: auto; border-radius: 5px; }
.mp-product-modal-details h2 { margin-top: 0; }
.mp-product-modal-details .price { font-size: 1.5em; color: var(--primary-color); margin-bottom: 15px; }
.mp-product-modal-details .description { margin-bottom: 20px; }
.mp-product-modal-details .variations label { font-weight: bold; display: block; margin-bottom: 5px; }
.mp-product-modal-details .variations select { width: 100%; margin-bottom: 15px; padding: 8px; }

.mp-product-modal .quantity {
    display: none;
}

.mp-product-modal-details .single_add_to_cart_button { background: var(--accent-color); color: white; padding: 12px 25px; font-weight: bold; text-decoration: none; border-radius: 5px; border: none; cursor: pointer; font-size: 1em; transition: background-color 0.2s ease; }
.mp-product-modal-details .single_add_to_cart_button:hover { background: #e65e01; }

@media (max-width: 768px) {
    .mp-product-modal-grid { grid-template-columns: 1fr; }
}

/* --- Resource Submenu Styling --- */
.mp-resource-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 20px 0;
  border-bottom: 2px solid var(--border-color);
  padding-bottom: 15px;
}

.mp-resource-filters label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: bold;
  color: var(--primary-color);
}

.mp-resource-filters select {
  appearance: none;
  border: 2px solid var(--border-color);
  border-radius: 5px;
  padding: 8px 12px;
  background: #f5f5f5;
  font-size: 1em;
  font-weight: bold;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}

.mp-resource-filters select:hover {
  background: #e0e0e0;
  border-color: var(--primary-color);
}

.mp-resource-filters select:focus {
  outline: none;
  border-color: var(--accent-color);
  background: white;
}




/* --- Style the Search input to match filters --- */
.mp-resource-filters input#mp-filter-search {
  appearance: none;
  border: 2px solid var(--border-color);
  border-radius: 5px;
  padding: 8px 12px;
  background: #f5f5f5;
  font-size: 1em;
  font-weight: bold;
  color: #333;
  width: 200px;               /* adjust as needed */
  transition: background 0.2s, border-color 0.2s;
  cursor: text;
}

.mp-resource-filters input#mp-filter-search::placeholder {
  color: #777;
  font-weight: normal;
}

.mp-resource-filters input#mp-filter-search:hover {
  background: #e0e0e0;
  border-color: var(--primary-color);
}

.mp-resource-filters input#mp-filter-search:focus {
  outline: none;
  background: #fff;
  border-color: var(--accent-color);
}

@media (max-width: 600px) {
  .mp-resource-filters input#mp-filter-search {
    width: 100%;
    margin-top: 10px;
  }
}


/* Ensure our Type & Module selects aren’t squashed */
.mp-resource-filters select {
  min-width: 150px;    /* or whatever you’d like */
  max-width: 300px;    /* prevents them getting huge on large screens */
  width: auto;         /* let the browser size it based on content/this min-width */
}


/* Restore native dropdown arrow & padding for our submenu selects */
.mp-resource-filters select {
  /* remove the override that hid the arrow */
  -webkit-appearance: menulist-button;
     -moz-appearance: menulist-button;
          appearance: menulist-button;

  /* ensure padding for text + arrow */
  padding: 8px 12px 8px 12px;  /* top/right/bottom/left */
  /* if you want a bit more room on the right for the arrow */
  padding-right: 30px; 

  /* keep your nice border / bg */
  border: 2px solid var(--border-color);
  border-radius: 5px;
  background: #f5f5f5;
  font-size: 1em;
  font-weight: bold;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}

/* On hover / focus keep our accenting */
.mp-resource-filters select:hover {
  background: #e0e0e0;
  border-color: var(--primary-color);
}
.mp-resource-filters select:focus {
  outline: none;
  background: #fff;
  border-color: var(--accent-color);
}

/* Center the submenu on desktop */
.mp-resource-filters {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;  /* center all items */
  gap: 10px;
  margin: 20px 0;
}

/* Make each control look uniform */
.mp-resource-filters label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: bold;
  color: var(--primary-color);
}

/* On mobile: stack each control full-width */
@media (max-width: 768px) {
  .mp-resource-filters {
    flex-direction: column;
    align-items: stretch;   /* labels take full width */
  }

  .mp-resource-filters label {
    width: 100%;
    justify-content: space-between;  /* label text left, control right */
    margin-bottom: 10px;
  }

  /* Make selects and input fill the width */
  .mp-resource-filters select,
  .mp-resource-filters input#mp-filter-search {
    width: calc(100% - 100px); /* leave room for label text */
    max-width: none;
  }
}

/* Ensure on desktop the controls stay a reasonable size */
@media (min-width: 769px) {
  .mp-resource-filters label {
    width: auto;
  }

  .mp-resource-filters select,
  .mp-resource-filters input#mp-filter-search {
    width: auto;
    min-width: 150px;
    max-width: 250px;
  }
}



