/**
 * Elementor Compatibility Styles
 * 
 * @package PinterestShop
 * @version 1.0.0
 */

/* ==========================================================================
   ELEMENTOR GENERAL COMPATIBILITY
   ========================================================================== */

/* Ensure Elementor sections work with theme */
.elementor-section-wrap {
    overflow-x: hidden;
}

.elementor-container {
    max-width: 1200px;
}

/* Typography integration */
.elementor-widget-container {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

.elementor-widget-container h1,
.elementor-widget-container h2,
.elementor-widget-container h3,
.elementor-widget-container h4,
.elementor-widget-container h5,
.elementor-widget-container h6 {
    font-family: inherit;
    font-weight: 600;
    line-height: 1.3;
    color: #333;
    margin-bottom: 15px;
}

.elementor-widget-container p {
    font-family: inherit;
    line-height: 1.6;
    color: #666;
    margin-bottom: 15px;
}

/* ==========================================================================
   PINTEREST WIDGETS STYLES
   ========================================================================== */

/* Pinterest Products Widget */
.elementor-pinterest-products {
    margin: 0;
    padding: 0;
}

.elementor-products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
    margin-bottom: 50px;
    align-items: start;
}

.elementor-product-card {
    background: #fff;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    transition: all 0.4s ease;
    position: relative;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    height: fit-content;
}

.elementor-product-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 40px rgba(0,0,0,0.15);
}

.elementor-product-image {
    position: relative;
    overflow: hidden;
}

.elementor-product-image img {
    width: 100%;
    height: auto;
    transition: transform 0.4s ease;
}

.elementor-product-card:hover .elementor-product-image img {
    transform: scale(1.08);
}

.elementor-product-badges {
    position: absolute;
    top: 15px;
    left: 15px;
    z-index: 2;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.elementor-product-info {
    padding: 20px;
}

.elementor-product-title a {
    color: #333;
    text-decoration: none;
    font-size: 1.1rem;
    font-weight: 600;
    transition: color 0.3s ease;
}

.elementor-product-title a:hover {
    color: #e60023;
}

.elementor-product-price {
    font-size: 1.2rem;
    font-weight: 700;
    color: #e60023;
    margin-bottom: 10px;
}

.elementor-product-price del {
    color: #999;
    font-weight: 400;
    margin-right: 8px;
}

.elementor-product-excerpt {
    font-size: 0.9rem;
    color: #666;
    line-height: 1.4;
}

/* Load More Button */
.elementor-load-more {
    text-align: center;
    margin-top: 40px;
}

.elementor-load-more-btn {
    padding: 15px 40px;
    background: #e60023;
    color: #fff;
    border: none;
    border-radius: 30px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.elementor-load-more-btn:hover {
    background: #c8001f;
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(230, 0, 35, 0.4);
}

/* ==========================================================================
   HERO SECTION WIDGET STYLES
   ========================================================================== */

.elementor-hero-section {
    position: relative;
    min-height: 70vh;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    overflow: hidden;
}

.elementor-hero-pattern {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        radial-gradient(circle at 25% 25%, rgba(255,255,255,0.1) 2px, transparent 2px),
        radial-gradient(circle at 75% 75%, rgba(255,255,255,0.1) 2px, transparent 2px);
    background-size: 50px 50px;
    animation: heroFloat 20s ease-in-out infinite;
}

@keyframes heroFloat {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-20px); }
}

.elementor-hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    max-width: 800px;
    padding: 0 20px;
}

.elementor-hero-title {
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: 20px;
    line-height: 1.2;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.elementor-hero-subtitle {
    font-size: 1.3rem;
    margin-bottom: 40px;
    opacity: 0.9;
    line-height: 1.6;
}

.elementor-hero-actions {
    display: flex;
    gap: 20px;
    justify-content: center;
    margin-bottom: 50px;
    flex-wrap: wrap;
}

.elementor-btn {
    padding: 18px 35px;
    font-size: 1.2rem;
    font-weight: 600;
    border-radius: 30px;
    text-decoration: none;
    transition: all 0.3s ease;
    display: inline-block;
}

.elementor-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
}

.elementor-btn-primary {
    background: #e60023;
    color: #fff;
    border: 2px solid #e60023;
}

.elementor-btn-primary:hover {
    background: #c8001f;
    border-color: #c8001f;
}

.elementor-btn-secondary {
    background: transparent;
    color: #fff;
    border: 2px solid rgba(255,255,255,0.8);
}

.elementor-btn-secondary:hover {
    background: rgba(255,255,255,0.1);
    border-color: #fff;
}

.elementor-hero-search {
    max-width: 600px;
    margin: 0 auto;
}

.elementor-search-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.elementor-hero-search-field {
    width: 100%;
    padding: 20px 60px 20px 25px;
    border: none;
    border-radius: 30px;
    font-size: 1.1rem;
    background: rgba(255,255,255,0.95);
    color: #333;
    box-shadow: 0 8px 30px rgba(0,0,0,0.2);
    transition: all 0.3s ease;
}

.elementor-hero-search-field:focus {
    outline: none;
    background: #fff;
    box-shadow: 0 12px 40px rgba(0,0,0,0.3);
    transform: translateY(-2px);
}

.elementor-hero-search-submit {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    border: none;
    background: #e60023;
    border-radius: 50%;
    color: #fff;
    cursor: pointer;
    transition: all 0.3s ease;
}

.elementor-hero-search-submit:hover {
    background: #c8001f;
    transform: translateY(-50%) scale(1.1);
}

/* ==========================================================================
   FILTERS WIDGET STYLES
   ========================================================================== */

.elementor-filters-container {
    padding: 30px 0;
    background: #f8f9fa;
    border-bottom: 1px solid #eee;
}

.elementor-filters-wrapper {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}

.elementor-filter-btn {
    padding: 12px 24px;
    border: 2px solid #e0e0e0;
    background: #fff;
    border-radius: 25px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #666;
}

.elementor-filter-btn:hover,
.elementor-filter-btn.active {
    background: #e60023;
    border-color: #e60023;
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(230, 0, 35, 0.3);
}

/* ==========================================================================
   WOOCOMMERCE INTEGRATION
   ========================================================================== */

.elementor-widget-container .woocommerce {
    font-family: inherit;
}

.elementor-widget-container .woocommerce .button {
    background: #e60023;
    color: #fff;
    border-radius: 25px;
    font-weight: 600;
    transition: all 0.3s ease;
    border: none;
    padding: 12px 24px;
}

.elementor-widget-container .woocommerce .button:hover {
    background: #c8001f;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(230, 0, 35, 0.3);
}

.elementor-widget-container .woocommerce .price {
    color: #e60023;
    font-weight: 700;
}

.elementor-widget-container .woocommerce .star-rating {
    color: #ffc107;
}

/* ==========================================================================
   RESPONSIVE DESIGN
   ========================================================================== */

@media (max-width: 1200px) {
    .elementor-products-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 20px;
    }
}

@media (max-width: 768px) {
    .elementor-hero-title {
        font-size: 2.5rem;
    }

    .elementor-hero-subtitle {
        font-size: 1.1rem;
    }

    .elementor-hero-actions {
        flex-direction: column;
        align-items: center;
    }

    .elementor-btn {
        padding: 15px 30px;
        font-size: 1.1rem;
    }

    .elementor-filters-wrapper {
        justify-content: flex-start;
        overflow-x: auto;
        padding: 0 20px;
    }

    .elementor-filter-btn {
        white-space: nowrap;
        flex-shrink: 0;
    }

    .elementor-products-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 15px !important;
        padding: 0 10px;
    }

    .elementor-product-card {
        min-width: 0; /* Prevent overflow */
    }

    /* Mobile action buttons for Elementor - horizontal on hover */
    .elementor-product-overlay {
        opacity: 0 !important;
        background: rgba(0,0,0,0.6) !important;
        transition: opacity 0.3s ease !important;
    }

    .elementor-product-card:hover .elementor-product-overlay {
        opacity: 1 !important;
    }

    .elementor-product-actions {
        transform: translateX(-50%) !important;
        position: absolute;
        bottom: 15px;
        left: 50%;
        display: flex;
        flex-direction: row;
        gap: 12px;
        justify-content: center;
    }

    .elementor-action-btn {
        width: 44px !important;
        height: 44px !important;
        border-radius: 50%;
        background: rgba(255,255,255,0.95) !important;
        color: #333 !important;
        border: none;
        cursor: pointer;
        transition: all 0.3s ease;
        display: flex !important;
        align-items: center;
        justify-content: center;
        font-size: 18px;
        box-shadow: 0 2px 10px rgba(0,0,0,0.2);
        -webkit-tap-highlight-color: transparent;
        touch-action: manipulation;
    }
}

@media (max-width: 400px) {
    .elementor-hero-title {
        font-size: 2rem;
    }

    .elementor-hero-search-field {
        padding: 15px 50px 15px 20px;
        font-size: 1rem;
    }

    .elementor-hero-search-submit {
        width: 40px;
        height: 40px;
    }

    .elementor-products-grid {
        grid-template-columns: 1fr !important;
        gap: 20px !important;
        padding: 0 15px;
    }

    .elementor-action-btn {
        width: 40px !important;
        height: 40px !important;
        font-size: 16px;
    }

    .elementor-product-actions {
        gap: 6px;
        bottom: 8px;
        right: 8px;
    }
}

/* ==========================================================================
   ELEMENTOR EDITOR COMPATIBILITY
   ========================================================================== */

.elementor-editor-active .elementor-widget-container {
    min-height: auto;
}

.elementor-editor-active .elementor-products-grid {
    min-height: 200px;
}

.elementor-editor-active .elementor-hero-section {
    min-height: 400px;
}

/* ==========================================================================
   ANIMATIONS
   ========================================================================== */

.elementor-product-card {
    animation: elementorFadeInUp 0.6s ease-out;
}

.elementor-product-card:nth-child(even) {
    animation-delay: 0.1s;
}

.elementor-product-card:nth-child(3n) {
    animation-delay: 0.2s;
}

@keyframes elementorFadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Loading states */
.elementor-widget-container .loading {
    opacity: 0.6;
    pointer-events: none;
}

.elementor-widget-container .loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #e60023;
    border-radius: 50%;
    animation: elementorSpin 1s linear infinite;
    transform: translate(-50%, -50%);
}

@keyframes elementorSpin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}
