/* Container Layout */
.sw-merch-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    padding: 1.5rem 0;
}

/* Tablet: 3 Spalten */
@media (min-width: 768px) {
    .sw-merch-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Desktop: 4 Spalten */
@media (min-width: 1024px) {
    .sw-merch-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Card Styling - Clean & Modern */
.sw-merch-card {
    background-color: var(--font-weiss, #ffffff);
    display: flex;
    flex-direction: column;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 30, 100, 0.04);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.sw-merch-card:hover,
.sw-merch-card:focus-within {
    transform: translateY(-5px);
    box-shadow: 0 12px 25px rgba(0, 30, 100, 0.08);
}

/* Image Area */
.sw-merch-media {
    width: 100%;
    aspect-ratio: 1 / 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2.5rem;
    position: relative;
    background-color: #ffffff;
}

.sw-merch-img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    transition: transform 0.4s ease, opacity 0.3s ease, filter 0.3s ease;
}

.sw-merch-card:not(.is-out-of-stock):hover .sw-merch-img {
    transform: scale(1.05);
}

/* Out of Stock Status */
.sw-merch-card.is-out-of-stock .sw-merch-img {
    opacity: 0.55;
    filter: grayscale(100%);
}

.sw-merch-badge-outofstock {
    position: absolute;
    top: 1.25rem;
    right: 1.25rem;
    background-color: #e53e3e;
    color: #ffffff;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    padding: 0.35rem 0.75rem;
    border-radius: 4px;
    z-index: 2;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 6px rgba(229, 62, 62, 0.2);
}

/* Content Area */
.sw-merch-body {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    justify-content: space-between;
    background-color: #ffffff;
}

.sw-merch-header {
    margin-bottom: 1.5rem;
}

.sw-merch-subtitle {
    display: block;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--color-brand-green, #52992F);
    margin-bottom: 0.35rem;
}

.sw-merch-title {
    margin: 0;
    font-size: 1.35rem;
    font-weight: 700;
    line-height: 1.25;
    color: var(--color-primary, #002868);
}

/* Footer Area (Price & Actions) */
.sw-merch-footer {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
    border-top: 1px solid #f1f5f9;
    padding-top: 1.25rem;
    margin-top: auto;
}

.sw-merch-price {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--color-primary, #002868);
    line-height: 1;
    display: flex;
    align-items: baseline;
}

.sw-merch-currency {
    font-size: 1.1rem;
    font-weight: 700;
    margin-right: 0.25rem;
}

.sw-merch-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

/* Buttons */
.sw-merch-btn-anfrage {
    padding: 0.6rem 1.2rem;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 6px;
    line-height: 1.2;
    background-color: var(--color-brand-green, #52992F);
    color: var(--font-weiss, #ffffff);
    border: 1px solid var(--color-brand-green, #52992F);
    cursor: pointer;
    transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.sw-merch-btn-anfrage:not(:disabled):hover,
.sw-merch-btn-anfrage:not(:disabled):focus-visible {
    background-color: #427c25;
    border-color: #427c25;
    outline: 2px solid var(--color-primary, #002868);
    outline-offset: 2px;
}

.sw-merch-btn-anfrage:disabled {
    background-color: #e2e8f0;
    color: #94a3b8;
    border-color: #e2e8f0;
    cursor: not-allowed;
}

.sw-merch-btn-info {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background-color: var(--font-weiss, #ffffff);
    color: var(--color-primary, #002868);
    border: 1px solid #cbd5e1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: serif;
    font-style: italic;
    font-size: 1.2rem;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.sw-merch-btn-info:hover,
.sw-merch-btn-info:focus-visible {
    background-color: var(--color-bg-even, #f4f7fa);
    border-color: var(--color-primary, #002868);
    outline: 2px solid var(--color-brand-green, #52992F);
    outline-offset: 2px;
}

/* Modals */
.merch-modal {
    padding: 0;
    border: none;
    border-radius: 12px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    max-width: 550px;
    width: 90%;
    background: var(--font-weiss, #ffffff);
    color: var(--color-text, #333333);
}

.merch-modal::backdrop {
    background: rgba(0, 30, 100, 0.85);
    backdrop-filter: blur(4px);
}

.merch-modal-inner {
    display: flex;
    flex-direction: column;
}

.merch-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem;
    border-bottom: 1px solid rgba(0, 30, 100, 0.08);
    background-color: var(--color-bg-even, #f4f7fa);
}

.merch-modal-header h4 {
    margin: 0;
    color: var(--color-primary, #002868);
    font-size: 1.25rem;
    font-weight: 700;
}

.merch-modal-close {
    background: transparent;
    border: none;
    font-size: 1.8rem;
    cursor: pointer;
    color: var(--color-primary, #002868);
    padding: 0.5rem;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease, color 0.2s ease;
    margin-right: -0.5rem;
}

.merch-modal-close:hover,
.merch-modal-close:focus-visible {
    transform: scale(1.1);
    color: var(--color-brand-green, #52992F);
    outline: 2px solid var(--color-brand-green, #52992F);
    outline-offset: 2px;
    border-radius: 4px;
}

.merch-modal-body {
    padding: 2rem;
    line-height: 1.6;
}

/* Form Styling within Modal */
.merch-form {
    margin-top: 1.5rem;
}

.sw-form-group {
    margin-bottom: 1.25rem;
    text-align: left;
}

.sw-form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.4rem;
    color: var(--color-primary, #002868);
    font-size: 0.95rem;
}

.sw-form-control {
    width: 100%;
    padding: 0.8rem 1rem;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-family: inherit;
    font-size: 1rem;
    background-color: var(--font-weiss, #ffffff);
    color: var(--color-text, #333333);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.sw-form-control:focus {
    outline: none;
    border-color: var(--color-brand-green, #52992F);
    box-shadow: 0 0 0 3px rgba(82, 153, 47, 0.15);
}

textarea.sw-form-control {
    resize: vertical;
}

/* Privacy Checkbox Styling */
.sw-form-check {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

.sw-form-check-input {
    margin-top: 0.25rem;
    width: 1.15rem;
    height: 1.15rem;
    flex-shrink: 0;
    accent-color: var(--color-brand-green, #52992F);
    cursor: pointer;
}

.sw-form-check-label {
    font-size: 0.85rem;
    font-weight: 400 !important;
    line-height: 1.4;
    cursor: pointer;
}

.sw-form-check-label a {
    color: var(--color-primary, #002868);
    text-decoration: underline;
    font-weight: 600;
}

.sw-form-check-label a:hover {
    color: var(--color-brand-green, #52992F);
}

.mt-4 {
    margin-top: 1.5rem;
}

/* Success Message im Modal */
.sw-merch-success-msg {
    text-align: center;
    padding: 2.5rem 1rem;
    outline: none;
    /* Verhindert Rahmen beim programmatischen Fokus */
}

.sw-merch-success-title {
    color: var(--color-brand-green, #52992F);
    font-size: 1.75rem;
    margin-bottom: 1rem;
    font-weight: 700;
}

@media (min-width: 500px) and (max-width: 767px) {
    .sw-merch-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
