/* ==========================================================================
   Apex Pure Pep - Clinical Shop & Catalog Stylesheet (SwissChems Monograph)
   Version: 2.2.0 | Zero-Bloat Performance Architecture
   ========================================================================== */

/* 1. SHOP LOOP TOOLS & HEADER CHROME */
.shop-loop-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 18px;
    margin-bottom: 24px;
    border-bottom: 1px solid #E6E8EB;
}

.shop-loop-head .wd-shop-tools {
    display: flex;
    align-items: center;
    gap: 16px;
}

.wd-show-sidebar-btn {
    display: none !important;
}

/* SwissChems Clean Filters Toggle */
.wd-filter-buttons .open-filters {
    display: inline-flex !important;
    align-items: center;
    gap: 8px;
    background: #ffffff !important;
    color: #16191F !important;
    border: 1.5px solid #16191F !important;
    border-radius: 6px !important;
    font-size: 13px !important;
    font-weight: 700 !important;
    padding: 7px 18px !important;
    text-transform: none !important;
    letter-spacing: 0.02em !important;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1) !important;
    cursor: pointer;
}

.wd-filter-buttons .open-filters::before {
    content: "";
    display: inline-block;
    width: 14px;
    height: 14px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2316191F' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='4' y1='6' x2='20' y2='6'/%3E%3Cline x1='7' y1='12' x2='17' y2='12'/%3E%3Cline x1='10' y1='18' x2='14' y2='18'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
    transition: filter 0.2s ease;
}

.wd-filter-buttons .open-filters:hover {
    background: #1DA074 !important;
    border-color: #1DA074 !important;
    color: #ffffff !important;
    box-shadow: 0 4px 12px rgba(29, 160, 116, 0.25) !important;
}

.wd-filter-buttons .open-filters:hover::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='4' y1='6' x2='20' y2='6'/%3E%3Cline x1='7' y1='12' x2='17' y2='12'/%3E%3Cline x1='10' y1='18' x2='14' y2='18'/%3E%3C/svg%3E");
}

/* 2. CLINICAL FILTER PANEL */
.filters-area {
    background: linear-gradient(160deg, #F0F6F2 0%, #EAF3EE 100%) !important;
    border: 1px solid #E6E8EB !important;
    border-radius: 12px !important;
    padding: 24px 28px !important;
    margin-bottom: 32px !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.02) !important;
}

.filters-area .widget-title {
    font-size: 12px !important;
    font-weight: 800 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.06em !important;
    color: #16191F !important;
    margin-bottom: 14px !important;
    padding-bottom: 8px !important;
    border-bottom: 2px solid #16191F !important;
}

.filters-area ul {
    list-style: none !important;
    padding: 0 !important;
    margin: 0 !important;
}

.filters-area ul li {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    padding: 6px 10px !important;
    margin-bottom: 4px !important;
    border-radius: 6px !important;
    font-size: 13px !important;
    color: #4B5563 !important;
    transition: all 0.15s ease !important;
}

.filters-area ul li a {
    color: #4B5563 !important;
    text-decoration: none !important;
    flex-grow: 1 !important;
    display: flex !important;
    align-items: center !important;
    gap: 6px !important;
}

.filters-area ul li:hover {
    background: #ffffff !important;
    color: #16191F !important;
}

.filters-area ul li:hover a {
    color: #16191F !important;
}

.filters-area ul li.chosen,
.filters-area ul li.current-cat,
.filters-area ul li.wd-active {
    background: #1DA074 !important;
    color: #ffffff !important;
    font-weight: 600 !important;
}

.filters-area ul li.chosen a,
.filters-area ul li.current-cat a,
.filters-area ul li.wd-active a {
    color: #ffffff !important;
}

.filters-area ul li.chosen .count,
.filters-area ul li.current-cat .count,
.filters-area ul li.wd-active .count {
    background: rgba(255, 255, 255, 0.22) !important;
    color: #ffffff !important;
}

.filters-area .count {
    background: #E5E7EB !important;
    color: #6B7280 !important;
    font-size: 11px !important;
    font-weight: 600 !important;
    padding: 2px 7px !important;
    border-radius: 9999px !important;
    margin-left: 6px !important;
}

/* 3. PRODUCT CARDS (SwissChems Monograph Standard) */
.products.wd-products {
    gap: 22px !important;
}

.wd-product.product-grid-item {
    background: #ffffff !important;
    border: 1.5px solid #E6E8EB !important;
    border-radius: 12px !important;
    padding: 0 0 16px !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: space-between !important;
    position: relative !important;
    overflow: hidden !important;
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.25s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.25s ease !important;
}

.wd-product.product-grid-item:hover {
    transform: translateY(-3px) !important;
    box-shadow: 0 10px 24px rgba(29, 160, 116, 0.08) !important;
    border-color: #1DA074 !important;
}

/* Image Wrapper: Pure White Full-Bleed Clinical Monograph Container */
.wd-product.product-grid-item .product-element-top {
    background: #ffffff !important;
    border-radius: 12px 12px 0 0 !important;
    overflow: hidden !important;
    position: relative !important;
    margin-bottom: 0 !important;
    aspect-ratio: 1 / 1 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.wd-product.product-grid-item .product-element-top img {
    width: 100% !important;
    height: 100% !important;
    max-height: none !important;
    max-width: none !important;
    object-fit: cover !important;
    object-position: center bottom !important;
    display: block !important;
    transition: transform 0.3s ease !important;
}

.wd-product.product-grid-item:hover .product-element-top img {
    transform: scale(1.05) !important;
}

/* Overlay Badges on Image */
.ax-card-badge-wrap {
    position: absolute !important;
    top: 8px !important;
    left: 8px !important;
    right: 8px !important;
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    z-index: 5 !important;
    pointer-events: none !important;
}

.ax-card-badge {
    font-size: 10.5px !important;
    font-weight: 700 !important;
    letter-spacing: 0.02em !important;
    padding: 3px 8px !important;
    border-radius: 4px !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 4px !important;
    line-height: 1 !important;
}

.ax-badge-std {
    background: #1DA074 !important;
    color: #ffffff !important;
    box-shadow: 0 2px 5px rgba(29, 160, 116, 0.28) !important;
}

.ax-badge-ultra {
    background: #D62A28 !important;
    color: #ffffff !important;
    box-shadow: 0 2px 5px rgba(214, 42, 40, 0.32) !important;
}

.ax-badge-form {
    background: rgba(255, 255, 255, 0.94) !important;
    color: #16191F !important;
    border: 1px solid #E6E8EB !important;
}

/* Card Content Hierarchy */
.product-element-bottom {
    display: flex !important;
    flex-direction: column !important;
    position: relative !important;
    padding: 14px 16px 48px !important; /* Space for the bottom price + cart action row */
    flex-grow: 1 !important;
    background: #ffffff !important;
}

.ax-card-field-tag {
    display: block !important;
    font-size: 10.5px !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.05em !important;
    color: #1DA074 !important;
    margin-bottom: 4px !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}

.wd-entities-title {
    margin: 0 0 3px !important;
}

.wd-entities-title a {
    font-size: 15px !important;
    font-weight: 700 !important;
    color: #16191F !important;
    line-height: 1.35 !important;
    display: -webkit-box !important;
    -webkit-line-clamp: 2 !important;
    -webkit-box-orient: vertical !important;
    overflow: hidden !important;
    min-height: 38px !important;
    transition: color 0.15s ease !important;
}

.wd-entities-title a:hover {
    color: #1DA074 !important;
}

/* Packaging Spec */
.ax-card-spec {
    font-size: 12px !important;
    color: #6B7280 !important;
    margin: 0 0 8px !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    line-height: 1.3 !important;
}

/* Hide rating & default stock from card loop for clean SwissChems clinical look */
.product-grid-item .star-rating,
.product-grid-item .wd-star-rating,
.product-grid-item .wd-product-stock,
.product-grid-item .stock {
    display: none !important;
}

/* Trust Row: Reward Points & RUO */
.ax-card-trust-row {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    font-size: 11px !important;
    margin-bottom: 8px !important;
    background: #F0F6F2 !important;
    padding: 4px 8px !important;
    border-radius: 6px !important;
}

.ax-card-pts {
    display: inline-flex !important;
    align-items: center !important;
    gap: 4px !important;
    color: #178460 !important;
    font-weight: 700 !important;
}

.ax-card-ruo {
    color: #4B5563 !important;
    font-size: 10px !important;
    font-weight: 600 !important;
    letter-spacing: 0.03em !important;
}

/* BOTTOM ACTION ROW: Price on Left, SwissChems Circular Cart Button on Right */
.product-grid-item .price {
    position: absolute !important;
    left: 16px !important;
    bottom: 14px !important;
    font-size: 18px !important;
    font-weight: 800 !important;
    color: #16191F !important;
    margin: 0 !important;
    line-height: 1.2 !important;
}

.product-grid-item .price del {
    font-size: 13px !important;
    color: #9AA0A6 !important;
    font-weight: 500 !important;
    margin-right: 4px !important;
}

.product-grid-item .price ins {
    text-decoration: none !important;
    color: #D62A28 !important; /* SwissChems signature red for sale price */
    font-weight: 800 !important;
}

/* SwissChems Signature Circular Add-to-Cart Button */
.product-grid-item .wd-add-btn {
    position: absolute !important;
    right: 16px !important;
    bottom: 12px !important;
    width: 38px !important;
    height: 38px !important;
    z-index: 10 !important;
    opacity: 1 !important;
    visibility: visible !important;
    margin: 0 !important;
}

.product-grid-item .wd-add-btn a.button,
.product-grid-item .wd-add-btn a {
    width: 38px !important;
    height: 38px !important;
    min-width: 38px !important;
    min-height: 38px !important;
    border-radius: 50% !important;
    background: #1DA074 !important;
    color: transparent !important;
    border: none !important;
    padding: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-shadow: 0 4px 10px rgba(29, 160, 116, 0.28) !important;
    transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), background-color 0.2s ease, box-shadow 0.2s ease !important;
    cursor: pointer !important;
}

.product-grid-item .wd-add-btn a.button:hover,
.product-grid-item .wd-add-btn a:hover {
    background: #D62A28 !important; /* Turns Swiss Red on hover */
    transform: scale(1.1) !important;
    box-shadow: 0 6px 14px rgba(214, 42, 40, 0.35) !important;
}

.product-grid-item .wd-add-btn a.button span,
.product-grid-item .wd-add-btn a span {
    display: none !important;
}

.product-grid-item .wd-add-btn a.button::before,
.product-grid-item .wd-add-btn a::before {
    content: "" !important;
    display: block !important;
    width: 18px !important;
    height: 18px !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='9' cy='21' r='1'/%3E%3Ccircle cx='20' cy='21' r='1'/%3E%3Cpath d='M1 1h4l2.68 13.39a2 2 0 0 0 2 1.61h9.72a2 2 0 0 0 2-1.61L23 6H6'/%3E%3C/svg%3E") !important;
    background-size: contain !important;
    background-repeat: no-repeat !important;
    background-position: center !important;
}

/* Fix mobile touch target and alignment */
@media (max-width: 767px) {
    .products.wd-products {
        gap: 12px !important;
    }
    .wd-product.product-grid-item {
        padding: 0 0 14px !important;
        border-radius: 12px !important;
    }
    .product-element-bottom {
        padding: 10px 12px 42px !important;
    }
    .wd-entities-title a {
        font-size: 13.5px !important;
        min-height: 34px !important;
    }
    .product-grid-item .price {
        left: 12px !important;
        bottom: 12px !important;
        font-size: 16px !important;
    }
    .product-grid-item .wd-add-btn {
        right: 12px !important;
        bottom: 10px !important;
        width: 34px !important;
        height: 34px !important;
    }
    .product-grid-item .wd-add-btn a.button,
    .product-grid-item .wd-add-btn a {
        width: 34px !important;
        height: 34px !important;
        min-width: 34px !important;
        min-height: 34px !important;
    }
}
/* ============ Card rating: star row + average + review count ============ */
.ax-card-rate {
    display: flex !important;
    align-items: center !important;
    gap: 6px !important;
    margin: 3px 0 8px !important;
    padding: 0 !important;
    line-height: 1 !important;
}
.ax-card-rate .ax-stars {
    position: relative;
    display: inline-block;
    width: 82px;
    height: 14px;
    flex: 0 0 82px;
    color: #D7DCE4;
    font-size: 0;
    line-height: 0;
}
.ax-card-rate .ax-stars-svg {
    display: block;
    width: 82px;
    height: 14px;
}
.ax-card-rate .ax-stars-clip {
    position: absolute;
    left: 0;
    top: 0;
    height: 14px;
    overflow: hidden;
    color: #E0A106;
}
.ax-card-rate .ax-rate-num {
    font-size: 12px !important;
    font-weight: 700 !important;
    color: #111827 !important;
    letter-spacing: 0 !important;
    font-variant-numeric: tabular-nums;
}
.ax-card-rate .ax-rate-cnt {
    font-size: 11.5px !important;
    font-weight: 400 !important;
    color: #6B7280 !important;
    letter-spacing: 0 !important;
    font-variant-numeric: tabular-nums;
}
/* home "most popular" shelf */
.ax-prod-card .ax-card-rate {
    margin: 6px 0 2px !important;
}
.ax-prod-card .ax-card-rate .ax-rate-num { color: #111827 !important; }
.ax-prod-card .ax-card-rate .ax-rate-cnt { color: #6B7280 !important; }

@media (max-width: 767px) {
    .ax-card-rate { gap: 5px !important; }
    .product-grid-item .ax-card-rate { margin: 2px 0 6px !important; }
    .ax-card-rate .ax-rate-num { font-size: 11.5px !important; }
    .ax-card-rate .ax-rate-cnt { font-size: 11px !important; }
}

/* ==========================================================================
   14. Mobile catalog: two-up grid + swipeable category row
   (selectors are deliberately over-qualified: .products.elements-grid sets
    `grid-template-columns: 1fr !important` at <=640px in another sheet)
   ========================================================================== */

@media (max-width: 767px) {

    body .wd-products.wd-grid-g,
    body ul.wd-products.wd-grid-g {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 16px 12px !important;
    }

    body .wd-products.wd-grid-g .wd-product {
        min-width: 0 !important;
        width: auto !important;
    }

    body .wd-products.wd-grid-g .wd-product img {
        width: 100% !important;
        height: auto !important;
        max-height: 200px !important;
        object-fit: contain !important;
    }

    body .wd-products.wd-grid-g .wd-entities-title,
    body .wd-products.wd-grid-g .product-title {
        font-size: 12.5px !important;
        line-height: 1.3 !important;
        min-height: 0 !important;
    }

    /* The category list was a 366px wall above the grid; make it one swipeable row. */
    body .wd-page-title ul.wd-nav-product-cat,
    body ul.wd-nav-product-cat.wd-active {
        display: flex !important;
        flex-wrap: nowrap !important;
        justify-content: flex-start !important;
        align-items: center !important;
        overflow-x: auto !important;
        overflow-y: hidden !important;
        gap: 8px !important;
        margin: 0 !important;
        padding: 0 0 10px !important;
        scrollbar-width: none;
        -webkit-overflow-scrolling: touch;
    }

    body .wd-page-title ul.wd-nav-product-cat::-webkit-scrollbar,
    body ul.wd-nav-product-cat.wd-active::-webkit-scrollbar {
        display: none;
    }

    body .wd-page-title ul.wd-nav-product-cat > li,
    body ul.wd-nav-product-cat.wd-active > li {
        flex: 0 0 auto !important;
        margin: 0 !important;
        width: auto !important;
    }

    body .wd-page-title ul.wd-nav-product-cat > li > a,
    body ul.wd-nav-product-cat.wd-active > li > a {
        display: block !important;
        white-space: nowrap !important;
        padding: 8px 14px !important;
        border: 1px solid #E2E8E5 !important;
        border-radius: 999px !important;
        background: #fff !important;
        font-size: 12px !important;
        font-weight: 600 !important;
        letter-spacing: 0 !important;
        text-transform: none !important;
        color: #16191F !important;
    }

    .wd-page-title {
        padding-bottom: 6px !important;
    }
}

/* ============================================================
   1b · Mobile category strip: add right-edge fade so users know
   the row scrolls horizontally (content 1388px vs viewport 350px).
   Scoped to <=768px so the desktop sidebar list is untouched.
   ============================================================ */
@media (max-width: 768px) {
  .wd-nav-product-cat {
    -webkit-mask-image: linear-gradient(to right,
      #000 0,
      #000 calc(100% - 32px),
      rgba(0, 0, 0, 0.15) 100%) !important;
    mask-image: linear-gradient(to right,
      #000 0,
      #000 calc(100% - 32px),
      rgba(0, 0, 0, 0.15) 100%) !important;
    scrollbar-width: none !important;
    -ms-overflow-style: none !important;
  }

  .wd-nav-product-cat::-webkit-scrollbar {
    display: none !important;
  }
}

/* Reward points badge: stop overflow on narrow 2-up cards */
.ax-card-pts {
    min-width: 0 !important;
    flex: 1 1 auto !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}
.ax-card-trust-row { gap: 4px !important; }
.ax-card-ruo { flex: 0 0 auto !important; }
.ax-pts-short { display: none !important; }
@media (max-width: 620px) {
    .ax-pts-full { display: none !important; }
    .ax-pts-short { display: inline !important; }
    .ax-card-trust-row { font-size: 10px !important; padding: 3px 6px !important; }
    .ax-card-pts { font-size: 10px !important; gap: 3px !important; }
    .ax-card-pts svg { width: 10px !important; height: 10px !important; }
}
