/**
 * Shop / Product Guide enhancements.
 * Loaded only on the shop, product category and product tag archives.
 * See app/shop.php.
 */

/* ---------------------------------------------------------------- toolbar */

.cc-shop-toolbar {
    position: sticky;
    top: 0;
    z-index: 20;
    background: #fff;
    box-shadow: 0 6px 12px -10px rgba(0, 0, 0, 0.25);
    padding: 12px 0 2px;
    margin-bottom: 2.5rem;
}

.cc-shop-toolbar .shop-nav-container {
    margin-bottom: 0;
}

/* Category tabs: label + count over a skewed rule */

ul#shopTabs.cc-shop-tabs {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: flex-end;
    gap: 10px 36px;
    padding: 0;
    margin: 0 0 1.25rem;
    list-style: none;
}

.cc-shop-tabs .nav-item {
    margin: 0;
}

.cc-shop-tabs .nav-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    padding: 0;
    background: none;
    color: #6a6a6a;
    text-decoration: none;
}

/* The theme's pills draw a skewed background on ::before — not wanted here. */
.cc-shop-tabs .nav-link:before,
.cc-shop-tabs .nav-link:after {
    display: none !important;
    content: none !important;
}

.cc-shop-tabs .nav-link:hover,
.cc-shop-tabs .nav-link:focus {
    color: #000;
}

.cc-shop-tabs .nav-link.active {
    color: #000;
}

/* Label and count share a line; the rule sits under both. */
.cc-shop-tabs__head {
    display: flex;
    align-items: baseline;
    gap: 6px;
    white-space: nowrap;
}

.cc-shop-tabs__label {
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 0.8rem;
    line-height: 1.2;
    color: inherit;
}

.cc-shop-tabs__count {
    font-size: 0.7rem;
    font-weight: 500;
    line-height: 1.2;
    color: #adadad;
}

.cc-shop-tabs__rule {
    display: block;
    width: 100%;
    height: 3px;
    background: transparent;
    transform: skewX(-30deg);
}

.cc-shop-tabs .nav-link.active .cc-shop-tabs__rule {
    background: #00ff00;
}

/* Magic FX swaps the green accents for red (see the brand block in
   partials/content-page-shop.blade.php). */
body.cc-brand-magic-fx .cc-shop-tabs .nav-link.active .cc-shop-tabs__rule {
    background: #f00;
}

body.cc-brand-magic-fx .cc-shop-search__input:focus {
    box-shadow: 0 0 0 2px #f00;
}

/* Search / count / sort row */

.cc-shop-filters {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px 18px;
    padding-bottom: 1rem;
}

.cc-shop-filters__spacer {
    flex: 1 1 auto;
}

.cc-shop-search {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.cc-shop-search__input {
    width: 320px;
    max-width: 100%;
    padding: 0.75rem 2.4rem 0.75rem 1rem;
    border: 0;
    background: #f3f3f3;
    font-size: 1rem;
    color: #1c1c1c;
    outline: none;
}

.cc-shop-search__input:focus {
    box-shadow: 0 0 0 2px #00ff00;
}

.cc-shop-search__clear {
    position: absolute;
    right: 8px;
    width: 24px;
    height: 24px;
    padding: 0;
    border: 0;
    background: transparent;
    color: #888;
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
}

.cc-shop-search__clear:hover {
    color: #000;
}

.cc-shop-count {
    font-size: 13px;
    color: #adadad;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.cc-shop-compare {
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: #464646;
    text-decoration: none;
    border-bottom: 2px solid #464646;
    padding-bottom: 2px;
}

.cc-shop-compare:hover,
.cc-shop-compare:focus {
    color: #000;
    border-bottom-color: #00ff00;
    text-decoration: none;
}

.cc-shop-sort__label {
    margin: 0;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: #adadad;
}

select.cc-shop-sort {
    width: auto;
    min-width: 170px;
    padding: 0.7rem 0.9rem;
    border: 0;
    background: #f3f3f3;
    font-size: 1rem;
    color: #1c1c1c;
    outline: none;
}

/* --------------------------------------------------------- empty results */

.cc-shop-empty {
    padding: 70px 15px 90px;
    text-align: center;
    color: #adadad;
    font-size: 15px;
}

/* ------------------------------------------------------------------ cards */

.woocommerce .products .product.cc-hidden {
    display: none !important;
}

/* Keep titles and prices on a shared baseline across the row. */
.woocommerce .products .product .custom-blurb {
    min-height: 67px;
}

.cc-quote-tag {
    position: absolute;
    top: 44px;
    right: 24px;
    z-index: 2;
    padding: 4px 8px;
    background: #000;
    color: #00ff00;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 1.5px;
    text-transform: uppercase;
}

.cc-card-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: auto;
    min-height: 44px;
    line-height: 1;
}

.cc-card-actions .cc-price {
    display: flex;
    align-items: center;
}

.cc-card-actions .cc-price .price,
.cc-card-actions .cc-price {
    color: #03dd03;
    font-size: 1.2rem;
    font-weight: 500;
    line-height: 1.2;
    margin: 0;
}

/* WooCommerce ships .price with a 1rem bottom margin, which would drop the
   price text half a line above the button. Outweigh it. */
.woocommerce .products .product .cc-card-actions .cc-price,
.woocommerce .products .product .cc-card-actions .cc-price .price {
    margin: 0;
    padding: 0;
}

/* Price collapses out of the way when the CTA needs the room. */
.cc-hide-hover {
    max-width: 220px;
    overflow: hidden;
    white-space: nowrap;
    transition: max-width 0.35s ease, opacity 0.25s ease;
}

.woocommerce .products .product:hover .cc-hide-hover {
    max-width: 0;
    opacity: 0;
}

/* Flex, not inline-block: keeps the button on the price's centre line rather
   than on a text baseline. */
.cc-cta-wrap {
    display: flex;
    align-items: center;
    max-width: 0;
    opacity: 0;
    overflow: hidden;
    white-space: nowrap;
    transition: max-width 0.35s ease, opacity 0.25s ease;
}

.woocommerce .products .product:hover .cc-cta-wrap {
    max-width: 260px;
    opacity: 1;
}

.cc-card-actions .cc-cta,
.cc-card-actions .button {
    position: relative;
    display: inline-block;
    margin: 0 18px;
    padding: 0.5rem 1.5rem;
    border: 0;
    border-radius: 0;
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    line-height: 1.4;
    text-decoration: none;
    background: transparent;
    clip-path: polygon(0.65rem 0, 100% 0, calc(100% - 0.65rem) 100%, 0 100%);
}

/* Add to Cart — WooCommerce's own AJAX button */
.cc-card-actions .button {
    background: #00ff00;
    color: #000;
}

.cc-card-actions .button:hover,
.cc-card-actions .button:focus {
    background: #03dd03;
    color: #000;
}

.cc-card-actions .button.loading,
.cc-card-actions .button.added {
    opacity: 0.75;
}

/* Choose Options */
.cc-cta-wrap--options .cc-cta {
    background: #000;
    color: #fff;
}

.cc-cta-wrap--options .cc-cta:hover,
.cc-cta-wrap--options .cc-cta:focus {
    background: #1c1c1c;
    color: #00ff00;
}

/* Request Quote */
.cc-cta-wrap--quote .cc-cta {
    background: #464646;
    color: #fff;
}

.cc-cta-wrap--quote .cc-cta:hover,
.cc-cta-wrap--quote .cc-cta:focus {
    background: #000;
    color: #00ff00;
}

/* WooCommerce's "View cart" link after an AJAX add */
.cc-card-actions .added_to_cart {
    display: block;
    margin-top: 6px;
    font-size: 0.65rem;
    font-weight: 800;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: #464646;
}

/* ------------------------------------------------------------ responsive */

@media (max-width: 991px) {
    .cc-shop-toolbar {
        position: static;
        box-shadow: none;
    }

    .cc-shop-filters {
        gap: 12px;
    }

    .cc-shop-filters__spacer {
        display: none;
    }

    .cc-shop-search,
    .cc-shop-search__input {
        width: 100%;
    }
}

/* No hover on touch — show the CTA and the price together. */
@media (hover: none), (max-width: 767px) {
    .cc-card-actions {
        flex-direction: column;
        gap: 12px;
    }

    .cc-cta-wrap {
        max-width: none;
        opacity: 1;
    }

    .cc-hide-hover {
        max-width: none;
        opacity: 1;
    }
}
