/* ==========================================================
   Circulate Vendor Store Page
   ========================================================== */

/* Reset plugin defaults */
.circulate-vendor-page .multivendorx-banner,
.circulate-vendor-page .multivendorx-store-wrapper,
.circulate-vendor-page .store-header {
    all: unset;
    display: block;
}

.circulate-vendor-page {
    margin: 0 auto;
    padding: 0 50px;
}

/* ==========================================================
   Page title
   ========================================================== */
.cv-page-title {
    padding: 24px 0 16px;
}

.cv-page-title h1 {
    font-size: 16px;
    font-weight: 400;
    color: #141414;
    margin: 0;
    letter-spacing: 0;
}

/* ==========================================================
   Banner / Hero
   ========================================================== */
.cv-banner {
    position: relative;
    text-align: center;
    padding: 60px 24px 48px;
    background-color: #F1F1F1;
    margin-bottom: 0;
}

.cv-banner__bg {
    display: none; /* Hidden unless vendor has banner — keep design clean */
}

.cv-banner__content {
    position: relative;
    z-index: 1;
}

.cv-banner__name {
    font-size: 40px;
    font-weight: 400;
    color: #141414;
    margin: 0 0 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
        text-transform: capitalize;
}

.cv-banner__verified {
    flex-shrink: 0;
}

.cv-banner__icon {
    display: flex;
    justify-content: center;
    margin-bottom: 16px;
}

.cv-banner__icon-img {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    object-fit: cover;
    background: #f5f5f5;
}

.cv-banner__icon-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: #7FBFBF;
}

/* Stars */
.cv-banner__rating {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 20px;
}

.cv-banner__stars {
    display: flex;
    gap: 2px;
}

.cv-star {
    font-size: 18px;
    line-height: 1;
}

.cv-star--full {
    color: #F5A623;
}

.cv-star--half {
    color: #F5A623;
    opacity: 0.6;
}

.cv-star--empty {
    color: #ccc;
}

.cv-banner__rating-text {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: #666;
}

/* Description */
.cv-banner__description {
    max-width: 640px;
    margin: 0 auto 28px;
    font-size: 14px;
    line-height: 1.7;
    color: #444;
}

.cv-banner__description p {
    margin: 0 0 8px;
}

/* Contact button */
.cv-banner__actions {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}

.cv-banner__contact-btn {
    display: inline-block;
    padding: 14px 40px;
    background: #141414;
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    text-decoration: none;
    border-radius: 0;
    transition: background 0.2s;
}

.cv-banner__contact-btn:hover {
    background: #333;
    color: #fff;
}

/* ==========================================================
   Profile bar (avatar below banner)
   ========================================================== */
.cv-profile-bar {
    display: flex;
    align-items: center;
    padding: 20px 0 0;
}

.cv-profile-bar__avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    overflow: hidden;
    background: #7FBFBF;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.cv-profile-bar__avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cv-profile-bar__initial {
    font-size: 18px;
    font-weight: 600;
    color: #fff;
}

/* ==========================================================
   Tabs
   ========================================================== */
.cv-tabs {
    margin-top: 60px!important;
}

.cv-tabs__nav {
    display: flex;
    gap: 24px;
    padding: 12px 0;
}

.cv-tabs__link {
    font-size: 14px;
    font-weight: 500;
    color: #888;
    text-decoration: none;
    padding-bottom: 10px;
    border-bottom: 2px solid transparent;
    transition: color 0.15s, border-color 0.15s;
}

.cv-tabs__link--active,
.cv-tabs__link:hover {
    color: #141414;
    border-bottom-color: #141414;
}

.cv-tabs__content {
    padding: 60px 0px;
    width: 100%;
    max-width: 100%;
    overflow: hidden;
}

.cv-tabs {
    margin: 60px 0;
}

/* ==========================================================
   Catalogue
   ========================================================== */
.cv-catalogue__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}

.cv-catalogue__title {
    font-size: 40px;
    font-weight: 400;
    color: #141414;
    margin: 0;
}

.cv-catalogue__tools {
    display: flex;
    align-items: center;
    gap: 12px;
}

.cv-catalogue__search input {
    border: 1px solid #ddd;
    padding: 10px 16px;
    font-size: 14px;
    border-radius: 0;
    outline: none;
    min-width: 200px;
    transition: border-color 0.15s;
}

.cv-catalogue__search input:focus {
    border-color: #141414;
}

.cv-catalogue__sort {
    background: none;
    border: none;
    padding: 0px;
    cursor: pointer;
    color: #141414;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.15s;
}

.cv-catalogue__sort:hover {
    opacity: 0.6;
}

#cv-products-container {
    position: relative;
    min-height: 200px;
    transition: opacity 0.2s ease;
}

#cv-products-container.cv-loading {
    opacity: 0.4;
    pointer-events: none;
}

#cv-products-container.cv-loading::after {
    content: '';
    position: absolute;
    inset: 0;
    background: transparent;
    cursor: wait;
}

.cv-sort-wrapper {
    position: relative;
}

.cv-sort-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    background: #fff;
    border: 1px solid #e5e5e5;
    min-width: 260px;
    z-index: 100;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px);
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
    box-shadow: 0 8px 24px rgba(0,0,0,0.10);
}

.cv-sort-dropdown.is-open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.cv-sort-dropdown__item {
    display: block;
    padding: 10px 20px;
    font-size: 13px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #141414;
    text-decoration: none;
    transition: background 0.15s;
}

.cv-sort-dropdown__item:last-child {
    border-bottom: none;
}

.cv-sort-dropdown__item:hover {
    background: #f7f7f7;
}

.cv-sort-dropdown__item.is-active {
    font-weight: 700;
    background: #f7f7f7;
}

.cv-product-image .added_to_cart.wc-forward {
    display: none;
}

/* SHOP CTA button */
.cv-catalogue__cta {
    display: flex;
    justify-content: center;
    margin-top: 40px;
}

.cv-catalogue__shop-btn {
    display: inline-block;
    padding: 14px 60px;
    background: #141414;
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    text-decoration: none;
    transition: background 0.2s;
}

.cv-catalogue__shop-btn:hover {
    background: #333;
    color: #fff;
}

/* Product grid — use WooCommerce loop classes */
.cv-catalogue .products {
    display: grid !important;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 24px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    padding: 0;
}

.cv-catalogue .products li.product {
    margin: 0 !important;
    padding: 0 !important;
    width: 100% !important;
    max-width: 100%;
    list-style: none;
    box-sizing: border-box;
}

/* Product card hover effects */
.cv-catalogue .products li.product .cv-product-image {
    position: relative;
    overflow: hidden;
}

/* Add to cart button - hidden by default, shows on hover */
.cv-catalogue .products li.product .button.add_to_cart_button,
.cv-catalogue .products li.product .button.product_type_simple {
    position: absolute;
    bottom: 12px;
    right: 12px;
    width: 44px;
    height: 44px;
    padding: 0;
    margin: 0;
    background: rgba(255, 255, 255, 0.95);
    color: #141414;
    border: none;
    border-radius: 50%;
    font-size: 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.3s ease;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Cart icon using pseudo-element */
.cv-catalogue .products li.product .button.add_to_cart_button::before,
.cv-catalogue .products li.product .button.product_type_simple::before {
    content: "";
    width: 20px;
    height: 20px;
    background-image: url("data:image/svg+xml,%3Csvg%20width%3D%2220%22%20height%3D%2220%22%20viewBox%3D%220%200%2020%2020%22%20fill%3D%22none%22%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%3E%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M18.6349%2016.0062C18.2447%2013.0306%2017.3455%206.172%2016.9961%203.5062C16.8737%202.573%2016.0783%201.875%2015.1369%201.875C12.8003%201.875%207.35492%201.875%205.01832%201.875C4.07712%201.875%203.28172%202.573%203.15932%203.5062C2.80972%206.172%201.91052%2013.0306%201.52032%2016.0062C1.45012%2016.5414%201.61412%2017.081%201.97012%2017.4866C2.32612%2017.8924%202.83972%2018.125%203.37952%2018.125H16.7759C17.3157%2018.125%2017.8293%2017.8924%2018.1853%2017.4866C18.5413%2017.081%2018.7051%2016.5414%2018.6349%2016.0062ZM17.3955%2016.1688C17.4189%2016.3472%2017.3643%2016.527%2017.2457%2016.6622C17.1269%2016.7974%2016.9557%2016.875%2016.7759%2016.875H3.37952C3.19952%2016.875%203.02832%2016.7974%202.90972%2016.6622C2.79092%2016.527%202.73632%2016.3472%202.75972%2016.1688L4.39872%203.6688C4.43952%203.3576%204.70452%203.125%205.01832%203.125H15.1369C15.4507%203.125%2015.7159%203.3576%2015.7567%203.6688L17.3955%2016.1688Z%22%20fill%3D%22%23282828%22/%3E%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M6.32568%205.00098C6.32568%207.07058%208.00588%208.75098%2010.0757%208.75098C12.1453%208.75098%2013.8257%207.07058%2013.8257%205.00098C13.8257%204.65598%2013.5455%204.37598%2013.2007%204.37598C12.8557%204.37598%2012.5757%204.65598%2012.5757%205.00098C12.5757%206.38078%2011.4555%207.50098%2010.0757%207.50098C8.69588%207.50098%207.57568%206.38078%207.57568%205.00098C7.57568%204.65598%207.29548%204.37598%206.95068%204.37598C6.60568%204.37598%206.32568%204.65598%206.32568%205.00098Z%22%20fill%3D%22%23282828%22/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

/* Show add to cart on product hover (only when not added) */
.cv-catalogue .products li.product:hover .button.add_to_cart_button:not(.added),
.cv-catalogue .products li.product:hover .button.product_type_simple:not(.added) {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Hide add to cart when added */
.cv-catalogue .products li.product .button.add_to_cart_button.added,
.cv-catalogue .products li.product .button.product_type_simple.added {
    display: none !important;
}

.cv-catalogue .products li.product .button.add_to_cart_button:hover,
.cv-catalogue .products li.product .button.product_type_simple:hover {
    background: #fff;
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* Added to cart state - change icon to checkmark */
.cv-catalogue .products li.product .button.add_to_cart_button.added,
.cv-catalogue .products li.product .button.product_type_simple.added {
    background: #4CAF50;
}

.cv-catalogue .products li.product .button.add_to_cart_button.added::before,
.cv-catalogue .products li.product .button.product_type_simple.added::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'%3E%3C/polyline%3E%3C/svg%3E");
}

/* Loading state */
.cv-catalogue .products li.product .button.add_to_cart_button.loading,
.cv-catalogue .products li.product .button.product_type_simple.loading {
    opacity: 0.8;
}

.cv-catalogue .products li.product .button.add_to_cart_button.loading::after,
.cv-catalogue .products li.product .button.product_type_simple.loading::after {
    content: "";
    position: absolute;
    width: 16px;
    height: 16px;
    border: 2px solid #141414;
    border-top-color: transparent;
    border-radius: 50%;
    animation: cv-spin 0.8s linear infinite;
}

@keyframes cv-spin {
    to { transform: rotate(360deg); }
}

/* View Cart button - same styling as add to cart */
.cv-catalogue .products li.product .button.cv-view-cart-button {
    position: absolute;
    bottom: 12px;
    right: 12px;
    width: 44px;
    height: 44px;
    padding: 0;
    margin: 0;
    color: #fff;
    border: none;
    border-radius: 50%;
    font-size: 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.3s ease;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Cart icon for View Cart button */
.cv-catalogue .products li.product .button.cv-view-cart-button::before {
    content: "";
    width: 20px;
    height: 20px;
    background-image: url("/wp-content/themes/furnique/assets/images/view-icon.svg") !important;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

/* View Cart - hidden by default, shown after added to cart */
.cv-catalogue .products li.product .button.cv-view-cart-button {
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
}

.cv-catalogue .products li.product:hover .button.cv-view-cart-button {
    opacity: 0;
    visibility: hidden;
}

/* Show View Cart after product is added to cart */
.cv-catalogue .products li.product .cv-product-image.has-added .button.cv-view-cart-button,
.cv-catalogue .products li.product:hover .cv-product-image.has-added .button.cv-view-cart-button {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.cv-catalogue .products li.product .button.cv-view-cart-button:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* Tooltip for View Cart */
.cv-catalogue .products li.product .button.cv-view-cart-button .cv-tooltip {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #141414;
    color: #fff;
    padding: 6px 10px;
    font-size: 11px;
    font-weight: 500;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    margin-bottom: 8px;
    pointer-events: none;
}

.cv-catalogue .products li.product .button.cv-view-cart-button:hover .cv-tooltip {
    opacity: 1;
    visibility: visible;
}

/* Pagination */
.cv-catalogue__pagination {
    margin-top: 40px;
    display: flex;
    justify-content: center;
}

.cv-catalogue__pagination ul {
    display: flex;
    gap: 8px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.cv-catalogue__pagination li {
    margin: 0;
    padding: 0;
}

.cv-catalogue__pagination a,
.cv-catalogue__pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 10px;
    font-size: 14px;
    text-decoration: none;
    border: 1px solid #eee;
    color: #141414;
    transition: all 0.15s;
}

.cv-catalogue__pagination span.current {
    background: #141414;
    color: #fff;
    border-color: #141414;
}

.cv-catalogue__pagination a:hover {
    border-color: #141414;
}

.cv-catalogue__empty {
    text-align: center;
    padding: 60px 0;
    color: #888;
    font-size: 16px;
}

/* ==========================================================
   Product Image & Wishlist
   ========================================================== */
.cv-product-image {
    position: relative;
    display: block;
}

/* Top-right corner container for wishlist + sale badge */
.cv-product-badges {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 10;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
}

/* Wishlist button */
.cv-wishlist-wrapper .wlfmc-add-to-wishlist {
    margin: 0 !important;
}



.cv-wishlist-wrapper .wlfmc-add-to-wishlist i,
.cv-wishlist-wrapper .wlfmc-add-to-wishlist .wlfmc-icon {
    font-size: 16px;
    color: #fff;
    line-height: 1;
}

.cv-wishlist-wrapper .wlfmc-add-to-wishlist.exists i,
.cv-wishlist-wrapper .wlfmc-add-to-wishlist.exists .wlfmc-icon {
    color: #e74c3c;
}

/* Sale badge - positioned in badges container */
.cv-sale-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 12px;
    background-color: #2d5a5a;
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Hide default WooCommerce sale badge */
.cv-product-image .onsale {
    display: none !important;
}

/* Fix: Hide extra wishlist plugin elements that appear as circles */
.wlfmc-add-to-wishlist .woocommerce-loop-product__link {
    display: none !important;
}

/* ==========================================================
   Responsive
   ========================================================== */
@media (max-width: 1200px) {
    .circulate-vendor-page {
        padding: 0 32px;
    }
}

@media (max-width: 991px) {
    .cv-catalogue .products {
        grid-template-columns: repeat(3, 1fr);
        gap: 20px;
    }
}

@media (max-width: 767px) {
    .circulate-vendor-page {
        padding: 0 20px;
    }

    .cv-banner {
        padding: 40px 16px 32px;
    }

    .cv-banner__name {
        font-size: 24px;
    }

    .cv-catalogue .products {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }

    .cv-catalogue__header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .cv-catalogue__search input {
        min-width: unset;
        width: 100%;
    }
}

@media (max-width: 480px) {
    .circulate-vendor-page {
        padding: 0 16px;
    }

    .cv-catalogue .products {
        grid-template-columns: 1fr;
        gap: 16px;
    }
}

/* ==========================================================
   Override plugin default styles
   ========================================================== */
.circulate-vendor-page .multivendorx-store-wrapper {
    display: block !important;
    gap: unset !important;
}

.circulate-vendor-page .woocommerce-tabs,
.circulate-vendor-page .wc-tabs-wrapper {
    all: unset !important;
    display: block !important;
}

.circulate-vendor-page ul.wc-tabs {
    display: none !important; /* We use our own tabs */
}

.circulate-vendor-page .wc-tab {
    all: unset !important;
    display: block !important;
}

/* Hide plugin's default store header */
.circulate-vendor-page .store-header,
.circulate-vendor-page .multivendorx-banner {
    display: none !important;
}
