/* ================================================================
   Parinhall — Comparison Page (page-compare.php)
   ================================================================ */

/* Hide the site header + announcement on the compare page */
body.page-compare .ph-header,
body.page-template-page-compare .ph-header,
body.page-compare .ph-announcement,
body.page-template-page-compare .ph-announcement { display: none !important; }

/* ── WRAPPER ────────────────────────────────────────────────────── */
.ph-cmp-page {
    min-height: 100vh;
    background: #F4F1EB;
    font-family: 'Vazirmatn', sans-serif;
    color: #20261F;
    direction: rtl;
}

/* ── ANNOUNCEMENT BAR ───────────────────────────────────────────── */
.ph-cmp-announce {
    background: #E2734A;
    color: #fff;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    font-size: 13px;
    overflow: hidden;
    white-space: nowrap;
}
.ph-cmp-announce__sep { color: rgba(255,255,255,.5); }

/* ── HEADER ─────────────────────────────────────────────────────── */
.ph-cmp-header {
    position: sticky;
    top: 0;
    z-index: 60;
    background: rgba(251, 249, 245, 0.96);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(32, 38, 31, 0.07);
}
.ph-cmp-header__inner {
    max-width: 1440px;
    margin: 0 auto;
    padding: 10px 32px;
    display: flex;
    align-items: center;
    gap: 18px;
}

/* Logo */
.ph-cmp-logo {
    text-decoration: none;
    display: flex;
    align-items: baseline;
    gap: 0;
    flex-shrink: 0;
}
.ph-cmp-logo__orange {
    font-family: 'Vazirmatn', sans-serif;
    font-weight: 700;
    font-size: 24px;
    color: #E2734A;
    line-height: 1.1;
}
.ph-cmp-logo__teal {
    font-family: 'Vazirmatn', sans-serif;
    font-weight: 700;
    font-size: 24px;
    color: #1B7A8C;
    line-height: 1.1;
}
.ph-cmp-logo__sub {
    font-family: 'Markazi Text', serif;
    font-size: 12px;
    color: #8A9382;
    margin-right: 7px;
}

/* Cart */
.ph-cmp-cart {
    display: flex;
    align-items: center;
    gap: 7px;
    background: #20261F;
    border-radius: 22px;
    padding: 8px 15px;
    text-decoration: none;
    flex-shrink: 0;
    position: relative;
    transition: background .2s;
}
.ph-cmp-cart:hover { background: #1B7A8C; }
.ph-cmp-cart span { font-size: 13px; color: #fff; font-weight: 500; }
.ph-cmp-cart__badge {
    background: #E2734A;
    color: #fff;
    font-size: 10.5px;
    font-weight: 600;
    min-width: 17px;
    height: 17px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
}

/* ── MAIN ────────────────────────────────────────────────────────── */
.ph-cmp-main {
    max-width: 1440px;
    margin: 0 auto;
    padding: 28px 32px 80px;
}

/* ── BREADCRUMB + TITLE ──────────────────────────────────────────── */
.ph-cmp-page-title { margin-bottom: 28px; }

.ph-cmp-breadcrumb {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12.5px;
    color: #8A9382;
    margin-bottom: 10px;
}
.ph-cmp-breadcrumb a {
    color: #8A9382;
    text-decoration: none;
    transition: color .18s;
}
.ph-cmp-breadcrumb a:hover { color: #1B7A8C; }

.ph-cmp-h1 {
    font-family: 'Markazi Text', serif;
    font-weight: 600;
    font-size: clamp(34px, 3.5vw, 50px);
    color: #20261F;
    line-height: 1.2;
}
.ph-cmp-subtitle {
    font-size: 14px;
    color: #8A9382;
    margin-top: 6px;
}

/* ── COMPARISON TABLE SCROLLER ──────────────────────────────────── */
.ph-cmp-scroller {
    overflow-x: auto;
    scrollbar-width: thin;
    scrollbar-color: #D8D2C8 transparent;
}
.ph-cmp-scroller::-webkit-scrollbar { height: 5px; }
.ph-cmp-scroller::-webkit-scrollbar-thumb { background: #D8D2C8; border-radius: 4px; }

/* ── PRODUCT CARDS GRID (display:grid) ─────────────────────────── */
.ph-cmp-scroll { /* grid for product cards row */ }

.ph-cmp-table {
    display: grid;
    gap: 0;
    min-width: 700px;
}

.ph-cmp-corner { padding: 0 0 20px 0; }

/* Product column */
.ph-cmp-prod-col {
    padding: 0 12px 20px;
    border-right: 1px solid rgba(32, 38, 31, 0.07);
    position: relative;
}

/* Remove button */
.ph-cmp-remove {
    position: absolute;
    top: 0;
    left: 10px;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: #F4F1EB;
    border: none;
    cursor: pointer;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .18s;
}
.ph-cmp-remove:hover { background: #FDE8DE; }
.ph-cmp-remove:hover svg { stroke: #C9541F; }

/* Product image */
.ph-cmp-prod-img-wrap {
    display: block;
    position: relative;
    border-radius: 14px;
    overflow: hidden;
    aspect-ratio: 1 / 1.05;
    background: linear-gradient(155deg, #C4E8F0, #8ABFC9);
    margin-bottom: 14px;
    text-decoration: none;
}
.ph-cmp-prod-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .3s;
}
.ph-cmp-prod-img-wrap:hover .ph-cmp-prod-img { transform: scale(1.04); }
.ph-cmp-prod-img-sheen {
    position: absolute;
    inset: 0;
    background: radial-gradient(85% 65% at 28% 14%, rgba(255,255,255,0.26), transparent 55%);
    pointer-events: none;
}
.ph-cmp-prod-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(251, 249, 245, 0.92);
    font-size: 10px;
    color: #E2734A;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 5px;
}
.ph-cmp-prod-label {
    position: absolute;
    left: 50%;
    top: 48%;
    transform: translate(-50%, -50%);
    font-family: 'Markazi Text', serif;
    font-size: 17px;
    color: rgba(255, 255, 255, 0.5);
    text-align: center;
    padding: 0 8px;
    pointer-events: none;
}

/* Info */
.ph-cmp-prod-brand {
    font-size: 11px;
    color: #8A9382;
    margin-bottom: 2px;
}
.ph-cmp-prod-name {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-family: 'Markazi Text', serif;
    font-weight: 600;
    font-size: 19px;
    line-height: 1.3;
    color: #20261F;
    margin-bottom: 8px;
    text-decoration: none;
}
.ph-cmp-prod-name:hover { color: #1B7A8C; }
.ph-cmp-prod-price {
    font-size: 14px;
    font-weight: 600;
    color: #1B7A8C;
    margin-bottom: 12px;
}
.ph-cmp-prod-add-btn {
    width: 100%;
    background: #E2734A;
    color: #fff;
    border: none;
    border-radius: 10px;
    padding: 10px;
    font-family: 'Vazirmatn', sans-serif;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: background .2s;
}
.ph-cmp-prod-add-btn:hover { background: #C9541F; }

/* Add slot column */
.ph-cmp-add-slot-col {
    padding: 0 12px 20px;
    border-right: 1px solid rgba(32, 38, 31, 0.07);
}
.ph-cmp-add-slot {
    border: 2px dashed rgba(32, 38, 31, 0.15);
    border-radius: 14px;
    aspect-ratio: 1 / 1.05;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    background: #fff;
    transition: border-color .2s, background .2s;
}
.ph-cmp-add-slot:hover {
    border-color: #1B7A8C;
    background: #F0FAFB;
}
.ph-cmp-add-slot__icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #F4F1EB;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 10px;
}
.ph-cmp-add-slot__label {
    font-size: 13px;
    color: #8A9382;
    text-align: center;
    line-height: 1.5;
}

/* ── ATTRIBUTE TABLE ─────────────────────────────────────────────── */
.ph-cmp-scroll2 { margin-top: 0; }
.ph-cmp-attr-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border-radius: 0 0 16px 16px;
    overflow: hidden;
}
.ph-cmp-attr-table tr {
    border-top: 1px solid rgba(32, 38, 31, 0.07);
}
.ph-cmp-tr--alt { background: #F7F4EF; }
.ph-cmp-td-label {
    width: 200px;
    min-width: 200px;
    padding: 14px 16px 14px 0;
    vertical-align: middle;
}
.ph-cmp-td-label span {
    font-size: 13px;
    font-weight: 500;
    color: #5B6358;
}
.ph-cmp-td-val {
    padding: 14px 12px;
    border-right: 1px solid rgba(32, 38, 31, 0.07);
    vertical-align: middle;
}
.ph-cmp-td-empty { background: transparent; }

/* Check / Cross icons */
.ph-cmp-check {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #E0F2F5;
    display: flex;
    align-items: center;
    justify-content: center;
}
.ph-cmp-cross {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #F4F1EB;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Text cells */
.ph-cmp-td-best {
    font-size: 13px;
    font-weight: 600;
    color: #1B7A8C;
}
.ph-cmp-td-normal {
    font-size: 13px;
    color: #5B6358;
}

/* ── EMPTY STATE ─────────────────────────────────────────────────── */
.ph-cmp-empty-state {
    text-align: center;
    padding: 80px 20px;
    background: #fff;
    border-radius: 20px;
    border: 1.5px dashed rgba(32, 38, 31, 0.12);
}
.ph-cmp-empty-state__icon {
    margin-bottom: 16px;
    display: flex;
    justify-content: center;
}
.ph-cmp-empty-state__title {
    font-family: 'Markazi Text', serif;
    font-size: 26px;
    color: #20261F;
    margin-bottom: 8px;
}
.ph-cmp-empty-state__sub {
    font-size: 13.5px;
    color: #8A9382;
    margin-bottom: 24px;
    line-height: 1.7;
}
.ph-cmp-empty-state__btn {
    background: #E2734A;
    color: #fff;
    border: none;
    border-radius: 12px;
    padding: 12px 28px;
    font-family: 'Vazirmatn', sans-serif;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background .2s;
}
.ph-cmp-empty-state__btn:hover { background: #C9541F; }

/* ── PICKER MODAL ────────────────────────────────────────────────── */
.ph-cmp-overlay {
    position: fixed;
    inset: 0;
    z-index: 80;
    background: rgba(20, 26, 18, 0.45);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.ph-cmp-picker {
    background: #FBF9F5;
    border-radius: 20px;
    width: 100%;
    max-width: 680px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 40px 80px -30px rgba(20, 26, 18, 0.4);
    animation: phCmpFade .25s ease;
    overflow: hidden;
}
@keyframes phCmpFade {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}

.ph-cmp-picker__head {
    padding: 22px 24px;
    border-bottom: 1px solid rgba(32, 38, 31, 0.08);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}
.ph-cmp-picker__title {
    font-family: 'Markazi Text', serif;
    font-weight: 600;
    font-size: 26px;
    color: #20261F;
}
.ph-cmp-picker__close {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #F4F1EB;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .18s;
}
.ph-cmp-picker__close:hover { background: #FDE8DE; }

.ph-cmp-picker__search-wrap {
    padding: 16px 24px;
    border-bottom: 1px solid rgba(32, 38, 31, 0.07);
    flex-shrink: 0;
}
.ph-cmp-picker__search-bar {
    display: flex;
    align-items: center;
    gap: 9px;
    background: #fff;
    border: 1.5px solid rgba(32, 38, 31, 0.12);
    border-radius: 11px;
    padding: 10px 14px;
    transition: border-color .18s;
}
.ph-cmp-picker__search-bar:focus-within { border-color: #1B7A8C; }
.ph-cmp-picker__input {
    flex: 1;
    border: none;
    outline: none;
    background: transparent;
    font-family: 'Vazirmatn', sans-serif;
    font-size: 14px;
    color: #20261F;
    text-align: right;
    direction: rtl;
}
.ph-cmp-picker__input::placeholder { color: #A6AC9E; }

.ph-cmp-picker__results {
    flex: 1;
    overflow-y: auto;
    padding: 16px 24px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    align-content: start;
    scrollbar-width: thin;
    scrollbar-color: #D8D2C8 transparent;
}
.ph-cmp-picker__empty {
    grid-column: span 2;
    font-size: 13px;
    color: #A6AC9E;
    text-align: center;
    padding: 24px 0;
}

/* Picker card */
.ph-cmp-picker-card {
    display: flex;
    gap: 12px;
    align-items: center;
    padding: 13px;
    border: 1.5px solid rgba(32, 38, 31, 0.1);
    border-radius: 13px;
    cursor: pointer;
    background: #fff;
    transition: border-color .2s, background .2s;
}
.ph-cmp-picker-card:hover {
    border-color: #1B7A8C;
    background: #F0FAFB;
}
.ph-cmp-picker-card__img {
    width: 52px;
    height: 58px;
    border-radius: 9px;
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
    background: linear-gradient(150deg, #C4E8F0, #8ABFC9);
}
.ph-cmp-picker-card__img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.ph-cmp-picker-card__sheen {
    position: absolute;
    inset: 0;
    background: radial-gradient(85% 65% at 28% 14%, rgba(255,255,255,0.24), transparent 55%);
}
.ph-cmp-picker-card__body { flex: 1; min-width: 0; }
.ph-cmp-picker-card__brand {
    font-size: 10.5px;
    color: #8A9382;
    margin-bottom: 2px;
}
.ph-cmp-picker-card__name {
    font-family: 'Markazi Text', serif;
    font-weight: 600;
    font-size: 17px;
    line-height: 1.3;
    color: #20261F;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.ph-cmp-picker-card__price {
    font-size: 13px;
    color: #1B7A8C;
    font-weight: 600;
    margin-top: 3px;
}

/* Overlay transitions */
.ph-overlay-in  { animation: phCmpFade .2s ease; }
.ph-overlay-out { animation: phCmpFade .15s ease reverse; }

/* ── RESPONSIVE ──────────────────────────────────────────────────── */
@media (max-width: 900px) {
    .ph-cmp-header__inner { padding: 10px 16px; }
    .ph-cmp-main { padding: 20px 16px 60px; }
    .ph-cmp-picker { max-width: 100%; margin: 0 8px; }
    .ph-cmp-picker__results { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
    .ph-cmp-announce { font-size: 11.5px; gap: 8px; }
    .ph-cmp-cart span:first-of-type { display: none; }
}
