/* =========================================================
                   PLAN PRODUCT PAGE
                ========================================================= */

.plan-page {
    min-height: 100vh;
    padding: 26px 0 55px;
}

.plan-page *,
.plan-page *::before,
.plan-page *::after {
    box-sizing: border-box;
}

.plan-breadcrumb {
    margin-bottom: 18px;
}

.plan-breadcrumb nav {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 13px;
}

.plan-breadcrumb a {
    color: #64748b;
    text-decoration: none;
    transition: color 0.2s ease;
}

.plan-breadcrumb a:hover {
    color: var(--primary-color, #3b82f6);
}

.plan-breadcrumb .plan-breadcrumb-separator {
    color: #cbd5e1;
}

.plan-breadcrumb .plan-breadcrumb-current {
    color: #334155;
    font-weight: 700;
}

/* =========================================================
                   MAIN PRODUCT CARD
                ========================================================= */

.plan-product-shell {
    display: grid;
    grid-template-columns: minmax(330px, 42%) minmax(0, 58%);
    background: #fff;
    border: 1px solid #e7edf5;
    border-radius: 24px;
    overflow: hidden;

    box-shadow:
        0 22px 60px rgba(15, 23, 42, 0.065),
        0 3px 10px rgba(15, 23, 42, 0.025);
}

/* =========================================================
                   MEDIA SIDE
                ========================================================= */

.plan-product-media {
    position: relative;
    min-height: 585px;
    padding: 35px;

    display: flex;
    align-items: center;
    justify-content: center;

    background: linear-gradient(145deg, #f8fafc 0%, #f1f5f9 100%);

    border-left: 1px solid #edf2f7;
}

.plan-product-media::before {
    content: '';

    position: absolute;

    width: 270px;
    height: 270px;

    border-radius: 50%;

    background: rgba(59, 130, 246, 0.055);

    filter: blur(4px);

    pointer-events: none;
}

.plan-product-image-box {
    position: relative;
    z-index: 1;

    width: 100%;
    max-width: 500px;

    aspect-ratio: 1 / 1;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 25px;

    overflow: hidden;
}

.plan-product-image-box::after {
    content: '';

    position: absolute;
    inset: 0;

    pointer-events: none;

    background: radial-gradient(
        circle at center,
        transparent 35%,
        rgba(248, 250, 252, 0.32) 100%
    );
}

#plan-selected-image {
    position: relative;
    z-index: 2;

    width: 100%;
    height: 100%;

    display: block;

    object-fit: contain;

    opacity: 1;

    transform: scale(1);

    transition:
        opacity 0.16s ease,
        transform 0.22s ease;
}

.plan-product-image-box.is-changing #plan-selected-image {
    opacity: 0.35;
    transform: scale(0.985);
}

.plan-image-preload {
    position: absolute !important;

    width: 1px !important;
    height: 1px !important;

    overflow: hidden !important;

    opacity: 0 !important;

    pointer-events: none !important;
}

.plan-image-preload img {
    width: 1px !important;
    height: 1px !important;
}

.plan-product-badge {
    position: absolute;

    top: 22px;
    right: 22px;

    z-index: 5;

    padding: 7px 14px;

    border-radius: 999px;

    color: #fff;
    background: #64748b;

    font-size: 12px;
    font-weight: 800;

    box-shadow: 0 8px 20px rgba(100, 116, 139, 0.2);
}

.plan-product-badge--special {
    background: linear-gradient(135deg, #ef4444, #f97316);

    box-shadow: 0 8px 20px rgba(239, 68, 68, 0.22);
}

/* =========================================================
                   AJAX REPLACEABLE INFO BLOCK
                ========================================================= */

.plan-product-shell > .product-info-block {
    width: 100%;
    max-width: none;

    flex: none;

    padding: 0 !important;
    margin: 0 !important;
}

.product-info-block {
    position: relative;
    background: #fff;
}

.product-info-block.is-variant-loading::after {
    content: '';

    position: absolute;

    top: 0;
    right: 0;
    left: 0;

    height: 3px;

    z-index: 20;

    background: linear-gradient(
        90deg,
        transparent,
        var(--primary-color, #3b82f6),
        transparent
    );

    background-size: 200% 100%;

    animation: planAjaxLoading 1s linear infinite;
}

@keyframes planAjaxLoading {
    from {
        background-position: 200% 0;
    }

    to {
        background-position: -200% 0;
    }
}

.plan-product-info {
    height: 100%;
    min-height: 585px;

    padding: 38px 42px;

    display: flex;
    flex-direction: column;
}

/*
                 * فقط این قسمت با Ajax عوض می‌شود.
                 * خود کارت، عنوان، توضیحات و سمت عکس ثابت می‌مانند.
                 */

.js-plan-price-fragment {
    display: flex;
    flex: 1 1 auto;

    flex-direction: column;

    min-width: 0;
}

.plan-product-title {
    padding-bottom: 20px;

    border-bottom: 1px solid #eef2f6;
}

.plan-product-title h1 {
    margin: 0;

    color: #0f172a;

    font-size: 26px;
    line-height: 1.8;

    font-weight: 900;
}

.plan-product-title h3 {
    margin: 4px 0 0;

    direction: ltr;
    text-align: right;

    color: #94a3b8;

    font-size: 13px;
    line-height: 1.7;

    font-weight: 400;
}

.plan-description {
    margin-top: 18px;

    padding: 15px 17px;

    color: #64748b;

    background: #f8fafc;

    border: 1px solid #eef2f6;
    border-radius: 14px;

    font-size: 14px;
    line-height: 2;
}

.plan-description p,
.plan-description .little-des {
    margin: 0;
    padding-top: 0;
}

.plan-brand {
    margin-top: 15px;

    color: #475569;

    font-size: 13px;
}

.plan-brand strong {
    color: #334155;
}

.plan-brand a {
    color: var(--primary-color, #3b82f6);
    text-decoration: none;
}

.plan-labels {
    display: flex;
    flex-wrap: wrap;

    gap: 7px;

    margin-top: 15px;
}

.plan-label {
    display: inline-flex;
    align-items: center;

    padding: 5px 10px;

    color: #2563eb;

    background: #eff6ff;

    border: 1px solid #dbeafe;
    border-radius: 8px;

    font-size: 11px;
    font-weight: 800;
}

/* =========================================================
                   VARIANTS
                ========================================================= */

.plan-variants-area {
    margin-top: 28px;
}

.plan-variant-group {
    margin-bottom: 23px;
}

.plan-variant-group:last-child {
    margin-bottom: 0;
}

.plan-variant-title {
    display: flex;
    align-items: center;

    gap: 8px;

    margin-bottom: 12px;

    color: #334155;

    font-size: 14px;
    font-weight: 800;
}

.plan-variant-title::before {
    content: '';

    width: 4px;
    height: 19px;

    border-radius: 999px;

    background: var(--primary-color, #3b82f6);
}

.plan-product-variants {
    list-style: none;

    padding: 0;
    margin: 0;

    display: flex;
    flex-wrap: wrap;

    gap: 9px;
}

.plan-product-variants > li {
    padding: 0 !important;
    margin: 0 !important;
}

.plan-variant-label {
    position: relative;

    display: block;

    margin: 0;

    cursor: pointer;
}

.plan-variant-label .variant-selector {
    position: absolute;

    opacity: 0;

    pointer-events: none;
}

.plan-ui-varint-style {
    min-width: 84px;
    min-height: 43px;

    padding: 9px 15px !important;

    display: inline-flex;

    align-items: center;
    justify-content: center;

    gap: 7px;

    color: #475569;

    background: #fff;

    border: 1px solid #dfe7f0;
    border-radius: 11px;

    box-shadow: none !important;

    font-size: 13px;
    line-height: 1.6;

    font-weight: 700;

    cursor: pointer;

    transition:
        color 0.18s ease,
        background 0.18s ease,
        border-color 0.18s ease,
        box-shadow 0.18s ease,
        transform 0.18s ease;
}

.plan-variant-label:hover .plan-ui-varint-style {
    color: var(--primary-color);

    background: #eff6ff;

    border-color: var(--primary-color);

    transform: translateY(-1px);
}

.variant-selector:checked + .plan-ui-varint-style {
    color: var(--primary-color);

    background: #eff6ff;

    border-color: var(--primary-color);

    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.09) !important;
}

.variant-selector:focus-visible + .plan-ui-varint-style {
    outline: 2px solid rgba(59, 130, 246, 0.35);

    outline-offset: 2px;
}

.plan-color-dot {
    width: 18px;
    height: 18px;

    flex: 0 0 18px;

    border-radius: 50%;

    border: 2px solid #fff;

    outline: 1px solid #cbd5e1;
}

/* =========================================================
                   PRICE
                ========================================================= */

.plan-price-box {
    margin-top: 28px;

    padding: 18px 20px;

    display: flex;

    align-items: center;
    justify-content: space-between;

    gap: 15px;

    background: linear-gradient(135deg, #f8fafc, #f0f7ff);

    border: 1px solid #e2ecf8;
    border-radius: 16px;
}

.plan-price-label {
    color: #64748b;

    font-size: 13px;
    font-weight: 700;
}

.plan-price-values {
    display: flex;

    align-items: baseline;
    flex-wrap: wrap;

    gap: 9px;
}

.plan-price-values .price {
    color: #0f172a;

    font-size: 22px;
    font-weight: 900;
}

.plan-price-values del {
    color: #ef4444 !important;

    font-size: 13px;
}

/* =========================================================
                   PURCHASE AREA
                ========================================================= */

.plan-buy-area {
    margin-top: auto;

    padding-top: 28px;

    display: flex;

    align-items: flex-end;
    justify-content: space-between;

    gap: 16px;
}

.plan-quantity-box > span {
    display: block;

    margin-bottom: 7px;

    color: #64748b;

    font-size: 12px;
    font-weight: 700;
}

.plan-buy-area .number-input {
    border: 1px solid #e2e8f0;
    border-radius: 12px;

    overflow: hidden;

    background: #fff;
}

.plan-add-to-cart {
    min-height: 50px;

    display: inline-flex;

    align-items: center;
    justify-content: center;

    gap: 9px;

    border: 0;
    border-radius: 13px;

    font-size: 14px;
    font-weight: 800;

    transition:
        transform 0.18s ease,
        box-shadow 0.18s ease;
}

.plan-add-to-cart:hover {
    transform: translateY(-2px);

    box-shadow: 0 12px 26px rgba(59, 130, 246, 0.22);
}

.plan-add-to-cart img {
    width: 21px;
    height: 21px;

    object-fit: contain;
}

/* =========================================================
                   RELATED PRODUCTS
                ========================================================= */

.plan-related-products {
    margin-top: 30px;

    padding: 24px;

    background: #fff;

    border: 1px solid #e7edf5;
    border-radius: 20px;

    box-shadow: 0 14px 45px rgba(15, 23, 42, 0.045);
}

.plan-related-products .section-title {
    margin-bottom: 18px;
}

/* =========================================================
                   RESPONSIVE
                ========================================================= */

@media (max-width: 991px) {
    .plan-product-shell {
        grid-template-columns: 1fr;
    }

    .plan-product-media {
        min-height: auto;

        padding: 28px;

        border-left: 0;
        border-bottom: 1px solid #edf2f7;
    }

    .plan-product-image-box {
        max-width: 440px;
    }

    .plan-product-info {
        min-height: auto;

        padding: 30px;
    }
}

@media (max-width: 576px) {
    .plan-page {
        padding-top: 14px;
    }

    .plan-product-shell {
        border-radius: 18px;
    }

    .plan-product-media {
        padding: 18px;
    }

    .plan-product-badge {
        top: 14px;
        right: 14px;
    }

    .plan-product-image-box {
        padding: 15px;

        border-radius: 16px;
    }

    .plan-product-info {
        padding: 22px 18px;
    }

    .plan-product-title h1 {
        font-size: 20px;
    }

    .plan-product-variants {
        display: grid;

        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .plan-ui-varint-style {
        width: 100%;

        min-width: 0;
        min-height: 45px;
    }

    .plan-price-box {
        flex-direction: column;
        align-items: flex-start;
    }

    .plan-price-values .price {
        font-size: 19px;
    }

    .plan-buy-area {
        flex-direction: column;
        align-items: stretch;
    }

    .plan-quantity-box,
    .plan-add-to-cart {
        width: 100%;
    }

    .plan-add-to-cart {
        min-height: 52px;
    }
}
