/* CSS Variables for Theme Compatibility */
:root {
    --ingredients-primary-color: var(--wp--preset--color--primary, #5e35b1);
    --ingredients-secondary-color: var(--wp--preset--color--secondary, #4fc3f7);
    --ingredients-text-color: var(--wp--preset--color--foreground, #333);
    --ingredients-text-light: var(--wp--preset--color--foreground-light, #666);
    --ingredients-background: var(--wp--preset--color--background, #fff);
    --ingredients-surface: var(--wp--preset--color--surface, #f5f5f5);
    --ingredients-border: var(--wp--preset--color--border, #e0e0e0);
    --ingredients-border-hover: var(--wp--preset--color--border-hover, #ccc);
    --ingredients-surface-hover: var(--wp--preset--color--surface-hover, #e8e8e8);
    --ingredients-accent: var(--wp--preset--color--accent, #999);
    --ingredients-white: var(--wp--preset--color--white, #fff);
}

/* Ingredients Tab Styles */
.ingredients-tab-content {
    padding: 20px 0;
    background: var(--ingredients-background);
    position: relative;
}

/* Two Column Layout */
.ingredients-two-column-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    align-items: start;
}

.ingredients-left-column {
    min-width: 0;
    background-color: #fff9fd;
    display: block;
    padding: 10px;
}

.ingredients-right-column {
    min-width: 0;
}

.ingredients-tab-content h3 {
    margin-bottom: 20px;
    margin-left:-10px;
    font-size: 17px;
    color: #ffffff;
}

.featured-ingredients-title {
    display: inline-block;
    background:#b5415e;
    color: #fff;
    padding: 8px ;
    border-radius: 0px 5px 0px 5px;
    font-size: 12px;
    font-weight: 600;
    margin: 0 0 20px 0;
}

.regular-ingredients-title {
    margin-top: 30px;
    color:#b5415e;
    border-bottom: 1px solid var(--ingredients-primary-color);
    padding-bottom: 10px;
    margin-bottom: 20px;
    font-weight: 600;
}

/* Featured Ingredients Section */
.featured-ingredients {
    padding: 0;
    border-radius: 0;
    margin-bottom: 0;
    border: none;
}

.featured-ingredients .ingredient-item {
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 0;
    margin-bottom: 20px;
    box-shadow: none;
}

.featured-ingredients .ingredient-item:last-child {
    margin-bottom: 0;
}

/* Featured Ingredient Items */
.featured-ingredient-item {
    margin-bottom: 20px;
}

.featured-ingredient-item:last-child {
    margin-bottom: 0;
}

.featured-ingredient-title {
    font-size: 16px;
    font-weight: 600;
    color: #b5415e;
    margin: 0 0 6px 0;
    line-height: 1.3;
}

.featured-ingredient-description {
    font-size: 14px;
    color: var(--ingredients-text-light);
    margin: 0;
    line-height: 1.4;
}

/* All Ingredients Section */
.regular-ingredients {
    display: flex;
    flex-wrap: wrap;
    gap: 0;
    margin-top: 20px;
    line-height: 1.4;
}

.ingredient-item {
    display: inline-flex;
    align-items: center;
    background: var(--ingredients-surface);
    border: 1px solid var(--ingredients-border);
    border-radius: 6px;
    padding: 8px 12px;
    margin: 2px 4px 2px 0;
    font-size: 13px;
    color: var(--ingredients-text-color);
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    font-weight: 400;
    line-height: 1.2;
}

.ingredient-item:hover {
    background: var(--ingredients-surface-hover);
    border-color: var(--ingredients-border-hover);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.ingredient-name {
    margin-right: 6px;
}

.ingredient-info-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    background: #597a46;
    color:  #c5ffc2;
    border-radius: 50%;
    font-size: 10px;
    font-weight: bold;
    font-style: italic;
    margin-left: 4px;
    line-height: 1;
}

.ingredient-info-icon::before {
    content: "i";
}

/* Featured ingredient styling in regular section */
.regular-ingredients .ingredient-item.featured-ingredient {
    background: #e0f1d3;
    border-color: #a8eea4;
    color: #597a46;
    font-weight: 500;
}

.regular-ingredients .ingredient-item.featured-ingredient:hover {
    background:  #e0f1d3;
    border-color: #a8eea4;
}

/* Tooltip Styles */
.ingredient-tooltip {
    position: fixed;
    background: var(--ingredients-background);
    border: 1px solid var(--ingredients-border);
    border-radius: 6px;
    padding: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.12);
    z-index: 1000;
    max-width: 280px;
    min-width: 180px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    pointer-events: none;
}

.ingredient-tooltip.show {
    opacity: 1;
    visibility: visible;
}

.ingredient-tooltip-image {
    width: 50px;
    height: 50px;
    border-radius: 4px;
    object-fit: cover;
    margin: 0 auto 8px;
    display: block;
    background: var(--ingredients-surface);
}

.ingredient-tooltip-title {
    font-weight: 500;
    color: #597a46;
    margin-bottom: 6px;
    text-align: center;
    font-size: 14px;
}

.ingredient-tooltip-description {
    color: var(--ingredients-text-light);
    font-size: 12px;
    line-height: 1.3;
    text-align: center;
}

.ingredient-image {
    margin-bottom: 10px;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--ingredients-surface);
}

.ingredient-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.ingredient-name h4 {
    margin: 0 0 8px 0;
    font-size: 1.1em;
    color: var(--ingredients-text-color);
    font-weight: 600;
}

.ingredient-description {
    margin: 0;
    font-size: 0.9em;
    color: var(--ingredients-text-light);
    line-height: 1.4;
}

/* Responsive Design */
@media (max-width: 768px) {
    .ingredients-two-column-layout {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .featured-ingredients {
        padding: 15px;
    }
    
    .regular-ingredients {
        gap: 6px;
    }
    
    .ingredient-item {
        font-size: 13px;
        padding: 6px 12px;
    }
    
    .ingredient-tooltip {
        max-width: 250px;
        min-width: 180px;
    }
    
    .ingredient-tooltip-image {
        width: 50px;
        height: 50px;
    }
}

@media (max-width: 480px) {
    .ingredients-two-column-layout {
        gap: 15px;
    }
    
    .featured-ingredients {
        padding: 10px;
    }
    
    .regular-ingredients {
        gap: 4px;
        justify-content: center;
        text-align: center;
    }
    
    .ingredients-right-column {
        display: flex;
        flex-direction: column;
        align-items: center;
    }
    
    .ingredient-item {
        font-size: 14px;
        padding: 5px 10px;
    }
    
    .ingredient-tooltip {
        max-width: 200px;
        min-width: 150px;
        padding: 10px;
    }
    
    .ingredient-tooltip-image {
        width: 40px;
        height: 40px;
    }
    
    .ingredient-tooltip-title {
        font-size: 14px;
    }
    
    .ingredient-tooltip-description {
        font-size: 12px;
    }

    .regular-ingredients {
        margin-top: 0;
    }
}

/* WooCommerce Tab Integration */
.woocommerce-tabs .ingredients-tab-content {
    margin-top: 20px;
}

.woocommerce-tabs .ingredients-tab-content h3 {
    border-bottom: 2px solid #b5415e;
    padding-bottom: 10px;
    margin-bottom: 20px;
}
