/* =============================================================
   Rette Dein Obst – Sammelstellen – Frontend Styles
   CI: rette-dein-obst.de
   ============================================================= */

:root {
    --rdo-green:       #4a7c3f;
    --rdo-green-dark:  #355c2d;
    --rdo-green-light: #e8f2e5;
    --rdo-orange:      #e8531c;
    --rdo-beige:       #faf7f2;
    --rdo-border:      #d0cec9;
    --rdo-radius:      8px;
    --rdo-shadow:      0 2px 8px rgba(0,0,0,.10);
}

/* Single Sammelstelle ----------------------------------------- */
.rdo-sammelstelle {
    font-family: inherit;
    border: 1px solid var(--rdo-border);
    border-radius: var(--rdo-radius);
    overflow: hidden;
    box-shadow: var(--rdo-shadow);
    background: #fff;
    margin: 1.5em 0;
}

.rdo-sammelstelle.rdo-layout-list {
    display: flex;
    align-items: flex-start;
}

.rdo-ss-image img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    display: block;
}
.rdo-layout-list .rdo-ss-image {
    flex: 0 0 200px;
}
.rdo-layout-list .rdo-ss-image img {
    height: 100%;
}

.rdo-ss-content {
    padding: 20px 24px;
    flex: 1;
}

.rdo-ss-title {
    margin: 0 0 12px;
    font-size: 1.3rem;
    color: var(--rdo-green-dark);
    border-bottom: 2px solid var(--rdo-green-light);
    padding-bottom: 8px;
}

/* Address ---------------------------------------------------- */
.rdo-ss-address {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}
.rdo-ss-address address {
    font-style: normal;
    line-height: 1.5;
    flex: 1;
}
.rdo-icon {
    font-size: 16px;
    line-height: 1.5;
}

.rdo-route-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: var(--rdo-orange);
    color: #fff !important;
    text-decoration: none !important;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    transition: background .15s;
    white-space: nowrap;
}
.rdo-route-btn:hover {
    background: #c4430f;
    color: #fff !important;
}

/* Contact ---------------------------------------------------- */
.rdo-ss-contact {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 10px;
    font-size: 14px;
}
.rdo-ss-contact span {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}
.rdo-ss-contact a {
    color: var(--rdo-green);
    text-decoration: none;
}
.rdo-ss-contact a:hover { text-decoration: underline; }

.rdo-ss-note {
    margin-bottom: 12px;
    color: #555;
    font-size: 14px;
    background: var(--rdo-beige);
    border-left: 3px solid var(--rdo-orange);
    padding: 6px 12px;
    border-radius: 0 4px 4px 0;
}

/* Hours ------------------------------------------------------ */
.rdo-ss-hours {
    margin-top: 16px;
    border-top: 1px solid var(--rdo-border);
    padding-top: 14px;
}
.rdo-ss-hours-title {
    margin: 0 0 12px;
    font-size: 1rem;
    color: var(--rdo-green-dark);
}

.rdo-ss-product-group {
    background: var(--rdo-green-light);
    border-radius: var(--rdo-radius);
    padding: 10px 14px;
    margin-bottom: 10px;
}
.rdo-ss-product-name {
    margin: 0 0 6px;
    font-size: 0.9rem;
    color: var(--rdo-green-dark);
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 6px;
}
.rdo-ss-product-name::before {
    content: '';
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--rdo-green);
}
.rdo-ss-start-date {
    margin: 0 0 6px;
    font-size: 12px;
    color: #555;
}
.rdo-ss-time-list {
    margin: 0;
    padding: 0;
    list-style: none;
}
.rdo-ss-time-list li {
    padding: 3px 0;
    font-size: 14px;
    border-bottom: 1px solid rgba(74,124,63,.15);
}
.rdo-ss-time-list li:last-child { border-bottom: none; }
.rdo-ss-time-list li small { color: var(--rdo-muted, #777); margin-left: 6px; }

/* Overview Table --------------------------------------------- */
.rdo-overview { overflow-x: auto; }

.rdo-overview-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}
.rdo-overview-table th {
    background: var(--rdo-green);
    color: #fff;
    padding: 10px 14px;
    text-align: left;
    font-weight: 600;
}
.rdo-overview-table td {
    padding: 10px 14px;
    border-bottom: 1px solid var(--rdo-border);
    vertical-align: top;
}
.rdo-overview-table tr:nth-child(even) td {
    background: var(--rdo-beige);
}
.rdo-overview-table tr:hover td {
    background: var(--rdo-green-light);
}

.rdo-overview-times {
    margin: 0;
    padding: 0;
    list-style: none;
}
.rdo-overview-times li { margin-bottom: 3px; font-size: 13px; }

.rdo-no-results {
    padding: 20px;
    color: #777;
    font-style: italic;
}

/* Status Badge ----------------------------------------------- */
.rdo-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 20px;
    white-space: nowrap;
    letter-spacing: .2px;
}
.rdo-status-badge::before {
    content: '';
    display: inline-block;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    flex-shrink: 0;
    animation: rdoStatusPulse 1.8s ease-in-out infinite;
}
.rdo-badge--open {
    background: #e8f5e4;
    color: #2e7d32;
    border: 1px solid #81c784;
}
.rdo-badge--open::before    { background: #43a047; --rdo-pulse-color: 67,160,71; }
.rdo-badge--soon {
    background: #fff3e0;
    color: #e65100;
    border: 1px solid #ffb74d;
}
.rdo-badge--soon::before    { background: #fb8c00; --rdo-pulse-color: 251,140,0; }
.rdo-badge--closed {
    background: #fce4e4;
    color: #b71c1c;
    border: 1px solid #ef9a9a;
}
.rdo-badge--closed::before  { background: #e53935; --rdo-pulse-color: 229,57,53; }

@keyframes rdoStatusPulse {
    0%   { box-shadow: 0 0 0 0 rgba(var(--rdo-pulse-color, 0,0,0), .55); }
    70%  { box-shadow: 0 0 0 6px rgba(var(--rdo-pulse-color, 0,0,0), 0); }
    100% { box-shadow: 0 0 0 0 rgba(var(--rdo-pulse-color, 0,0,0), 0); }
}
@media (prefers-reduced-motion: reduce) {
    .rdo-status-badge::before { animation: none; }
}

.rdo-status-next {
    display: block;
    font-size: 11px;
    color: #666;
    margin-top: 3px;
}

/* Dual-Badge (Sammelstelle + Getränkemarkt) ------------------ */
.rdo-dual-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: flex-start;
}

/* Getränkemarkt-Badge: Blau (eigene Farbe) */
.rdo-badge--gm.rdo-badge--open {
    background: #e3f0fb;
    color: #1565c0;
    border-color: #90caf9;
}
.rdo-badge--gm.rdo-badge--open::before  { background: #1976d2; --rdo-pulse-color: 25,118,210; }
.rdo-badge--gm.rdo-badge--soon {
    background: #fff3e0;
    color: #e65100;
    border-color: #ffb74d;
}
.rdo-badge--gm.rdo-badge--closed {
    background: #fce4e4;
    color: #b71c1c;
    border-color: #ef9a9a;
}

/* Getränkemarkt-Block im Frontend ---------------------------- */
.rdo-getraenk-block {
    margin-top: 16px;
    border-top: 1px solid var(--rdo-border);
    padding-top: 14px;
}
.rdo-getraenk-title {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 1rem;
    margin: 0 0 10px;
    color: #1565c0;
}
.rdo-getraenk-icon { font-size: 1rem; }
.rdo-getraenk-list {
    margin: 0 0 6px;
    padding: 0;
    list-style: none;
}
.rdo-getraenk-list li {
    padding: 4px 10px;
    background: #e3f0fb;
    border-radius: 4px;
    margin-bottom: 4px;
    font-size: 14px;
    border-left: 3px solid #1976d2;
}
.rdo-getraenk-note {
    font-size: 12px;
    color: #1976d2;
    font-weight: 600;
    margin: 0;
}

.rdo-ss-title-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}
.rdo-ss-title-row .rdo-ss-title { margin: 0; }

/* Typ-Fähnchen (Strip oben an der Karte) --------------------- */
.rdo-type-strip {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 7px 16px;
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: #fff;
    line-height: 1;
}
.rdo-type-strip::before {
    content: '';
    display: inline-block;
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 5px 0 5px 7px;
    border-color: transparent transparent transparent rgba(255,255,255,.45);
    flex-shrink: 0;
}
.rdo-type--sammelstelle         { background: var(--rdo-green); }
.rdo-type--ankauf-lohn          { background: #1976d2; }           /* Blau  */
.rdo-type--ankauf-lohn-getraenk { background: var(--rdo-orange); } /* Orange */

/* Modern Layout (zweispaltige Vollansicht) -------------------- */
.rdo-layout-modern {
    padding: 32px;
    border-radius: 20px;
    box-shadow: 0 4px 24px rgba(0,0,0,.08);
}

.rdo-modern-header {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}
.rdo-modern-avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: var(--rdo-green-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    flex-shrink: 0;
}
.rdo-modern-heading { min-width: 0; }
.rdo-modern-title {
    margin: 0 0 6px;
    font-size: 1.7rem;
    color: var(--rdo-green-dark);
}
.rdo-modern-contact {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    color: #555;
    font-size: 14px;
}
.rdo-modern-contact a { color: #555; text-decoration: none; }
.rdo-modern-contact a:hover { text-decoration: underline; }
.rdo-modern-dot { color: #bbb; }
.rdo-modern-icon { margin-right: 3px; }

.rdo-modern-badges {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 20px;
}
.rdo-layout-modern .rdo-status-badge {
    font-size: 13px;
    padding: 8px 16px;
    border-radius: 6px;
    width: 100%;
    justify-content: center;
}
.rdo-layout-modern .rdo-status-next { display: none; }

.rdo-modern-divider {
    border: none;
    border-top: 1px solid var(--rdo-border);
    margin: 0 0 24px;
}

.rdo-modern-columns {
    display: grid;
    grid-template-columns: 1fr;
    gap: 28px;
}
.rdo-modern-columns.rdo-modern-columns--with-gm {
    grid-template-columns: 1.3fr 1fr;
}

.rdo-modern-col-title {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 14px;
    font-size: 1.05rem;
    color: var(--rdo-green-dark);
}
.rdo-modern-col-title--gm { color: #1565c0; }

.rdo-modern-product-card {
    border: 1px solid var(--rdo-border);
    border-radius: 14px;
    padding: 16px;
    margin-bottom: 14px;
}
.rdo-modern-product-card:last-child { margin-bottom: 0; }
.rdo-modern-product-head {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 10px;
}
.rdo-modern-product-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--rdo-green-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}
.rdo-modern-product-name { font-weight: 700; color: #222; }
.rdo-modern-product-start { font-size: 12px; color: #888; }

.rdo-modern-times {
    border-top: 1px solid var(--rdo-border);
    padding-top: 10px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.rdo-modern-time-row {
    display: flex;
    align-items: baseline;
    gap: 8px;
    font-size: 14px;
    flex-wrap: wrap;
}
.rdo-modern-time-icon { font-size: 13px; }
.rdo-modern-time-row small { color: #999; }

.rdo-modern-gm-card {
    border: 1px solid #cfe3f7;
    background: #f4f9fe;
    border-radius: 14px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.rdo-modern-empty { color: #888; font-style: italic; }

@media (max-width: 700px) {
    .rdo-layout-modern { padding: 20px; }
    .rdo-modern-columns,
    .rdo-modern-columns.rdo-modern-columns--with-gm { grid-template-columns: 1fr; }
}

/* Mini Card -------------------------------------------------- */
.rdo-mini-card {
    border: 1px solid var(--rdo-border);
    border-radius: var(--rdo-radius);
    background: #fff;
    box-shadow: var(--rdo-shadow);
    margin: .75em 0;
    overflow: hidden;
    transition: box-shadow .2s;
    /* Feste Mindesthöhe statt Höhenangleich über den Elterncontainer: die Karten
       stecken in unabhängig gestapelten Spalten (kein gemeinsamer Zeilen-Wrapper
       über alle 3 Spalten), daher lässt sich Gleichhöhe nicht per Grid/Flex-Stretch
       vom Divi-Layout ableiten. Bei ungewöhnlich langem Inhalt wächst die Karte
       trotzdem über die Mindesthöhe hinaus, statt Text abzuschneiden. */
    min-height: 260px;
    height: 100%;
    display: flex;
    flex-direction: column;
}
.rdo-mini-card:hover { box-shadow: 0 3px 14px rgba(0,0,0,.14); }

.rdo-mini-body {
    display: flex;
    justify-content: space-between;
    padding: 12px 16px;
    gap: 14px;
    flex-wrap: wrap;
    /* nimmt jede zusätzliche Höhe der Card auf, Kinder verteilen sich per align-self */
    flex: 1;
}

.rdo-mini-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
    min-width: 0;
    align-self: flex-start;
}

/* Status: volle Kartenbreite, als Balken statt Pille */
.rdo-mini-status-row {
    padding: 10px 16px 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.rdo-mini-status-row .rdo-dual-badges {
    flex-direction: column;
}
.rdo-mini-status-row .rdo-status-badge {
    width: 100%;
    justify-content: center;
    font-size: 14px;
    padding: 6px 14px;
    border-radius: 6px;
}
.rdo-mini-status-row .rdo-status-badge::before {
    width: 9px;
    height: 9px;
}
.rdo-mini-status-row .rdo-status-next {
    text-align: center;
}

.rdo-mini-name {
    font-size: 15px;
    font-weight: 700;
    color: var(--rdo-green-dark);
    line-height: 1.3;
}

.rdo-mini-address-block {
    display: flex;
    flex-direction: column;
    gap: 1px;
}
.rdo-mini-addr-line {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    color: #555;
    line-height: 1.4;
}
.rdo-mini-addr-plz {
    padding-left: 18px; /* fluchtet mit Icon oben */
    font-weight: 600;
    color: #333;
}
.rdo-mini-icon { font-size: 13px; flex-shrink: 0; }

/* "Alle Infos"-Button */
.rdo-mini-detail-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: var(--rdo-green);
    color: #fff;
    border: none;
    border-radius: 22px;
    padding: 8px 18px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
    transition: background .15s, transform .1s;
    line-height: 1;
    align-self: flex-end;
}
.rdo-mini-detail-btn:hover  { background: var(--rdo-green-dark); }
.rdo-mini-detail-btn:active { transform: scale(.97); }
.rdo-mini-detail-btn svg    { flex-shrink: 0; }

/* Modal (optional, via JS trigger) --------------------------- */
.rdo-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.55);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: rdoFadeIn .2s ease;
}
.rdo-modal-overlay[hidden] { display: none; }

@keyframes rdoFadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.rdo-modal-box {
    background: #fff;
    border-radius: var(--rdo-radius);
    max-width: 640px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    padding: 24px;
    box-shadow: 0 8px 32px rgba(0,0,0,.25);
    animation: rdoSlideUp .2s ease;
}
@keyframes rdoSlideUp {
    from { transform: translateY(20px); opacity: 0; }
    to   { transform: translateY(0);    opacity: 1; }
}

/* Typ-Strip im Modal: negativer Rand damit es bündig am oberen Rahmen liegt */
.rdo-modal-body .rdo-type-strip {
    margin: -24px -24px 16px -24px;
    border-radius: var(--rdo-radius) var(--rdo-radius) 0 0;
}

.rdo-modal-close {
    position: absolute;
    top: 14px;
    right: 16px;
    background: none;
    border: none;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    color: #888;
    padding: 2px 6px;
}
.rdo-modal-close:hover { color: #111; }

body.rdo-modal-open { overflow: hidden; }

.rdo-popup-header { margin-bottom: 14px; }
.rdo-popup-title-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 6px;
}
.rdo-popup-title { margin: 0; font-size: 1.2rem; color: var(--rdo-green-dark); }
.rdo-popup-image img {
    width: 100%;
    max-height: 180px;
    object-fit: cover;
    border-radius: var(--rdo-radius);
}

/* Responsive ------------------------------------------------- */
@media (max-width: 600px) {
    .rdo-layout-list { flex-direction: column; }
    .rdo-layout-list .rdo-ss-image { flex: none; width: 100%; }
    .rdo-ss-content { padding: 14px 16px; }
    .rdo-ss-address { flex-direction: column; }

    /* Mini-Card: Button unter statt neben den (oft umbrechenden) Adresstext.
       Etwas mehr Mindesthöhe als auf Desktop, da der Button jetzt eine eigene
       Zeile braucht und Text auf schmaler Breite eher umbricht. */
    .rdo-mini-card { min-height: 300px; }
    .rdo-mini-body {
        flex-direction: column;
        align-items: stretch;
    }
    .rdo-mini-info { align-self: stretch; }
    .rdo-mini-detail-btn {
        align-self: stretch;
        justify-content: center;
        margin-top: 4px;
    }
}
