/* ==========================================================================
   PORTO FINO SHOP LAYOUT
   Custom WooCommerce shop interface met sticky category bar
   ========================================================================== */

/* ==========================================================================
   WRAPPER & CONTAINER
   ========================================================================== */
.pta-shop-wrapper {
    padding-top: 10px;
    padding-bottom: 0.5rem;
    max-width: 1200px;
    margin: 0 auto;
}

/* ==========================================================================
   CATEGORY BAR - DYNAMISCHE ACHTERGROND (volgt body)
   ========================================================================== */
.pta-shop-category-bar {
    position: relative;
    z-index: 2;
    /* Erft achtergrondkleur van parent/body */
    background-color: transparent;
    border-bottom: 0 !important;
    padding: 0.6rem 1rem;
    padding-bottom: 8px;
}

/* JavaScript zal de juiste kleur instellen via inline style */

/* Fixed state (via JavaScript op desktop) */
.pta-shop-category-bar.pta-is-fixed {
    position: fixed;
    top: var(--pta-sticky-top, 80px);
    left: 0;
    right: 0;
    z-index: 2;
    /* JavaScript stelt achtergrondkleur in */
}

/* Spacer element om layout jump te voorkomen */
.pta-shop-category-spacer {
    height: 0;
}

/* Category bar inner container */
.pta-shop-category-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
}

/* Category links/buttons */
.pta-shop-category-link {
    padding: 6px 18px;
    border-radius: 8px;
    background: linear-gradient(180deg, #ffffff 0%, #f0ece8 100%);
    font-size: 0.95rem;
    border: 1px solid #d4c4b8;
    color: #333;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.1s ease;
    box-shadow: 0 2px 0 #c4b0a0, 0 4px 6px rgba(0,0,0,0.05);
    transform: translateY(0);
}
.pta-shop-category-link:hover {
    background: #f0e4de;
    border-color: #e0c2aa;
    box-shadow: 0 1px 0 #c4b0a0, 0 3px 4px rgba(0,0,0,0.05);
    transform: translateY(1px);
}
.pta-shop-category-link.is-active {
    background: linear-gradient(180deg, #c45a5a 0%, #a03030 100%);
    border: 1px solid #8a2020;
    box-shadow: 0 2px 0 #6a1010, 0 4px 6px rgba(0,0,0,0.1);
    color: #fff;
}

/* ==========================================================================
   PRODUCT GRID
   ========================================================================== */
.pta-product-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.2rem;
    width: 100%;
    margin: 0;
    padding-bottom: 1rem;
}

/* ==========================================================================
   PRODUCT CARD
   ========================================================================== */
.pta-product-card {
    background: #fff;
    border: 1px solid #eee;
    border-radius: 10px;
    padding: 1.2rem 1.4rem;
    display: grid;
    grid-template-columns: auto 1fr;
    grid-template-rows: auto auto;
    column-gap: 1rem;
    row-gap: 0.4rem;
    position: relative;
    overflow: visible !important;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.pta-product-card:hover {
    transform: scale(1.02);
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.08);
}

/* Product link (display: contents zorgt dat grid intact blijft) */
.pta-product-link {
    display: contents;
    color: inherit;
    text-decoration: none;
}

.pta-product-link:hover .pta-product-name {
    text-decoration: underline;
    text-underline-offset: 2px;
}

/* ==========================================================================
   PRODUCT THUMBNAIL
   ========================================================================== */
.pta-product-image {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    position: relative;
    overflow: visible !important;
    grid-row: 1 / span 2;
}

.pta-product-thumb {
    width: 50px;
    height: 50px;
    border-radius: 15%;
    object-fit: cover;
    position: relative;
    z-index: 1;
}

/* Hover ring effect */
.pta-product-image::after {
    content: "";
    position: absolute;
    inset: -4px;
    border-radius: 15%;
    border: 2px solid transparent;
    transition: border-color 0.25s ease;
}

.pta-product-card:hover .pta-product-image::after {
    border-color: #b24b4b;
}

/* ==========================================================================
   PRODUCT INFO (tekst kolom)
   ========================================================================== */
.pta-product-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    overflow: visible !important;
}

/* Titel + prijs op   n regel */
.pta-product-topline {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    column-gap: 0.75rem;
    align-items: baseline;
    width: 100%;
}

/* Product naam */
.pta-product-name {
    min-width: 0;
    font-size: 1rem;
    font-weight: 700;
    margin: 0 1rem 0 0;
    color: #222;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Product prijs */
.pta-product-price {
    font-size: 1rem;
    font-weight: 700;
    color: #222;
    margin-left: auto;
    white-space: nowrap;
    text-align: right;
}

/* Product beschrijving */
.pta-product-desc {
    font-size: 0.82rem;
    color: #666;
    line-height: 1.3;
    margin-top: 2px;
}

/* ==========================================================================
   ADD TO CART BUTTON
   ========================================================================== */
.pta-add-btn-wrap {
    grid-column: 2;
    position: absolute;
    bottom: 1.2rem;
    right: 1.2rem;
    z-index: 1;
}

.pta-add-btn {
    width: 22px;
    height: 22px;
    border-radius: 15%;
    background: #2e9c3d;
    color: #fff;
    border: none;
    font-size: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease;
}

.pta-add-btn:hover {
    background: #3ad64a;
    transform: scale(1.1);
}

/* ==========================================================================
   WOOCOMMERCE OVERFLOW FIX
   Voorkomt dat hover ring wordt afgesneden
   ========================================================================== */
body.woocommerce ul.products,
body.woocommerce ul.products li.product,
body.woocommerce .product,
body.woocommerce .inner_product,
body.woocommerce .grid-entry,
body.woocommerce .grid-content {
    overflow: visible !important;
}

/* ==========================================================================
   RESPONSIVE: TABLET (max-width: 1024px)
   ========================================================================== */
@media (max-width: 1024px) {
    .pta-product-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ==========================================================================
   RESPONSIVE: MOBIEL (max-width: 767px)
   MET SHRINKING HEADER SUPPORT
   ========================================================================== */
@media (max-width: 767px) {
    /* Product grid: 1 kolom */
    .pta-product-grid {
        grid-template-columns: 1fr;
    }

    /* Category bar: padding aanpassen */
    .pta-shop-category-bar {
        padding: 0.4rem 0.6rem 4px;
    }

    /* Category bar: fixed, TOP is dynamisch (88px normaal, 60px geschrompen) */
    .pta-shop-category-bar,
    .pta-shop-category-bar.pta-is-fixed {
        position: fixed !important;
        top: 88px !important;
        left: 0;
        right: 0;
        z-index: 50 !important;
        transition: top 0.3s ease; /* Smooth meebewegen met header */
    }
    
    /* Category bar positie wanneer header geschrompen is */
    body.pta-header-shrunk .pta-shop-category-bar,
    body.pta-header-shrunk .pta-shop-category-bar.pta-is-fixed {
        top: 45px !important;
    }

    /* Met WordPress admin bar */
    body.admin-bar .pta-shop-category-bar,
    body.admin-bar .pta-shop-category-bar.pta-is-fixed {
        top: calc(88px + 46px) !important;
    }
    
    body.admin-bar.pta-header-shrunk .pta-shop-category-bar,
    body.admin-bar.pta-header-shrunk .pta-shop-category-bar.pta-is-fixed {
        top: calc(55px + 46px) !important;
    }

    /* Ruimte voor header + category bar - normale staat */
    .pta-shop-wrapper {
        padding-top: calc(58px + 82px);
        transition: padding-top 0.3s ease;
    }
    
    /* Ruimte wanneer header geschrompen is */
    body.pta-header-shrunk .pta-shop-wrapper {
        padding-top: calc(55px + 82px);
    }

    body.admin-bar .pta-shop-wrapper {
        padding-top: calc(58px + 128px);
    }
    
    body.admin-bar.pta-header-shrunk .pta-shop-wrapper {
        padding-top: calc(55px + 128px);
    }

    /* Spacer niet nodig op mobiel */
    .pta-shop-category-spacer {
        display: none !important;
    }

    /* Producten: normale stacking context */
    .pta-product-card,
    .pta-product-grid {
        position: relative;
        z-index: auto;
    }

    /* Enfold header z-index verhogen (boven alles) */
    body #header_main,
    body.responsive #header_main,
    html body #header_main,
    body #header,
    body.responsive #header {
        z-index: 1000 !important; /* Consistent met style.css */
    }
}

/* ==========================================================================
   RESPONSIVE: SMALL MOBIEL (max-width: 570px)
   Extra ruimte voor category bar die op 3+ regels wrapt
   ========================================================================== */
@media (max-width: 570px) {
  .pta-shop-wrapper {
    padding-top: calc(58px + 50px);   /* was: calc(70px + 118px) voor 3 rijen */
  }
  body.pta-header-shrunk .pta-shop-wrapper {
    padding-top: calc(45px + 50px);   /* was: calc(55px + 118px) */
  }
}

/* ==========================================================================
   punten-tekst toch zichtbaar maar da nerboven
   ==========================================================================*/

@media (max-width: 375px) {
  .pta-total-row {
    flex-wrap: wrap;
    gap: 8px;
  }
  
  .pta-points-in-footer {
    width: 100%;
    text-align: center;
    font-size: 11px;
    order: -1; /* zet punten-tekst bovenaan */
    margin-bottom: 4px;
  }
}