/* =========================================
   TS Product Page — Premium Light (Crimson #a20606 + Black)
   كل الكلاسات مسبوقة بـ ts- عشان ما تتعارضش مع القالب
   ========================================= */
:root {
    --ts-primary: #a20606;
    --ts-primary-hover: #8a0505;
    --ts-primary-bright: #c40808;
    --ts-black: #0e0e0e;
    --ts-bg: #f7f5f2;
    --ts-surface: #ffffff;
    --ts-soft: #faf8f6;
    --ts-ink: #0e0e0e;
    --ts-slate: #625d57;
    --ts-line: rgba(14, 14, 14, 0.09);
    --ts-font: 'Inter', sans-serif;
    --ts-font-title: 'Playfair Display', serif;
    /* المسافة فوق الصفحة (عشان الهيدر الثابت بتاع الموقع ما يغطيش المحتوى) — عدّلها لو لزم */
    --ts-top-space: 120px;
}

/* ---------- الغلاف + الخلفية ---------- */
.ts-page {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    overflow: clip; /* clip بدل hidden عشان الـ sticky يشتغل */
    background: var(--ts-bg);
    color: var(--ts-ink);
    font-family: var(--ts-font);
    min-height: 100vh;
    padding: var(--ts-top-space) 20px 80px;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    -webkit-font-smoothing: antialiased;
}
.ts-page *, .ts-page *::before, .ts-page *::after { box-sizing: border-box; }
.ts-page::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: -1;
    background:
        radial-gradient(800px 480px at 8% -8%, rgba(162, 6, 6, 0.13), transparent 62%),
        radial-gradient(700px 500px at 108% 102%, rgba(162, 6, 6, 0.08), transparent 62%),
        radial-gradient(600px 400px at 90% 6%, rgba(14, 14, 14, 0.04), transparent 70%);
}
.ts-page::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: -1;
    opacity: 0.035;
    pointer-events: none;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%' height='100%' filter='url(%23n)' opacity='.8'/></svg>");
}

.ts-page .ts-product-container {
    max-width: 1120px;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 28px;
}

/* ---------- الكارت ---------- */
.ts-page .ts-glass {
    background: var(--ts-surface);
    border: 1px solid var(--ts-line);
    border-radius: 26px;
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.9) inset, 0 30px 60px -34px rgba(14, 14, 14, 0.22), 0 2px 6px rgba(14, 14, 14, 0.03);
}

/* ---------- Breadcrumb ---------- */
.ts-page .ts-breadcrumb {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--ts-slate);
}
.ts-page .ts-breadcrumb a { color: var(--ts-slate); text-decoration: none; transition: color 0.2s; }
.ts-page .ts-breadcrumb a:hover { color: var(--ts-primary); }
.ts-page .ts-breadcrumb .ts-sep { opacity: 0.4; }
.ts-page .ts-breadcrumb .ts-current { color: var(--ts-ink); font-weight: 500; }

/* ---------- القسم العلوي ---------- */
.ts-page .ts-product-grid {
    display: grid;
    grid-template-columns: 1.05fr 1fr;
    gap: 28px;
    align-items: start;
}

/* المعرض */
.ts-page .ts-gallery { position: sticky; top: 110px; display: flex; flex-direction: column; gap: 14px; }
.ts-page .ts-main-image {
    position: relative;
    aspect-ratio: 1 / 1;
    padding: 12px;
    overflow: hidden;
}
.ts-page .ts-main-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    border-radius: 18px;
    transition: transform 0.8s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.25s ease;
}
.ts-page .ts-main-image:hover img { transform: scale(1.045); }
.ts-page .ts-main-image img.ts-fade { opacity: 0; }
.ts-page .ts-badge {
    position: absolute;
    top: 26px;
    left: 26px;
    z-index: 2;
    background: linear-gradient(135deg, var(--ts-primary-bright), var(--ts-primary));
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.4px;
    padding: 7px 14px;
    border-radius: 999px;
    box-shadow: 0 10px 22px -8px rgba(162, 6, 6, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}
.ts-page .ts-thumbs { display: flex; gap: 10px; overflow-x: auto; padding: 4px 2px; scrollbar-width: none; }
.ts-page .ts-thumbs::-webkit-scrollbar { display: none; }
.ts-page .ts-thumb {
    flex: 0 0 74px;
    width: 74px;
    height: 74px;
    padding: 4px;
    border-radius: 16px;
    background: var(--ts-surface);
    border: 1px solid var(--ts-line);
    cursor: pointer;
    opacity: 0.65;
    transition: all 0.25s ease;
}
.ts-page .ts-thumb img { width: 100%; height: 100%; object-fit: cover; border-radius: 12px; display: block; }
.ts-page .ts-thumb:hover { opacity: 1; }
.ts-page .ts-thumb.active { opacity: 1; border-color: var(--ts-primary); box-shadow: 0 0 0 3px rgba(162, 6, 6, 0.16); }

/* التفاصيل */
.ts-page .ts-details { padding: 40px; display: flex; flex-direction: column; }
.ts-page .ts-category {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    width: fit-content;
    font-size: 11.5px;
    font-weight: 600;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: #fff;
    background: var(--ts-black);
    padding: 8px 15px;
    border-radius: 999px;
    margin-bottom: 20px;
}
.ts-page .ts-category i {
    width: 7px; height: 7px; border-radius: 50%;
    background: #e11d1d;
    box-shadow: 0 0 10px 2px rgba(225, 29, 29, 0.7);
}
.ts-page .ts-title {
    font-family: var(--ts-font-title);
    font-size: clamp(2rem, 3.6vw, 3rem);
    font-weight: 600;
    line-height: 1.12;
    letter-spacing: -0.5px;
    color: var(--ts-black);
    margin: 0 0 20px;
}
.ts-page .ts-price-row { display: flex; align-items: center; flex-wrap: wrap; gap: 14px; margin-bottom: 22px; }
.ts-page .ts-price {
    display: flex;
    align-items: baseline;
    gap: 12px;
    font-size: 34px;
    font-weight: 700;
    letter-spacing: -0.5px;
    color: var(--ts-black);
}
.ts-page .ts-price .amount, .ts-page .ts-price bdi { color: inherit; }
.ts-page .ts-price del { order: 2; font-size: 18px; font-weight: 500; color: #9a958e; }
.ts-page .ts-price ins { text-decoration: none; background: none; color: var(--ts-primary); }
.ts-page .ts-save {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.4px;
    color: var(--ts-primary);
    background: rgba(162, 6, 6, 0.08);
    border: 1px solid rgba(162, 6, 6, 0.22);
    padding: 6px 12px;
    border-radius: 999px;
}
.ts-page .ts-short-desc {
    font-size: 15.5px;
    line-height: 1.75;
    color: var(--ts-slate);
    margin-bottom: 28px;
    padding-bottom: 28px;
    border-bottom: 1px solid var(--ts-line);
}
.ts-page .ts-short-desc p { margin: 0 0 10px; }
.ts-page .ts-short-desc p:last-child { margin-bottom: 0; }

/* ---------- زر الواتساب ----------
   مكتوب بقوة (a + body + !important) عشان ستايل الثيم/Elementor ما يغيّرش اللون */
body a.ts-whatsapp-btn {
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
    padding: 19px 22px;
    border: none;
    border-radius: 16px;
    cursor: pointer;
    font-family: var(--ts-font);
    font-size: 16px;
    font-weight: 600;
    line-height: 1.2;
    letter-spacing: 0.2px;
    text-decoration: none !important;
    color: #fff !important;
    background: linear-gradient(135deg, var(--ts-primary-bright) 0%, var(--ts-primary) 55%, #7d0404 100%);
    box-shadow: 0 16px 32px -10px rgba(162, 6, 6, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.28);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
body a.ts-whatsapp-btn::after {
    content: '';
    position: absolute;
    top: 0; left: -60%;
    width: 40%; height: 100%;
    background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.32), transparent);
    transform: skewX(-20deg);
    transition: left 0.7s ease;
    pointer-events: none;
}
body a.ts-whatsapp-btn:hover,
body a.ts-whatsapp-btn:focus,
body a.ts-whatsapp-btn:active { color: #fff !important; text-decoration: none !important; }
body a.ts-whatsapp-btn:hover { transform: translateY(-3px); box-shadow: 0 22px 38px -10px rgba(162, 6, 6, 0.7), inset 0 1px 0 rgba(255, 255, 255, 0.3); }
body a.ts-whatsapp-btn:hover::after { left: 130%; }
body a.ts-whatsapp-btn span,
body a.ts-whatsapp-btn svg {
    position: relative;
    z-index: 1;
    color: #fff !important;
    opacity: 1 !important;
    visibility: visible !important;
    -webkit-text-fill-color: #fff !important;
}
body a.ts-whatsapp-btn svg { width: 22px; height: 22px; flex-shrink: 0; fill: currentColor; }

/* ---------- عناصر الثقة ---------- */
.ts-page .ts-trust {
    list-style: none;
    margin: 26px 0 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}
.ts-page .ts-trust li {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 14px;
    margin: 0;
    border-radius: 16px;
    background: var(--ts-soft);
    border: 1px solid var(--ts-line);
}
.ts-page .ts-trust svg { width: 22px; height: 22px; color: var(--ts-primary); }
.ts-page .ts-trust strong { display: block; font-size: 13px; font-weight: 600; color: var(--ts-black); }
.ts-page .ts-trust span { display: block; font-size: 12px; color: var(--ts-slate); margin-top: 2px; }

/* ---------- عناوين الأقسام ---------- */
.ts-page .ts-section-title {
    font-family: var(--ts-font-title);
    font-size: 1.9rem;
    font-weight: 600;
    letter-spacing: -0.3px;
    color: var(--ts-black);
    margin: 0 0 24px;
    line-height: 1.2;
}
.ts-page .ts-eyebrow {
    display: flex;
    align-items: center;
    gap: 12px;
    font-family: var(--ts-font);
    font-size: 11.5px;
    font-weight: 600;
    letter-spacing: 2.4px;
    text-transform: uppercase;
    color: var(--ts-primary);
    margin-bottom: 10px;
}
.ts-page .ts-eyebrow::before { content: ''; width: 28px; height: 1px; background: var(--ts-primary); }

/* ---------- المميزات ---------- */
.ts-page .ts-features-wrapper { padding: 40px; }
.ts-page .ts-features-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}
.ts-page .ts-features-list li {
    display: flex;
    align-items: center;
    gap: 18px;
    margin: 0;
    padding: 18px 20px;
    border-radius: 18px;
    background: var(--ts-soft);
    border: 1px solid var(--ts-line);
    transition: all 0.3s ease;
}
.ts-page .ts-features-list li:hover {
    border-color: rgba(162, 6, 6, 0.5);
    background: #fff;
    transform: translateY(-2px);
    box-shadow: 0 16px 30px -18px rgba(162, 6, 6, 0.35);
}
.ts-page .ts-num {
    font-family: var(--ts-font-title);
    font-variant-numeric: lining-nums;
    font-feature-settings: 'lnum' 1;
    font-size: 26px;
    font-weight: 600;
    line-height: 1;
    color: var(--ts-primary);
    min-width: 40px;
}
.ts-page .ts-feature-text { font-size: 15px; line-height: 1.5; color: var(--ts-black); font-weight: 500; }

/* ---------- الوصف الطويل ---------- */
.ts-page .ts-long-desc-wrapper { padding: 40px; }
.ts-page .ts-long-desc-content {
    position: relative;
    font-size: 15.5px;
    line-height: 1.85;
    color: var(--ts-slate);
    max-height: 120px;
    overflow: hidden;
    transition: max-height 0.55s cubic-bezier(0.4, 0, 0.2, 1);
    -webkit-mask-image: linear-gradient(to bottom, #000 45%, transparent 100%);
    mask-image: linear-gradient(to bottom, #000 45%, transparent 100%);
}
.ts-page .ts-long-desc-content.expanded,
.ts-page .ts-long-desc-content.ts-no-clamp { -webkit-mask-image: none; mask-image: none; }
.ts-page .ts-long-desc-content.ts-no-clamp { max-height: none; }

/* تنسيق أي HTML يتكتب في الوصف (أحجام العناوين متحكم فيها عشان ما تبقاش ضخمة) */
.ts-page .ts-long-desc-content p { margin: 0 0 16px; color: var(--ts-slate); font-size: 15.5px; }
.ts-page .ts-long-desc-content h1,
.ts-page .ts-long-desc-content h2,
.ts-page .ts-long-desc-content h3,
.ts-page .ts-long-desc-content h4,
.ts-page .ts-long-desc-content h5 {
    font-family: var(--ts-font-title);
    font-weight: 600;
    color: var(--ts-black);
    margin: 26px 0 12px;
    line-height: 1.3;
}
.ts-page .ts-long-desc-content > *:first-child { margin-top: 0; }
.ts-page .ts-long-desc-content h1 { font-size: 1.9rem; }
.ts-page .ts-long-desc-content h2 { font-size: 1.6rem; }
.ts-page .ts-long-desc-content h3 { font-size: 1.35rem; }
.ts-page .ts-long-desc-content h4,
.ts-page .ts-long-desc-content h5 { font-size: 1.15rem; margin-top: 18px; }
.ts-page .ts-long-desc-content strong, .ts-page .ts-long-desc-content b { color: var(--ts-black); font-weight: 600; }
.ts-page .ts-long-desc-content ul, .ts-page .ts-long-desc-content ol { margin: 0 0 18px; padding-left: 22px; }
.ts-page .ts-long-desc-content ul { list-style: none; padding-left: 0; }
.ts-page .ts-long-desc-content ul li { position: relative; padding-left: 26px; margin-bottom: 10px; }
.ts-page .ts-long-desc-content ul li::before {
    content: '';
    position: absolute;
    left: 0; top: 0.75em;
    width: 8px; height: 8px;
    border-radius: 50%;
    background: var(--ts-primary);
    box-shadow: 0 0 0 4px rgba(162, 6, 6, 0.12);
}
.ts-page .ts-long-desc-content ol li { margin-bottom: 10px; }
.ts-page .ts-long-desc-content img { max-width: 100%; height: auto; border-radius: 16px; }
.ts-page .ts-long-desc-content a { color: var(--ts-primary); }
.ts-page .ts-long-desc-content blockquote {
    margin: 0 0 18px;
    padding: 14px 20px;
    border-left: 3px solid var(--ts-primary);
    background: var(--ts-soft);
    border-radius: 0 14px 14px 0;
    color: var(--ts-black);
}

.ts-page .ts-read-more-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 18px;
    padding: 11px 20px;
    border-radius: 999px;
    border: 1px solid rgba(162, 6, 6, 0.3);
    background: rgba(162, 6, 6, 0.05);
    color: var(--ts-primary);
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
}
.ts-page .ts-read-more-btn:hover { background: var(--ts-black); border-color: var(--ts-black); color: #fff; }
.ts-page .ts-read-more-btn[hidden] { display: none; }
.ts-page .ts-read-more-btn svg { width: 16px; height: 16px; transition: transform 0.3s ease; }
.ts-page .ts-read-more-btn.active svg { transform: rotate(180deg); }

/* ---------- التوصيات ---------- */
.ts-page .ts-recommendations-wrapper { display: flex; flex-direction: column; margin-top: 8px; }
.ts-page .ts-rec-title { margin-bottom: 22px; }
.ts-page .ts-rec-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.ts-page a.ts-rec-card {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding: 12px;
    text-decoration: none !important;
    color: inherit;
    transition: transform 0.35s ease, border-color 0.35s ease, box-shadow 0.35s ease;
}
.ts-page a.ts-rec-card:hover {
    transform: translateY(-6px);
    border-color: rgba(162, 6, 6, 0.5);
    box-shadow: 0 34px 60px -30px rgba(162, 6, 6, 0.4), 0 2px 6px rgba(14, 14, 14, 0.03);
}
.ts-page .ts-rec-img { aspect-ratio: 4 / 3; overflow: hidden; border-radius: 16px; background: var(--ts-soft); }
.ts-page .ts-rec-img img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.7s cubic-bezier(0.2, 0.8, 0.2, 1); }
.ts-page .ts-rec-card:hover .ts-rec-img img { transform: scale(1.07); }
.ts-page .ts-rec-info { display: flex; flex-direction: column; flex-grow: 1; padding: 16px 8px 8px; }
.ts-page .ts-rec-info h4 { font-family: var(--ts-font); font-size: 17px; font-weight: 600; line-height: 1.35; margin: 0 0 6px; color: var(--ts-black); }
.ts-page .ts-rec-info p { font-size: 13.5px; line-height: 1.6; color: var(--ts-slate); margin: 0 0 14px; }
.ts-page .ts-rec-foot { display: flex; align-items: center; justify-content: space-between; margin-top: auto; }
.ts-page .ts-rec-price { font-size: 17px; font-weight: 700; color: var(--ts-primary); }
.ts-page .ts-rec-price del { color: #9a958e; font-weight: 500; font-size: 13px; margin-right: 6px; }
.ts-page .ts-rec-price ins { text-decoration: none; background: none; }
.ts-page .ts-rec-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px; height: 38px;
    border-radius: 50%;
    background: var(--ts-black);
    color: #fff;
    transition: all 0.3s ease;
}
.ts-page .ts-rec-btn svg { width: 17px; height: 17px; }
.ts-page .ts-rec-card:hover .ts-rec-btn { background: var(--ts-primary); transform: translateX(3px); }

/* ---------- Reveal on scroll ---------- */
.ts-page.ts-js .ts-reveal { opacity: 0; transform: translateY(22px); transition: opacity 0.8s ease, transform 0.8s cubic-bezier(0.2, 0.8, 0.2, 1); }
.ts-page.ts-js .ts-reveal.ts-in { opacity: 1; transform: none; }

/* ---------- البار الثابت ----------
   بيتطبع في wp_footer (برّه .ts-page) عشان يبقى فوق كل حاجة حتى الفوتر */
.ts-sticky-bar,
.ts-sticky-bar * { box-sizing: border-box; }
.ts-sticky-bar {
    position: fixed;
    left: 50%;
    bottom: calc(18px + env(safe-area-inset-bottom, 0px));
    z-index: 99990;
    width: min(760px, calc(100% - 24px));
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 10px 10px 10px 12px;
    border-radius: 22px;
    font-family: var(--ts-font);
    background: rgba(14, 14, 14, 0.94);
    border: 1px solid rgba(255, 255, 255, 0.1);
    -webkit-backdrop-filter: blur(16px);
    backdrop-filter: blur(16px);
    box-shadow: 0 24px 50px -12px rgba(14, 14, 14, 0.6);
    transform: translate(-50%, 190%);
    transition: transform 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.ts-sticky-bar.is-visible { transform: translate(-50%, 0); }
.ts-sticky-bar img {
    width: 46px; height: 46px;
    border-radius: 12px;
    object-fit: cover;
    flex-shrink: 0;
    background: #222;
}
.ts-sticky-bar .ts-sticky-info { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.ts-sticky-bar .ts-sticky-name { font-size: 12.5px; color: #bdb8b0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ts-sticky-bar .ts-sticky-price { font-size: 18px; font-weight: 700; color: #fff; line-height: 1.3; }
body .ts-sticky-bar a.ts-whatsapp-btn { width: auto; flex-shrink: 0; padding: 14px 26px; font-size: 15px; border-radius: 14px; }

/* ---------- التجاوب ---------- */
@media (max-width: 900px) {
    :root { --ts-top-space: 100px; }
    .ts-page { padding-left: 16px; padding-right: 16px; padding-bottom: 110px; }
    .ts-page .ts-product-grid { grid-template-columns: 1fr; gap: 20px; }
    .ts-page .ts-gallery { position: static; }
    .ts-page .ts-details { padding: 28px 22px; }
    .ts-page .ts-features-wrapper, .ts-page .ts-long-desc-wrapper { padding: 28px 22px; }
    .ts-page .ts-features-list { grid-template-columns: 1fr; }
    .ts-page .ts-rec-grid { grid-template-columns: 1fr; }
    .ts-page a.ts-rec-card { flex-direction: row; align-items: center; gap: 14px; }
    .ts-page .ts-rec-img { width: 104px; height: 104px; flex-shrink: 0; aspect-ratio: auto; }
    .ts-page .ts-rec-info { padding: 4px 4px 4px 0; }
    .ts-page .ts-rec-info p { display: none; }
    .ts-page .ts-section-title { font-size: 1.6rem; }
}
@media (max-width: 520px) {
    .ts-page .ts-trust { grid-template-columns: 1fr; }
    .ts-page .ts-trust li { flex-direction: row; align-items: center; gap: 14px; }
    .ts-sticky-bar { gap: 10px; padding-left: 10px; }
    .ts-sticky-bar img { width: 40px; height: 40px; }
    body .ts-sticky-bar a.ts-whatsapp-btn { padding: 13px 20px; }
}
@media (prefers-reduced-motion: reduce) {
    .ts-page *, .ts-page *::before, .ts-page *::after, .ts-sticky-bar { transition: none !important; animation: none !important; }
    .ts-page.ts-js .ts-reveal { opacity: 1; transform: none; }
}
