/* Flatsome Temu Features - Styles */

/* ==========================================
   1. PRODUCT PAGE - Layout Override
   ========================================== */

/* Move description and reviews to left column */
@media (min-width: 850px) {

    /* Force product page to use flexbox layout */
    .single-product .product-container,
    .single-product .product-main {
        display: flex !important;
        flex-wrap: wrap;
        align-items: flex-start;
    }

    /* Left column: Gallery (keep in left position) */
    .single-product .product-gallery {
        order: 1;
        flex: 0 0 58%;
        max-width: 58%;
    }

    /* Right column: Product summary (sticky) */
    .single-product .product-info.summary {
        order: 2;
        flex: 0 0 38%;
        max-width: 38%;
        margin-left: 4%;
        position: sticky;
        top: 20px;
        align-self: flex-start;
    }

    /* Move tabs/reviews to left column below gallery */
    .single-product .woocommerce-tabs-wrapper,
    .single-product .woocommerce-tabs {
        order: 3;
        flex: 0 0 58%;
        max-width: 58%;
        margin-top: 30px;
        clear: both;
    }

    /* Related products full width below everything */
    .single-product .related,
    .single-product .up-sells {
        order: 4;
        flex: 0 0 100%;
        max-width: 100%;
        margin-top: 40px;
    }

    /* Stop sticking when reaching related products */
    .product-info.summary.entry-summary.ftf-unstick {
        position: relative !important;
        top: auto !important;
    }
}

/* Mobile: Keep default layout */
@media (max-width: 849px) {

    .single-product .product-gallery,
    .single-product .product-info.summary,
    .single-product .woocommerce-tabs-wrapper,
    .single-product .woocommerce-tabs {
        order: initial !important;
        flex: initial !important;
        max-width: 100% !important;
        margin: 0 !important;
    }
}

/* ==========================================
   2. PRODUCT PAGE - Sale Badge
   ========================================== */

.ftf-quantity-wrapper {
    position: relative;
    display: inline-block;
}

.ftf-sale-badge {
    position: absolute;
    top: -15px;
    right: -15px;
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #ff4444 0%, #ff6b6b 100%);
    color: white;
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: bold;
    line-height: 1.2;
    box-shadow: 0 2px 8px rgba(255, 68, 68, 0.4);
    z-index: 10;
    animation: ftf-pulse 2s infinite;
}

@keyframes ftf-pulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }
}

/* ==========================================
   3. PRODUCT PAGE - Delivery Info
   ========================================== */

.ftf-delivery-info {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 15px;
    background: #f0f9ff;
    border: 1px solid #bae6fd;
    border-radius: 6px;
    margin: 15px 0;
    font-size: 14px;
}

.ftf-delivery-icon {
    font-size: 20px;
}

.ftf-delivery-text strong {
    color: #0284c7;
}

/* ==========================================
   4. SEARCH - Overlay
   ========================================== */

.ftf-search-overlay,
.ftf-search-overlay-instance {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #ddd;
    border-top: none;
    border-radius: 0 0 8px 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    max-height: 500px;
    overflow-y: auto;
    z-index: 9999;
}

.ftf-search-content {
    padding: 20px;
}

.ftf-search-section {
    margin-bottom: 20px;
}

.ftf-search-section:last-child {
    margin-bottom: 0;
}

.ftf-search-section h4 {
    font-size: 14px;
    font-weight: 600;
    margin: 0 0 12px 0;
    color: #333;
}

/* ==========================================
   5. SEARCH - Trending Chips
   ========================================== */

.ftf-search-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.ftf-chip {
    display: inline-block;
    padding: 8px 16px;
    background: #f5f5f5;
    border: 1px solid #e0e0e0;
    border-radius: 20px;
    font-size: 13px;
    color: #555;
    text-decoration: none;
    transition: all 0.2s;
}

.ftf-chip:hover {
    background: #e8f4fd;
    border-color: #2196f3;
    color: #2196f3;
}

/* ==========================================
   6. SEARCH - Recent Searches
   ========================================== */

.ftf-recent-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ftf-recent-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s;
}

.ftf-recent-item:hover {
    background: #f5f5f5;
}

.ftf-recent-icon {
    color: #999;
    font-size: 16px;
}

.ftf-recent-text {
    flex: 1;
    font-size: 14px;
    color: #333;
}

.ftf-recent-remove {
    color: #999;
    cursor: pointer;
    padding: 4px;
}

.ftf-recent-remove:hover {
    color: #f44336;
}

/* ==========================================
   7. SEARCH - Suggestions
   ========================================== */

.ftf-suggestion-group {
    margin-bottom: 15px;
}

.ftf-suggestion-title {
    font-size: 12px;
    color: #999;
    text-transform: uppercase;
    margin-bottom: 8px;
    font-weight: 600;
}

.ftf-suggestion-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s;
    text-decoration: none;
    color: inherit;
}

.ftf-suggestion-item:hover {
    background: #f5f5f5;
}

.ftf-suggestion-image {
    width: 40px;
    height: 40px;
    object-fit: cover;
    border-radius: 4px;
}

.ftf-suggestion-info {
    flex: 1;
}

.ftf-suggestion-name {
    font-size: 14px;
    color: #333;
    margin-bottom: 2px;
}

.ftf-suggestion-price {
    font-size: 13px;
    color: #666;
}

/* ==========================================
   8. MOBILE RESPONSIVE
   ========================================== */

@media (max-width: 849px) {
    .ftf-sale-badge {
        width: 40px;
        height: 40px;
        font-size: 10px;
        top: -10px;
        right: -10px;
    }

    .ftf-delivery-info {
        font-size: 13px;
    }

    .ftf-search-overlay,
    .ftf-search-overlay-instance {
        max-height: 400px;
    }
}