/**
 * One Elementor - One Products Widget
 * Product Grid Styles
 */

/* ========================================
   Products Grid
======================================== */
.oe-products-wrapper {
    width: 100%;
}

.oe-products-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    column-gap: 20px;
    row-gap: 20px;
}

/* ========================================
   Product Item
======================================== */
.oe-product-item {
    background-color: #FFFFFF;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.oe-product-item:hover {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

/* ========================================
   Product Image
======================================== */
.oe-product-image {
    position: relative;
    overflow: hidden;
    background-color: #F5F5F5;
    aspect-ratio: 1 / 1;
}

.oe-product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.oe-product-item:hover .oe-product-image img {
    transform: scale(1.05);
}

.oe-product-image a {
    display: block;
    height: 100%;
    position: relative;
}

/* Hover Image Effect */
.oe-product-item.has-hover-image .oe-product-image a {
    position: relative;
}

.oe-product-item.has-hover-image .oe-main-image,
.oe-product-item.has-hover-image .oe-hover-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    transition: opacity 0.4s ease;
}

.oe-product-item.has-hover-image .oe-main-image {
    opacity: 1;
    z-index: 1;
}

.oe-product-item.has-hover-image .oe-hover-image {
    opacity: 0;
    z-index: 2;
}

.oe-product-item.has-hover-image:hover .oe-main-image {
    opacity: 0;
}

.oe-product-item.has-hover-image:hover .oe-hover-image {
    opacity: 1;
}

/* Reset scale on hover for has-hover-image */
.oe-product-item.has-hover-image:hover .oe-product-image img {
    transform: scale(1);
}

/* ========================================
   Product Badge
======================================== */
.oe-product-badge {
    position: absolute;
    top: 0;
    right: 0;
    background-color: #FF6B6B;
    color: #FFFFFF;
    padding: 5px 5px;
    border-radius: 0 0 0 4px;
    font-size: 14px;
    font-weight: 600;
    z-index: 2;
}

/* ========================================
   Product Content
======================================== */
.oe-product-content {
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex-grow: 1;
}

/* Product Title */
.oe-product-title {
    margin: 0;
    font-size: 14px;
    font-weight: 400;
    line-height: 20px;
    color: #333333;
}

.oe-product-title a {
    color: inherit;
    text-decoration: none;
    transition: color 0.3s ease;
    display: block;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.oe-product-title a:hover {
    color: #FF6B6B;
}

/* ========================================
   Price
======================================== */
.oe-product-price-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.oe-product-old-price {
    font-size: 12px;
    color: #333
    text-decoration: line-through;
}

.oe-product-price {
    font-size: 16px;
    font-weight: 500;
    color: #ee4d2d;
}

.oe-product-price .woocommerce-Price-amount {
    color: inherit;
}

/* Discount Amount */
.oe-product-discount {
    font-size: 13px;
    color: #FF6B6B;
    font-weight: 500;
}

/* ========================================
   Rating
======================================== */
.oe-product-rating {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 14px;
}

.oe-product-rating .star-rating {
    font-size: 14px;
}

.oe-rating-count {
    color: #999999;
    font-size: 13px;
}

/* ========================================
   Button
======================================== */
.oe-product-actions {
    margin-top: auto;
    padding-top: 10px;
}

.oe-product-button {
    display: block;
    width: 100%;
    padding: 12px 20px;
    background-color: #FFFFFF;
    color: #333333;
    text-align: center;
    text-decoration: none;
    border: 1px solid #E0E0E0;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    cursor: pointer;
}

.oe-product-button:hover {
    background-color: #FF6B6B;
    color: #FFFFFF;
    border-color: #FF6B6B;
}

/* ========================================
   Responsive Design
======================================== */

/* Tablet */
@media (max-width: 1024px) {
    .oe-products-grid {
        grid-template-columns: repeat(3, 1fr);
        column-gap: 15px;
        row-gap: 15px;
    }
}

/* Mobile */
@media (max-width: 768px) {
    .oe-products-grid {
        grid-template-columns: repeat(2, 1fr);
        column-gap: 10px;
        row-gap: 10px;
    }

    .oe-product-content {
        padding: 12px;
        gap: 8px;
    }

    .oe-product-title {
        font-size: 14px;
    }

    .oe-product-price {
        font-size: 18px;
    }

    .oe-product-button {
        padding: 10px 15px;
        font-size: 13px;
    }
}

/* Small Mobile */
@media (max-width: 480px) {
    .oe-product-content {
        padding: 10px;
    }

    .oe-product-title {
        font-size: 13px;
    }

    .oe-product-price {
        font-size: 16px;
    }

    .oe-product-old-price {
        font-size: 12px;
    }

    .oe-product-discount {
        font-size: 12px;
    }
}

/* ========================================
   WooCommerce Compatibility
======================================== */
.oe-product-item .star-rating {
    overflow: hidden;
    position: relative;
    height: 1em;
    line-height: 1em;
    font-size: 1em;
    width: 5.4em;
    font-family: star;
}

.oe-product-item .star-rating::before {
    content: "SSSSS";
    color: #d3ced2;
    float: left;
    top: 0;
    left: 0;
    position: absolute;
}

.oe-product-item .star-rating span {
    overflow: hidden;
    float: left;
    top: 0;
    left: 0;
    position: absolute;
    padding-top: 1.5em;
}

.oe-product-item .star-rating span::before {
    content: "SSSSS";
    top: 0;
    position: absolute;
    left: 0;
    color: #FF9800;
}

/* ========================================
   Load More Button
======================================== */
.oe-load-more-wrapper {
    text-align: center;
    margin-top: 30px;
    padding-top: 20px;
}

.oe-load-more-btn {
    display: inline-block;
    padding: 12px 30px;
    background-color: #ef583a;
    color: #FFFFFF;
    font-size: 16px;
    font-weight: 600;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
}

.oe-load-more-btn:hover {
    background-color: #FF5252;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 107, 107, 0.3);
}

.oe-load-more-btn.loading {
    opacity: 0.6;
    cursor: wait;
    pointer-events: none;
}

.oe-load-more-btn.loading::before {
    content: '';
    display: inline-block;
    width: 14px;
    height: 14px;
    margin-right: 8px;
    border: 2px solid #FFFFFF;
    border-top-color: transparent;
    border-radius: 50%;
    animation: oe-spin 0.6s linear infinite;
}

.oe-load-more-btn.no-more {
    background-color: #CCCCCC;
    cursor: not-allowed;
    pointer-events: none;
}

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

/* ========================================
   Numbers Pagination
======================================== */
.oe-pagination {
    margin-top: 40px;
    padding-top: 20px;
}

.oe-pagination-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
}

.oe-pagination-prev,
.oe-pagination-next,
.oe-pagination-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 12px;
    background-color: #FFFFFF;
    color: #333333;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    border: 1px solid #E0E0E0;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.oe-pagination-prev:hover,
.oe-pagination-next:hover,
.oe-pagination-number:hover {
    background-color: #FF6B6B;
    color: #FFFFFF;
    border-color: #FF6B6B;
    transform: translateY(-2px);
    box-shadow: 0 2px 8px rgba(255, 107, 107, 0.2);
}

.oe-pagination-number.current {
    background-color: #FF6B6B;
    color: #FFFFFF;
    border-color: #FF6B6B;
    pointer-events: none;
}

.oe-pagination-dots {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    color: #999999;
    font-size: 14px;
}

.oe-pagination-prev,
.oe-pagination-next {
    font-weight: 600;
}

/* Mobile */
@media (max-width: 768px) {
    .oe-pagination {
        margin-top: 30px;
        padding-top: 15px;
    }

    .oe-pagination-wrapper {
        gap: 6px;
    }

    .oe-pagination-prev,
    .oe-pagination-next,
    .oe-pagination-number {
        min-width: 36px;
        height: 36px;
        padding: 0 10px;
        font-size: 13px;
    }

    .oe-pagination-dots {
        min-width: 30px;
        height: 36px;
    }

    .oe-load-more-wrapper {
        margin-top: 20px;
    }

    .oe-load-more-btn {
        padding: 10px 25px;
        font-size: 14px;
    }
}