/**
 * SLV Product Sales Lift - Frontend Styles
 */

/* Base Styles */
.slv-product-list {
    margin: 30px 0;
    clear: both;
}

.slv-product-list-title {
    font-size: 1.5em;
    margin-bottom: 20px;
    font-weight: 600;
}

/* Coupon Badge */
.slv-coupon-badge {
    display: inline-block;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 20px;
}

.slv-coupon-text {
    display: flex;
    align-items: center;
    gap: 6px;
}

.slv-coupon-text::before {
    content: "🎉";
}

/* Product Grid */
.slv-product-grid {
    display: grid;
    gap: 20px;
}

.slv-columns-1 {
    grid-template-columns: 1fr;
}

.slv-columns-2 {
    grid-template-columns: repeat(2, 1fr);
}

.slv-columns-3 {
    grid-template-columns: repeat(3, 1fr);
}

.slv-columns-4 {
    grid-template-columns: repeat(4, 1fr);
}

.slv-columns-5 {
    grid-template-columns: repeat(5, 1fr);
}

.slv-columns-6 {
    grid-template-columns: repeat(6, 1fr);
}

/* Product Item */
.slv-product-item {
    display: flex;
    flex-direction: column;
}

.slv-product-item-inner {
    height: 100%;
    display: flex;
    flex-direction: column;
}

/* Style: Minimal */
.slv-style-minimal .slv-product-item-inner {
    background: transparent;
}

/* Style: Card */
.slv-style-card .slv-product-item-inner {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    transition: box-shadow 0.3s ease;
}

.slv-style-card .slv-product-item-inner:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

.slv-style-card .slv-product-info {
    padding: 15px;
}

/* Style: Bordered */
.slv-style-bordered .slv-product-item-inner {
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    overflow: hidden;
    transition: border-color 0.3s ease;
}

.slv-style-bordered .slv-product-item-inner:hover {
    border-color: #999;
}

.slv-style-bordered .slv-product-info {
    padding: 15px;
}

/* Product Image */
.slv-product-image {
    position: relative;
    overflow: hidden;
}

.slv-product-image a {
    display: block;
}

.slv-product-image img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.3s ease;
}

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

/* Product Info */
.slv-product-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding-top: 15px;
}

.slv-product-name {
    font-size: 1em;
    font-weight: 500;
    margin: 0 0 8px;
    line-height: 1.4;
}

.slv-product-name a {
    color: inherit;
    text-decoration: none;
}

.slv-product-name a:hover {
    color: #2271b1;
}

/* Product Rating */
.slv-product-rating {
    margin-bottom: 8px;
}

.slv-product-rating .star-rating {
    font-size: 0.9em;
}

/* Product Price */
.slv-product-price {
    font-size: 1.1em;
    font-weight: 600;
    margin-bottom: 15px;
    color: #333;
}

.slv-product-price del {
    color: #999;
    font-weight: 400;
    font-size: 0.9em;
}

.slv-product-price ins {
    background: none;
    color: #e74c3c;
}

/* Product Actions */
.slv-product-actions {
    margin-top: auto;
}

/* Add to Cart Button */
.slv-add-to-cart {
    width: 100%;
    padding: 10px 20px;
    background: #2271b1;
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.3s ease;
}

.slv-add-to-cart:hover {
    background: #135e96;
}

.slv-add-to-cart.loading {
    opacity: 0.7;
    pointer-events: none;
}

.slv-add-to-cart.added {
    background: #46b450;
}

/* View Button (for variable/other products) */
.slv-view-product {
    display: block;
    width: 100%;
    padding: 10px 20px;
    background: #f0f0f0;
    color: #333;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
}

.slv-view-product:hover {
    background: #e0e0e0;
    color: #333;
}

/* SLV Add to Cart Wrapper - Injected buttons */
.slv-atc-wrapper {
    margin-top: 10px;
    text-align: center;
}

.slv-atc-button {
    display: inline-block;
    width: 100%;
    max-width: 200px;
    padding: 10px 20px;
    font-size: 13px;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: none;
    border-radius: 0;
    cursor: pointer;
    transition: all 0.3s ease;
}

.slv-atc-button.button.primary {
    background-color: var(--primary-color, #446084);
    color: #fff;
}

.slv-atc-button.button.primary:hover {
    background-color: var(--primary-color-dark, #3a5270);
    opacity: 0.9;
}

.slv-atc-button.button.secondary,
.slv-atc-button.slv-view-button {
    background-color: transparent;
    color: var(--primary-color, #446084);
    border: 2px solid var(--primary-color, #446084);
}

.slv-atc-button.button.secondary:hover,
.slv-atc-button.slv-view-button:hover {
    background-color: var(--primary-color, #446084);
    color: #fff;
}

.slv-atc-button.loading {
    opacity: 0.7;
    pointer-events: none;
}

.slv-atc-button.added {
    background-color: #5cb85c !important;
    border-color: #5cb85c !important;
    color: #fff !important;
}

.slv-atc-button.error {
    background-color: #d9534f !important;
    border-color: #d9534f !important;
    color: #fff !important;
}

/* Spinner */
.slv-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: slv-spin 0.8s linear infinite;
}

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

/* Out of stock label */
.slv-out-of-stock-label {
    display: inline-block;
    padding: 8px 16px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    color: #999;
    background: #f5f5f5;
    border-radius: 3px;
}

/* Flatsome specific adjustments */
.slv-product-list .box-text .slv-atc-wrapper {
    padding: 0 15px 15px;
}

.slv-product-list .product-small .slv-atc-wrapper {
    margin-top: 8px;
}

/* Out of Stock */
.slv-out-of-stock {
    color: #999;
    font-style: italic;
}

/* Mobile: Slider */
@media (max-width: 767px) {
    .slv-mobile-slider .slv-product-grid {
        display: flex;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
        gap: 15px;
        padding-bottom: 15px;
    }

    .slv-mobile-slider .slv-product-item {
        flex: 0 0 75%;
        scroll-snap-align: start;
    }

    .slv-mobile-slider.slv-columns-2 .slv-product-item,
    .slv-mobile-slider.slv-columns-3 .slv-product-item {
        flex: 0 0 60%;
    }

    /* Hide scrollbar but keep functionality */
    .slv-mobile-slider .slv-product-grid::-webkit-scrollbar {
        height: 6px;
    }

    .slv-mobile-slider .slv-product-grid::-webkit-scrollbar-track {
        background: #f1f1f1;
        border-radius: 3px;
    }

    .slv-mobile-slider .slv-product-grid::-webkit-scrollbar-thumb {
        background: #ccc;
        border-radius: 3px;
    }

    /* Mobile: Stack */
    .slv-mobile-stack .slv-product-grid {
        grid-template-columns: 1fr;
    }

    /* Stack items horizontally on mobile */
    .slv-mobile-stack .slv-product-item-inner {
        flex-direction: row;
    }

    .slv-mobile-stack .slv-product-image {
        width: 100px;
        flex-shrink: 0;
    }

    .slv-mobile-stack .slv-product-info {
        padding: 10px 15px;
    }
}

/* Tablet */
@media (min-width: 768px) and (max-width: 991px) {
    .slv-columns-4,
    .slv-columns-5,
    .slv-columns-6 {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Loading State */
.slv-product-list.slv-loading {
    opacity: 0.6;
    pointer-events: none;
}

/* Success message */
.slv-added-notice {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: #46b450;
    color: #fff;
    padding: 15px 25px;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 9999;
    animation: slv-slide-in 0.3s ease;
}

.slv-added-notice a {
    color: #fff;
    text-decoration: underline;
    margin-left: 10px;
}

@keyframes slv-slide-in {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
