/**
 * WCFM Marketplace Customizer — Frontend Styles
 *
 * Warenkorb-Elemente werden kontextabhängig ausgeblendet:
 * .wcfm-mc-abo-seite = Abo-Produktseite, Warenkorb & Checkout mit Abo-Produkt
 */

/* -------------------------------------------------------
 * Warenkorb-Elemente
 * ------------------------------------------------------- */

/* Mini-Cart im Header — immer versteckt (kein klassischer Shop) */
.cart-contents,
.mini-cart,
.shopping-cart-icon,
.cart-icon,
a.cart-contents,
.woocommerce-mini-cart,
.site-header-cart,
.wc-block-mini-cart,
.wp-block-woocommerce-mini-cart {
    display: none !important;
}

/* Kaufen-Button und Mengenfeld — nur auf normalen Produkt-/Shop-Seiten verstecken */
body:not(.wcfm-mc-abo-seite) .single_add_to_cart_button,
body:not(.wcfm-mc-abo-seite) .woocommerce-variation-add-to-cart,
body:not(.wcfm-mc-abo-seite) .quantity {
    display: none !important;
}

/* Warenkorb-Formular — nur ohne Abo-Kontext */
body:not(.wcfm-mc-abo-seite) .woocommerce-cart-form {
    display: none !important;
}

/* -------------------------------------------------------
 * Suchformular [ballen_suche]
 * ------------------------------------------------------- */

.ballen-suche-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.ballen-suche-form {
    background: rgba(0, 0, 0, .5);
    padding: 25px;
    border-radius: 12px;
    margin-bottom: 30px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

/* -------------------------------------------------------
 * Such-Filter: gemeinsame Form-Höhe + Layout
 *
 * Einheitliche Höhe für alle Form-Elemente (Inputs, Selects,
 * Bio-Toggle, Buttons): 42px. Box-sizing border-box garantiert,
 * dass Padding/Border die Höhe nicht aufblähen.
 * ------------------------------------------------------- */

.search-fields {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 14px;
    margin-bottom: 18px;
}

.search-field {
    display: flex;
    flex-direction: column;
}

.search-field label {
    display: block;
    font-weight: 600;
    margin-bottom: 6px;
    color: #fff;
    font-size: 14px;
}

.search-field input,
.search-field select {
    width: 100%;
    height: 42px;
    padding: 0 14px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 15px;
    color: #333;
    background: #fff;
    box-sizing: border-box;
    line-height: 1;
    transition: border-color .15s, box-shadow .15s;
}

/* Native Select-Dropdown-Pfeil-Höhe stabilisieren */
.search-field select {
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'><path fill='%23555' d='M6 8L0 0h12z'/></svg>");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 36px;
}

.search-field input:focus,
.search-field select:focus {
    border-color: #4CAF50;
    box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.15);
    outline: none;
    color: #333;
}

.range-inputs {
    display: flex;
    align-items: center;
    gap: 8px;
}

.range-inputs input { flex: 1; min-width: 0; }
.range-inputs span  { color: #fff; font-weight: 600; }

.search-buttons {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 4px;
}

.search-button,
.reset-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 42px;
    padding: 0 28px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    border: 1px solid transparent;
    cursor: pointer;
    text-decoration: none;
    line-height: 1;
    transition: background .15s, transform .15s, border-color .15s;
    box-sizing: border-box;
}

.search-button {
    background: #000;
    color: white;
}

.search-button:hover {
    background: #43a047;
    transform: translateY(-1px);
}

.reset-button {
    background: #e0e0e0;
    color: #333;
}

.reset-button:hover {
    background: #d4d4d4;
}

.search-results-info {
    margin-bottom: 20px;
    color: #666;
}

.search-field br,
.search-field p { display: none; }

/* Bio-Toggle visuell wie ein Filterfeld: gleiche Höhe, weißer Hintergrund */
.search-field-checkbox {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

.bio-filter-label {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    height: 42px;
    padding: 0 14px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    color: #333;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    box-sizing: border-box;
    line-height: 1;
    transition: border-color .15s, box-shadow .15s, background .15s;
}

.bio-filter-label:hover {
    border-color: #4CAF50;
}

.bio-filter-label:has(input:checked) {
    background: #e8f5e9;
    border-color: #4CAF50;
}

.bio-filter-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #4CAF50;
    cursor: pointer;
    margin: 0;
}

/* -------------------------------------------------------
 * Produkt-Grid
 * ------------------------------------------------------- */

.ballen-products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
}

.ballen-product-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s;
}

.ballen-product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12);
}

.ballen-product-card .product-image {
    display: block;
    aspect-ratio: 4/3;
    overflow: hidden;
    background: #f5f5f5;
    position: relative;
}

.bio-badge {
    position: absolute;
    top: 60px;
    left: 10px;
    z-index: 2;
    background: #4CAF50;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 1px;
    padding: 4px 12px;
    border-radius: 4px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.ballen-product-card .product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ballen-product-card .no-image {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
}

.ballen-product-card .product-info { padding: 10px; }

.ballen-product-card h3 {
    margin: 0;
    font-size: 18px;
    padding-bottom:5px;
}

.ballen-product-card p {
    display:none;
}

.ballen-product-card h3 a {
    color: #333;
    text-decoration: none;
}

.ballen-product-card h3 a:hover { color: #DC771F; }

.product-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 5px;
}


.product-meta .meta-item {
    background: #f0f0f0;
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 13px;
    color: #555;
}

.product-meta .meta-item.distance {
    background: #e3f2fd;
    color: #1976d2;
}

.product-price {
    font-size: 20px;
    font-weight: 700;
    color: #4CAF50;
}

.product-price-main {
    font-size: 20px;
    font-weight: 700;
    color: #4CAF50;
}

/* Sekundärpreis (Gesamtpreis bzw. €/t), unter dem Hauptpreis */
.product-price-total,
.price-per-tonne {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: #888;
    margin-top: 2px;
}

.price-on-request {
    font-size: 16px;
    font-weight: normal;
    color: #666;
    font-style: italic;
}

.no-results {
    text-align: center;
    padding: 60px 20px;
    background: #f8f9fa;
    border-radius: 12px;
}

.d-md-none{display:none;}

/* -------------------------------------------------------
 * Paginierung
 * ------------------------------------------------------- */

.search-pagination {
    margin-top: 40px;
    text-align: center;
}

.search-pagination .page-numbers {
    display: inline-block;
    padding: 10px 16px;
    margin: 0 5px;
    background: #f0f0f0;
    color: #333;
    text-decoration: none;
    border-radius: 8px;
}

.search-pagination .page-numbers.current,
.search-pagination .page-numbers:hover {
    background: #4CAF50;
    color: white;
}

/* -------------------------------------------------------
 * Kontakt-Sektion (Einzelprodukt)
 * ------------------------------------------------------- */

.vendor-contact-section {
    margin-top: 20px;
    padding: 20px;
    background: #f9f9f9;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
}

.contact-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.contact-buttons a.button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
    padding: 12px 24px;
    text-decoration: none;
    border-radius: 4px;
    transition: all 0.3s;
}

.contact-buttons a.button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.contact-buttons .btn-message { background: #2196F3; color: white; }
.contact-buttons .btn-phone   { background: #4CAF50; color: white; }
.contact-buttons .btn-login   { background: #607D8B; color: white; }
.contact-buttons .btn-store   { background: #FF9800; color: white; }

/* -------------------------------------------------------
 * Responsive
 * ------------------------------------------------------- */

@media (max-width: 768px) {
    .search-fields           { grid-template-columns: 1fr; }
    .ballen-products-grid    { grid-template-columns: 1fr; }
    .search-buttons          { flex-direction: column; }
    .search-button,
    .reset-button            { width: 100%; text-align: center; }
}
