
/* =====================================================================
 * 2026 REDESIGN — refined product cards + sort bar + load more
 * Scoped to .ukch-product-grid and .ukch-catalog-tools so legacy
 * .product-card rules elsewhere (mini-cart, related products) stay put.
 * ===================================================================== */

/* ---------- Sort + filter utility bar ---------- */
.ukch-catalog-tools {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem 1.5rem;
    padding: 0.9rem 0;
    margin: 0 auto 1.5rem;
    border-top: 1px solid #eee;
    border-bottom: 1px solid #eee;
}
.ukch-catalog-tools .ukch-sort {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 0.85rem;
    color: #4a4a4a;
}
.ukch-catalog-tools .ukch-sort-label { font-weight: 600; margin: 0; }
.ukch-catalog-tools select.orderby,
.ukch-catalog-tools .woocommerce-ordering select {
    padding: 0.4rem 0.65rem;
    font: inherit; font-size: 0.85rem; color: #1a1a1a;
    background: #fff; border: 1px solid #e0e0e0; border-radius: 6px;
    cursor: pointer; min-width: 180px;
}
.ukch-catalog-tools .ukch-filter-toggle { display: inline-flex; align-items: center; gap: 0.5rem; }
.ukch-catalog-tools .toggle-input { display: none; }
.ukch-catalog-tools .toggle-label {
    display: inline-flex; align-items: center; gap: 0.55rem;
    font-size: 0.85rem; color: #4a4a4a; font-weight: 500;
    cursor: pointer; margin: 0;
}
.ukch-catalog-tools .toggle-switch {
    position: relative; display: inline-block;
    width: 36px; height: 20px;
    background: #d4d4d4; border-radius: 999px;
    transition: background 0.2s ease;
}
.ukch-catalog-tools .toggle-knob {
    position: absolute; top: 2px; left: 2px;
    width: 16px; height: 16px;
    background: #fff; border-radius: 50%;
    transition: transform 0.2s ease;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
}
.ukch-catalog-tools .toggle-input:checked ~ .toggle-label .toggle-switch { background: var(--ukch-color-gold); }
.ukch-catalog-tools .toggle-input:checked ~ .toggle-label .toggle-knob { transform: translateX(16px); }
body.dark-mode .ukch-catalog-tools { border-color: #2a2a2a; }
body.dark-mode .ukch-catalog-tools .ukch-sort,
body.dark-mode .ukch-catalog-tools .toggle-label { color: #c8c8c8; }
body.dark-mode .ukch-catalog-tools select.orderby,
body.dark-mode .ukch-catalog-tools .woocommerce-ordering select {
    background: #1f1f1f; color: #f3f3f3; border-color: #2a2a2a;
}
body.dark-mode .ukch-catalog-tools .toggle-switch { background: #333; }
@media (max-width: 640px) {
    .ukch-catalog-tools { justify-content: center; text-align: center; }
}

/* Grid row — center the cards so a sparse last row (e.g. 2 or 3
 * cards on a 4-column grid) nests in the middle instead of left-
 * aligning with empty space on the right. Bootstrap .row is a
 * flex container by default, so justify-content does the trick.
 * !important to beat any legacy .row rule in style.css. */
.ukch-product-grid.row {
    justify-content: center !important;
}

/* Out-of-stock hiding — class-based so we don't fight inline styles
 * or WooCommerce-plugin CSS with !important battles. Default state
 * on the container is "hide OOS"; JS removes the class when the
 * toggle is switched on. */
.ukch-product-grid.ukch-hide-oos > .outofstock {
    display: none !important;
}

/* ---------- Product cards (redesign) ---------- */
.ukch-product-grid .product-card {
    position: relative;
    display: flex; flex-direction: column;
    height: 100%;
    background: #fff;
    border: 1px solid #ececec;
    border-radius: 10px;
    /* overflow:hidden removed — it was clipping the price into invisibility
     * when the natural content height exceeded the row-stretched card
     * height. The image-wrapper has its own overflow:hidden so the
     * border-radius still clips at the top. */
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}
.ukch-product-grid .product-card:hover,
.ukch-product-grid .product-card:focus-within {
    transform: translateY(-3px);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.08);
    border-color: var(--ukch-color-gold);
}
.ukch-product-grid .product-image-wrapper {
    position: relative;
    aspect-ratio: 1 / 1;
    background: #fafafa;
    overflow: hidden;
    /* Round the top corners — the card itself no longer has
     * overflow:hidden so we need to clip the image here directly. */
    border-top-left-radius: 9px;
    border-top-right-radius: 9px;
    display: flex; align-items: center; justify-content: center;
}
.ukch-product-grid .product-image-wrapper .product-image-link {
    display: block; width: 100%; height: 100%;
}
/* Override legacy style.css (.product-card .product-image-wrapper img) which
 * absolute-positions images with translate(-50%,-50%). On this page we want
 * a simple flex-centred layout, so force positioning back to static and
 * make images fill the square wrapper. Higher-specificity + !important so
 * we beat the legacy declarations regardless of enqueue order. */
.ukch-product-grid .product-card .product-image-wrapper img {
    position: static !important;
    top: auto !important;
    left: auto !important;
    transform: none !important;
    width: 100% !important;
    height: 100% !important;
    max-width: 100% !important;
    max-height: 100% !important;
    object-fit: contain !important;
    padding: 12px;
    transition: transform 0.4s ease-out;
    /* Bypass the skeleton-shimmer opacity:0 rule — some images never get
     * the .loaded class applied and end up invisible. */
    opacity: 1 !important;
}
.ukch-product-grid .product-card:hover .product-image-wrapper img,
.ukch-product-grid .product-card:focus-within .product-image-wrapper img {
    transform: scale(1.04) !important;
}

/* Kill the legacy `.product-card { margin-right: 10px }` from style.css
 * which shifts each card 10px left inside its Bootstrap column, making
 * them look off-centre. */
.ukch-product-grid .product-card {
    margin-right: 0 !important;
}
/* Kill the skeleton shimmer on this page — we don't need it and it
 * occasionally gets stuck animating a card that's already loaded. */
.ukch-product-grid .product-card .product-image-wrapper {
    animation: none !important;
    background: #fafafa !important;
}

/* Badges */
.ukch-product-badge {
    position: absolute; top: 10px; left: 10px; z-index: 3;
    padding: 3px 9px;
    font-size: 0.7rem; font-weight: 700; letter-spacing: 0.04em;
    text-transform: uppercase; color: #fff;
    background: #333; border-radius: 999px; line-height: 1.3;
}
.ukch-product-badge-sale    { background: var(--ukch-color-gold-dark); }
.ukch-product-badge-digital { background: #555;    }
.ukch-product-badge-oos     { background: #888;    }

/* Wishlist heart — chip-style button with gold heart inside.
 *
 * Two visual states:
 *   - NOT in wishlist  : white circle chip + GOLD OUTLINE heart
 *   - IN wishlist (.added) : white circle chip + SOLID GOLD heart
 *
 * The outline state is achieved by setting the icon's `color` to
 * `transparent` and drawing a gold `-webkit-text-stroke` AROUND the
 * glyph — the chip background fills the heart's interior so there's
 * no card-bg bleed through. The added state restores `color: gold`
 * so the heart fills solid.
 *
 * The chip (white circle + subtle border + small shadow) makes the
 * heart pop against any product photography. style.css:543 sets the
 * default chip; we override the badly-shaped one and set our own. */
.ukch-product-grid .wishlist-button {
    position: absolute; top: 10px; right: 10px; z-index: 4;
    width: 36px; height: 36px;
    display: inline-flex; align-items: center; justify-content: center;
    background: rgba(255, 255, 255, 0.96) !important;
    background-color: rgba(255, 255, 255, 0.96) !important;
    border: 1px solid rgba(207, 163, 98, 0.35) !important;
    border-radius: 50% !important;
    padding: 0 !important;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15) !important;
    text-decoration: none;
    transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
    cursor: pointer;
}
.ukch-product-grid .wishlist-button .fa-heart,
.ukch-product-grid .wishlist-button i {
    font-size: 17px;
    line-height: 1;
    color: transparent;
    -webkit-text-stroke: 1.5px var(--ukch-color-gold-dark);
    text-stroke: 1.5px var(--ukch-color-gold-dark);
    transition: color 0.2s ease;
}
.ukch-product-grid .wishlist-button:hover,
.ukch-product-grid .wishlist-button:focus-visible {
    transform: scale(1.08);
    border-color: var(--ukch-color-gold-dark) !important;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2) !important;
}
/* IN wishlist — heart fills solid gold; chip stays white so the gold
 * pop is what reads as "active". */
.ukch-product-grid .wishlist-button.added .fa-heart,
.ukch-product-grid .wishlist-button.added i {
    color: var(--ukch-color-gold-dark);
}
.ukch-product-grid .wishlist-button.added {
    border-color: var(--ukch-color-gold-dark) !important;
}

/* LOADING state — wishlist-ajax.js adds .loading on beforeSend and
 * removes on complete. While the AJAX is in flight, spin the heart so
 * the user knows the click registered and a request is happening.
 * Using a heartbeat-style pulse rather than a pure rotate would also
 * work, but a clean rotate reads universally as "loading". */
.ukch-product-grid .wishlist-button.loading {
    pointer-events: none;
}
.ukch-product-grid .wishlist-button.loading .fa-heart,
.ukch-product-grid .wishlist-button.loading i {
    animation: ukch-wishlist-spin 0.8s linear infinite;
    transform-origin: 50% 50%;
}
@keyframes ukch-wishlist-spin {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}
.ukch-product-grid .wishlist-button:hover,
.ukch-product-grid .wishlist-button:focus-visible {
    color: var(--ukch-color-gold);
    transform: scale(1.12);
    background: transparent;
}
/* "In wishlist" — solid gold filled heart, no chip. The heart icon
 * (`fas fa-heart`) is already filled; the colour change is enough. */
.ukch-product-grid .wishlist-button.added {
    color: var(--ukch-color-gold);
    background: transparent;
    border: 0;
}
.ukch-product-grid .wishlist-button.added:hover,
.ukch-product-grid .wishlist-button.added:focus-visible {
    color: var(--ukch-color-gold-dark);
    background: transparent;
}

/* Info */
.ukch-product-grid .product-info {
    display: flex; flex-direction: column; gap: 6px;
    padding: 12px 14px 14px;
    flex: 1 1 auto;
}
.ukch-product-grid .product-title {
    margin: 0;
    font-size: 0.92rem; font-weight: 600; line-height: 1.3;
    min-height: 2.4em;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
    overflow: hidden;
}
.ukch-product-grid .product-title a {
    color: #1a1a1a; text-decoration: none;
    transition: color 0.2s ease;
}
.ukch-product-grid .product-title a:hover { color: var(--ukch-color-gold); }

/* Star rating — container + overlayed gold stars over grey stars */
.ukch-stars {
    position: relative;
    display: inline-flex; align-items: center; gap: 0.4rem;
    font-size: 0.78rem; color: #8a8a8a;
    /* Shrink-wrap so the flex parent (.product-info, display:flex column)
     * doesn't stretch us to full column width, which would blow out the
     * inner span's `width: 100%` past the 5-star grey backdrop. Centre
     * the shrunk container horizontally within the card. */
    align-self: center;
    text-align: left;
}
.ukch-stars-inner {
    position: relative;
    display: inline-block;
    font-size: 0.95rem;
    letter-spacing: 2px;
    color: var(--ukch-color-gold);
    line-height: 1;
    overflow: hidden;
    white-space: nowrap;
    text-align: left;
}
.ukch-stars-inner::before {
    content: "★★★★★";
}
.ukch-stars::before {
    content: "★★★★★";
    display: inline-block;
    font-size: 0.95rem;
    letter-spacing: 2px;
    color: #ddd;
    line-height: 1;
    position: absolute;
    top: 0; left: 0;
    pointer-events: none;
}
.ukch-stars-count { color: inherit; }

/* Price */
.ukch-product-grid .product-price {
    margin: 0;
    font-size: 1.02rem; font-weight: 700;
    color: var(--ukch-color-gold); line-height: 1.2;
}
.ukch-product-grid .product-price del {
    color: #999; font-weight: 500; font-size: 0.85em; margin-right: 5px;
    text-decoration: line-through;
}
.ukch-product-grid .product-price ins { background: none; text-decoration: none; }

/* Actions — Add to Cart + View More side by side */
.ukch-product-grid .product-actions {
    display: flex;
    gap: 6px;
    padding-top: 8px;
    /* Legacy style.css pins .product-actions to position:absolute
     * bottom:26px + pads .product-info 80px at the bottom. Force
     * natural flow here. */
    position: static !important;
    left: auto !important;
    right: auto !important;
    bottom: auto !important;
    margin: 0;
}

/* View More — outlined secondary button sitting next to Add-to-Cart */
.ukch-product-grid .product-actions .view-more-btn {
    flex: 1 1 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 40px;
    padding: 0 10px;
    font-family: inherit;
    font-size: 0.82rem;
    font-weight: 600;
    line-height: 1;
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--ukch-color-gold);
    background: transparent;
    border: 1px solid var(--ukch-color-gold);
    border-radius: 6px;
    transition: background 0.2s ease, color 0.2s ease;
}
.ukch-product-grid .product-actions .view-more-btn:hover,
.ukch-product-grid .product-actions .view-more-btn:focus-visible {
    background: var(--ukch-color-gold);
    color: #fff;
    text-decoration: none;
    outline: none;
}
body.dark-mode .ukch-product-grid .product-actions .view-more-btn {
    color: #e5c48a;
    border-color: var(--ukch-color-gold);
}
body.dark-mode .ukch-product-grid .product-actions .view-more-btn:hover {
    background: var(--ukch-color-gold);
    color: #111;
}

/* Cancel the legacy 80px padding-bottom reserve on .product-info
 * (put there to make room for the absolutely-positioned actions
 * which no longer float). */
.ukch-product-grid .product-info {
    padding-bottom: 14px !important;
}
.ukch-product-grid .product-actions .add-to-cart-btn {
    flex: 1 1 auto;
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    height: 40px; padding: 0 12px; margin: 0;
    font-family: inherit; font-size: 0.85rem; font-weight: 600; line-height: 1;
    text-decoration: none; text-align: center; white-space: nowrap;
    overflow: hidden; text-overflow: ellipsis;
    background: var(--ukch-color-gold); color: #fff;
    border: 1px solid var(--ukch-color-gold); border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}
.ukch-product-grid .product-actions .add-to-cart-btn:hover,
.ukch-product-grid .product-actions .add-to-cart-btn:focus-visible {
    background: var(--ukch-color-gold-dark); border-color: var(--ukch-color-gold-dark); color: #fff;
}
.ukch-product-grid .product-actions .add-to-cart-btn.in-cart-btn,
.ukch-product-grid .product-actions .add-to-cart-btn[disabled] {
    background: #e4d4b2; border-color: #e4d4b2; color: #fff; cursor: not-allowed;
}
.ukch-product-grid .outofstock .product-actions .add-to-cart-btn[disabled] {
    background: #ddd; border-color: #ddd; color: #666;
}

/* Out-of-stock cards */
.ukch-product-grid .outofstock .product-card { opacity: 0.72; }
.ukch-product-grid .outofstock .product-image-wrapper img { filter: grayscale(50%); }

/* Dark mode — product cards */
body.dark-mode .ukch-product-grid .product-card { background: #1e1e1e; border-color: #2a2a2a; }
body.dark-mode .ukch-product-grid .product-card:hover,
body.dark-mode .ukch-product-grid .product-card:focus-within {
    border-color: var(--ukch-color-gold); box-shadow: 0 10px 24px rgba(0, 0, 0, 0.5);
}
body.dark-mode .ukch-product-grid .product-image-wrapper { background: #141414; }
body.dark-mode .ukch-product-grid .product-title a { color: #f3f3f3; }
body.dark-mode .ukch-product-grid .product-title a:hover { color: #e5c48a; }
body.dark-mode .ukch-product-grid .product-price { color: #e5c48a; }
body.dark-mode .ukch-product-grid .product-price del { color: #7a7a7a; }
/* Dark-mode wishlist heart — dark chip with gold heart.
 *   - NOT in wishlist : dark chip + gold-outline heart
 *   - IN wishlist     : dark chip + solid gold heart
 *
 * style.css:2031 sets `.dark-mode .wishlist-button { background-color:
 * #2C2C2C }`, which is fine — we just override the colour to a softer
 * tone with our own gold border so the chip visually reads as part
 * of the brand language rather than a generic grey button. */
body.dark-mode .ukch-product-grid .wishlist-button {
    background: rgba(28, 28, 30, 0.9) !important;
    background-color: rgba(28, 28, 30, 0.9) !important;
    border: 1px solid rgba(207, 163, 98, 0.45) !important;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.55) !important;
    padding: 0 !important;
}
body.dark-mode .ukch-product-grid .wishlist-button:hover,
body.dark-mode .ukch-product-grid .wishlist-button:focus-visible {
    border-color: var(--ukch-color-gold) !important;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.65) !important;
}
body.dark-mode .ukch-product-grid .wishlist-button .fa-heart,
body.dark-mode .ukch-product-grid .wishlist-button i {
    color: transparent;
    -webkit-text-stroke: 1.5px var(--ukch-color-gold);
    text-stroke: 1.5px var(--ukch-color-gold);
}
body.dark-mode .ukch-product-grid .wishlist-button.added .fa-heart,
body.dark-mode .ukch-product-grid .wishlist-button.added i {
    color: var(--ukch-color-gold);
}
body.dark-mode .ukch-product-grid .wishlist-button.added {
    border-color: var(--ukch-color-gold) !important;
}
body.dark-mode .ukch-product-grid .wishlist-button:hover,
body.dark-mode .ukch-product-grid .wishlist-button:focus-visible {
    color: #e5c48a;
    background: transparent;
}
body.dark-mode .ukch-product-grid .wishlist-button.added {
    color: var(--ukch-color-gold);
    background: transparent;
    border: 0;
}
body.dark-mode .ukch-product-grid .wishlist-button.added:hover,
body.dark-mode .ukch-product-grid .wishlist-button.added:focus-visible {
    color: #e5c48a;
    background: transparent;
}
body.dark-mode .ukch-product-grid .product-actions .add-to-cart-btn { background: var(--ukch-color-gold); color: #111; border-color: var(--ukch-color-gold); }
body.dark-mode .ukch-product-grid .product-actions .add-to-cart-btn:hover { background: #e5c48a; border-color: #e5c48a; color: #111; }
body.dark-mode .ukch-product-grid .product-actions .add-to-cart-btn.in-cart-btn,
body.dark-mode .ukch-product-grid .product-actions .add-to-cart-btn[disabled] {
    background: #3a3227; border-color: #3a3227; color: #bfa577;
}
body.dark-mode .ukch-stars { color: #a8a8a8; }
body.dark-mode .ukch-stars::before { color: #333; }

/* ---------- Load more ---------- */
.ukch-load-more { text-align: center; margin: 1.5rem 0 0.5rem; }
.ukch-counter {
    margin: 0 0 0.85rem;
    font-size: 0.9rem; color: #6a6a6a;
}
.ukch-counter #products-loaded,
.ukch-counter #products-total { font-weight: 700; color: var(--ukch-color-gold); }
.ukch-load-more-btn {
    display: inline-flex; align-items: center; justify-content: center;
    padding: 0.75rem 1.75rem;
    font-family: inherit; font-size: 0.95rem; font-weight: 600;
    color: #fff; background: var(--ukch-color-gold);
    border: 1px solid var(--ukch-color-gold); border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}
.ukch-load-more-btn:hover,
.ukch-load-more-btn:focus-visible {
    background: var(--ukch-color-gold-dark); border-color: var(--ukch-color-gold-dark);
    transform: translateY(-1px);
    box-shadow: 0 8px 18px rgba(207, 163, 98, 0.25);
    outline: none;
}
.ukch-load-more-btn:disabled { opacity: 0.6; cursor: not-allowed; }
.ukch-spinner { margin: 1rem 0; }
.ukch-spinner[hidden] { display: none; }
.ukch-spinner .spinner-border { color: var(--ukch-color-gold); width: 2rem; height: 2rem; }
body.dark-mode .ukch-counter { color: #a8a8a8; }
body.dark-mode .ukch-counter #products-loaded,
body.dark-mode .ukch-counter #products-total { color: #e5c48a; }
body.dark-mode .ukch-load-more-btn { color: #111; }
body.dark-mode .ukch-load-more-btn:hover { color: #111; }