/* =================================================================
   CPM EDU MAP — Public Styles
   ================================================================= */

/* ---- Base reset for plugin elements ---- */
.cpm-map-wrapper,
.cpm-search-wrapper {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    box-sizing: border-box;
}
.cpm-map-wrapper *,
.cpm-search-wrapper * { box-sizing: border-box; }

/* ---- Map canvas ---- */
.cpm-map-canvas {
    width: 100%;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0,0,0,.1);
}

/* ---- Error state ---- */
.cpm-error {
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 8px;
    padding: 14px 18px;
    color: #856404;
    font-size: 14px;
}
div#cpm-edu-search-map {
    height: 600px !important;
}

/* ================================================================
   SEARCH BAR
   ================================================================ */
.cpm-search-bar {
    background: #fff;
    border: 1px solid #e0e4ea;
    border-radius: 14px;
    padding: 16px 20px;
    margin-bottom: 4rem;
    box-shadow: 0 2px 10px rgba(0,0,0,.06);
}
.cpm-search-fields {
    display: flex;
    gap: 12px;
    align-items: stretch;
    flex-wrap: no-wrap;
}

.cpm-search-input-wrap {
    position: relative;
    width: 60%;
}
input#cpm-search-location {
	height:45px;
}
button#cpm-search-btn {
    border: 1px solid #FE9C00;
    color: #FE9C00;
}
button#cpm-search-btn:hover {
    background: #FE9C00;
    color: #fff;
}
.cpm-distance-wrap, button#cpm-search-btn {
width: 20%}
.cpm-icon-pin {
    position: absolute;
    left: 12px; top: 50%; transform: translateY(-50%);
    width: 18px; height: 18px;
    color: #6b7280;
    pointer-events: none;
}
.cpm-search-input {
    width: 100%;
    padding: 12px 14px 12px 38px;
    border: 1.5px solid #d1d5db;
    border-radius: 10px;
    font-size: 15px;
    color: #111;
    background: #f9fafb;
    transition: border-color .18s, background .18s, box-shadow .18s;
    outline: none;
}
.cpm-search-input:focus {
    border-color: #2563eb;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(37,99,235,.12);
}
.cpm-search-input::placeholder { color: #9ca3af; }

.cpm-distance-select {
    padding: 12px 14px;
    border: 1.5px solid #d1d5db;
    border-radius: 10px;
    font-size: 14px;
    color: #374151;
    background: #f9fafb;
    cursor: pointer;
    outline: none;
    transition: border-color .18s;
    min-width: 110px;
}
.cpm-distance-select:focus { border-color: #2563eb; }

.cpm-btn-search {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: #1d4ed8;
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background .18s, transform .1s, box-shadow .18s;
    white-space: nowrap;
}
.cpm-btn-search svg { width: 18px; height: 18px; }
.cpm-btn-search:active { transform: scale(.97); }
.cpm-btn-search:disabled { background: #93c5fd; cursor: not-allowed; box-shadow: none; }

/* ================================================================
   MAP SECTION
   ================================================================ */
.cpm-search-map-wrap {
    position: relative;
    margin-bottom: 28px;
}
.cpm-search-status {
    position: absolute;
    top: 12px; left: 50%; transform: translateX(-50%);
    background: rgba(0,0,0,.7);
    color: #fff;
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 13px;
    pointer-events: none;
    opacity: 0;
    transition: opacity .3s;
    white-space: nowrap;
    z-index: 10;
}
.cpm-search-status.visible { opacity: 1; }

/* ================================================================
   INFO WINDOW (Google Maps popup)
   ================================================================ */
.cpm-infowindow {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    max-width: 280px;
    padding: 2px;
}
.cpm-iw-type {
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .05em;
    padding: 2px 8px;
    border-radius: 10px;
    margin-bottom: 6px;
}
.cpm-iw-type--cpm     { background: #fef3c7; color: #92400e; }
.cpm-iw-type--standard{ background: #dbeafe; color: #1e40af; }
.cpm-iw-name { font-size: 16px; font-weight: 700; color: #111; margin: 0 0 4px; }
.cpm-iw-rating { margin-bottom: 8px; }
.cpm-iw-address { font-size: 13px; color: #000; margin-bottom: 10px; font-style: normal; }
.cpm-iw-contacts { display: flex; flex-direction: column; gap: 4px; margin-bottom: 10px; }
.cpm-iw-contact { display: flex; align-items: center; gap: 6px; font-size: 13px; color: #374151; }
.cpm-iw-contact a { color: #000; text-decoration: none; }
.cpm-iw-contact a:hover { color: #c36; text-decoration: underline; }
.cpm-iw-website {
    display: inline-block;
    background-image: linear-gradient(147deg, #FE9C00 20%, #F8D034 79%);
    color: #fff !important;
    padding: 7px 16px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none !important;
    transition: background .15s;
}
.cpm-iw-website:hover { background: #000; }

/* ================================================================
   STARS (shared between infowindow and cards)
   ================================================================ */
.cpm-stars { display: inline-flex; align-items: center; gap: 1px; }
.cpm-stars__star { font-size: 15px; line-height: 1; }
.cpm-stars__star--full  { color: #F8D034; }
.cpm-stars__star--half  { color: #F8D034; opacity: .65; }
.cpm-stars__star--empty { color: #d1d5db; }
.cpm-stars__val { font-size: 12px; color: #6b7280; margin-left: 4px; }

/* ================================================================
   RESULTS SECTION
   ================================================================ */
.cpm-results-section { margin-top: 4rem; }
.cpm-results-header { margin-bottom: 16px; }
.cpm-results-count {
    font-size: 16px;
    font-weight: 700;
    color: #111;
    margin: 0;
}

/* ---- Grid ---- */
.cpm-results-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
}
@media (max-width: 640px) {
    .cpm-results-grid { grid-template-columns: 1fr; }
    .cpm-search-fields { flex-direction: column; }
    .cpm-btn-search { justify-content: center; }
}

/* ---- School Card ---- */
.cpm-school-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 18px 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    transition: box-shadow .2s, transform .2s, border-color .2s;
    cursor: default;
}
.cpm-school-card.cpm-card--active {
    border-color: #000000;
    box-shadow: 0 0 0 3px #00000017;
}

.cpm-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}
.cpm-card-type-badge {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .05em;
    padding: 2px 8px;
    border-radius: 10px;
}
.cpm-card-type-badge--cpm      { background: #fef3c7; color: #92400e; }
.cpm-card-type-badge--standard { background: #dbeafe; color: #1e40af; }

.cpm-card-name {
    font-size: 16px;
    font-weight: 700;
    color: #111;
    margin: 0;
    line-height: 1.3;
}
.cpm-card-address {
    font-size: 13px;
    color: #6b7280;
    font-style: normal;
}
.cpm-card-contacts {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.cpm-card-contact {
    font-size: 13px;
    color: #374151;
    display: flex;
    align-items: center;
    gap: 6px;
}
.cpm-card-contact a { color: #000; text-decoration: none; }
.cpm-card-contact a:hover { color: #c36;text-decoration: underline; }

.cpm-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 4px;
    gap: 10px;
    flex-wrap: wrap;
}
.cpm-btn-website {
    display: inline-block;
    background-image: linear-gradient(147deg, #FE9C00 20%, #F8D034 79%);
    color: #fff;
    padding: 7px 16px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    transition: background .15s;
    white-space: nowrap;
}
.cpm-btn-website:hover { background: #000; color: #fff; }
.cpm-card-distance {
    font-size: 12px;
    color: #9ca3af;
    font-weight: 500;
}

/* ================================================================
   LOAD MORE
   ================================================================ */
.cpm-load-more-wrap { text-align: center; margin-top: 24px; }
.cpm-btn-loadmore {
    display: inline-block;
    padding: 12px 32px;
    border: 2px solid #1d4ed8;
    background: transparent;
    color: #1d4ed8;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background .18s, color .18s;
}
.cpm-btn-loadmore:hover {
    background: #1d4ed8;
    color: #fff;
}

/* ================================================================
   SR-ONLY
   ================================================================ */
.cpm-sr-only {
    position: absolute; width: 1px; height: 1px;
    padding: 0; margin: -1px; overflow: hidden;
    clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}
@media screen and (max-width:600px) {
	.cpm-search-input-wrap {
    	width: 100%;
	}
	.cpm-distance-wrap, button#cpm-search-btn {
    	width: 100%;
	}
	.cpm-search-bar {
		margin-bottom: 2rem;
	}
}