/* ==========================================================================
   Shop & Warenkorb – ergänzt style.css (wird nur auf shop.html geladen)
   Ziel: große Bedienelemente, gut lesbare Schrift, klare Rückmeldungen.
   ========================================================================== */

[hidden] {
    display: none !important;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

body.modal-open {
    overflow: hidden;
}

/* Deutlich sichtbarer Tastatur-Fokus */
.shop-section :focus-visible,
.virtual-modal :focus-visible,
.cart-float:focus-visible,
.shop-toast :focus-visible {
    outline: 3px solid #0B57D0;
    outline-offset: 2px;
}

#cart-title:focus,
.cart-success h4:focus {
    outline: none;
}

/* Buttons im Shop: normale Schreibweise statt GROSSBUCHSTABEN (leichter lesbar) */
.shop-section .btn,
.virtual-modal .btn,
.shop-toast .btn {
    text-transform: none;
    letter-spacing: 0;
    font-size: 1rem;
    font-weight: 600;
    min-height: 48px;
}

.btn-block {
    display: block;
    width: 100%;
}

.btn-back,
.btn-secondary-outline {
    background: #FFFFFF;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
}

.btn-back:hover,
.btn-secondary-outline:hover {
    background: var(--primary-color);
    color: #FFFFFF;
    transform: translateY(-2px);
}

/* --- Seite & Hinweis-Banner --- */
.shop-section {
    padding-block: 50px 110px;
}

.shop-notice {
    max-width: 760px;
    margin: 0 auto 30px;
    padding: 14px 20px;
    background: #FDFBF7;
    border: 1px solid #E6DEC8;
    border-left: 5px solid var(--accent-color);
    border-radius: 10px;
    font-size: 1.05rem;
    line-height: 1.5;
    color: var(--primary-color);
    text-align: center;
}

.shop-noscript {
    padding: 20px;
    background: #FDFBF7;
    border-radius: 10px;
    font-size: 1.1rem;
    text-align: center;
}

.filter-btn {
    font-size: 1rem;
    min-height: 48px;
}

/* --- Produktkarten --- */
.shop-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(285px, 100%), 1fr));
    gap: 35px;
}

.shop-grid .card:hover {
    transform: translateY(-4px);
}

.shop-grid .card:hover .card-img-wrapper img {
    transform: scale(1.04);
}

.product-tag {
    color: #86680A;
    font-size: 0.85rem;
}

.product-title {
    font-size: 1.4rem;
    margin: 4px 0 8px;
}

.product-text {
    font-size: 1rem;
    color: #4A4A4A;
    line-height: 1.5;
    margin-bottom: 12px;
}

.variant-label {
    font-size: 0.95rem;
    color: #3A3A3A;
}

.variant-select {
    font-size: 1rem;
    min-height: 48px;
    padding: 10px 12px;
    border: 1.5px solid #BDBDB5;
}

.variant-select option:disabled {
    color: #8A8A8A;
}

.product-price {
    font-size: 1.5rem;
}

.product-unit {
    font-size: 0.95rem;
    color: #555555;
}

.product-unavailable-badge {
    display: block;
    font-size: 1rem;
    padding: 14px;
}

/* Menge + "In den Korb" */
.buy-row {
    display: flex;
    gap: 10px;
    align-items: stretch;
}

.buy-row .btn-add-to-cart {
    flex: 1;
    padding: 10px 16px;
    white-space: nowrap;
}

.btn-add-to-cart.is-added,
.btn-add-to-cart.is-added:hover {
    background-color: #1E7A46;
    border-color: #1E7A46;
}

.qty-stepper {
    display: inline-flex;
    align-items: center;
    border: 1.5px solid #BDBDB5;
    border-radius: 50px;
    background: #FFFFFF;
    overflow: hidden;
    flex-shrink: 0;
}

.qty-btn {
    width: 44px;
    height: 46px;
    border: none;
    background: #F2F2EE;
    color: var(--primary-color);
    font-size: 1.4rem;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    transition: background 0.2s;
}

.qty-btn:hover {
    background: var(--primary-color);
    color: #FFFFFF;
}

.qty-input {
    width: 44px;
    height: 46px;
    border: none;
    text-align: center;
    font-size: 1.1rem;
    font-weight: 600;
    font-family: inherit;
    color: var(--text-main);
    background: #FFFFFF;
    -moz-appearance: textfield;
    appearance: textfield;
}

.qty-input::-webkit-outer-spin-button,
.qty-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.btn-details {
    min-height: 44px;
    background: none;
    border: none;
    color: var(--secondary-color);
    font-family: inherit;
    font-size: 1rem;
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 3px;
    cursor: pointer;
}

.btn-details:hover {
    color: var(--secondary-hover);
}

/* --- Warenkorb-Knopf (immer sichtbar) --- */
.cart-float {
    display: flex;
    width: 64px;
    height: 64px;
    bottom: calc(24px + var(--banner-offset, 0px) + env(safe-area-inset-bottom, 0px));
    right: 24px;
    transition: transform 0.2s ease, bottom 0.2s ease;
    border: none;
    font-size: 26px;
    font-family: inherit;
}

.cart-float-count {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 28px;
    height: 28px;
    padding: 0 6px;
    border-radius: 14px;
    background: var(--primary-color);
    color: #FFFFFF;
    border: 2px solid #FFFFFF;
    font-size: 0.95rem;
    font-weight: 700;
    line-height: 24px;
    text-align: center;
}

/* --- Hinweis-Leiste (Toast) --- */
.shop-toast {
    position: fixed;
    left: 50%;
    bottom: calc(24px + var(--banner-offset, 0px) + env(safe-area-inset-bottom, 0px));
    z-index: 10001; /* über Dialogen und dem Cookie-Banner */
    display: flex;
    align-items: center;
    gap: 14px;
    width: max-content;
    max-width: min(560px, calc(100% - 32px));
    padding: 14px 18px;
    background: var(--primary-color);
    color: #FFFFFF;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    font-size: 1.05rem;
    line-height: 1.4;
    transform: translate(-50%, 150%);
    opacity: 0;
    visibility: hidden;
    transition: transform 0.3s ease, opacity 0.3s ease, visibility 0.3s;
}

.shop-toast.is-visible {
    transform: translate(-50%, 0);
    opacity: 1;
    visibility: visible;
}

.shop-toast-action {
    flex-shrink: 0;
    min-height: 44px;
    padding: 8px 16px;
    border: 2px solid #FFFFFF;
    border-radius: 50px;
    background: #FFFFFF;
    color: var(--primary-color);
    font-family: inherit;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
}

.shop-toast-action:hover {
    background: transparent;
    color: #FFFFFF;
}

/* --- Dialoge --- */
.virtual-modal.is-open {
    display: flex;
}

/* Platz für den Cookie-Banner lassen, damit die Senden-Knöpfe nie verdeckt sind */
.virtual-modal {
    box-sizing: border-box;
    padding-bottom: var(--banner-offset, 0px);
}

.virtual-modal .virtual-modal-content {
    padding: 0;
    width: 95%;
    max-width: 580px;
    max-height: calc(92vh - var(--banner-offset, 0px));
    border-radius: 20px;
    overflow: hidden;
    background: #FFFFFF;
    display: flex;
    flex-direction: column;
}

.virtual-modal .close-modal {
    position: absolute;
    top: 14px;
    right: 14px;
    float: none;
    width: 44px;
    height: 44px;
    border: none;
    border-radius: 50%;
    background: #EDEDED;
    color: #333333;
    font-size: 30px;
    font-weight: 400;
    line-height: 1;
    font-family: inherit;
}

.virtual-modal .close-modal:hover {
    background: #DCDCDC;
    color: #000000;
}

.virtual-modal-content h3 {
    padding-right: 70px;
}

/* --- Warenkorb-Inhalt --- */
.cart-modal-body {
    font-size: 1rem;
}

.cart-empty {
    text-align: center;
    padding: 30px 10px;
    color: #555555;
}

.cart-empty-icon {
    font-size: 3rem;
    opacity: 0.35;
    margin-bottom: 10px;
}

.cart-empty-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-main);
}

.cart-empty .btn {
    margin-top: 18px;
}

.cart-items-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #EEEEEE;
    font-weight: 600;
    font-size: 1.05rem;
}

.cart-clear-btn {
    min-height: 44px;
    padding: 0 8px;
    background: none;
    border: none;
    color: #555555;
    font-family: inherit;
    font-size: 0.95rem;
    text-decoration: underline;
    cursor: pointer;
}

.cart-items-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.cart-item {
    padding: 16px;
    gap: 16px;
    margin-bottom: 14px;
    align-items: flex-start;
    border-color: #E6E6E6;
}

.cart-item-header {
    flex-direction: column;
    gap: 4px;
}

.cart-item-price {
    font-size: 0.95rem;
    color: #555555;
}

.cart-item-actions {
    gap: 12px;
    flex-wrap: wrap;
}

.qty-stepper-small .qty-value {
    min-width: 40px;
    text-align: center;
    font-size: 1.1rem;
    font-weight: 700;
}

.cart-item-total {
    font-size: 1.15rem;
}

.virtual-modal .remove-btn {
    position: static;
    width: auto;
    height: auto;
    min-height: 44px;
    margin-top: 6px;
    padding: 0 4px;
    align-self: flex-start;
    border: none;
    border-radius: 6px;
    background: none;
    color: #B3261E;
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 600;
    gap: 6px;
}

.virtual-modal .remove-btn:hover {
    background: #FFF0F0;
    color: #8C1D18;
}

/* Lieferart */
.cart-delivery-section {
    border: 0;
    margin: 25px 0 0;
    padding: 20px 0 0;
    border-top: 1px solid #EEEEEE;
    min-width: 0;
}

.delivery-section-title {
    font-size: 1.1rem;
    padding: 0;
}

.delivery-card {
    padding: 14px;
    min-height: 64px;
}

.delivery-card:focus-within {
    outline: 3px solid #0B57D0;
    outline-offset: 2px;
}

.delivery-text strong {
    font-size: 1.05rem;
}

.delivery-text small {
    font-size: 0.9rem;
    color: #555555;
}

.pickup-info-box,
.pickup-info-header strong,
.pickup-info-header p {
    font-size: 1rem;
}

.shipping-form-title {
    font-size: 1.05rem;
}

/* Formularfelder: 16px Schrift verhindert das automatische Zoomen auf iPhones */
.form-group label {
    font-size: 0.95rem;
    color: #333333;
}

.form-group .optional {
    font-weight: 400;
    color: #666666;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    min-height: 48px;
    padding: 10px 12px;
    border: 1.5px solid #BDBDB5;
    border-radius: 8px;
    font-family: inherit;
    font-size: 1rem;
    background: #FFFFFF;
    color: var(--text-main);
}

.form-group textarea {
    resize: vertical;
}

.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(17, 36, 28, 0.1);
}

.form-group input.input-error {
    border-color: #B3261E;
}

.form-group-zip {
    flex: 1;
}

.form-group-city {
    flex: 1.6;
}

.cart-note {
    margin-top: 20px;
}

/* Altersbestätigung */
.age-confirm-box {
    margin-top: 18px;
    padding: 14px 16px;
    background: #FFFAF0;
    border: 2px solid #E6DEC8;
    border-radius: 10px;
}

.age-confirm-box.input-error {
    border-color: #B3261E;
    background: #FFF6F6;
}

.age-confirm-box label {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.05rem;
    cursor: pointer;
}

.age-confirm-box input[type="checkbox"] {
    width: 26px;
    height: 26px;
    flex-shrink: 0;
    accent-color: var(--primary-color);
    cursor: pointer;
}

.age-confirm-box p {
    margin: 8px 0 0 38px;
    font-size: 0.9rem;
    color: #555555;
    line-height: 1.45;
}

/* So geht's weiter */
.checkout-steps-box {
    margin-top: 18px;
    padding: 16px 18px;
    background: #F4F8F5;
    border: 1px solid #DCE8DF;
    border-radius: 10px;
}

.checkout-steps-box h4 {
    margin: 0 0 8px;
    font-size: 1.1rem;
    color: var(--primary-color);
}

.checkout-steps {
    margin: 0;
    padding-left: 22px;
    font-size: 1rem;
    line-height: 1.5;
}

.checkout-steps li {
    margin-bottom: 4px;
}

.checkout-steps-note {
    margin: 10px 0 0;
    font-size: 0.95rem;
    color: #444444;
}

/* E-Mail-Formular */
.email-form-box {
    margin-top: 18px;
    padding: 18px 20px;
    background: #FAFAFA;
    border: 2px solid var(--primary-color);
    border-radius: 12px;
    scroll-margin-top: 10px;
}

.email-form-box .btn {
    margin-top: 14px;
}

.hp-field {
    position: absolute;
    left: -10000px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.privacy-hint {
    margin: 10px 0 0;
    font-size: 0.9rem;
    color: #555555;
}

.shipping-error-msg {
    font-size: 0.95rem;
    color: #8C1D18;
    border-left-color: #B3261E;
}

.shipping-error-msg ul {
    margin: 0;
    padding-left: 18px;
}

/* Fußbereich mit Summe und Senden-Knöpfen */
.virtual-modal .cart-footer {
    margin: 0;
    padding: 18px 28px calc(18px + env(safe-area-inset-bottom, 0px));
    text-align: left;
    border-top: 1px solid #E6E6E6;
    background: #FAFAFA;
    border-radius: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.virtual-modal .cart-footer .btn-primary {
    font-size: 1.05rem;
    padding: 13px;
    box-shadow: none;
}

.cart-sum {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin: 0;
    font-size: 1.25rem;
}

/* style.css setzt .cart-footer p auf flex – hier wieder normaler Fließtext */
.virtual-modal .cart-footer .cart-shipping-line,
.virtual-modal .cart-footer .cart-phone {
    display: block;
}

.cart-shipping-line {
    margin: -6px 0 2px;
    font-size: 0.95rem;
    color: #555555;
}

.cart-phone {
    margin: 2px 0 0;
    text-align: center;
    font-size: 0.95rem;
    color: #444444;
}

.cart-phone a {
    font-weight: 700;
    color: var(--primary-color);
    white-space: nowrap;
}

/* Erfolgsmeldung */
.cart-success {
    padding: 40px 28px;
    text-align: center;
    font-size: 1.05rem;
}

.cart-success-icon {
    font-size: 3rem;
}

.cart-success h4 {
    font-size: 1.4rem;
    color: var(--primary-color);
    margin: 10px 0;
}

.cart-success .btn {
    margin-top: 16px;
}

/* --- Produktdetails --- */
.product-modal-body {
    padding: 28px;
    overflow-y: auto;
    text-align: center;
}

.detail-image {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 200px;
    padding: 16px;
    background: #FFFFFF;
    border-radius: 12px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
}

.detail-image img {
    max-height: 260px;
    max-width: 100%;
    object-fit: contain;
    border-radius: 8px;
}

.detail-title {
    margin: 18px 0 10px;
    color: var(--primary-color);
    font-family: 'Playfair Display', Georgia, serif;
}

.detail-box {
    text-align: left;
    background: #F7F7F5;
    padding: 18px 20px;
    border-radius: 10px;
    margin-bottom: 18px;
}

.detail-text {
    font-size: 1.05rem;
    line-height: 1.6;
    color: #333333;
}

.detail-list-title {
    margin: 14px 0 6px;
    font-size: 1rem;
    color: var(--primary-color);
}

.detail-list {
    margin: 0;
    padding-left: 20px;
    font-size: 1rem;
    line-height: 1.6;
}

.detail-price {
    margin-top: 12px;
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--primary-color);
}

.detail-price small {
    font-size: 0.95rem;
    font-weight: 400;
    color: #555555;
}

.detail-box hr {
    border: 0;
    border-top: 1px solid #E6E6E6;
    margin: 14px 0;
}

.detail-features {
    list-style: none;
    padding: 0;
    margin: 0;
    font-size: 0.95rem;
    color: #444444;
    line-height: 1.8;
}

.detail-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* --- Kleine Bildschirme --- */
@media (max-width: 700px) {
    .shop-toast {
        bottom: calc(100px + var(--banner-offset, 0px) + env(safe-area-inset-bottom, 0px));
        width: calc(100% - 32px);
        flex-wrap: wrap;
    }
}

@media (max-width: 500px) {
    .shop-grid {
        gap: 24px;
    }

    .shop-section {
        padding-block: 30px 110px;
    }

    .virtual-modal .virtual-modal-content {
        width: 100%;
        max-width: 100%;
        height: 100%;
        max-height: 100%;
        border-radius: 0;
    }

    .cart-item {
        flex-direction: row;
        align-items: flex-start;
    }

    .cart-item-image {
        width: 60px;
        height: 60px;
    }

    /* Auf dem Handy scrollt der ganze Warenkorb, damit die Artikelliste genug Platz hat */
    #cart-modal .virtual-modal-content {
        overflow-y: auto;
    }

    #cart-modal .cart-modal-body {
        flex: none;
        overflow: visible;
    }

    .virtual-modal .cart-footer {
        padding-inline: 16px;
    }

    .product-modal-body {
        padding: 20px 16px;
    }

    .form-row {
        flex-direction: column;
        gap: 12px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .shop-toast,
    .shop-grid .card,
    .shop-grid .card img,
    .cart-float {
        transition: none !important;
        animation: none !important;
    }
}
