/* ═══════════════════════════════════════════════════════════
   Kitronic — Product Bundles
   جميع الألوان من --kt-* (الثيم)
   ═══════════════════════════════════════════════════════════ */

.kt-bundle-count {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    background: var(--kt-primary-light);
    color: var(--kt-primary-dark);
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    width: fit-content;
}

.kt-bundle-count i.fa-solid,
.kt-bundle-count i[class*="fa-"] {
    font-size: 11px;
    color: inherit;
}

.kt-bundle-desc {
    margin: 0;
    font-size: 12px;
    color: var(--kt-text-muted);
    line-height: 1.5;
}

.kt-bundle-savings {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: var(--kt-success-light);
    color: var(--kt-success-dark);
    border-radius: 8px;
    font-size: 11px;
    font-weight: 700;
    width: fit-content;
}

.kt-bundle-savings i.fa-solid,
.kt-bundle-savings i[class*="fa-"] {
    font-size: 12px;
    color: var(--kt-success);
}

/* ═══════════════════════════════════════════════════════════
   Bundle Single Page
   ═══════════════════════════════════════════════════════════ */
.kt-bundle-single {
    max-width: 1240px;
    margin: 30px auto;
    padding: 0 20px;
    direction: rtl;
}

.kt-bundle-single__breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 20px;
    font-size: 13px;
    color: var(--kt-text-muted);
}

.kt-bundle-single__breadcrumb a {
    color: var(--kt-primary);
    text-decoration: none;
    font-weight: 600;
}

.kt-bundle-single__breadcrumb a:hover {
    text-decoration: underline;
}

.kt-bundle-single__grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 40px;
    margin-bottom: 50px;
    align-items: start;
}

@media (max-width: 900px) {
    .kt-bundle-single__grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }
}

.kt-bundle-single__media {
    border-radius: 20px;
    overflow: hidden;
    background: var(--kt-bg-soft);
    aspect-ratio: 1;
}

.kt-bundle-single__media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.kt-bundle-single__title {
    margin: 0 0 12px;
    font-size: 32px;
    font-weight: 800;
    color: var(--kt-text);
    line-height: 1.2;
}

.kt-bundle-single__desc {
    margin: 0 0 20px;
    color: var(--kt-text-muted);
    font-size: 15px;
    line-height: 1.6;
}

.kt-bundle-single__pricing {
    display: flex;
    align-items: baseline;
    gap: 12px;
    margin: 20px 0;
    padding: 20px;
    background: var(--kt-success-light);
    border-radius: 14px;
    flex-wrap: wrap;
}

.kt-bundle-single__old {
    text-decoration: line-through;
    color: var(--kt-text-muted);
    font-size: 18px;
}

.kt-bundle-single__old del {
    text-decoration: none;
}

.kt-bundle-single__new {
    color: var(--kt-success);
    font-size: 32px;
    font-weight: 900;
}

.kt-bundle-single__savings-badge {
    padding: 6px 14px;
    background: var(--kt-danger);
    color: var(--kt-on-danger);
    border-radius: 999px;
    font-size: 13px;
    font-weight: 800;
}

.kt-bundle-single__savings {
    padding: 12px 16px;
    background: var(--kt-warning-light);
    color: var(--kt-warning-dark);
    border-radius: 10px;
    font-size: 14px;
    margin-bottom: 20px;
}

.kt-bundle-single__long-desc {
    padding: 16px 0;
    color: var(--kt-text-muted);
    font-size: 14px;
    line-height: 1.8;
    border-top: 1px solid var(--kt-bg-softer);
    border-bottom: 1px solid var(--kt-bg-softer);
    margin-bottom: 20px;
}

.kt-bundle-single__action {
    margin-top: 20px;
}

/* ═══════════════════════════════════════════════════════════
   Bundle Add Button
   ═══════════════════════════════════════════════════════════ */
.kt-bundle-btn-wrap {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* زر شراء الحزمة المفرد (صفحة الحزمة).
   ⚠️ `:not(.kt-product-card__btn)`: الزر داخل بطاقة المنتج يتبع مكوّن البطاقة
   الموحّد (`.kt-product-card__btn` + `.kt-btn--primary`) فلا يُعاد تنسيقه هنا،
   وإلا اختلف شكل زر الحزمة عن زر المنتج في الشبكة نفسها. */
.kt-bundle-add-btn:not(.kt-product-card__btn) {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 16px 32px;
    border: 0;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 800;
    font-family: inherit;
    cursor: pointer;
    background: var(--kt-success);
    color: var(--kt-on-success);
    transition: all 0.25s ease;
    box-shadow: 0 6px 20px color-mix(in srgb, var(--kt-success) 3%, transparent);
    min-height: 54px;
    width: 100%;
}

.kt-bundle-add-btn:not(.kt-product-card__btn):hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 10px 28px color-mix(in srgb, var(--kt-success) 4%, transparent);
}

.kt-bundle-add-btn:not(.kt-product-card__btn):disabled {
    background: var(--kt-border-dark);
    color: var(--kt-text-muted);
    cursor: not-allowed;
    box-shadow: none;
}

.kt-bundle-add-btn.is-loading:not(.kt-product-card__btn) {
    opacity: 0.7;
    cursor: wait;
}

.kt-bundle-add-btn.is-success:not(.kt-product-card__btn) {
    background: var(--kt-success) !important;
}

/* زر الإضافة داخل بطاقة المنتج يتبع مكوّن البطاقة الموحّد
   (`.kt-product-card__btn` + `.kt-btn--primary`) — لا تنسيق موازٍ هنا. */
.kt-bundle-stock-warning {
    padding: 10px 14px;
    background: var(--kt-warning-light);
    color: var(--kt-warning-dark);
    border-radius: 8px;
    font-size: 12px;
    font-weight: 700;
    text-align: center;
}

/* ═══════════════════════════════════════════════════════════
   Bundle Buy Form — صفحة الحزمة = صفحة منتج
   التخطيط نفسه من قاعدة `form.cart` المشتركة في kitronic-components.css
   (شبكة عمود واحد: الكمية ثم الزر) — لا تنسيق موازٍ هنا.
   ═══════════════════════════════════════════════════════════ */
.kt-bundle-cart .kt-bundle-btn-wrap {
    min-width: 0;
}

/* ═══════════════════════════════════════════════════════════
   ⏳ العدّ التنازلي (بطاقة المتجر + أعلى صفحة الحزمة)
   ═══════════════════════════════════════════════════════════ */
.kt-countdown {
    display: inline-flex;
    align-items: center;
    gap: var(--kt-space-2);
    flex-wrap: wrap;
}

.kt-countdown__label {
    display: inline-flex;
    align-items: center;
    gap: var(--kt-space-1);
    font-size: var(--kt-font-size-sm, 13px);
    font-weight: 700;
    color: var(--kt-text-muted);
    white-space: nowrap;
}

.kt-countdown__label i {
    color: var(--kt-primary);
}

.kt-countdown__timer {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.kt-countdown__unit {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    padding: 4px 6px;
    border-radius: var(--kt-radius-sm, 8px);
    border: 1px solid var(--kt-border);
    background: var(--kt-surface);
    line-height: 1.1;
}

.kt-countdown__unit b {
    font-size: var(--kt-font-size-base, 14px);
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    color: var(--kt-text);
}

.kt-countdown__unit small {
    font-size: 10px;
    color: var(--kt-text-muted);
}

.kt-countdown.is-ended .kt-countdown__timer {
    font-size: var(--kt-font-size-sm, 13px);
    font-weight: 800;
    color: var(--kt-danger);
}

/* ═══ على بطاقة المتجر: شريط فوق أسفل الصورة ═══
   البطاقة تُمرِّر العدّاد داخل رابط الصورة (`absolute bottom`) مع تدرّج داكن
   يضمن وضوح الأرقام فوق أي صورة، ولا يعترض النقر (pointer-events: none). */
.kt-product-card__countdown {
    position: absolute;
    inset-inline: 0;
    bottom: 0;
    z-index: 3;
    display: block;
    padding: 12px 6px 5px;
    background: linear-gradient(to top,
            color-mix(in srgb, var(--kt-text) 82%, transparent),
            color-mix(in srgb, var(--kt-text) 45%, transparent) 55%,
            transparent);
    pointer-events: none;
}

.kt-product-card__countdown .kt-countdown--card {
    margin: 0;
    width: 100%;
    justify-content: center;
    gap: 4px;
}

.kt-product-card__countdown .kt-countdown__label {
    font-size: 9px;
    padding: 1px 6px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--kt-warning) 92%, transparent);
    color: #24170a;
    line-height: 1.5;
}

.kt-product-card__countdown .kt-countdown__label i {
    color: inherit;
    font-size: 9px;
}

.kt-product-card__countdown .kt-countdown__timer {
    gap: 3px;
    flex-wrap: wrap;
    justify-content: center;
}

.kt-product-card__countdown .kt-countdown__unit {
    min-width: 30px;
    padding: 2px 4px;
    border-radius: 6px;
    border-color: color-mix(in srgb, var(--kt-bg) 40%, transparent);
    background: color-mix(in srgb, var(--kt-bg) 22%, transparent);
    backdrop-filter: blur(3px);
}

.kt-product-card__countdown .kt-countdown__unit b {
    font-size: 12px;
    color: #fff;
}

.kt-product-card__countdown .kt-countdown__unit small {
    font-size: 8.5px;
    color: color-mix(in srgb, #fff 82%, transparent);
}

.kt-product-card__countdown .kt-countdown.is-ended .kt-countdown__timer {
    color: var(--kt-warning);
}

/* ═══ أعلى صفحة الحزمة: شريط بعرض كامل ═══ */
.kt-countdown--banner {
    width: 100%;
    justify-content: center;
    margin-block-end: var(--kt-space-4);
    padding: var(--kt-space-3) var(--kt-space-4);
    border-radius: var(--kt-radius-md, 12px);
    border: 1px solid color-mix(in srgb, var(--kt-primary) 28%, transparent);
    background: color-mix(in srgb, var(--kt-primary) 8%, var(--kt-surface));
}

.kt-countdown--banner .kt-countdown__label {
    font-size: var(--kt-font-size-base, 14px);
    color: var(--kt-text);
}

.kt-countdown--banner .kt-countdown__unit {
    min-width: 52px;
    padding: 6px 8px;
}

.kt-countdown--banner .kt-countdown__unit b {
    font-size: var(--kt-font-size-lg, 16px);
    color: var(--kt-primary-dark);
}

/* ═══════════════════════════════════════════════════════════
   Bundle Products List
   ═══════════════════════════════════════════════════════════ */
.kt-bundle-single__products {
    margin-top: 40px;
}

.kt-bundle-single__products h2 {
    margin: 0 0 20px;
    font-size: 20px;
    font-weight: 800;
    color: var(--kt-text);
}

/* عنوان «محتويات الحزمة» — الأيقونة بأنيميشن دائم جاهز
   (`kt-icon--pulse` من kitronic-components.css: نبض لا نهائي 1.5s). */
.kt-bundle-contents-title {
    display: flex;
    align-items: center;
    gap: var(--kt-space-2);
}

.kt-bundle-contents-title i {
    display: inline-block;
    color: var(--kt-primary);
    margin-inline-end: 0;
}

.kt-bundle-contents-title:hover i {
    color: var(--kt-primary-dark);
}

.kt-bundle-products-empty {
    margin: 0;
    padding: 20px 0;
    text-align: center;
    color: var(--kt-text-muted);
}

.kt-bundle-products-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.kt-bundle-product-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--kt-bg);
    border: 1px solid var(--kt-border);
    border-radius: 12px;
    transition: all 0.2s ease;
}

.kt-bundle-product-item:hover {
    border-color: var(--kt-primary-light);
    box-shadow: 0 4px 12px color-mix(in srgb, var(--kt-primary) 8%, transparent);
}

.kt-bundle-product-item__img {
    position: relative;
    width: 60px;
    height: 60px;
    border-radius: 8px;
    overflow: hidden;
    background: var(--kt-bg-soft);
    flex-shrink: 0;
}

.kt-bundle-product-item__img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.kt-bundle-product-item__qty {
    position: absolute;
    top: 4px;
    inset-inline-end: 4px;
    padding: 2px 6px;
    background: color-mix(in srgb, var(--kt-text) 75%, transparent);
    color: var(--kt-bg);
    border-radius: 4px;
    font-size: 10px;
    font-weight: 800;
}

.kt-bundle-product-item__info {
    flex: 1;
    min-width: 0;
}

.kt-bundle-product-item__name {
    display: block;
    color: var(--kt-text);
    text-decoration: none;
    font-weight: 700;
    font-size: 13px;
    line-height: 1.4;
    margin-bottom: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.kt-bundle-product-item__name:hover {
    color: var(--kt-primary);
}

.kt-bundle-product-item__price {
    font-size: 13px;
    font-weight: 800;
    color: var(--kt-success);
}

/* المتغيّر المختار داخل الحزمة (لون/مقاس) */
.kt-bundle-product-item__variant {
    display: block;
    margin-top: 2px;
    font-size: 12px;
    font-weight: 600;
    color: var(--kt-text-muted);
    line-height: 1.5;
}

/* ═══════════════════════════════════════════════════════════
   Bundle Toast
   ═══════════════════════════════════════════════════════════ */
.kt-bundle-toast {
    position: fixed;
    /* Clears the mobile bottom navigation bar. */
    bottom: calc(30px + var(--kt-mobile-nav-height, 0px));
    inset-inline-start: 50%;
    transform: translateX(-50%) translateY(120px);
    padding: 16px 24px;
    background: var(--kt-text);
    color: var(--kt-bg);
    border-radius: 12px;
    box-shadow: 0 15px 40px color-mix(in srgb, var(--kt-text) 3%, transparent);
    font-size: 14px;
    font-weight: 700;
    z-index: 9999999;
    transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
    direction: rtl;
    display: flex;
    align-items: center;
    gap: 12px;
    max-width: 90vw;
}

.kt-bundle-toast.is-visible {
    transform: translateX(-50%) translateY(0);
}

.kt-bundle-toast__icon {
    font-size: 22px;
}

.kt-bundle-toast__link {
    color: var(--kt-success);
    text-decoration: underline;
    margin-inline-start: 8px;
}

/* ═══════════════════════════════════════════════════════════
   Archive Page
   ═══════════════════════════════════════════════════════════ */
.kt-bundle-archive {
    max-width: 1240px;
    margin: 30px auto;
    padding: 0 20px;
    direction: rtl;
}

/* 🎁 Gift — ارتداد خفيف */
.kt-bundle-archive__header i.fa-gift {
    display: inline-block;
    animation: kt-bundle-gift 2s ease-in-out infinite;
}

@keyframes kt-bundle-gift {

    0%,
    100% {
        transform: translateY(0) rotate(0);
    }

    25% {
        transform: translateY(-5px) rotate(-8deg);
    }

    75% {
        transform: translateY(-3px) rotate(8deg);
    }
}

/* ⚠️ Warning — اهتزاز */
.kt-bundle-stock-warning i.fa-triangle-exclamation {
    animation: kt-bundle-shake 1.5s ease-in-out infinite;
}

@keyframes kt-bundle-shake {

    0%,
    100% {
        transform: rotate(0);
    }

    25% {
        transform: rotate(-12deg);
    }

    75% {
        transform: rotate(12deg);
    }
}

/* 📭 Inbox — طفو */
.kt-bundle-empty i.fa-inbox {
    animation: kt-float-y 3s ease-in-out infinite;
}

/* Float: shared `kt-float-y` (kitronic-components.css §13). */

/* ???? ????? ????? (BundlePage::render_archive) */
.kt-bundle-archive {
    max-width: 1240px;
    margin: 30px auto;
    padding: 0 20px;
    direction: rtl;
}
