/* پرشین پت — جزئیات محصول (نمای XShop؛ فقط با CSS) */

article#product-details {
    max-width: none;
    padding: 0;
}

article#product-details > header ul.path {
    padding-top: 20px;
}

/* ردیف بالا: گالری و اطلاعات خرید */
#product-details > section > div.row:first-child {
    --bs-gutter-x: 56px;
    align-items: flex-start;
}

/*#region gallery */
.product-images {
    display: flex;
    gap: 16px;
    align-items: flex-start;
}

.product-images > img {
    order: 2;
    flex: 1;
    min-width: 0;
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: contain;
    padding: 6%;
    box-sizing: border-box;
    background: var(--pp-surface);
    border: 1px solid var(--pp-line);
    border-radius: var(--pp-radius);
    cursor: zoom-in;
}

.product-images > ul {
    order: 1;
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex: none;
}

.product-images > ul > li {
    width: 84px;
    height: 105px;
    border: 1px solid var(--pp-line);
    border-radius: var(--pp-btn-radius);
    overflow: hidden;
    cursor: pointer;
    background: var(--pp-canvas);
    transition: border-color .2s ease;
}

.product-images > ul > li:hover {
    border-color: var(--pp-ink);
}

.product-images > ul > li > img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: var(--pp-surface);
}
/*#endregion */

/*#region buy box */
.product-details {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.product-details > h2 {
    margin: 0;
    font-family: var(--pp-display);
    font-size: 33px;
    font-weight: 700;
    line-height: 1.2;
}

/* «Price :» از نما می‌آید؛ فقط مبلغ نمایش داده می‌شود */
.product-details > h4 {
    margin: 0;
    font-size: 0;
    padding-bottom: 18px;
    border-bottom: 1px solid var(--pp-line);
}

.product-details > h4 > span {
    font-size: 24px;
    font-weight: 600;
    color: var(--pp-ink);
}

.product-details h3 {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
    font-family: var(--pp-sans);
}

.product-details > div.mx-auto {
    width: 100%;
    max-width: none;
    margin: 0 !important;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.product-details .row {
    margin: 0 !important;
}

.product-details .row > * {
    padding: 0;
}

.product-details .form-floating > label:empty {
    display: none;
}

.product-details .form-floating > .form-select {
    height: 52px;
    min-height: 52px;
    padding-top: 0;
    padding-bottom: 0;
    font-size: 15px;
}

/* وقتی برچسب (نام ویژگی اصلی/دوم گروه) هست ، مقدار زیر برچسب شناور می‌نشیند */
.product-details .form-floating > .form-select:has(~ label:not(:empty)) {
    height: 60px;
    min-height: 60px;
    padding-top: 1.45rem;
    padding-bottom: .3rem;
}

.product-details .form-floating > .form-select ~ label:not(:empty) {
    padding-top: .55rem;
    padding-bottom: 0;
    height: auto;
    font-size: 12px;
    transform: none;
    opacity: 1;
}

.product-details .input-group {
    flex-wrap: nowrap;
    gap: 12px;
    margin-top: 8px;
}

.product-details .input-group > .form-floating {
    flex: 0 0 120px !important;
}

.product-details .input-group > .form-floating > .form-control {
    height: 56px;
    min-height: 56px;
    border-radius: var(--pp-btn-radius) !important;
    text-align: center;
}

.product-details .input-group > .btn {
    flex: 1;
    height: 56px;
    margin: 0 !important;
    border-radius: var(--pp-btn-radius) !important;
    font-size: 16px;
}

/* ویژگی‌ها، برچسب‌ها و اشتراک‌گذاری */
.product-details > div.features,
.product-details > div.tags,
.product-details > div:last-child {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    padding-top: 18px;
    border-top: 1px solid var(--pp-line);
}

.product-details > div.features > h3,
.product-details > div.tags > h3,
.product-details > div:last-child > h3 {
    flex-basis: 100%;
    margin-bottom: 4px;
}

.product-details > div.features:not(:has(li)),
.product-details > div.tags:not(:has(a)) {
    display: none;
}

.product-details > div.features > ul {
    list-style: none;
    margin: 0;
    padding: 0;
    width: 100%;
    font-size: 14px;
}

.product-details > div.features > ul > li {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 8px 0;
    border-bottom: 1px dashed var(--pp-line);
}

.product-details > div.tags > a {
    display: inline-block;
    padding: 3px 12px;
    border: 1px solid var(--pp-line);
    border-radius: 999px;
    font-size: 13px;
    color: var(--pp-muted);
}

.product-details > div.tags > a:hover {
    border-color: var(--pp-accent);
    color: var(--pp-accent);
}

.product-details ul.socials {
    list-style: none;
    display: flex;
    gap: 6px;
    margin: 0;
    padding: 0;
}

.product-details ul.socials a {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--pp-line);
    border-radius: 999px;
    color: var(--pp-ink);
    font-size: 15px;
}

.product-details ul.socials a:hover {
    border-color: var(--pp-accent);
    color: var(--pp-accent);
}
/*#endregion */

/*#region description */
#product-details > section > div.row:nth-of-type(2) {
    display: block;
    max-width: 820px;
    margin: 88px auto 0;
    padding: 48px 0 0;
    border-top: 1px solid var(--pp-line);
    color: var(--pp-muted);
    font-size: 16px;
    line-height: 2.1;
}

#product-details > section > div.row:nth-of-type(2) > * {
    padding: 0;
    width: auto;
}

#product-details > section > div.row:nth-of-type(2) > h3 {
    font-family: var(--pp-display);
    font-size: 27px;
    font-weight: 700;
    color: var(--pp-ink);
    margin: 0 0 20px;
}

#product-details > section > div.row:nth-of-type(2) span {
    font-size: inherit !important;
}

#product-details > section > div.row:nth-of-type(2) p {
    margin: 0 0 12px;
}

#product-details > section > div.row:nth-of-type(2) img {
    max-width: 100%;
    height: auto;
    border-radius: var(--pp-radius);
    margin: 16px 0;
}

#product-details > section > div.row:nth-of-type(2) a {
    color: var(--pp-accent);
}
/*#endregion */

/*#region images page */
section.images {
    margin: 0;
}

section.images > header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 0 16px;
    border-bottom: 1px solid var(--pp-line);
    margin-bottom: 24px;
}

section.images > header > label {
    font-family: var(--pp-display);
    font-size: 22px;
    padding: 0;
    font-weight: 700;
}

section.images > div {
    display: flex;
    gap: 16px;
}

section.images > div > ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

section.images > div > ul img {
    width: 84px;
    height: 105px;
    object-fit: cover;
    border-radius: var(--pp-btn-radius);
    cursor: pointer;
    background: var(--pp-canvas);
}

#frm_pnaelImage {
    flex: 1;
    text-align: center;
    background: var(--pp-canvas);
    border-radius: var(--pp-radius);
}

#frm_pnaelImage > img {
    max-width: 100%;
    max-height: 80vh;
    object-fit: contain;
}
/*#endregion */

/*#region similar products */
article.swiper-products {
    margin-top: 104px;
}

article.swiper-products > header {
    font-family: var(--pp-display);
    font-size: 30px;
    font-weight: 700;
    line-height: 1.2;
    padding: 0;
    margin: 0 0 32px;
    border: 0;
}

.product-slide > a {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 0 8px;
    color: var(--pp-ink);
}

.product-slide > a > img {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: contain;
    padding: 6%;
    box-sizing: border-box;
    background: var(--pp-surface);
    border: 1px solid var(--pp-line);
    border-radius: var(--pp-radius);
    margin-bottom: 6px;
}

.product-slide > a > span[data-id] {
    position: absolute;
    top: 12px;
    right: 20px;
    padding: 2px 12px;
    border-radius: 999px;
    background: var(--pp-ground);
    font-size: 12px;
    font-weight: 500;
    opacity: 0;
    transition: opacity .2s ease;
}

.product-slide > a:hover > span[data-id] {
    opacity: 1;
}

.product-slide > a > h2 {
    margin: 0;
    font-size: 15px;
    font-weight: 400;
    line-height: 1.75;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-slide > a > h3 {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
}

.product-slide > a[data-issoldout='true'] > h3 {
    font-size: 0;
}

.product-slide > a[data-issoldout='true'] > h3::after {
    content: "قیمت را بپرسید";
    font-size: 14px;
    font-weight: 500;
    color: var(--pp-secondary);
}
/*#endregion */

/*#region responsive */
@media (max-width: 767.98px) {
    #product-details > section > div.row:first-child {
        row-gap: 28px;
    }

    .product-images {
        flex-direction: column;
    }

    .product-images > img {
        order: 1;
    }

    .product-images > ul {
        order: 2;
        flex-direction: row;
        overflow-x: auto;
        max-width: 100%;
    }

    .product-images > ul > li {
        flex: none;
        width: 64px;
        height: 80px;
    }

    .product-details > h2 {
        font-size: 25px;
    }

    #product-details > section > div.row:nth-of-type(2) {
        margin-top: 56px;
        padding-top: 32px;
        font-size: 15px;
    }

    #product-details > section > div.row:nth-of-type(2) > h3 {
        font-size: 22px;
    }

    article.swiper-products {
        margin-top: 64px;
    }

    article.swiper-products > header {
        font-size: 24px;
        margin-bottom: 20px;
    }

    .product-slide > a > h2,
    .product-slide > a > h3 {
        font-size: 13px;
    }
}
/*#endregion */

/* پرچم کشور سازنده در جدول ویژگی‌ها (مقدار ویژگی از Options به شکل HTML می‌آید) */
.country-feature { display: inline-flex; align-items: center; gap: 8px; }
.country-feature img { width: 28px; height: auto; border-radius: 3px; box-shadow: 0 0 0 1px rgba(0, 0, 0, .08); }

/* مقاله‌های مرتبط از سایت اصلی پرشین پت (Views/Shared/_ProductDetailExtras.cshtml) */
.product-detail-extras { margin: 28px 0 0 !important; }
.pp-related-articles { width: 100%; padding: 20px 22px; border: 1px solid var(--pp-line-2); border-radius: var(--pp-radius); background: var(--pp-surface); }
.pp-related-articles h3 { margin: 0 0 12px; font-size: 17px; font-weight: 700; color: var(--pp-ink); }
.pp-related-articles ul { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 6px 24px; margin: 0; padding: 0; list-style: none; }
.pp-related-articles a { display: flex; align-items: center; gap: 10px; padding: 8px 0; color: var(--pp-ink); text-decoration: none; border-bottom: 1px dashed var(--pp-line-2); }
.pp-related-articles a:hover, .pp-related-articles a:focus-visible { color: var(--pp-accent); }
.pp-related-articles svg { flex: 0 0 auto; color: var(--pp-accent); }