/* cutegory-catalog.css */
/* Grid and layout fixes */
/* Keep the curated category menu when native manufacturer pages are enabled. */
#navigation li.nav-manufacturers,
.navigation-wrapper .menu-helper li.nav-manufacturers {
    display: none !important;
}

body.type-category #products.products-page.products-block {
    display: grid;
    gap: 24px;
    grid-template-columns: repeat(4, minmax(0, 1fr));
}
body.type-category #products.products-page.products-block::before,
body.type-category #products.products-page.products-block::after {
    display: none !important; /* Shoptet clearfix override */
}
body.type-category #products.products-page.products-block > .product {
    width: auto !important; /* Shoptet grid inline style override */
    float: none !important;
    margin: 0 !important;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

@media (max-width: 991px) {
    body.type-category #products.products-page.products-block {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}
@media (max-width: 767px) {
    body.type-category #products.products-page.products-block {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
    }
}

/* CATEGORY CARD STYLING */
/* Hide duplicated hover overlay */
body.type-category #products.products-page.products-block > .product .image .product-buttons {
    display: none;
}

/* Make cart/detail buttons visible instead of hover-only overlay */
body.type-category #products.products-page.products-block > .product .p-bottom,
body.type-category #products.products-page.products-block > .product .p-tools {
    opacity: 1;
    visibility: visible;
    position: relative;
    transform: none;
    bottom: auto;
    left: auto;
    right: auto;
    display: block;
    height: auto;
}

/* Vertical card flow: p-in flex so native price/buttons aligned across same gridrow */
body.type-category #products.products-page.products-block > .product .p {
    display: flex;
    flex-direction: column;
    flex: 1;
}
body.type-category #products.products-page.products-block > .product .p-in {
    display: flex;
    flex-direction: column;
    flex: 1;
}
body.type-category #products.products-page.products-block > .product .p-in-in {
    flex: 1;
}
body.type-category #products.products-page.products-block > .product .p-bottom {
    margin-top: auto;
}

/* Image 1:1 contain */
body.type-category #products.products-page.products-block > .product .image {
    aspect-ratio: 1 / 1;
    display: flex;
    align-items: center;
    justify-content: center;
}
body.type-category #products.products-page.products-block > .product .image img {
    max-height: 100%;
    max-width: 100%;
    object-fit: contain;
}

/* Full readable names */
body.type-category #products.products-page.products-block > .product .p .name span,
body.type-category #products.products-page.products-block > .product .p .name {
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
    font-size: 14px;
    line-height: 1.35;
    display: block;
    -webkit-line-clamp: unset;
    min-height: 0;
    max-height: none;
    height: auto;
}
@media (min-width: 768px) {
    body.type-category #products.products-page.products-block > .product .p .name span,
    body.type-category #products.products-page.products-block > .product .p .name {
        font-size: 15px;
    }
}

/* Useful card shortdesc when present 2 lines */
body.type-category #products.products-page.products-block > .product [data-testid="productCardDescr"],
body.type-category #products.products-page.products-block > .product .p-short-description,
body.type-category #products.products-page.products-block > .product .p-desc {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-size: 13px;
    margin-top: 8px;
    margin-bottom: 8px;
    line-height: 1.4;
}

/* Unit price typography is consolidated in the price section at the bottom */

/* Touch-friendly native buttons in category */
body.type-category #products.products-page.products-block > .product .btn-cart,
body.type-category #products.products-page.products-block > .product .add-to-cart-button,
body.type-category #products.products-page.products-block > .product .btn-detail {
    min-height: 44px !important;
    min-width: 44px;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    width: 100%;
}

/* Brand buttons for category add to cart and PDP */
body.type-category #products.products-page.products-block > .product .add-to-cart-button,
body.type-category #products.products-page.products-block > .product .btn-cart,
#product-detail-form .add-to-cart-button,
#product-detail-form .btn-cart {
    background-color: #e31d75;
    border-color: #e31d75;
    color: #fff;
}
body.type-category #products.products-page.products-block > .product .add-to-cart-button:hover,
body.type-category #products.products-page.products-block > .product .btn-cart:hover,
#product-detail-form .add-to-cart-button:hover,
#product-detail-form .btn-cart:hover {
    background-color: #920D48;
    border-color: #920D48;
}
body.type-category #products.products-page.products-block > .product .add-to-cart-button:focus-visible,
body.type-category #products.products-page.products-block > .product .btn-cart:focus-visible,
#product-detail-form .add-to-cart-button:focus-visible,
#product-detail-form .btn-cart:focus-visible {
    outline: 2px solid #e31d75 !important; /* Dolomit resets :focus with !important. */
    outline-offset: 2px;
}

/* Hide product code from primary info (category + top PDP) */
body.type-category #products.products-page.products-block > .product .p-code,
.type-detail .product-top .p-code,
.type-detail .p-detail-inner-header .p-code {
    display: none;
}

/* Zero rating rule must require actual star-off evidence */
.type-detail .product-top .stars-wrapper:has(.star-off):not(:has(.star-on, .star-half)) {
    display: none;
}

/* PRODUCT DETAIL PAGE (PDP) */
/* Remove left redundant sidebar/top10, regain width */
.type-detail .sidebar-left {
    display: none;
}
.type-detail .content-wrapper-in {
    display: block;
}
.type-detail #content {
    width: 100%;
    float: none;
}

/* Add to cart overrides */
.type-detail .p-info-wrapper .add-to-cart {
    height: auto;
    min-height: 0;
    padding-block: 0;
    margin: 12px 0;
}

/* Desktop main gallery and buybox */
@media (min-width: 992px) {
    .type-detail .p-image-wrapper {
        max-width: 480px;
        margin: 0 auto;
    }

    .type-detail .p-info-wrapper {
        background: #faf9f8;
        border: 1px solid #eaeaea;
        padding: 24px;
        display: flex;
        flex-direction: column;
        justify-content: flex-start;
        height: auto;
        gap: 12px;
    }

    /* Ensure children inside .p-info-wrapper flow contiguously */
    .type-detail .p-info-wrapper > * {
        margin: 0;
    }
}

/* PDP Mobile gallery and cart row compacting */
@media (max-width: 991px) {
    .type-detail .p-image-wrapper {
        max-width: 280px;
        margin: 0 auto;
    }
    .type-detail .p-image {
        aspect-ratio: 1 / 1;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    .type-detail .p-image img {
        max-height: 100%;
        max-width: 100%;
        object-fit: contain;
    }

    /* Compact margins */
    #product-detail-form .price-final {
        margin-bottom: 8px;
    }
    #product-detail-form .availability-value {
        margin-bottom: 8px;
    }
    #product-detail-form .short-description,
#product-detail-form .p-short-description {
        margin-bottom: 12px;
    }

    /* Cart row compacting */
    #product-detail-form .add-to-cart {
        display: flex;
        flex-wrap: nowrap;
        gap: 8px;
    }
    #product-detail-form .quantity {
        flex: 0 0 138px;
        width: 138px;
        margin-right: 0;
    }
    #product-detail-form .add-to-cart-button {
        flex: 1;
        padding: 0;
        min-width: 0;
    }
}

@media (max-width: 320px) {
    #product-detail-form .add-to-cart {
        flex-wrap: wrap; /* Stack without overflow */
    }
    #product-detail-form .quantity {
        flex: 1 1 100%;
        width: 100%;
    }
    #product-detail-form .add-to-cart-button {
        flex: 1 1 100%;
        width: 100%;
    }
}

/* Buybox readable typography */
.type-detail .p-detail-inner-header h1 {
    font-size: 24px;
    line-height: 1.3;
    margin-bottom: 12px;
}
/* Main price typography is consolidated in the price section at the bottom */
#product-detail-form .short-description,
#product-detail-form .p-short-description {
    font-size: 15px;
    line-height: 1.5;
    margin-bottom: 16px;
}
#product-detail-form .availability-value {
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 8px;
}

/* Touch 44+ native buttons */
#product-detail-form .amount {
    min-height: 44px !important;
    min-width: 44px;
    text-align: center;
}
#product-detail-form .increase,
#product-detail-form .decrease {
    min-height: 44px !important;
    min-width: 44px;
}
#product-detail-form .add-to-cart-button {
    min-height: 44px !important;
    padding: 0 24px;
    font-weight: 600;
}

/* Avoid repeating the same products above the complete category listing. */
body.type-category .products-top-wrapper {
    display: none;
}

/* --- PRICE TYPOGRAPHY & SPACING POLISH --- */
body.type-category #products.products-page.products-block > .product .prices,
#product-detail-form .p-info-wrapper .p-final-price-wrapper {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    column-gap: 8px;
    row-gap: 4px;
    margin-bottom: 12px;
}

body.type-category #products.products-page.products-block > .product .prices > *,
#product-detail-form .p-info-wrapper .p-final-price-wrapper > * {
    margin: 0 !important;
    line-height: 1.2;
    white-space: nowrap;
}

body.type-category #products.products-page.products-block > .product .prices .price-final,
#product-detail-form .p-info-wrapper .p-final-price-wrapper .price-final,
body.type-category #products.products-page.products-block > .product .prices .price-measure,
#product-detail-form .p-info-wrapper .p-final-price-wrapper .price-measure {
    flex-basis: 100%;
}

body.type-category #products.products-page.products-block > .product .prices .price-final strong,
body.type-category #products.products-page.products-block > .product .prices .price-final {
    font-size: 22px;
    font-weight: 700;
    color: #111;
}

#product-detail-form .p-info-wrapper .p-final-price-wrapper .price-final {
    font-size: 28px;
    font-weight: 700;
    color: #111 !important; /* Dolomit uses !important for the main price color. */
}
#product-detail-form .p-info-wrapper .p-final-price-wrapper .price-final-holder {
    color: inherit !important; /* Dolomit colors the actual text span separately. */
}

body.type-category #products.products-page.products-block > .product .prices .price-measure,
#product-detail-form .p-info-wrapper .p-final-price-wrapper .price-measure {
    font-size: 14px !important;
    color: #595959 !important;
    line-height: 1.4 !important;
}

#product-detail-form .p-info-wrapper .p-final-price-wrapper .price-measure {
    display: none !important;
}
#product-detail-form .p-info-wrapper .p-final-price-wrapper .price-measure:has(> span:not(.sr-only)) {
    display: block !important;
}

body.type-category #products.products-page.products-block > .product .prices .old-price,
#product-detail-form .p-info-wrapper .p-final-price-wrapper .price-standard,
#product-detail-form .p-info-wrapper .p-final-price-wrapper .price-save {
    font-size: 14px;
    color: #595959;
}

body.type-category #products.products-page.products-block > .product .prices .old-price,
#product-detail-form .p-info-wrapper .p-final-price-wrapper .price-standard {
    text-decoration: line-through;
}

/* Dolomit switches this row to a fixed-height flex column at narrow widths. */
#product-detail-form .add-to-cart {
    flex-direction: row;
    align-items: center;
    height: auto !important;
}
#product-detail-form .quantity,
#product-detail-form .amount {
    height: 44px !important;
}
#product-detail-form .add-to-cart-button {
    height: auto;
    max-width: 100%;
    padding: 12px 16px;
    line-height: 1.3;
}
@media (max-width: 320px) {
    #product-detail-form .quantity {
        flex: 0 0 138px;
        width: 138px;
    }
}

/* These vendor declarations use !important on narrow Dolomit layouts. */
#product-detail-form .add-to-cart {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: wrap !important;
    gap: 12px;
}
#product-detail-form .quantity {
    flex: 0 0 138px !important;
    width: 138px !important;
}
#product-detail-form .add-to-cart-button {
    flex: 1 1 160px !important;
    width: auto !important;
    height: auto !important;
    padding: 12px 16px !important;
}
@media (max-width: 374px) {
    #product-detail-form .add-to-cart-button {
        flex-basis: 100% !important;
    }
}

/* Dolomit keeps an empty carousel slot when its final slide is disabled.
   Keep the remaining Top banners compact without changing a populated carousel. */
body.type-index .banners-row:not(:has(.wide-carousel > *)) > .wide-carousel {
  display: none !important;
}

body.type-index .banners-row:not(:has(.wide-carousel > *)) > .next-to-carousel-banners {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr);
  gap: 20px;
  width: 100% !important;
  padding: 0 10px;
}

body.type-index .banners-row:not(:has(.wide-carousel > *)) > .next-to-carousel-banners > .banner-wrapper {
  width: auto !important;
  min-width: 0;
  margin: 0 !important;
  padding: 0 !important;
}

@media (min-width: 768px) {
  body.type-index .banners-row:not(:has(.wide-carousel > *)) > .next-to-carousel-banners {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
