/**
 * RMRS Recycling Guide - Matching rmrecycling design exactly
 */

.rmrs-recycling-guide {
    --columns-desktop: 4;
    --columns: var(--columns-desktop);
    --gap: 24px;
    --card-bg: #ffffff;
    --card-radius: 16px;
    --accepted-color: #48ba47;
    --not-accepted-color: #dc3545;
}

/* Controls */
.rmrs-rg-controls {
    margin-bottom: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.rmrs-rg-search-wrap {
    display: flex;
    max-width: 700px;
    margin: 0 auto;
    width: 100%;
    gap: 0.5rem;
}

.rmrs-rg-search {
    flex: 1;
    padding: 0.875rem 1.25rem;
    border: 2px solid #213C7A;
    border-radius: 12px;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.rmrs-rg-search:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(33, 60, 122, 0.15);
}

.rmrs-rg-search-btn {
    padding: 0.875rem 1.75rem;
    background-color: #213C7A;
    color: #ffffff;
    border: 2px solid #213C7A;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.rmrs-rg-search-btn:hover {
    background-color: #2d4f99;
    border-color: #2d4f99;
}

/* Filters */
.rmrs-rg-filters {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
}

.rmrs-rg-filter {
    padding: 0.5rem 1rem;
    background-color: #213C7A;
    color: #ffffff;
    border: none;
    border-radius: 12px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.rmrs-rg-filter:focus {    outline: 2px solid #213C7A;    outline-offset: 2px;}
.rmrs-rg-filter:not(.rmrs-rg-filter--all):not(.rmrs-rg-filter--not-accepted):hover {
    background-color: #2d4f99;
}

.rmrs-rg-filter.item-category-highlight {
    background-color: #FF6F13;
}

/* All Materials - always green */
.rmrs-rg-filter.rmrs-rg-filter--all {
    background-color: #48ba47;
}
.rmrs-rg-filter.rmrs-rg-filter--all:hover {
    background-color: #3a9638;
}
.rmrs-rg-filter.rmrs-rg-filter--all:focus {
    outline-color: #48ba47;
}

/* Category buttons - orange when active */
.rmrs-rg-filter.active:not(.rmrs-rg-filter--all):not(.rmrs-rg-filter--not-accepted) {
    background-color: #FF6F13;
}
.rmrs-rg-filter.active:not(.rmrs-rg-filter--all):not(.rmrs-rg-filter--not-accepted):hover {
    background-color: #e06310;
}

.rmrs-rg-filter.rmrs-rg-filter--not-accepted {
    background-color: #dc2626;
}

.rmrs-rg-filter.rmrs-rg-filter--not-accepted:hover {
    background-color: #b91c1c;
}

.rmrs-rg-filter.rmrs-rg-filter--not-accepted.active {
    background-color: #991b1b;
}

/* Grid (semantic list) */
.rmrs-rg-grid {
    display: grid;
    grid-template-columns: repeat(var(--columns), 1fr);
    gap: var(--gap);
    align-items: stretch;
    list-style: none;
    margin: 0;
    padding: 0;
}

/* Card - matching original exactly */
.rmrs-rg-card {
    background: var(--card-bg);
    border-radius: var(--card-radius);
    padding: 24px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
    border: 2px solid transparent;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.rmrs-rg-card--accepted {
    border-color: rgba(72, 186, 71, 0.2);
}

.rmrs-rg-card--accepted:hover {
    box-shadow: 0 8px 30px rgba(0,0,0,0.15);
    border-color: rgba(72, 186, 71, 0.6);
}

.rmrs-rg-card--not-accepted {
    border-color: rgba(220, 53, 69, 0.2);
    opacity: 0.85;
}

.rmrs-rg-card--not-accepted:hover {
    box-shadow: 0 8px 30px rgba(0,0,0,0.15);
    border-color: rgba(220, 53, 69, 0.6);
    opacity: 1;
}

.rmrs-rg-card.rmrs-rg-hidden {
    display: none !important;
}

/* Card Image */
.rmrs-rg-card__image {
    margin: -24px -24px 0 -24px;
    border-radius: var(--card-radius) var(--card-radius) 0 0;
    overflow: hidden;
    aspect-ratio: 16 / 10;
    background: #f3f4f6;
}

.rmrs-rg-card__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Card Header - Title + Badge row */
.rmrs-rg-card__header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    padding-left: 0;
    margin-top: 1.25rem;
    margin-bottom: 0.75rem;
}

.rmrs-rg-card__badge {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    padding: 0.4rem 0.6rem;
    border-radius: 6px;
    text-align: center;
    line-height: 1.2;
    flex-shrink: 0;
    white-space: nowrap;
}

.rmrs-rg-card__badge--accepted {
    background: var(--accepted-color);
    color: #fff;
}

.rmrs-rg-card__badge--not-accepted {
    background: var(--not-accepted-color);
    color: #fff;
}

/* Card Title with Info Button */
.rmrs-rg-card__title {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0;
    color: #111827;
    line-height: 1.3;
    display: block;
    flex: 1;
    min-width: 0;
}

.rmrs-rg-info-btn {
    background: none;
    border: none;
    font-size: 1rem;
    cursor: pointer;
    opacity: 0.7;
    transition: all 0.3s ease;
    padding: 0;
}

.rmrs-rg-info-btn:hover {
    opacity: 1;
}

/* Card Content */
.rmrs-rg-card__desc {
    font-size: 0.9rem;
    color: #6b7280;
    margin: 0 0 1rem;
    line-height: 1.5;
}

.rmrs-rg-card__section {
    margin-bottom: 0.75rem;
}

.rmrs-rg-card__label {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--accepted-color);
    margin-bottom: 0.25rem;
}

.rmrs-rg-card--not-accepted .rmrs-rg-card__label {
    color: var(--not-accepted-color);
}

.rmrs-rg-card__section p {
    font-size: 0.875rem;
    color: #374151;
    margin: 0;
    line-height: 1.5;
}

/* Plastic Types */
.rmrs-rg-plastic-types {
    margin: 1rem 0;
    padding-top: 0.75rem;
    border-top: 1px solid #e5e7eb;
}

.rmrs-rg-plastic-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: #6b7280;
    display: block;
    margin-bottom: 0.5rem;
}

.rmrs-rg-plastic-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.rmrs-rg-plastic-chip {
    font-size: 0.75rem;
    font-weight: 500;
    padding: 0.35rem 0.65rem;
    background: #fff;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #374151;
}

.rmrs-rg-plastic-chip:hover {
    border-color: var(--accepted-color);
    background: rgba(72, 186, 71, 0.05);
    color: var(--accepted-color);
}

/* Location visibility - controlled by data-show-location attribute */
.rmrs-recycling-guide:not([data-show-location="true"]) .rmrs-rg-card__section--location {
    display: none;
}

/* Pagination hidden - cards beyond current visible row limit */
.rmrs-rg-card.rmrs-rg-pagination-hidden {
    display: none;
}

/* Load More Button */
.rmrs-rg-load-more-wrap {
    display: flex;
    justify-content: center;
    margin-top: 2rem;
}

.rmrs-rg-load-more-btn {
    padding: 0.875rem 2rem;
    background-color: #213C7A;
    color: #ffffff;
    border: 2px solid #213C7A;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.rmrs-rg-load-more-btn:hover {
    background-color: #2d4f99;
    border-color: #2d4f99;
}

.rmrs-rg-load-more-btn:focus {
    outline: 2px solid #213C7A;
    outline-offset: 2px;
}

/* No Results */
.rmrs-rg-no-results {
    text-align: center;
    padding: 3rem;
    color: #6b7280;
    font-size: 1.1rem;
    grid-column: 1 / -1;
}

/* Modal */
.rmrs-rg-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.rmrs-rg-modal.active {
    display: flex;
}

.rmrs-rg-modal__content {
    background: #fff;
    border-radius: 16px;
    max-width: 500px;
    width: 100%;
    max-height: 80vh;
    overflow-y: auto;
    padding: 2rem;
    position: relative;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}

.rmrs-rg-modal__content--plastic {
    max-width: 400px;
}

.rmrs-rg-modal__close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #6b7280;
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.rmrs-rg-modal__close:hover {
    background: #f3f4f6;
}

.rmrs-rg-modal__title {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0 0 1rem;
    padding-right: 2rem;
    color: #111827;
}

.rmrs-rg-modal__body {
    color: #374151;
    line-height: 1.6;
}

.rmrs-rg-modal__body p {
    margin: 0.75rem 0;
}

.rmrs-rg-modal__body strong {
    color: #111827;
}

/* Responsive - override columns at breakpoints */
@media (max-width: 1200px) {
    .rmrs-recycling-guide { --columns: 3; }
}

@media (max-width: 900px) {
    .rmrs-recycling-guide { --columns: 2; }
}

@media (max-width: 768px) {
    .rmrs-rg-search-wrap { flex-direction: column; max-width: none; }
    .rmrs-rg-search-btn { width: 100%; }
}

@media (max-width: 640px) {
    .rmrs-recycling-guide { --columns: 1; }
    .rmrs-rg-filter { font-size: 0.8rem; padding: 0.4rem 0.75rem; }
    .rmrs-rg-card { padding: 20px; }
    .rmrs-rg-card__image { margin: -20px -20px 0 -20px; }
}

@media (prefers-reduced-motion: reduce) {
    * { transition: none !important; }
}
