/* ===================================================================
   Tamm — packages-ui.css  (loaded last)
   1) الحزم: كروت ملوّنة عريضة + سلايدر (سحب على الموبايل / أسهم ونقاط)
   2) تحسين قسم المكتبة (البحث + الفلاتر + الكروت) على الموبايل
   3) ستايل تبويب «الحزم» في لوحة الإدارة
   =================================================================== */

/* ---------------------------------------------------------------- 1) packages */
/* كارت الحزمة: مستطيل عريض (العرض أكبر من الارتفاع) بخلفية ملوّنة متدرّجة بالكامل
   عشان يبان فورًا إنه "حزمة" مختلفة عن كروت المنتجات البيضاء اللي تحته. */
#packagesSection { overflow: visible; }
.pk-slider { position: relative; margin-top: 8px; }
.pk-track {
  display: flex; gap: 18px; overflow-x: auto; overflow-y: visible; scroll-snap-type: x mandatory;
  padding: 14px 4px 28px; margin-inline: -4px; scrollbar-width: none; -webkit-overflow-scrolling: touch; overscroll-behavior-x: contain;
  scroll-padding-inline: 4px;
}
.pk-track::-webkit-scrollbar { display: none; }
.pk-track.is-static { justify-content: center; }

.pk-card {
  --a: #1957a6; --b: #35c6d8;
  flex: 0 0 clamp(340px, calc((100% - 36px) / 3), 460px); scroll-snap-align: start; position: relative;
  display: flex; flex-direction: column; gap: 14px; min-height: 236px; padding: 20px 20px 18px;
  border-radius: 28px; color: #fff; cursor: pointer; isolation: isolate; overflow: hidden;
  background: linear-gradient(135deg, var(--a), var(--b));
  background: linear-gradient(135deg, var(--a) 0%, color-mix(in srgb, var(--a) 38%, var(--b)) 100%);
  box-shadow: 0 16px 30px -22px var(--a), 0 1px 3px rgba(20,52,93,.08);
  transition: transform .35s cubic-bezier(.2,.8,.2,1), box-shadow .35s;
}
.pk-card::before, .pk-card::after { content: ''; position: absolute; z-index: -1; border-radius: 50%; pointer-events: none; }
.pk-card::before { width: 260px; height: 260px; inset-inline-end: -90px; top: -120px; background: radial-gradient(circle, rgba(255,255,255,.28), rgba(255,255,255,0) 68%); }
.pk-card::after { width: 170px; height: 170px; inset-inline-start: -60px; bottom: -88px; border: 26px solid rgba(255,255,255,.10); }
.pk-card:hover { transform: translateY(-5px); box-shadow: 0 24px 40px -24px var(--a), 0 1px 3px rgba(20,52,93,.08); }
.pk-card:focus-visible { outline: 3px solid var(--a); outline-offset: 3px; }
.pk-theme-ocean    { --a: #1957a6; --b: #2bb3c8; }
.pk-theme-sunset   { --a: #f97316; --b: #e11d48; }
.pk-theme-violet   { --a: #7c3aed; --b: #c026d3; }
.pk-theme-emerald  { --a: #059669; --b: #14b8a6; }
.pk-theme-rose     { --a: #e11d48; --b: #fb7185; }
.pk-theme-midnight { --a: #0f172a; --b: #475569; }

/* الصف العلوي: أيقونات المنتجات المتداخلة + ستيكر الخصم */
.pk-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.pk-avs { display: flex; align-items: center; gap: 10px; min-width: 0; }
.pk-avatars { display: flex; flex: 0 0 auto; }
.pk-av {
  width: 44px; height: 44px; display: grid; place-items: center; overflow: hidden; border-radius: 50%; background: #fff; color: var(--a);
  border: 3px solid rgba(255,255,255,.9); font-size: 16px; box-shadow: 0 8px 16px -8px rgba(0,0,0,.45);
  margin-inline-start: -13px; position: relative; z-index: calc(10 - var(--i, 0)); transition: transform .35s cubic-bezier(.2,.8,.2,1);
}
.pk-av:first-child { margin-inline-start: 0; }
.pk-av img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pk-av-more { background: rgba(255,255,255,.22); color: #fff; font-size: 12px; font-weight: 800; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.pk-card:hover .pk-av { transform: translateY(-3px); }
.pk-card:hover .pk-av:nth-child(even) { transform: translateY(2px); }
.pk-count { font-size: 11.5px; font-weight: 700; opacity: .92; white-space: nowrap; }

.pk-off {
  flex: 0 0 auto; display: inline-flex; align-items: baseline; gap: 4px; padding: 7px 13px; border-radius: 99px; background: #fff; color: var(--a);
  box-shadow: 0 8px 16px -8px rgba(0,0,0,.4); line-height: 1;
}
.pk-off b { font-size: 16px; font-weight: 900; font-family: 'IBM Plex Sans Arabic', sans-serif; }
.pk-off small { font-size: 11px; font-weight: 800; }

/* المنتصف */
.pk-main { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.pk-badge {
  align-self: flex-start; display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 99px; font-size: 11px; font-weight: 800;
  background: rgba(255,255,255,.2); border: 1px solid rgba(255,255,255,.5);
}
.pk-badge i { font-size: 9px; }
.pk-name { margin: 0; font-size: 21px; font-weight: 900; line-height: 1.3; color: #fff; text-shadow: 0 2px 10px rgba(0,0,0,.12); }
.pk-tag { margin: 0; font-size: 12.5px; line-height: 1.65; color: rgba(255,255,255,.88); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pk-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 0; padding: 0; list-style: none; }
.pk-chips li {
  padding: 4px 11px; border-radius: 99px; font-size: 11.5px; font-weight: 700; color: #fff; white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis;
  background: rgba(255,255,255,.18); border: 1px solid rgba(255,255,255,.28); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
}
.pk-chips li.pk-more { background: rgba(0,0,0,.16); border-color: transparent; }

/* الأسفل: السعر + الزر */
.pk-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: auto; padding-top: 14px;
  border-top: 1px dashed rgba(255,255,255,.35);
}
.pk-price { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.pk-price small { display: block; font-size: 11px; color: rgba(255,255,255,.8); line-height: 1.2; }
.pk-price strong { font-size: 23px; font-weight: 900; line-height: 1.1; color: #fff; font-family: 'IBM Plex Sans Arabic', sans-serif; white-space: nowrap; }
.pk-save { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.pk-save s { font-size: 11.5px; color: rgba(255,255,255,.7); }
.pk-save b { padding: 1px 8px; border-radius: 99px; font-size: 10.5px; font-weight: 800; color: #0b6b49; background: #d9f7e9; white-space: nowrap; }
.pk-price-tbd strong { font-size: 15px; }
.pk-cta {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; flex: 0 0 auto; height: 44px; padding: 0 18px; border: 0; border-radius: 14px; cursor: pointer;
  font: inherit; font-size: 13.5px; font-weight: 800; color: var(--a); background: #fff; box-shadow: 0 10px 20px -10px rgba(0,0,0,.45);
  transition: transform .2s, box-shadow .2s;
}
.pk-cta i { font-size: 11px; transition: transform .25s; }
.pk-card:hover .pk-cta i { transform: translateX(-4px); }
.pk-cta:active { transform: scale(.96); }

.pk-arrow {
  position: absolute; z-index: 5; top: 44%; width: 44px; height: 44px; display: grid; place-items: center; border: 1px solid var(--tamm-line, #e3ebf3); border-radius: 50%;
  background: #fff; color: var(--tamm-ink, #14345d); font-size: 14px; cursor: pointer; box-shadow: 0 10px 24px rgba(20,52,93,.18); transition: transform .2s, opacity .2s, background .2s, color .2s;
}
.pk-arrow:hover:not(:disabled) { background: var(--tamm-blue, #1957a6); color: #fff; transform: scale(1.08); }
.pk-arrow:disabled { opacity: .35; cursor: default; }
.pk-arrow[hidden] { display: none; }
.pk-arrow--prev { inset-inline-start: -14px; } .pk-arrow--next { inset-inline-end: -14px; }
.pk-dots { display: flex; justify-content: center; gap: 6px; margin-top: 2px; }
.pk-dots[hidden] { display: none; }
.pk-dots button { width: 8px; height: 8px; padding: 0; border: 0; border-radius: 8px; background: #cdd9e6; cursor: pointer; transition: width .3s, background .3s; }
.pk-dots button.on { width: 26px; background: var(--tamm-blue, #1957a6); }

@media (max-width: 1100px) { .pk-card { flex-basis: clamp(340px, 46%, 460px); } }
@media (max-width: 720px) {
  .pk-track { gap: 12px; padding: 10px 16px 22px; margin-inline: -16px; scroll-padding-inline: 16px; }
  .pk-track.is-static { justify-content: flex-start; }
  .pk-card { flex-basis: 86%; max-width: 380px; min-height: 224px; padding: 16px 16px 14px; border-radius: 24px; gap: 12px; }
  .pk-av { width: 38px; height: 38px; margin-inline-start: -11px; }
  .pk-count { font-size: 10.5px; }
  .pk-off { padding: 6px 11px; } .pk-off b { font-size: 14px; }
  .pk-name { font-size: 18.5px; } .pk-tag { font-size: 12px; -webkit-line-clamp: 1; }
  .pk-chips li { font-size: 10.5px; padding: 3px 9px; }
  .pk-price strong { font-size: 20px; }
  .pk-save s { display: none; }
  .pk-cta { height: 40px; padding: 0 14px; font-size: 12.5px; border-radius: 12px; }
  .pk-arrow { display: none; }
}
@media (prefers-reduced-motion: reduce) { .pk-card, .pk-av, .pk-cta i { transition: none; } .pk-card:hover { transform: none; } }

/* ---------------------------------------------------- 2) mobile catalog polish */
@media (max-width: 720px) {
  .catalog-section .catalog-heading { display: grid; grid-template-columns: 1fr auto; align-items: end; gap: 6px 10px; margin-bottom: 14px; }
  .catalog-section .catalog-heading h2 { font-size: 24px; line-height: 1.25; margin: 4px 0 2px; }
  .catalog-section .catalog-heading p { font-size: 12px; margin: 0; line-height: 1.6; }
  .catalog-section .catalog-count { margin: 0; padding: 7px 12px; gap: 6px; border-radius: 99px; background: #fff; border: 1px solid var(--tamm-line, #e3ebf3); align-self: center; }
  .catalog-section .catalog-count i { display: none; }
  .catalog-section .catalog-count strong { font-size: 16px; } .catalog-section .catalog-count span { font-size: 11px; }

  .catalog-section .catalog-toolbar { gap: 10px; padding: 10px; margin-bottom: 16px; border-radius: 18px; }
  .catalog-section .search-field input { min-height: 44px; font-size: 14px; border-radius: 13px; background: #f3f7fb; }
  .catalog-section #filterTabsContainer.filter-tabs {
    display: flex; flex-wrap: nowrap; justify-content: flex-start; gap: 8px; overflow-x: auto; scroll-snap-type: x proximity; scrollbar-width: none;
    margin-inline: -10px; padding: 2px 10px 4px;
  }
  .catalog-section #filterTabsContainer.filter-tabs::-webkit-scrollbar { display: none; }
  .catalog-section .filter-tab {
    flex: 0 0 auto; min-height: 36px; padding: 6px 14px; font-size: 12.5px; white-space: nowrap; scroll-snap-align: start;
    border-radius: 99px; border: 1px solid var(--tamm-line, #e3ebf3); background: #fff;
  }
  .catalog-section .filter-tab.active, .catalog-section .filter-tab.is-selected { border-color: transparent; color: #fff; background: var(--tamm-blue, #1957a6); box-shadow: 0 6px 14px rgba(25,87,166,.28); }

  .catalog-section .product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .catalog-section .product-card { border-radius: 20px; }
  .catalog-section .product-copy { padding: 10px 10px 12px; gap: 6px; }
  .catalog-section .product-copy h3 { font-size: 13.5px; line-height: 1.35; }
  .catalog-section .product-copy p { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: 11px; line-height: 1.55; }
  .catalog-section .product-price-row strong { font-size: 14px; }
  .catalog-section .product-price-row small, .catalog-section .product-price-row .old-price { font-size: 10px; }
  .catalog-section .add-button { min-height: 38px; font-size: 12px; border-radius: 12px; padding-inline: 8px; }
  .catalog-section .product-open-hint { display: none; }
}

/* ------------------------------------------------------- 3) admin: packages tab */
.sm-pk-dot { width: 14px; height: 38px; flex: 0 0 14px; border-radius: 8px; }
.sm-themes { display: flex; flex-wrap: wrap; gap: 8px; }
.sm-theme { width: 74px; height: 38px; border: 3px solid transparent; border-radius: 12px; color: #fff; font: inherit; font-size: 12px; font-weight: 800; cursor: pointer; box-shadow: 0 0 0 1px rgba(0,0,0,.08); }
.sm-theme.on { border-color: #fff; box-shadow: 0 0 0 3px var(--tamm-blue, #1957a6); }
.sm-pk-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; max-height: 280px; overflow: auto; margin-top: 8px; padding: 2px; }
.sm-pk-prod { position: relative; display: flex; align-items: center; gap: 8px; padding: 8px 10px; text-align: start; border: 1.5px solid var(--tamm-line, #e3ebf3); border-radius: 12px; background: #fff; font: inherit; font-size: 12.5px; font-weight: 700; cursor: pointer; }
.sm-pk-prod img { width: 30px; height: 30px; flex: 0 0 30px; border-radius: 9px; object-fit: cover; }
.sm-pk-prod > i { width: 30px; text-align: center; color: var(--tamm-muted, #64748b); }
.sm-pk-prod span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sm-pk-prod b { width: 18px; height: 18px; display: none; place-items: center; border-radius: 50%; background: var(--tamm-blue, #1957a6); color: #fff; font-size: 9px; }
.sm-pk-prod.on { border-color: var(--tamm-blue, #1957a6); background: #eef5fd; }
.sm-pk-prod.on b { display: grid; }
#smPkgCount { font-style: normal; margin-inline-start: 6px; padding: 1px 8px; border-radius: 99px; background: #eef5fd; color: var(--tamm-blue, #1957a6); font-size: 11.5px; }