/**
Theme Name: DEKBEDDENPLEIN
Author: CHS
Author URI: http://wpastra.com/about/
Description: Astra child theme voor Dekbeddenplein.nl
Version: 1.0.1
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: dekbeddenplein
Template: astra
*/

/* =========================================
   0) Typografie & Webfont optimalisatie
   - Playfair Display met font-display: swap
   - Fallback-stacks om layout shift te beperken
   ========================================= */

/* 
   BELANGRIJK:
   - Controleer het pad naar het .woff2-bestand.
   - Kijk in DevTools / Network naar de exacte URL van
     het Playfair Display .woff2-bestand en pas hieronder aan.
*/
@font-face {
    font-family: 'Playfair Display';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('/wp-content/uploads/fonts/playfair-display/nuFiD-vYS.woff2') format('woff2');
}

/* Als je ook een bold-variant gebruikt, kun je die zo toevoegen: */
@font-face {
    font-family: 'Playfair Display';
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url('/wp-content/uploads/fonts/playfair-display/nuFiD-vYS-bold.woff2') format('woff2');
}

/* Globale font-stack:
   - Zorgt dat de fallback (Georgia/Times) qua look enigszins
     lijkt op Playfair Display om CLS te beperken.
*/
body,
button,
input,
select,
textarea {
    font-family: 'Playfair Display', Georgia, 'Times New Roman', serif;
}

/* =========================================
   1) Voorkom horizontale scroll
   ========================================= */
html, body {
    overflow-x: hidden;
    max-width: 100%;
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* =========================================
   2) Producten in flex-grid
   ========================================= */
ul.products {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    padding-left: 0;
}
ul.products li.product {
    flex: 1 1 23%;
    margin: 1%;
    display: flex;
    flex-direction: column;
    justify-content: stretch;
    min-height: 440px;
    box-sizing: border-box;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.04);
    overflow: hidden;
    position: relative;
}

/* =========================================
   3) Productafbeeldingen
   ========================================= */
ul.products li.product img {
    width: 100%;
    object-fit: contain;
    height: 230px;
    display: block;
    margin-bottom: 12px;
    background: #fafafa;
    border-bottom: 1px solid #eee;
}

/* =========================================
   4) Titels in productgrids
      - Desktop/Tablet: exact 2 regels
      - Mobiel: exact 3 regels
   ========================================= */
ul.products li.product .woocommerce-loop-product__title,
ul.products li.product h2 {
    text-align: center;
    font-size: 1.15em;
    font-weight: 600;
    line-height: 2.5ex;
    height: 5ex;                  /* exact 2 regels */
    overflow: hidden;
    margin: 6px 0 2px 0;
    padding: 0 8px;
    white-space: normal;
}

@media (max-width: 768px) {
    ul.products li.product .woocommerce-loop-product__title,
    ul.products li.product h2 {
        font-size: 1em;
        line-height: 2.5ex;
        height: 7.5ex;              /* exact 3 regels */
        margin-bottom: 4px;
    }
}

/* =========================================
   5) Meta-info links uitlijnen
   ========================================= */
ul.products li.product .woocommerce-product-details__short-description,
ul.products li.product .product-merk {
    text-align: left;
    margin: 6px 0 0 0;
    padding: 0 8px;
}

/* =========================================
   6) Prijs styling
   ========================================= */
ul.products li.product .price {
    font-size: 1.1em;
    color: #5C7F24;
    font-weight: bold;
    margin: 6px 0 0 8px;
    min-height: 1.2em;
    text-align: left;
}

/* Beschrijving */
ul.products li.product .woocommerce-product-details__short-description {
    font-size: 1em;
    color: #555;
    margin-top: 8px;
    min-height: 2em;
    max-height: 2em;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

/* Merk spacing */
ul.products li.product .product-merk {
    font-size: 0.95em;
    color: #444;
    margin-top: 4px;
}

/* =========================================
   7) Knop styling
   ========================================= */
ul.products li.product .button,
ul.products li.product .add_to_cart_button,
ul.products li.product .product_type_simple {
    margin-top: auto;
    margin-bottom: 16px;
    align-self: center;
    width: 100%;
    background: #5C7F24;
    color: #fff;
    font-weight: 600;
    border-radius: 5px;
    padding: 12px 0;
    text-align: center;
    transition: background 0.2s;
    box-shadow: 0 2px 6px rgba(0,0,0,0.06);
}
ul.products li.product .button:hover,
ul.products li.product .add_to_cart_button:hover {
    background: #3e5419;
}

/* =========================================
   8) Mobiel optimalisatie
   ========================================= */
@media (max-width: 1024px) {
    ul.products li.product {
        flex: 1 1 48%;
        min-height: 350px;
    }
    ul.products li.product img {
        height: 140px;
    }
}
@media (max-width: 768px) {
    ul.products li.product {
        flex: 1 1 98%;
        min-height: 300px;
    }
    ul.products li.product img {
        height: 110px;
    }
    ul.products li.product .price {
        font-size: 1em;
    }
}

/* =========================================
   9) Sterren en kortingslabel
   ========================================= */
ul.products li.product .star-rating {
    margin: 6px auto;
}
ul.products li.product .onsale {
    top: 12px;
    left: 12px;
    font-size: 0.9em;
    border-radius: 7px;
    padding: 6px 12px;
}

/* =========================================
   10) Mini-cart breedte
   ========================================= */
.ast-site-header-cart .widget_shopping_cart,
.woocommerce .ast-site-header-cart .widget_shopping_cart {
    width: 100%;
    max-width: 500px;
    min-width: 420px;
}
