/* ============================================
   Product Details
   ============================================ */

/* الأعمدة: gallery 502 / info 397 / sidebar 293, gap 20 (= 1232 container) */
.product-main {
    padding-bottom: 46px; /* top section → tabs bar ≈46px */
}

.product-main__grid {
    display: grid;
    grid-template-columns: minmax(0, 502fr) minmax(0, 397fr) 293px;
    gap: 20px;
    align-items: start;
}

/* ── Stars (shared inline SVG) ── */
.star-icon {
    display: block;
    flex-shrink: 0;
    fill: var(--n300);
    stroke: none;
}

.star-icon.is-filled {
    fill: #FFC107;
}

.star-icon.is-bar {
    fill: #FBB03B;
}

/* ── الجاليري ── */
.product-gallery__main {
    padding: 56px 69px;
    background: none;
    border-radius: 0;
}

.product-gallery__main img,
.product-gallery__main .image-placeholder {
    display: block;
    width: 100%;
    aspect-ratio: 364 / 239;
    height: auto;
    object-fit: contain;
    object-position: center;
}

.product-gallery__thumbs {
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
    margin-top: 24px;
}

.product-gallery__thumb {
    width: 104px;
    height: 104px;
    border: 1px solid var(--n200);
    border-radius: 17.33px;
    overflow: hidden;
    padding: 7px;
    box-sizing: border-box;
    background: var(--white);
    transition: border-color .2s;
}

.product-gallery__thumb.active,
.product-gallery__thumb:hover {
    border-color: var(--primary-600);
}

.product-gallery__thumb img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* ── معلومات المنتج ── */
.product-info {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.product-info__head {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.product-info__title {
    font-size: 20px;
    font-weight: 400;
    line-height: 30px;
    color: var(--text-black);
}

.product-info__rating {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 16px;
    font-weight: 500;
    line-height: 24px;
    color: var(--n800);
}

.product-info__price {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
}

.product-info__amount {
    display: flex;
    align-items: center;
    gap: 4px;
}

.product-info__currency {
    font-size: 24px;
    font-weight: 400;
    line-height: 30px;
    color: var(--text-black);
}

.product-info__now {
    font-size: 24px;
    font-weight: 600;
    line-height: 30px;
    color: var(--text-black);
}

.product-info__old {
    margin-inline-start: 5px; /* 4 gap + 5 = 9 */
    font-size: 18px;
    font-weight: 500;
    line-height: 30px;
    color: var(--n500);
    text-decoration: line-through;
}

.product-info__stock-badge {
    display: inline-flex;
    align-items: center;
    padding: 2.5px 10px;
    background: var(--n100);
    border: 1px solid var(--n200);
    border-radius: 8px;
    color: var(--text-black);
    font-size: 14px;
    font-weight: 500;
    line-height: 21px;
}

.product-info__stock-badge--out {
    background: #FEF2F2;
    border-color: #FECACA;
    color: #B91C1C;
}

/* ── الكارت الجانبي ── */
.product-sidebar {
    display: flex;
    flex-direction: column;
    gap: 24px;
    padding: 24px 16px;
    background: var(--white);
    border: 1px solid var(--n200);
    border-radius: 16px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
    box-sizing: border-box;
}

.product-sidebar__features {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--n200);
}

.product-sidebar__feature {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 16px;
    font-weight: 400;
    line-height: 24px;
    color: var(--n700);
}

.product-sidebar__feature--wide {
    gap: 8px;
}

.product-sidebar__feature svg {
    width: 20px;
    height: 20px;
    color: var(--n600);
    flex-shrink: 0;
}

.product-sidebar__cart {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    height: 48px;
    padding: 10px 20px;
    border: none;
    border-radius: 12px;
    background: var(--primary-500);
    color: var(--text-black);
    font-size: 16px;
    font-weight: 500;
    line-height: 24px;
    transition: background-color .2s;
}

.product-sidebar__cart svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.product-sidebar__cart:hover {
    background: var(--primary-600);
}

/* ── التابات ── */
.product-tabs-section {
    padding-top: 0;
    padding-bottom: 0;
}

.product-tabs {
    display: flex;
    gap: 16px;
    padding: 20px 24px 0;
    border-bottom: 1px solid var(--n200);
    margin-bottom: 32px;
}

.product-tabs__btn {
    padding: 0 8px 6.5px; /* 27 + 6.5 + 1.5 indicator = 35 */
    font-size: 18px;
    font-weight: 500;
    line-height: 27px;
    color: var(--n500);
    border-bottom: 1.5px solid transparent;
    margin-bottom: -1px;
    transition: color .2s, border-color .2s;
}

.product-tabs__btn.active {
    color: var(--text-black);
    border-bottom-color: var(--primary-600);
}

.product-tab-panel {
    display: none;
}

.product-tab-panel.active {
    display: block;
}

.product-tab-panel__heading {
    font-size: 18px;
    font-weight: 500;
    line-height: 27px;
    color: var(--text-black);
}

/* ── تاب الوصف ── */
.product-desc.active {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.product-desc__block--highlights {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.product-desc__block--specs {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.product-desc__text {
    font-size: 16px;
    font-weight: 400;
    line-height: 24px;
    color: var(--text-black);
}

/* ── جدول المواصفات ── */
.specs-table {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    align-items: start;
}

.specs-table__col {
    border: 1px solid var(--n200);
    border-radius: 12px;
    overflow: hidden;
}

.specs-table__row {
    display: grid;
    grid-template-columns: minmax(0, 279fr) minmax(0, 311fr);
    align-items: center;
    min-height: 72px;
    padding: 12px 8px;
    border-bottom: 1px solid var(--n100);
    background: var(--white);
    box-sizing: border-box;
}

.specs-table__row:last-child {
    border-bottom: none;
}

.specs-table__row:nth-child(even) {
    background: #F9FAFB;
}

.specs-table__label {
    padding: 0 8px;
    font-size: 16px;
    font-weight: 400;
    line-height: 24px;
    color: var(--n700);
    text-align: start;
}

.specs-table__value {
    padding: 0 16px;
    font-size: 16px;
    font-weight: 400;
    line-height: 24px;
    color: var(--n900);
    text-align: start;
    overflow-wrap: anywhere;
}

/* ── تقييمات ── */
.reviews-heading {
    margin-bottom: 12px;
}

.reviews-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 20px;
    align-items: stretch;
}

.reviews-aside {
    display: flex;
    flex-direction: column;
    gap: 24px;
    min-width: 0;
}

.reviews-summary {
    display: flex;
    flex-direction: column;
    gap: 16px;
    width: 294px;
    max-width: 100%;
}

.reviews-summary__overall {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.reviews-summary__score {
    font-size: 28px;
    font-weight: 600;
    line-height: 32px;
    color: #060B14;
}

.reviews-summary__meta {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.reviews-summary__stars {
    display: flex;
    gap: 4px;
}

.reviews-summary__count {
    font-size: 14px;
    font-weight: 500;
    line-height: 21px;
    color: var(--text-black);
}

.reviews-summary__bars {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.reviews-summary__bar-row {
    display: flex;
    align-items: center;
    gap: 12px;
    height: 24px;
}

.reviews-summary__bar-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    width: 35px;
    flex-shrink: 0;
    font-family: var(--font-en);
    font-size: 16px;
    font-weight: 500;
    line-height: 24px;
    color: #000;
}

.reviews-summary__bar {
    position: relative;
    display: block;
    width: 200px;
    height: 6px;
    flex-shrink: 1;
    min-width: 80px;
    background: #D9D9D9;
    border-radius: 12px;
    overflow: hidden;
}

.reviews-summary__bar span {
    position: absolute;
    inset-block: 0;
    inset-inline-start: 0;
    background: #FBB03B;
    border-radius: 12px;
}

.reviews-summary__bar-count {
    margin-inline-start: -4px; /* bar → count gap 8 */
    font-family: var(--font-en);
    font-size: 12px;
    font-weight: 500;
    line-height: 16px;
    color: var(--text-black);
}

/* ── فورم التقييم ── */
.review-form-wrap {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.review-form {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.review-form__stars {
    display: flex;
    gap: 0;
    margin: -8px 0 12px;
    margin-inline-start: -8px;
}

/* مساحة ضغط 40×40 والنجمة نفسها 24 — المسافة الظاهرة بين النجوم 4 */
.review-form__stars button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    line-height: 0;
    cursor: pointer;
    border-radius: 8px;
}

.review-form__stars button + button {
    margin-inline-start: -12px;
}

.review-form__stars .star-icon {
    fill: none;
    stroke: #9DA4AE;
    transition: fill .15s, stroke .15s;
}

.review-form__stars button.filled .star-icon,
.review-form__stars button:hover .star-icon {
    fill: #FFC107;
    stroke: #FFC107;
}

.review-form__fields {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
}

.review-form .form-field .input-wrap {
    gap: 8px;
    padding-inline: 12px 16px;
}

.review-form .form-field .input-wrap input {
    padding-inline-start: 0;
    min-width: 0;
}

.review-form .review-form__textarea {
    display: block;
    width: 100%;
    height: 137px;
    min-height: 137px;
    padding: 12px;
    border: 1px solid #E8EAED;
    border-radius: 8px;
    background: var(--white);
    font-size: 16px;
    line-height: 24px;
    resize: vertical;
    box-sizing: border-box;
}

.review-form .review-form__textarea:focus {
    border-color: var(--primary-500);
}

.review-form__remember {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-top: 16px;
    font-size: 14px;
    font-weight: 400;
    line-height: 21px;
    color: var(--text-black);
    cursor: pointer;
}

.review-form__remember input {
    width: 20px;
    height: 20px;
    margin: 0;
    flex-shrink: 0;
    accent-color: var(--primary-600);
    cursor: pointer;
}

.review-form__submit {
    margin-top: 24px;
}

.review-form__submit svg {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
}

.reviews-list__viewall svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

html[dir="rtl"] .pd-arrow {
    transform: scaleX(-1);
}

/* ── قائمة التقييمات ── */
.reviews-list {
    position: relative;
    display: flex;
    flex-direction: column;
    min-width: 0;
    border: 1px solid var(--n200);
    border-radius: 12px;
    overflow: hidden;
}

.reviews-list__header {
    display: flex;
    align-items: center;
    height: 48px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--n200);
    font-size: 16px;
    font-weight: 500;
    line-height: 24px;
    color: var(--text-black);
    box-sizing: border-box;
}

.reviews-list__items {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 16px;
}

.reviews-list--has-more .reviews-list__items {
    padding-bottom: 64px;
}

.reviews-list__empty {
    font-size: 14px;
    line-height: 21px;
    color: var(--n500);
}

.review-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 12px;
    background: #F9FAFB;
    border-radius: 12px;
    box-shadow: 0 4px 8px rgba(113, 72, 236, 0.04);
}

.review-item__header {
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.review-item__avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--primary-100);
    color: var(--primary-700);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
    flex-shrink: 0;
}

.review-item__who {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.review-item__name {
    font-size: 14px;
    font-weight: 500;
    line-height: 21px;
    color: #1E1F24;
}

.review-item__date {
    font-size: 12px;
    font-weight: 400;
    line-height: 18px;
    color: var(--n600);
}

.review-item__stars {
    display: flex;
    gap: 2px;
}

.review-item__text {
    font-size: 12px;
    font-weight: 400;
    line-height: 18px;
    color: var(--text-black);
}

.review-item__images {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 4px;
}

.review-item__image {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    padding: 3px;
    background: var(--white);
    border: 0.5px solid var(--n200);
    border-radius: 8px;
    box-sizing: border-box;
    overflow: hidden;
}

.review-item__image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* Fade overlay over the end of the list + "View all" */
.reviews-list__fade {
    position: absolute;
    inset-inline: 0;
    bottom: 0;
    height: 168px;
    display: flex;
    align-items: flex-end;
    padding: 16px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.4) 11.21%, #FFFFFF 23.18%, #FFFFFF 100%);
    border-radius: 24px;
    box-sizing: border-box;
    pointer-events: none;
}

.reviews-list .reviews-list__viewall {
    pointer-events: auto;
    height: 40px;
    min-height: 40px;
    padding: 0 20px;
    gap: 8px;
    font-size: 14px;
    font-weight: 500;
    line-height: 21px;
    color: var(--primary-700);
    border: 1px solid var(--primary-600);
    border-radius: 12px;
    background: var(--white);
}

/* ── منتجات ذات صلة ── */
.related-products {
    padding-top: 40px;
}

.related-products__heading {
    line-height: 24px;
    margin-bottom: 21px;
}

.related-products__grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 20px;
}

/* Responsive */
@media (max-width: 1100px) {
    .product-main__grid {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    }
    .product-sidebar {
        grid-column: span 2;
    }
    .related-products__grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 900px) {
    .product-main__grid {
        grid-template-columns: minmax(0, 1fr);
    }
    .product-sidebar {
        grid-column: span 1;
    }
    .product-gallery__main {
        padding: 24px;
    }
    .reviews-layout {
        grid-template-columns: minmax(0, 1fr);
    }
    .specs-table {
        grid-template-columns: minmax(0, 1fr);
    }
    .related-products__grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 600px) {
    .product-gallery__thumbs {
        gap: 12px;
    }
    .product-gallery__thumb {
        width: 80px;
        height: 80px;
    }
    .product-tabs {
        padding-inline: 0;
    }
    .specs-table__row {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    }
    .related-products__grid {
        grid-template-columns: minmax(0, 1fr);
    }
}

/* صورة بديلة لما المنتج مالوش صورة */
.product-card__placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    background: linear-gradient(160deg, #F6FDF8 0%, var(--primary-50) 100%);
}

.product-card__placeholder img {
    width: 56px;
    height: 56px;
    opacity: .5;
    object-fit: contain;
}

.product-desc__text--muted {
    color: var(--n500);
}
