/* Frontend Styles - Woo Insert Products from Category */

.wipc-container {
    margin: 40px 0;
    padding: 0;
    -webkit-box-sizing: border-box;
    box-sizing: border-box;
}

.wipc-container *,
.wipc-container *::before,
.wipc-container *::after {
    -webkit-box-sizing: border-box;
    box-sizing: border-box;
}

/* Title */
.wipc-container .wipc-title {
    margin: 0 0 20px;
    padding: 0;
    font-weight: 700;
}

/* Products Wrapper - padding allows shadows to show */
.wipc-container .wipc-products-wrapper {
    position: relative;
    padding: 10px;
    margin: -10px;
}

/* Slider: clip horizontally but allow vertical shadow overflow */
.wipc-container.wipc-mode-slider .wipc-products-wrapper {
    overflow-x: clip;
    overflow-y: visible;
}

/* Grid: allow all shadows to show */
.wipc-container.wipc-mode-grid .wipc-products-wrapper {
    overflow: visible;
}

/* Slider Track */
.wipc-container.wipc-mode-slider .wipc-products-track {
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-align: stretch;
    -ms-flex-align: stretch;
    align-items: stretch;
    gap: 16px;
    -webkit-transition: -webkit-transform .35s ease;
    transition: -webkit-transform .35s ease;
    transition: transform .35s ease;
    transition: transform .35s ease, -webkit-transform .35s ease;
    will-change: transform;
}

/* Grid Track */
.wipc-container.wipc-mode-grid .wipc-products-track {
    display: -ms-grid;
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(var(--wipc-cols, 4), 1fr);
}

/* Product Card */
.wipc-container .wipc-product-card {
    overflow: hidden;
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-orient: vertical;
    -webkit-box-direction: normal;
    -ms-flex-direction: column;
    flex-direction: column;
    -ms-flex-negative: 0;
    flex-shrink: 0;
}

/* Product Image */
.wipc-container .wipc-product-image {
    position: relative;
    overflow: hidden;
    line-height: 0;
}

.wipc-container .wipc-product-image a {
    display: block;
    text-decoration: none !important;
}

.wipc-container .wipc-product-image img,
.wipc-container .wipc-product-image .wipc-product-img {
    width: 100%;
    height: auto;
    display: block;
    -o-object-fit: cover;
    object-fit: cover;
}

/* Sale Badge - base positioning, colors set by inline styles */
.wipc-container .wipc-sale-badge {
    position: absolute;
    z-index: 2;
    -webkit-box-sizing: border-box;
    box-sizing: border-box;
}

/* Product Info */
.wipc-container .wipc-product-info {
    padding: 16px;
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-orient: vertical;
    -webkit-box-direction: normal;
    -ms-flex-direction: column;
    flex-direction: column;
    -webkit-box-align: stretch;
    -ms-flex-align: stretch;
    align-items: stretch;
    -webkit-box-flex: 1;
    -ms-flex: 1;
    flex: 1;
    gap: 10px;
}

/* Product Title */
.wipc-container .wipc-product-title {
    margin: 0;
    padding: 0;
    font-weight: 700;
}

.wipc-container .wipc-product-title a {
    display: block;
}

.wipc-container .wipc-product-title a:hover,
.wipc-container .wipc-product-title a:focus,
.wipc-container .wipc-product-title a:active {
    opacity: 1 !important;
}

/* Price */
.wipc-container .wipc-product-price {
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-align: center;
    -ms-flex-align: center;
    align-items: center;
    gap: 8px;
    -ms-flex-wrap: wrap;
    flex-wrap: wrap;
}

.wipc-container .wipc-price-regular,
.wipc-container .wipc-price-sale {
    font-weight: 700;
}

/* Add to Cart */
.wipc-container .wipc-add-to-cart {
    display: inline-block !important;
    text-align: center !important;
    border: none !important;
    border-radius: 6px;
    cursor: pointer !important;
    -webkit-transition: color .2s, background-color .2s !important;
    transition: color .2s, background-color .2s !important;
    font-weight: 400 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    margin-top: auto;
    -ms-flex-item-align: start;
    align-self: flex-start;
    -webkit-box-shadow: none !important;
    box-shadow: none !important;
    outline: none !important;
    float: none !important;
    width: auto !important;
    height: auto !important;
    min-height: 0 !important;
    letter-spacing: normal !important;
}

.wipc-container .wipc-add-to-cart:hover {
    opacity: 1 !important;
}

.wipc-container .wipc-add-to-cart.loading {
    pointer-events: none !important;
}

/* Spinner ring while loading */
.wipc-container .wipc-add-to-cart .wipc-btn-icon {
    display: none;
    width: 14px;
    height: 14px;
    margin-left: 4px;
    margin-top: -4px;
    vertical-align: middle;
    -ms-flex-negative: 0;
    flex-shrink: 0;
}

.wipc-container .wipc-add-to-cart.loading .wipc-btn-spinner {
    display: inline-block;
    border: 2px solid transparent;
    border-top-color: currentColor;
    border-radius: 50%;
    -webkit-animation: wipc-spin .6s linear infinite;
    animation: wipc-spin .6s linear infinite;
}

.wipc-container .wipc-add-to-cart.added .wipc-btn-check {
    display: inline-block;
}

/* Hide WooCommerce default added checkmark */
.wipc-container .wipc-add-to-cart.added::after {
    display: none !important;
}

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

/* Hide WooCommerce "View cart" notice after AJAX add to cart */
.wipc-container .added_to_cart,
.wipc-container .wc-forward,
.wipc-container a.added_to_cart {
    display: none !important;
}

/* Arrows - high specificity to override theme button styles */
.wipc-container .wipc-products-wrapper .wipc-arrow {
    position: absolute;
    top: 50%;
    -webkit-transform: translateY(-50%);
    -ms-transform: translateY(-50%);
    transform: translateY(-50%);
    z-index: 10;
    border: none !important;
    width: 44px;
    height: 44px;
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-align: center;
    -ms-flex-align: center;
    align-items: center;
    -webkit-box-pack: center;
    -ms-flex-pack: center;
    justify-content: center;
    cursor: pointer;
    -webkit-transition: background .2s, opacity .3s;
    transition: background .2s, opacity .3s;
    padding: 0 !important;
    margin: 0 !important;
    outline: none !important;
    -webkit-box-shadow: none !important;
    box-shadow: none !important;
    min-width: 0 !important;
    min-height: 0 !important;
    line-height: 1 !important;
    letter-spacing: 0 !important;
    text-indent: 0 !important;
    text-transform: none !important;
}

.wipc-container .wipc-products-wrapper .wipc-arrow svg {
    display: block;
    fill: none !important;
    -webkit-transition: stroke .2s;
    transition: stroke .2s;
}

.wipc-container .wipc-products-wrapper .wipc-arrow-left {
    left: 8px;
}

.wipc-container .wipc-products-wrapper .wipc-arrow-right {
    right: 8px;
}

/* Check More Button */
.wipc-container .wipc-more-btn-wrap {
    margin-top: 24px;
}

.wipc-container .wipc-more-btn {
    display: inline-block;
    border: none !important;
    border-radius: 6px;
    cursor: pointer;
    -webkit-transition: color .2s, background-color .2s;
    transition: color .2s, background-color .2s;
    font-weight: 400;
}

.wipc-container .wipc-more-btn:hover {
    opacity: 1;
}

/* Grid Responsive */
.wipc-container.wipc-mode-grid .wipc-products-track {
    grid-template-columns: repeat(var(--wipc-cols-laptop, 4), 1fr);
}

@media (max-width: 1023px) {
    .wipc-container.wipc-mode-grid .wipc-products-track {
        grid-template-columns: repeat(var(--wipc-cols-tablet, 2), 1fr);
    }
}

@media (max-width: 767px) {
    .wipc-container.wipc-mode-grid .wipc-products-track {
        grid-template-columns: repeat(var(--wipc-cols-phone, 1), 1fr);
    }

    .wipc-container .wipc-products-wrapper .wipc-arrow {
        width: 36px;
        height: 36px;
    }

    .wipc-container .wipc-products-wrapper .wipc-arrow-left {
        left: 4px;
    }

    .wipc-container .wipc-products-wrapper .wipc-arrow-right {
        right: 4px;
    }
}

/* Print */
@media print {
    .wipc-container .wipc-arrow {
        display: none;
    }
}
