/* Product Grid Widget — reset WooCommerce / theme defaults */
.wsp-product-grid .products {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    list-style: none;
    padding: 0 !important;
    margin: 0 !important;
}

.wsp-product-grid .products::before,
.wsp-product-grid .products::after {
    display: none !important;   /* WooCommerce clearfix floats */
}

.wsp-product-grid .products .product {
    list-style: none;
    width: auto !important;     /* override WC fixed widths */
    float: none !important;     /* override WC float layout */
    margin: 0 !important;       /* override WC item margins */
    padding: 0 !important;
    clear: none !important;
}

.wsp-product-grid--empty {
    padding: 20px 0;
}

/* Pagination */
.wsp-product-grid__pagination {
    text-align: center;
    margin: 20px 0 0;
}

.wsp-product-grid__pagination .woocommerce-pagination {
    margin: 0;
}

.wsp-product-grid__pagination .page-numbers {
    display: inline-flex;
    gap: 6px;
    list-style: none;
    padding: 0;
    margin: 0;
    border: none;
}

.wsp-product-grid__pagination .page-numbers li {
    margin: 0;
    padding: 0;
    border: none;
}

.wsp-product-grid__pagination .page-numbers li a,
.wsp-product-grid__pagination .page-numbers li span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2em;
    text-decoration: none;
}

/* Wine Card Widget */
.wsp-card {
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* Image wrapper */
.wsp-card__image-wrap {
    position: relative;
    overflow: hidden;
}

/* Image link – navigates to product */
.wsp-card__image-link {
    display: block;
    position: relative;
    overflow: hidden;
    text-decoration: none;
}

.wsp-card__image {
    overflow: hidden;
    line-height: 0;
    aspect-ratio: 1;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
}

.wsp-card__image img.wsp-card__img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    transition: transform 0.4s ease;
}

.wsp-card:hover .wsp-card__img {
    transform: scale(1.05);
}


/* =============================================
   Cart style: Icon on Image (bottom-right of image)
   ============================================= */
.wsp-card--cart-icon .wsp-card__cart-btn {
    position: absolute;
    bottom: 12px;
    right: 12px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background-color: inherit;
    color: inherit;
    font-size: 16px;
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.3s ease, transform 0.3s ease, background-color 0.2s ease, color 0.2s ease;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    z-index: 2;
    text-decoration: none;
}

.wsp-card--cart-icon .wsp-card__image-wrap:hover .wsp-card__cart-btn {
    opacity: 1;
    transform: translateY(0);
}

.wsp-card--cart-icon .wsp-card__cart-btn:hover {
    background-color: var(--e-global-color-primary, currentColor);
    color: #fff;
}

/* =============================================
   Cart style: Icon on Card (bottom-right of entire card)
   ============================================= */
.wsp-card--cart-icon-card > .wsp-card__cart-btn {
    position: absolute;
    bottom: 12px;
    right: 12px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background-color: inherit;
    color: inherit;
    font-size: 16px;
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.3s ease, transform 0.3s ease, background-color 0.2s ease, color 0.2s ease;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    z-index: 3;
    text-decoration: none;
}

.wsp-card--cart-icon-card:hover > .wsp-card__cart-btn {
    opacity: 1;
    transform: translateY(0);
}

.wsp-card--cart-icon-card > .wsp-card__cart-btn:hover {
    background-color: var(--e-global-color-primary, currentColor);
    color: #fff;
}

/* =============================================
   Cart style: Icon on Card + Overlay
   ============================================= */
.wsp-card--cart-icon-card-overlay > .wsp-card__overlay {
    position: absolute;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.4);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 2;
    pointer-events: none;
}

.wsp-card--cart-icon-card-overlay:hover > .wsp-card__overlay {
    opacity: 1;
}

.wsp-card--cart-icon-card-overlay > .wsp-card__cart-btn {
    position: absolute;
    bottom: 12px;
    right: 12px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background-color: inherit;
    color: inherit;
    font-size: 16px;
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.3s ease, transform 0.3s ease, background-color 0.2s ease, color 0.2s ease;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    z-index: 3;
    text-decoration: none;
}

.wsp-card--cart-icon-card-overlay:hover > .wsp-card__cart-btn {
    opacity: 1;
    transform: translateY(0);
}

.wsp-card--cart-icon-card-overlay > .wsp-card__cart-btn:hover {
    background-color: var(--e-global-color-primary, currentColor);
    color: #fff;
}

/* =============================================
   Cart style: Overlay (covers the whole card, centered icon)
   ============================================= */
.wsp-card--cart-overlay > .wsp-card__overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(0, 0, 0, 0.4);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 2;
    text-decoration: none;
    cursor: pointer;
}

.wsp-card--cart-overlay:hover > .wsp-card__overlay {
    opacity: 1;
}

.wsp-card--cart-overlay .wsp-card__overlay .wsp-card__cart-btn {
    width: 52px;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background-color: inherit;
    color: inherit;
    font-size: 20px;
    transform: scale(0.8);
    transition: transform 0.3s ease, background-color 0.2s ease, color 0.2s ease;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.2);
}

.wsp-card--cart-overlay:hover .wsp-card__overlay .wsp-card__cart-btn {
    transform: scale(1);
}

.wsp-card--cart-overlay .wsp-card__overlay .wsp-card__cart-btn:hover {
    background-color: var(--e-global-color-primary, currentColor);
    color: #fff;
}

/* =============================================
   Shared button base styles
   ============================================= */
.wsp-card__cart-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    background-color: var(--e-global-color-primary, currentColor);
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    cursor: pointer;
    white-space: nowrap;
    border-radius: 5px;
}

a.wsp-card__cart-button,
a.wsp-card__cart-button:hover {
    color: #fff;
}

.wsp-card__cart-button i {
    font-size: 16px;
}

/* =============================================
   Cart style: Text Button on Image
   – bar overlays the bottom of the image, slides up on hover
   ============================================= */
.wsp-card--cart-button-image .wsp-card__cart-button {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 12px 16px;
    z-index: 2;
    transform: translateY(100%);
    transition: transform 0.3s ease, background-color 0.2s ease;
}

.wsp-card--cart-button-image .wsp-card__image-wrap:hover .wsp-card__cart-button {
    transform: translateY(0);
}

.wsp-card--cart-button-image .wsp-card__cart-button:hover {
    filter: brightness(1.1);
}

/* =============================================
   Cart style: Text Button
   – button below body (after price), image shrinks on hover.
   JS pins --wsp-img-h on .wsp-card--cart-button at load.
   ============================================= */
.wsp-card--cart-button .wsp-card__image-wrap {
    overflow: hidden;
    height: var(--wsp-img-h, auto);
    transition: height 0.35s ease;
}

.wsp-card--cart-button.wsp-card--ready:hover .wsp-card__image-wrap {
    height: calc(var(--wsp-img-h) - 44px);
}

.wsp-card--cart-button .wsp-card__cart-button {
    height: 0;
    overflow: hidden;
    padding: 0 10px;
    margin: 0 10px;
    width: calc(100% - 20px);
    transition: height 0.35s ease, padding 0.35s ease, background-color 0.2s ease;
}

.wsp-card--cart-button.wsp-card--ready:hover .wsp-card__cart-button {
    height: 44px;
    padding: 12px 10px;
    margin-bottom: 10px;
}

.wsp-card--cart-button .wsp-card__cart-button:hover {
    filter: brightness(1.1);
}

.wsp-card--cart-button:hover .wsp-card__image img.wsp-card__img {
    transform: scale(1);
}

/* Remove flex:1 from body in button variant so it doesn't grow */
.wsp-card--cart-button .wsp-card__body {
    flex: 0 0 auto;
}

/* =============================================
   Body / text area
   ============================================= */
.wsp-card__body {
    padding: 16px 10px 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
}

/* Winery name */
.wsp-card__winery {
    font-size: 18px;
    font-weight: 700;
    line-height: 1.3;
    color: var(--e-global-color-text, #333);
}

/* Variety + Vintage */
.wsp-card__variety-vintage {
    font-size: 14px;
    font-weight: 400;
    line-height: 1.4;
    color: var(--e-global-color-secondary, #777);
}

/* Price */
.wsp-card__price {
    font-size: 16px;
    font-weight: 600;
    color: var(--e-global-color-primary, currentColor);
    margin-top: auto;
    padding-top: 4px;
    padding-bottom: 6px;
}

/* =============================================
   Out of stock — disabled cart buttons
   ============================================= */
.wsp-card__cart-btn--disabled,
.wsp-card__cart-button--disabled {
    pointer-events: none;
    cursor: default;
    opacity: 0.5;
}

.wsp-card__cart-button--disabled {
    background-color: #999;
}

.wsp-card__overlay--disabled {
    pointer-events: none;
    cursor: default;
}
