* {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 32px 20px;
    color: #004E47;
    font-family: Verdana, Geneva, Tahoma, sans-serif;
    background: #fff;
}

.page-title {
    text-align: center;
    font-size: clamp(1.5rem, 2vw, 2.2rem);
    font-weight: 700;
    margin-bottom: 24px;
}

.shop {
    position: relative;
    display: grid;
    gap: 18px;
    width: min(980px, 100%);
    max-width: 980px;
    margin: 0 auto;
    padding: 24px 16px 32px;
    border: 2px solid #9dbe28;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.28);
    box-shadow: 0 6px 18px rgba(0, 78, 71, 0.06);
    overflow: visible;
    z-index: 1;
    isolation: isolate;
}

.shelf-row {
    position: relative;
    display: block;
    width: 100%;
    min-height: 120px;
    padding: 18px 0 22px;
    border-radius: 10px;
    z-index: 0;
    margin: 0 auto;
}

.shelf-board {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - 8px);
    max-width: 930px;
    bottom: 0;
    height: 38px;
    border-radius: 8px;
    background-image: url("objects/ShelfWood.jpg");
    background-position: center center;
    background-repeat: no-repeat;
    background-size: 100% 100%;
    opacity: 0.96;
    z-index: 0;
}

.shelf-items {
    position: relative;
    z-index: 1;
    display: flex;
    justify-content: space-evenly;
    align-items: flex-end;
    gap: 20px;
    width: min(930px, calc(100% - 8px));
    max-width: 930px;
    margin: 0 auto;
    padding: 0;
    min-width: 0;
}

.item {
    position: relative;
    z-index: 1;
    flex: 1 1 0;
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: url("objects/Firefly_Werkzeugsymbolbild.jpg") no-repeat center center;
    backdrop-filter: blur(8px); /* Zeichnet den Hintergrund dahinter weich */
    background-size: cover;
    color: #9dbe28;
    text-shadow: 1px 1px 1px black;
    padding: 18px 24px;
    border-radius: 12px;
    border: 1px solid #9dbe28;
    text-align: center;
    overflow-wrap: anywhere;
    width: min(180px, 100%);
    max-width: 180px;
    min-height: 180px;
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.2s ease;
    cursor: pointer;
    margin-bottom: 18px;
    -webkit-hyphens: auto; /* Für Safari */
    -ms-hyphens: auto; /* Für Internet Explorer */
    hyphens: auto;
}

.item--priced {
    padding-top: 30px;
}

.item--bought {
    padding-top: 30px;
    background-size: cover;
    cursor: not-allowed;
}

.item-label {
    display: block;
}

.item:hover,
.item:focus-visible {
    background: #9dbe28;
    color: #004E47;
    box-shadow: 0 8px 18px rgba(157, 190, 40, 0.25);
    outline: 3px solid #9dbe28; 
}

.item:focus-visible,
.close-btn:focus-visible,
.secondary-btn:focus-visible {
    outline: 3px solid #9dbe28; 
    outline-offset: 3 px;
}

.popup-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.popup-overlay.hidden {
    display: none;
}

.price-tag {
    position: absolute;
    text-shadow: none;
    top: 7px;
    right: 8px;
    transform: translateY(-20%);
    display: inline-block;
    margin: 0;
    padding: 6px 8px;
    background: #9dbe28;
    color: #004E47;
    font-size: 0.7rem;
    font-weight: 600;
    border-radius: 5px;
    z-index: 2;
    border: 1px solid rgba(255, 255, 255, 0.45);
}

.sponsor-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    right: 10px;
    display: grid;
    gap: 2px;
    padding: 8px 10px;
    background: #004E47;
    color: #fff;
    text-align: left;
    border-radius: 7px;
    z-index: 2;
    border: 1px solid rgba(255, 255, 255, 0.45);
    box-shadow: 0 3px 8px rgba(0, 78, 71, 0.22);
}

.sponsor-status {
    color: #d8ed76;
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.sponsor-name {
    font-size: 0.82rem;
    font-weight: 700;
    overflow-wrap: anywhere;
}

.popup {
    position: relative;
    width: min(520px, 100%);
    background: #fff;
    border: 1px solid #9dbe28;
    border-radius: 18px;
    padding: 28px 24px 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.18);
    margin: 0 auto;
    max-height: 80vh;
    overflow: auto; 
}

.popup h2 {
    margin: 0 0 18px;
    color: #004E47;
    font-size: 1.4rem;
}

.close-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    border: none;
    background: transparent;
    font-size: 2rem;
    line-height: 1;
    cursor: pointer;
    color: #004E47;
}

#genericContent,
#specificContent {
    line-height: 1.6;
}

#genericContent h3 {
    margin: 0 0 10px;
    color: #004E47;
    font-size: 1.3rem;
}

#specificContent {
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid #e7ebdd;
}

.popup-item {
    display: grid;
    gap: 10px;
}

.popup-label {
    margin: 0;
    font-size: 0.75rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #5d7857;
    font-weight: 700;
}

.price-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-top: 8px;
    padding: 12px 14px;
    background: #f4f8eb;
    border-radius: 10px;
    border: 1px solid #dfeabd;
}

.price-row strong {
    color: #004E47;
    font-size: 1.1rem;
}

.secondary-btn {
    margin-top: 14px;
    width: 100%;
    border: none;
    border-radius: 10px;
    background: #004E47;
    color: #fff;
    padding: 12px 16px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease;
}

.secondary-btn:hover,
.secondary-btn:focus-visible {
    background: #003b38;
    transform: translateY(-1px);
    outline: 3px solid #9dbe28;
}

.popup-note {
    margin: 0;
    color: #48635d;
}

.popup-step.hidden {
    display: none;
}

#sponsorshipForm {
    display: grid;
    gap: 12px;
}

#sponsorshipForm p {
    margin: 0;
}

#sponsorshipForm label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
}

#sponsorshipForm input[type="text"] {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #b8c9a0;
    border-radius: 8px;
    color: #004E47;
    font: inherit;
}

#sponsorshipForm input[type="checkbox"] {
    margin-right: 6px;
    accent-color: #9dbe28;
}

.form-error {
    color: #9b1c1c;
    font-weight: 600;
}

.pay-pal-link {
    display: inline-block;
    padding: 8px 12px;
    border-radius: 8px;
    background: #004E47;
    color: #9dbe28;
    font-weight: 600;
}

@media (max-width: 900px) {
    .item {
        width: min(170px, 100%);
    }

    .shelf-row {
        gap: 14px;
    }
}

@media (max-width: 600px) {
    .shop {
        padding: 18px 12px 20px;
    }

    .shelf-row {
        padding: 12px 0 16px;
        min-height: 110px;
    }

    .shelf-board {
        width: calc(100% - 8px);
        height: 30px;
    }

    .shelf-items {
        width: calc(100% - 8px);
        gap: 12px;
    }

    .item {
        width: min(150px, 100%);
        margin-bottom: 12px;
    }

    .popup {
        padding: 22px 16px 18px;
    }
}
