/**
 * 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);
}

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

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

.search-field input {
    width: 100%;
    padding: 6px 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 15px;
    color: #333;
}

.search-field select {
    width: 100%;
    padding: 8px 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 15px;
    color: #333;
}

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

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

.range-inputs input { flex: 1; }

.search-buttons {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.search-button {
    background: #000;
    color: white;
    border: none;
    padding: 7px 15px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
}

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

.reset-button {
    background: #e0e0e0;
    color: #333;
    text-decoration: none;
    padding: 7px 15px;
    border-radius: 8px;
    font-size: 16px;
    display: inline-block;
}

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

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

/* -------------------------------------------------------
 * 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;
}

.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;
}

.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;
}

/* -------------------------------------------------------
 * 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; }
}
