/* ————————————————————————
   1. تعریف فونت متغیر Yekan Bakh
————————————————————————————— */
@font-face {
    font-family: 'Yekan Bakh';
    src: url('../fonts/YekanBakhFaNum-VF.woff2') format('woff2'),
         url('../fonts/YekanBakhFaNum-VF.woff') format('woff');
    font-weight: 100 900;
    font-style: normal;
    font-display: swap;
}

/* همیشه اعمال فونت یکان‌بخ به همه اجزای افزونه (حتی FAQ!) */
.woo-ingredients,
.ingredient-details,
.ingredient-single,
.ingr-card,
.ingr-faq-q,
.ingr-faq-a,
.ingr-main-img img,
.ingr-gallery-thumb,
.ingr-attr-badge,
.ingr-story-label,
.copy-link-btn,
.share-ico {
    font-family: 'Yekan Bakh', sans-serif !important;
    letter-spacing: 0;
}

/* ساختار کلی */
.woo-ingredients, .ingredient-details, .ingredient-single {
    margin: 30px 0;
    direction: rtl;
    text-align: right;
}

.ingr-video video {
    width: 100%;
    max-width: 100%;
    display: block;
    object-fit: cover;  /* مهم! */
    aspect-ratio: 16/9; /* دلخواه، مثلاً ویدیوهای افقی */
    border-radius: 12px;
}

.ingredient-item.circle {
  background-color: #fff;
  border-radius: 8px;
  padding: 5px 10px;
  display: flex;
  align-items: center;     /* وسط‌چین عمودی */
  justify-content: center; /* ✅ وسط‌چین افقی */
  gap: 8px;
  flex-grow: 1;
  flex-basis: 150px;
}

.ingredient-image img {
  width: 40px;           /* اندازه دلخواه عکس */
  height: 40px;
  border-radius: 50%;    /* اگر می‌خواهی عکس دایره‌ای باشد */
  object-fit: cover;
}

.ingredient-name {
  display: block;
  font-size: 0.9rem;
}

/* -------------------
  کارت جزئیات ترکیب
------------------- */
.ingr-card {
    background: #fff;
    border-radius: 18px;
    box-shadow: 0 2px 28px #e0e0e0;
    display: flex;
    flex-wrap: wrap;
    padding: 32px 26px;
    gap: 40px;
    margin: 24px 0;
}
@media (max-width: 900px) {
    .ingr-card { flex-direction: column; padding: 18px 8px; }
}

/* ساید چپ */
.ingr-header {
    flex: 1 1 150px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1px;
}
.ingr-main-img {
    width: 200px;
    height: 200px;
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 2px 14px #eee;
    background: #fafafa;
}
.ingr-main-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 18px;
}

/* گالری */
.ingr-gallery {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 8px;
}
.ingr-gallery-thumb {
    border: 1px solid #f5f3fe;
    border-radius: 5px;
    padding: 3px;
    display: flex;
    transition: box-shadow .17s;
}
.ingr-gallery-thumb img {
    width: 60px;
    height: 60px;
    border-radius: 4px;
    object-fit: cover;
    cursor: pointer;
    transition: transform .18s;
}
.ingr-gallery-thumb:hover { box-shadow: 0 4px 10px #edeaff; }
.ingr-gallery-thumb img:hover { transform: scale(1.08); }

/* ویدیو */
.ingr-video {
    margin-top: 16px;
}
.ingr-video video {
    width: 210px;
    border-radius: 12px;
    box-shadow: 0 1px 10px #d6d6d6;
}

/* ساید راست */
.ingr-content {
    flex: 3 1 450px;
}
.ingr-title {
    font-size: 2.1rem;
    font-weight: 700;
    margin-bottom: 10px;
    color: #221155;
}
.ingr-desc {
    color: #444;
    font-size: 1.04rem;
    margin-bottom: 18px;
}
.ingr-attrs {
    margin-bottom: 18px;
}
.ingr-attr-badge {
    background: #f5f3fe;
    color: #6036b7;
    padding: 6px 18px;
    border-radius: 22px;
    font-size: .98rem;
    display: inline-block;
    margin: 0 5px 8px 0;
}
.ingr-story-card {
    background: #f7faff;
    border-radius: 10px;
    box-shadow: 0 2px 10px #f0f0ff;
    padding: 14px 15px;
    margin-bottom: 18px;
}
.ingr-story-label {
    color: #0073aa; 
    font-weight: 600;
    margin-bottom: 6px;
}
.ingr-faq {
    margin: 36px 0;
}
.ingr-faq-title {
    font-size: 1.15rem;
    color: #352088;
    font-weight: 600;
    margin-bottom: 18px;
}
.ingr-faq-list {
    border-radius: 10px;
}
.ingr-faq-item {
    margin-bottom: 12px;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 2px 6px #f2f2f2;
}
.ingr-faq-q { 
    width: 100%;
    text-align: right;
    padding: 14px 10px;
    background: none;
    border: none;
    outline: none;
    cursor: pointer;
    font-weight: 600;
    color: #003366;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-family: 'Yekan Bakh', sans-serif !important;
}
.ingr-faq-q svg {
    margin-right: 8px;
    transition: .2s;
}
.ingr-faq-item .ingr-faq-a {
    display: none;
    padding: 0 16px 16px 8px;
    color: #333;
    font-family: 'Yekan Bakh', sans-serif !important;
}
.ingr-faq-item.open .ingr-faq-a {
    display: block;
}
.ingr-faq-item.open .ingr-faq-q svg {
    transform: rotate(180deg);
}
.ingr-share {
    margin-top: 26px;
    display: flex;
    align-items: center;
    gap: 12px;
}
.copy-link-btn {
    background: #704ad4;
    color: #fff;
    border: none;
    padding: 7px 14px;
    border-radius: 7px;
    font-size: .97em;
    cursor: pointer;
    font-family: 'Yekan Bakh', sans-serif !important;
}
.share-ico img {
    border-radius: 50%;
    background: #ededed;
    padding: 4px;
}

/* لیست ترکیبات */
.ingredient-list {
    list-style: none;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
}
.ingredient-list.layout-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
}
.ingredient-list.layout-list {
    flex-direction: column;
}
.ingredient-item {
    display: flex;
    align-items: center;
    gap: 10px;
}
.ingredient-image img {
    max-width: 100%;
    height: auto;
    border-radius: 50% !important;
    transition: transform 0.3s ease;
}
.ingredient-image img:hover {
    transform: scale(1.05);
}
.ingredient-name {
    color: #333;
    text-decoration: none;
    font-weight: 500;
}
.ingredient-name:hover {
    color: #0073aa;
}
.ingredient-attributes {
    list-style: none;
    padding: 0;
    margin: 0;
}
.ingredient-attributes li {
    margin-bottom: 10px;
    font-size: 0.9em;
}

/* لودر خطی پاپ‌آپ */
.ingredient-popup-loading-bar {
    width: 200px;
    height: 10px;
    background: #eaeaea;
    border-radius: 5px;
    overflow: hidden;
    margin: 0 auto;
    position: relative;
}
.ingredient-popup-loading-bar-inner {
    width: 0;
    height: 100%;
    background: linear-gradient(90deg, #a259ff 0%, #0073aa 100%);
    transition: width 0.3s;
}
.ingredient-popup-loading-bar-label {
    display: block;
    text-align: center;
    color: #fff;
    font-size: 14px;
    margin-top: 8px;
    font-weight: bold;
    letter-spacing: 1px;
}

.ingr-section-header {
    font-size: 1.2rem;           /* اندازه فونت */
    font-weight: 600;            /* ضخامت فونت */
    color: #221155;              /* رنگ متن */
    margin-bottom: 12px;         /* فاصله پایین تیتر تا محتوا */
    padding-right: 8px;          /* فاصله از راست برای تراز RTL */
    text-align: right;           /* راست‌چین کردن متن */
    border-bottom: 2px solid #f5f3fe; /* یک خط زیر تیتر (اختیاری) */  
    margin-top: 38px;
}

.ingr-story-txt {
    text-align: justify;
    text-justify: inter-word;
    line-height: 1.6;
}

/* پاپ‌آپ جزئیات ترکیب */
.ingredient-details-popup {
    background: #fff;
    border-radius: 18px;
    box-shadow: 0 2px 28px #e0e0e0;
    padding: 32px 26px;
    max-width: 480px;
    width: 98vw;
    margin: 0 auto;
    position: relative;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.3s ease, transform 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 18px;
}
.ingredient-details-popup.show {
    opacity: 1;
    transform: translateY(0);
}
.ingredient-details-popup h3 {
    color: #221155;
    font-size: 1.55em;
    font-weight: 700;
    margin-bottom: 14px;
}
.ingredient-details-popup img {
    width: 90px;
    height: 90px;
    object-fit: cover;
    border-radius: 18px;
    box-shadow: 0 2px 14px #eee;
    display: block;
}
.ingredient-details-popup .ingredient-description {
    color: #444;
    font-size: 1.04rem;
    margin-bottom: 18px;
}
.ingredient-details-popup .ingredient-attributes {
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
}
.ingredient-details-popup .ingredient-attributes li {
    flex-grow: 1;
    flex-basis: 200;
    background: #f5f3fe;
    color: #6036b7;
    border-radius: 9px;
    font-size: 1em;
    padding: 8px 16px;
    margin: 0;
    font-family: 'Yekan Bakh', sans-serif !important;
}
.ingredient-details-popup .ingredient-popup-buttons {
    margin-top: 15px;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    width: 100%;
}
.ingredient-details-popup .more-info-button {
    background: #6036b7;
    color: #fff;
    border: none;
    padding: 7px 15px;
    cursor: pointer;
    border-radius: 6px;
    text-decoration: none;
    display: inline-block;
    font-size: 1em;
    margin-left: 10px;
    font-family: 'Yekan Bakh', sans-serif !important;
    transition: background 0.18s;
}
.ingredient-details-popup .more-info-button:hover {
    background: #f5f3fe;
    color: #6036b7;
}
.ingredient-details-popup .close-popup {
    position: absolute;
    top: 10px;
    left: 10px;
    background: #d63638;
    color: #fff;
    border: none;
    width: 32px;
    height: 32px;
    line-height: 32px;
    text-align: center;
    font-size: 22px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px #f7f7f7;
}
.ingredient-details-popup .close-popup::before {
    content: '×';
}

/* پوشش پاپ‌آپ */
.ingredient-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s ease;
}
.ingredient-popup-overlay.show {
    opacity: 1;
}

/* لودر گردان پاپ‌آپ */
.ingredient-popup-loading {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 60px;
    height: 60px;
    background: transparent;
    border-radius: 50%;
    position: relative;
}
.ingredient-popup-loading::before {
    content: '';
    width: 50px;
    height: 50px;
    border: 5px solid #0073aa;
    border-top: 5px solid transparent;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* دکمه‌ها و لینک‌های اشتراک‌گذاری */
.ingr-share {
    margin-top: 26px;
    display: flex;
    align-items: center;
    gap: 10px;
}
.ingr-share .copy-link-btn,
.ingr-share .share-ico {
    display: inline-block;
    background: #704ad4;
    color: #fff !important;
    border: none;
    padding: 7px 18px;
    border-radius: 7px;
    font-size: 1em;
    cursor: pointer;
    text-decoration: none;
    font-family: 'Yekan Bakh', sans-serif !important;
    transition: background 0.18s;
}
.ingr-share .copy-link-btn:hover,
.ingr-share .share-ico:hover {
    background: #5a39b6;
    color: #fff !important;
}

/* پاپ‌آپ ساده تصویر */
.simple-image-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1001;
    opacity: 0;
    transition: opacity 0.3s ease;
}
.simple-image-popup-overlay.show {
    opacity: 1;
}
.simple-image-popup {
    position: relative;
    max-width: 90%;
    max-height: 90%;
    background: #fff;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}
.simple-image-popup img {
    max-width: 100%;
    max-height: 80vh;
    object-fit: contain;
    border-radius: 8px;
}
.close-simple-popup {
    position: absolute;
    top: -15px;
    left: -15px;
    background: #d63638;
    color: #fff;
    border: none;
    width: 30px;
    height: 30px;
    line-height: 30px;
    text-align: center;
    font-size: 20px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ingr-attrs {
    display: flex;
    flex-wrap: wrap;
}
.ingr-attr-badge {
    flex-grow: 1;
    flex-basis: 200;
}

/* انیمیشن چرخش */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ریسپانسیو */
@media (max-width: 768px) {
    .ingredient-list.layout-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    }
    .ingredient-single {
        padding: 0 15px;
    }
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }
    .ingredient-details-popup {
        max-width: 97vw;
        padding: 16px 6px;
    }
    .ingr-share .copy-link-btn,
    .ingr-share .share-ico {
        font-size: 0.8em;
    }
    .ingr-title {
        font-size: 1.8em;
        margin-top: -20px;
    }
    .ingr-section-header {
        font-size: 1rem;           /* اندازه کمی کوچکتر برای موبایل */
        margin-top: 20px;          /* فاصله بالایی کمتر */
        margin-bottom: 8px;        /* فاصله پایین تیتر تا محتوا */
        padding-right: 6px;        /* کمی فاصله کمتر از راست */
    }
    .ingr-attr-badge {
        font-size: 15px;
    }
    .ingr-main-img, .ingr-main-img img {
        width: 130px !important;
        height: 130px !important;
    }
    .ingredient-details-popup img {
        width: 110px;
        height: 110px;
    }
    .ingr-video video {
        width: 140px;
    }
}