/**
 * Frontend styles for My Products (محصولات من)
 * برگرفته از قالب طراحی hand-soap-v2.html
 */

:root {
    --bg-page: #f8fafc;
    --bg-white: #ffffff;
    --text-dark: #0f172a;
    --text-body: #334155;
    --text-muted: #64748b;
    --border-color: #e2e8f0;
    --border-hover: #cbd5e1;
    --brand-blue: #0284c7;
    --brand-blue-hover: #0369a1;
    --brand-blue-light: #f0f9ff;
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --radius-full: 9999px;
}

.myp-single-product-main {
    padding: 40px 0 60px 0;
    direction: rtl;
    text-align: right;
}

.myp-container {
    width: 100%;
    max-width: 1140px;
    margin: 0 auto;
    padding: 0 20px;
    box-sizing: border-box;
}

/* شبکه دو ستونه نمایش محصول بر اساس hand-soap-v2.html */
.myp-product-grid {
    display: grid;
    grid-template-columns: 1fr 1.25fr;
    gap: 40px;
    align-items: start;
}

/* ستون اطلاعات متنی محصول */
.myp-product-info {
    display: flex;
    flex-direction: column;
    gap: 22px;
}

/* ---------------------------------
   بخش گالری تصاویر محصول (GALLERY)
--------------------------------- */
.myp-product-visual {
    background: #ffffff;
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: var(--radius-lg, 20px);
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    top: auto;
    align-self: auto;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
    box-sizing: border-box;
    width: 100%;
}

/* حالت چسبان (Sticky) فقط در نمایشگرهای دسکتاپ */
@media (min-width: 901px) {
    .myp-product-visual {
        position: sticky;
        top: 96px;
        align-self: start;
        z-index: 10;
    }
}

/* چیدمان در موبایل و تبلت (نوع نمایش عمودی - Vertical): ابتدا نام محصول، سپس گالری بدون چسبندگی (غیر استیکی)، سپس توضیحات با استفاده حداکثری از تمام عرض صفحه */
@media (max-width: 900px) {
    .myp-single-product-main {
        padding: 20px 0 45px 0;
    }

    .container.myp-container,
    .myp-container {
        padding: 0 12px;
        max-width: 100%;
        width: 100%;
        box-sizing: border-box;
    }

    .myp-product-grid {
        display: flex;
        flex-direction: column;
        gap: 16px;
        width: 100%;
        box-sizing: border-box;
    }

    .myp-product-info {
        display: contents;
    }

    .product-title-area,
    .myp-product-info > .product-title-area {
        order: 1;
        margin-bottom: 0;
        width: 100%;
        box-sizing: border-box;
    }

    .myp-product-visual {
        order: 2;
        position: relative !important;
        top: auto !important;
        align-self: auto !important;
        z-index: 1;
        width: 100%;
        padding: 12px;
        border-radius: 16px;
        box-sizing: border-box;
    }

    .myp-product-info > * {
        order: 3;
        width: 100%;
        box-sizing: border-box;
    }

    .info-card {
        padding: 16px 14px;
        border-radius: 14px;
        width: 100%;
        box-sizing: border-box;
    }
}

.myp-main-stage-frame {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    height: auto;
    background: #ffffff;
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding: 0;
    box-sizing: border-box;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03);
}

.myp-main-stage-img {
    width: 100%;
    height: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border-radius: 16px;
    transition: opacity 0.22s ease, transform 0.22s cubic-bezier(0.16, 1, 0.3, 1);
    display: block;
}

.myp-main-stage-img.fade-out {
    opacity: 0;
    transform: scale(0.97);
}

/* دکمه‌های ناوبری قبلی و بعدی روی هاور */
.myp-product-visual .gallery-arrow-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-dark, #0f172a);
    font-size: 1.35rem;
    line-height: 1;
    cursor: pointer;
    opacity: 0;
    transition: all 0.25s ease;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
    z-index: 6;
}

.myp-main-stage-frame:hover .gallery-arrow-btn {
    opacity: 1;
}

.myp-product-visual .gallery-arrow-btn:hover {
    background: #ffffff;
    color: var(--brand-blue, #0284c7);
    transform: translateY(-50%) scale(1.08);
}

.myp-product-visual .gallery-arrow-btn.prev { right: 12px; }
.myp-product-visual .gallery-arrow-btn.next { left: 12px; }

/* کپسول شیشه‌ای شناور توضیح تصویر فعال روی فریم اصلی */
.myp-gallery-caption-badge {
    position: absolute;
    bottom: 12px;
    right: 14px;
    max-width: calc(100% - 28px);
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(0, 0, 0, 0.06);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
    border-radius: var(--radius-full, 9999px);
    padding: 5px 14px;
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text-dark, #0f172a);
    display: flex;
    align-items: center;
    gap: 7px;
    z-index: 5;
    transition: opacity 0.22s ease, transform 0.22s cubic-bezier(0.16, 1, 0.3, 1);
    box-sizing: border-box;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.myp-gallery-caption-badge.fade-out {
    opacity: 0;
    transform: translateY(4px);
}

.myp-gallery-caption-badge svg {
    color: var(--brand-blue, #0284c7);
    flex-shrink: 0;
}

/* نوار تامبنیل‌های تصاویر گالری - مینیمال مدرن */
.myp-product-gallery-strip {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    width: 100%;
    margin-top: 14px;
}

.myp-gallery-thumb-item {
    background: transparent;
    border: 2px solid transparent;
    border-radius: 12px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0.55;
    transition: all 0.25s ease;
    position: relative;
    user-select: none;
    box-sizing: border-box;
}

.myp-gallery-thumb-item:hover {
    opacity: 0.85;
    transform: translateY(-2px);
    border-color: transparent;
}

.myp-gallery-thumb-item.active {
    opacity: 1;
    background: transparent;
    border-color: var(--brand-blue, #0284c7);
    box-shadow: 0 4px 12px rgba(2, 132, 199, 0.3);
    transform: scale(1.03);
}

.myp-thumb-preview-img {
    width: 100%;
    aspect-ratio: 1 / 1;
    height: auto;
    object-fit: cover;
    border-radius: 10px;
    display: block;
}

/* ۱. ناحیه نام محصول و توضیح کوتاه زیر نام */
.product-title-area {
    margin-bottom: 4px;
}

.product-title-area h1 {
    font-size: 1.9rem;
    font-weight: 800;
    color: var(--text-dark, #0f172a);
    line-height: 1.35;
    margin-top: 4px;
    margin-bottom: 8px;
}

.product-title-area .sub-title {
    font-size: 0.95rem;
    color: var(--text-muted, #64748b);
    line-height: 1.6;
    margin-top: 4px;
}

/* ۲. کارت توضیحات محصول (مطابق با استایل info-card در hand-soap-v2.html) */
.info-card {
    background: #ffffff;
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: var(--radius-md, 14px);
    padding: 22px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.info-card-title {
    font-size: 0.98rem;
    font-weight: 800;
    color: var(--text-dark, #0f172a);
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.info-card-title svg {
    color: var(--brand-blue, #0284c7);
    flex-shrink: 0;
}

.product-desc-text {
    font-size: 0.94rem;
    color: var(--text-body, #334155);
    line-height: 1.85;
    text-align: justify;
}

.product-desc-text p {
    margin-bottom: 1.1em;
}

.product-desc-text p:empty {
    display: none;
}

.product-desc-text > *:last-child,
.product-desc-text p:last-child,
.product-desc-text p:last-of-type {
    margin-bottom: 0 !important;
}

/* ---------------------------------
   ۳. مشخصات کلی محصول (GENERAL SPECIFICATIONS)
   برگرفته از فایل طراحی hand-soap-v2.html
---------------------------------- */
.specs-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 0;
    padding: 0;
    width: 100%;
    box-sizing: border-box;
}

.specs-list li {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding-bottom: 8px;
    border-bottom: 1px dashed var(--border-color, #e2e8f0);
    font-size: 0.88rem;
    line-height: 1.6;
    width: 100%;
    gap: 12px;
    box-sizing: border-box;
}

.specs-list li:last-child {
    padding-bottom: 0;
    border-bottom: none;
}

.specs-list .spec-name {
    color: var(--text-muted, #64748b);
    flex-shrink: 0;
    margin-left: 12px;
    font-size: 0.88rem;
}

.specs-list .spec-value {
    font-weight: 700;
    color: var(--text-dark, #0f172a);
    text-align: left;
    font-size: 0.88rem;
    word-break: break-word;
}

/* واکنش‌گرایی در نمایشگرهای موبایل و صفحات کوچک */
@media (max-width: 480px) {
    .specs-list {
        gap: 8px;
    }
    .specs-list li {
        display: flex;
        flex-direction: row;
        justify-content: space-between;
        align-items: baseline;
        gap: 8px;
        padding-bottom: 7px;
        font-size: 0.84rem;
    }
    .specs-list .spec-name {
        margin-left: 0;
        font-size: 0.82rem;
        flex-shrink: 0;
    }
    .specs-list .spec-value {
        text-align: left;
        font-size: 0.84rem;
    }
}

/* ---------------------------------
   ۴. مشخصات ظروف و بسته‌بندی (CONTAINER SPECIFICATIONS)
   برگرفته از فایل طراحی hand-soap-v2.html - بدون قابلیت هاور
---------------------------------- */
.containers-header-flex {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    width: 100%;
}

.containers-tag-pill {
    font-size: 0.74rem;
    color: var(--brand-blue, #0284c7);
    background: var(--brand-blue-light, #f0f9ff);
    border: 1px solid #bae6fd;
    padding: 3px 12px;
    border-radius: var(--radius-full, 9999px);
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.containers-tag-pill::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--brand-blue, #0284c7);
}

.volumes-showcase-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
    gap: 14px;
    width: 100%;
    box-sizing: border-box;
}

.volume-tile {
    background: #ffffff;
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: var(--radius-md, 14px);
    padding: 22px 14px 20px 14px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 6px;
    position: relative;
    cursor: default;
    user-select: none;
    width: 100%;
    box-sizing: border-box;
}

/* صراحتاً بدون هاور طبق دستور کاربر */
.volume-tile:hover {
    border-color: var(--border-color, #e2e8f0);
    transform: none;
    box-shadow: none;
}

.vol-main-heading {
    font-size: 1.45rem;
    font-weight: 900;
    color: var(--text-dark, #0f172a);
    line-height: 1.2;
    letter-spacing: -0.02em;
}

.vol-sub-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted, #64748b);
    line-height: 1.3;
}

/* واکنش‌گرایی در صفحات کوچک */
@media (max-width: 640px) {
    .product-title-area h1 {
        font-size: 1.5rem;
        line-height: 1.35;
        margin-top: 0;
        margin-bottom: 6px;
    }
    .product-title-area .sub-title {
        font-size: 0.88rem;
        line-height: 1.55;
    }
    .myp-product-visual {
        padding: 10px;
        border-radius: 14px;
    }
    .myp-main-stage-frame {
        border-radius: 12px;
    }
    .myp-main-stage-img {
        border-radius: 12px;
    }
    .myp-product-gallery-strip {
        gap: 6px;
        margin-top: 8px;
    }
    .myp-gallery-thumb-item {
        border-radius: 8px;
    }
    .myp-thumb-preview-img {
        border-radius: 6px;
    }
    .myp-product-visual .gallery-arrow-btn {
        opacity: 0.9;
        width: 32px;
        height: 32px;
        font-size: 1.2rem;
    }
    .volumes-showcase-row {
        grid-template-columns: repeat(auto-fit, minmax(72px, 1fr));
        gap: 8px;
        width: 100%;
    }
    .volume-tile {
        padding: 12px 4px 10px 4px;
        gap: 4px;
        border-radius: 10px;
        width: 100%;
        box-sizing: border-box;
    }
    .vol-main-heading {
        font-size: 1.15rem;
    }
    .vol-sub-label {
        font-size: 0.74rem;
    }
}

@media (max-width: 480px) {
    .myp-single-product-main {
        padding: 14px 0 35px 0;
    }
    .container.myp-container,
    .myp-container {
        padding: 0 8px;
    }
    .myp-product-grid {
        gap: 12px;
    }
    .product-title-area h1 {
        font-size: 1.35rem;
        margin-bottom: 4px;
    }
    .product-title-area .sub-title {
        font-size: 0.82rem;
    }
    .myp-product-visual {
        padding: 8px;
        border-radius: 12px;
    }
    .myp-main-stage-frame {
        border-radius: 10px;
    }
    .myp-main-stage-img {
        border-radius: 10px;
    }
    .info-card {
        padding: 14px 10px;
        border-radius: 12px;
    }
    .info-card-title {
        font-size: 0.92rem;
        margin-bottom: 12px;
    }
    .product-desc-text {
        font-size: 0.88rem;
        line-height: 1.8;
    }
    .volumes-showcase-row {
        grid-template-columns: repeat(auto-fit, minmax(66px, 1fr));
        gap: 6px;
    }
    .volume-tile {
        padding: 10px 3px 8px 3px;
        border-radius: 8px;
    }
    .vol-main-heading {
        font-size: 1.05rem;
    }
    .vol-sub-label {
        font-size: 0.70rem;
    }
}

/* ---------------------------------
   PRODUCT ARCHIVE VIEW (/products/)
   صفحه لیست محصولات و کاتالوگ
--------------------------------- */
.myp-archive-main {
    padding: 36px 0 60px 0;
    direction: rtl;
    text-align: right;
}

.myp-archive-header {
    text-align: center;
    margin-bottom: 38px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.myp-archive-header-badge {
    display: inline-flex;
    align-items: center;
    background: var(--brand-blue-light, #f0f9ff);
    color: var(--brand-blue, #0284c7);
    border: 1px solid #bae6fd;
    font-size: 0.78rem;
    font-weight: 700;
    padding: 4px 14px;
    border-radius: var(--radius-full, 9999px);
    margin-bottom: 12px;
}

.myp-archive-title {
    font-size: 2.1rem;
    font-weight: 800;
    color: var(--text-dark, #0f172a);
    margin-bottom: 8px;
    line-height: 1.3;
}

.myp-archive-desc {
    font-size: 0.94rem;
    color: var(--text-muted, #64748b);
    max-width: 580px;
    line-height: 1.7;
    margin: 0;
}

/* شبکه محصولات */
.myp-products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 24px;
}

/* کارت محصول */
.myp-product-card {
    background: #ffffff;
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: var(--radius-md, 14px);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    position: relative;
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
}

.myp-product-card:hover {
    transform: translateY(-4px);
    border-color: var(--border-hover, #cbd5e1);
    box-shadow: 0 12px 28px -6px rgba(15, 23, 42, 0.08);
}

.myp-card-link-overlay {
    position: absolute;
    inset: 0;
    z-index: 2;
}

/* فریم تصویر محصول در کارت */
.myp-card-image-wrap {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    background: #f8fafc;
    overflow: hidden;
    border-bottom: 1px solid var(--border-color, #e2e8f0);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* در صورت خالی بودن تصویر طبق درخواست کاربر */
.myp-card-image-wrap.is-empty {
    background: #f8fafc;
}

.myp-card-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.myp-product-card:hover .myp-card-img {
    transform: scale(1.04);
}

.myp-card-badges {
    position: absolute;
    top: 10px;
    right: 10px;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    z-index: 2;
    pointer-events: none;
}

.myp-card-badge {
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(0, 0, 0, 0.06);
    font-size: 0.72rem;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: var(--radius-full, 9999px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    display: inline-flex;
    align-items: center;
    line-height: 1.4;
}

.myp-card-pkg-badge {
    color: var(--brand-blue, #0284c7);
}

.myp-card-scent-badge {
    color: #475569;
}

/* بدنه کارت */
.myp-card-body {
    padding: 16px 18px 18px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.myp-card-title {
    font-size: 1.05rem;
    font-weight: 800;
    line-height: 1.4;
    margin: 0 0 6px 0;
    color: var(--text-dark, #0f172a);
}

.myp-card-title a {
    color: inherit;
    text-decoration: none;
    transition: color 0.15s ease;
}

.myp-product-card:hover .myp-card-title a {
    color: var(--brand-blue, #0284c7);
}

.myp-card-subtitle {
    font-size: 0.82rem;
    color: var(--text-muted, #64748b);
    line-height: 1.5;
    margin: 0 0 14px 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.myp-card-footer {
    margin-top: auto;
    padding-top: 12px;
    border-top: 1px dashed var(--border-color, #e2e8f0);
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

.myp-card-cta {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--brand-blue, #0284c7);
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: transform 0.2s ease, gap 0.2s ease;
}

.myp-product-card:hover .myp-card-cta {
    gap: 6px;
    transform: translateX(-2px);
}

.myp-archive-empty {
    padding: 60px 20px;
    text-align: center;
    background: #ffffff;
    border: 1px dashed var(--border-color, #e2e8f0);
    border-radius: var(--radius-md, 14px);
    color: var(--text-muted, #64748b);
    font-size: 0.95rem;
}

/* صفحه‌بندی آرشیو */
.myp-archive-main .pagination,
.myp-archive-main .navigation.pagination {
    margin-top: 40px;
    text-align: center;
}

.myp-archive-main .nav-links {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.myp-archive-main .nav-links .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    height: 38px;
    padding: 0 10px;
    border-radius: var(--radius-sm, 8px);
    border: 1px solid var(--border-color, #e2e8f0);
    background: #ffffff;
    color: var(--text-dark, #0f172a);
    font-size: 0.88rem;
    font-weight: 600;
    text-decoration: none;
    transition: var(--transition, all 0.25s ease);
}

.myp-archive-main .nav-links .page-numbers.current,
.myp-archive-main .nav-links .page-numbers:hover {
    background: var(--brand-blue, #0284c7);
    color: #ffffff;
    border-color: var(--brand-blue, #0284c7);
}

/* واکنش‌گرایی در صفحات کوچک */
@media (max-width: 640px) {
    .myp-products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 14px;
    }
    .myp-card-body {
        padding: 12px 14px 14px;
    }
    .myp-card-title {
        font-size: 0.95rem;
    }
    .myp-card-subtitle {
        font-size: 0.78rem;
    }
    .myp-archive-title {
        font-size: 1.6rem;
    }
}

@media (max-width: 420px) {
    .myp-products-grid {
        grid-template-columns: 1fr;
    }
}

