/* ── Base ── */
*, *::before, *::after {
    box-sizing: border-box;
}

body {
    font-family: sans-serif;
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem;
    background: #f9f6f1;
    color: #222;
}

a {
    color: #b5451b;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* ── Nav ── */
nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
    border-bottom: 2px solid #b5451b;
    margin-bottom: 2rem;
}

nav a {
    font-weight: bold;
    font-size: 1.1rem;
}

/* ── Footer ── */
footer {
    margin-top: 3rem;
    padding-top: 1rem;
    border-top: 2px solid #b5451b;
    text-align: center;
    color: #888;
    font-size: 0.9rem;
}

.footer-nav {
    border-bottom: 1px solid #ddd;
    padding: 0 0 1rem 0;
    margin-bottom: 0.5rem;
}

/* ── Buttons ── */
button, .button {
    background: #b5451b;
    color: white;
    border: none;
    padding: 0.5rem 1.2rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1rem;
}

button:hover, .button:hover {
    background: #8f3515;
}

/* ── Forms ── */
form label {
    display: block;
    margin-top: 1rem;
    font-weight: bold;
}

form input {
    display: block;
    width: 100%;
    max-width: 400px;
    padding: 0.4rem 0.6rem;
    margin-top: 0.3rem;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 1rem;
}

form input[type="number"] {
    max-width: 80px;
}

form button {
    margin-top: 1.2rem;
}

/* ── Filter form ── */
.filter-form {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    align-items: center;
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1.2rem;
}

.filter-form input[type="text"],
.filter-form select {
    padding: 0.4rem 0.6rem;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 0.95rem;
    background: white;
}

.filter-form input[type="text"] {
    flex: 1;
    min-width: 150px;
    max-width: 100%;
    width: auto;
    display: inline;
    margin-top: 0;
}

.filter-form button {
    margin-top: 0;
    padding: 0.4rem 1rem;
}

.reset-link {
    font-size: 0.9rem;
    color: #888;
}

.reset-link:hover {
    color: #b5451b;
}

/* ── Result count ── */
.result-count {
    font-size: 0.9rem;
    color: #888;
    margin-bottom: 1rem;
}

/* ── Error message (stock check, form errors) ── */
.error-message {
    background: #fdecea;
    color: #b5451b;
    border: 1px solid #f5c6c0;
    border-radius: 6px;
    padding: 0.7rem 1rem;
    margin: 1rem 0;
}

/* ── No results message ── */
.no-results {
    text-align: center;
    color: #888;
    margin-top: 3rem;
}

/* ── Product images ── */

/* Wrapper is the anchor for the sold-out overlay positioned on top of the image */
.product-image-wrapper {
    position: relative;
}

/* Semi-transparent grey layer that covers the image with centered "Ausverkauft" text */
.sold-out-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.65);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgb(60, 60, 60);
    font-weight: bold;
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.product-card img {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: contain;
    border-radius: 6px;
    background: white;
    padding: 0.5rem;
}

.product-detail-image {
    width: 100%;
    max-width: 350px;
    border-radius: 8px;
    margin-top: 1.5rem;
    margin-bottom: 1rem;
    display: block;
    background: white;
    padding: 1rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* ── Product card extras ── */
.product-info-block {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    flex-grow: 1;
}

.product-info-block p {
    margin: 0.75rem 0 0 0;
}

.product-description {
    flex-grow: 1;
}

/* Out-of-stock cards are faded so the user can see them but they clearly look unavailable */
.out-of-stock {
    opacity: 0.55;
}

/* "Ausverkauft" badge — grey pill matching the style of the category badge */
.stock-badge {
    display: inline-block;
    background: #888;
    color: white;
    font-size: 0.75rem;
    font-weight: bold;
    text-transform: uppercase;
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
    letter-spacing: 0.05em;
}

/* Disabled button keeps the same shape but signals it can't be clicked */
button:disabled {
    background: #ccc;
    color: #888;
    cursor: not-allowed;
}

button:disabled:hover {
    background: #ccc;
}

.product-category {
    font-size: 0.75rem;
    font-weight: bold;
    text-transform: uppercase;
    color: #b5451b;
    letter-spacing: 0.05em;
}

.product-players {
    font-size: 0.85rem;
    color: #666;
    margin: 0;
}

.product-delivery {
    font-size: 0.72rem;
    color: #999;
}

/* ── Product grid ── */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1.5rem;
}

.product-card {
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.product-card a {
    margin-top: auto;
    display: inline-block;
    background: #b5451b;
    color: white;
    padding: 0.4rem 0.9rem;
    border-radius: 6px;
    font-weight: bold;
    text-align: center;
}

.product-card a:hover {
    background: #8f3515;
    text-decoration: none;
}

/* ── Tables (cart, admin) ── */
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

th {
    text-align: left;
    border-bottom: 2px solid #b5451b;
    padding: 0.5rem;
}

td {
    padding: 0.5rem;
    border-bottom: 1px solid #eee;
}

/* ── Cart remove button ── */
td form button {
    background: #888;
    padding: 0.3rem 0.7rem;
    font-size: 0.85rem;
    margin-top: 0;
}

td form button:hover {
    background: #555;
}

/* ── Widerruf CTA button ── */
.btn-widerruf {
    display: inline-block;
    background: #b5451b;
    color: white;
    text-decoration: none;
    padding: 0.6rem 1.5rem;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: bold;
    margin-top: 0.5rem;
    margin-bottom: 0.5rem;
}

.btn-widerruf:hover {
    background: #8f3515;
    color: white;
}
