/* ════════════════════════════════════
   PROFILE PAGE
   ════════════════════════════════════ */

.profile-page {
    padding-top: 60px; /* ارتفاع navbar موبایل */
    min-height: 100vh;
    background: var(--cream);
}

/* ── Banner ── */
.profile-banner {
    position: relative;
    width: 100%;
    height: 180px;
    overflow: hidden;
    background: linear-gradient(135deg, var(--brown-dark), var(--brown));
}

.profile-banner-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.profile-banner-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to bottom,
        transparent 40%,
        rgba(44, 26, 10, 0.55) 100%
    );
}

/* ── Card Wrap ── */
.profile-card-wrap {
    max-width: 860px;
    margin: 0 auto;
    padding: 0 1rem;
}

.profile-card {
    background: var(--warm-white);
    border-radius: 20px;
    border: 1px solid var(--border);
    padding: 0 1.25rem 1.5rem;
    margin-top: -40px;
    position: relative;
    box-shadow: 0 4px 24px rgba(92, 61, 30, 0.09);
}

/* ── Avatar ── */
.profile-avatar-wrap {
    position: relative;
    display: inline-block;
    margin-top: -44px;
    margin-bottom: 0.75rem;
}

.profile-avatar {
    width: 88px;
    height: 88px;
    border-radius: 50%;
    border: 4px solid var(--warm-white);
    object-fit: cover;
    display: block;
    box-shadow: 0 4px 16px rgba(92, 61, 30, 0.18);
    background: var(--cream);
}

.profile-badge {
    position: absolute;
    bottom: 4px;
    left: 0;
    width: 22px;
    height: 22px;
    background: var(--gold);
    color: #fff;
    border-radius: 50%;
    font-size: 0.65rem;
    font-weight: 800;
    display: grid;
    place-items: center;
    border: 2px solid var(--warm-white);
}

/* ── Info ── */
.profile-name-row {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex-wrap: wrap;
    margin-bottom: 0.4rem;
}

.profile-name {
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--brown-dark);
    line-height: 1.3;
}

.profile-type-tag {
    font-size: 0.7rem;
    font-weight: 600;
    background: rgba(201, 168, 76, 0.15);
    color: var(--gold-dark);
    border: 1px solid rgba(201, 168, 76, 0.3);
    border-radius: 20px;
    padding: 0.15rem 0.6rem;
    white-space: nowrap;
}

/* ── Rating ── */
.profile-meta-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 0.75rem;
}

.profile-rating {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.stars {
    color: var(--gold);
    font-size: 0.9rem;
    letter-spacing: 1px;
}

.rating-val {
    font-weight: 700;
    font-size: 0.875rem;
    color: var(--brown-dark);
}

.rating-count {
    font-size: 0.78rem;
    color: var(--text-muted);
}

.profile-rank {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--brown);
    background: rgba(92, 61, 30, 0.07);
    padding: 0.2rem 0.65rem;
    border-radius: 20px;
}

/* ── Bio ── */
.profile-bio {
    font-size: 0.875rem;
    line-height: 1.7;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

/* ── Details ── */
.profile-details {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    margin-bottom: 1rem;
}

.profile-detail-item {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    font-size: 0.82rem;
    color: var(--text-muted);
}

.detail-icon {
    flex-shrink: 0;
    margin-top: 1px;
}

.profile-link {
    color: var(--gold-dark);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

.profile-link:hover {
    color: var(--brown);
    text-decoration: underline;
}

/* ── Socials ── */
.profile-socials {
    display: flex;
    gap: 0.6rem;
    flex-wrap: wrap;
    margin-bottom: 1.25rem;
}

.profile-social {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 1.5px solid var(--border);
    background: var(--cream);
    display: grid;
    place-items: center;
    color: var(--brown-light);
    transition: all 0.2s;
    text-decoration: none;
}

.profile-social svg {
    width: 17px;
    height: 17px;
}

.profile-social:hover {
    border-color: var(--gold);
    color: var(--gold-dark);
    background: rgba(201, 168, 76, 0.08);
    transform: translateY(-2px);
}

/* ── Actions ── */
.profile-actions {
    display: flex;
    gap: 0.6rem;
}

.profile-actions button {
    flex: 1;
    padding: 0.6rem 0.5rem;
    border-radius: 10px;
    font-family: "Vazirmatn", sans-serif;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
}

.btn-contact {
    background: linear-gradient(135deg, var(--gold), #a8751e);
    color: #fff;
    box-shadow: 0 3px 12px rgba(201, 168, 76, 0.35);
}

.btn-contact:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(201, 168, 76, 0.45);
}

.btn-save,
.btn-share {
    background: var(--cream);
    color: var(--brown);
    border: 1.5px solid var(--border) !important;
}

.btn-save:hover,
.btn-share:hover {
    background: rgba(201, 168, 76, 0.1);
    border-color: var(--gold) !important;
}

/* ════ TABS ════ */
.profile-tabs-wrap {
    max-width: 860px;
    margin: 1.25rem auto 0;
    padding: 0 1rem;
    position: sticky;
    top: 60px;
    z-index: 50;
    background: var(--cream);
    padding-bottom: 0;
}

.profile-tabs {
    display: flex;
    border-bottom: 2px solid var(--border);
    gap: 0;
}

.tab-btn {
    flex: 1;
    padding: 0.8rem 0.5rem;
    background: none;
    border: none;
    border-bottom: 2.5px solid transparent;
    margin-bottom: -2px;
    font-family: "Vazirmatn", sans-serif;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s;
}

.tab-btn:hover {
    color: var(--brown);
}

.tab-btn.active {
    color: var(--brown-dark);
    border-bottom-color: var(--gold);
}

/* ════ TAB PANELS ════ */
.tab-contents {
    max-width: 860px;
    margin: 0 auto;
    padding: 1.25rem 1rem 3rem;
}

.tab-panel {
    display: block;
}

.tab-panel[hidden] {
    display: none;
}

/* ── Products Grid ── */
.products-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.85rem;
}

.product-card {
    background: var(--warm-white);
    border-radius: 14px;
    border: 1px solid var(--border);
    overflow: hidden;
    transition:
        box-shadow 0.2s,
        transform 0.2s;
}

.product-card:hover {
    box-shadow: 0 6px 24px rgba(92, 61, 30, 0.12);
    transform: translateY(-2px);
}

.product-img-wrap {
    position: relative;
    aspect-ratio: 4/3;
    overflow: hidden;
    background: var(--cream);
}

.product-img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s;
}

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

.product-badge-new,
.product-badge-sale {
    position: absolute;
    top: 8px;
    right: 8px;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 0.2rem 0.5rem;
    border-radius: 6px;
}

.product-badge-new {
    background: var(--gold);
    color: #fff;
}

.product-badge-sale {
    background: var(--red);
    color: #fff;
}

.product-info {
    padding: 0.75rem;
}

.product-info h3 {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--brown-dark);
    margin-bottom: 0.25rem;
    line-height: 1.4;
}

.product-material {
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-bottom: 0.6rem;
}

.product-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.4rem;
    flex-wrap: wrap;
}

.product-price {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--brown);
    direction: ltr;
    unicode-bidi: embed;
}

.btn-inquire {
    font-family: "Vazirmatn", sans-serif;
    font-size: 0.72rem;
    font-weight: 600;
    padding: 0.3rem 0.65rem;
    background: linear-gradient(135deg, var(--gold), #a8751e);
    color: #fff;
    border: none;
    border-radius: 7px;
    cursor: pointer;
    transition: opacity 0.2s;
    white-space: nowrap;
}

.btn-inquire:hover {
    opacity: 0.85;
}

/* ── Reviews ── */
.reviews-wrap {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.rating-summary {
    background: var(--warm-white);
    border-radius: 16px;
    border: 1px solid var(--border);
    padding: 1.25rem;
    display: flex;
    gap: 1.5rem;
    align-items: center;
    flex-wrap: wrap;
}

.rating-big {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    min-width: 80px;
}

.rating-num {
    font-size: 2.5rem;
    font-weight: 900;
    color: var(--brown-dark);
    line-height: 1;
}

.rating-stars-big {
    color: var(--gold);
    font-size: 1rem;
    letter-spacing: 2px;
}

.rating-total {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.rating-bars {
    flex: 1;
    min-width: 160px;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.bar-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.bar-row > span:first-child {
    min-width: 28px;
    text-align: left;
    direction: ltr;
}

.bar-row > span:last-child {
    min-width: 32px;
}

.bar {
    flex: 1;
    height: 7px;
    background: var(--cream);
    border-radius: 4px;
    overflow: hidden;
}

.bar-fill {
    height: 100%;
    width: var(--w, 0%);
    background: linear-gradient(to left, var(--gold), var(--gold-light));
    border-radius: 4px;
}

.reviews-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.review-item {
    background: var(--warm-white);
    border-radius: 14px;
    border: 1px solid var(--border);
    padding: 1rem;
}

.review-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.65rem;
}

.review-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--gold-light), var(--brown-light));
    color: #fff;
    font-weight: 700;
    font-size: 1rem;
    display: grid;
    place-items: center;
    flex-shrink: 0;
}

.review-name {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--brown-dark);
}

.review-date {
    font-size: 0.72rem;
    color: var(--text-muted);
}

.review-stars {
    margin-right: auto;
    color: var(--gold);
    font-size: 0.85rem;
    letter-spacing: 1px;
}

.review-text {
    font-size: 0.84rem;
    line-height: 1.7;
    color: var(--text-muted);
}

/* ── Gallery ── */
.gallery-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

.gallery-item {
    position: relative;
    border-radius: 14px;
    overflow: hidden;
    aspect-ratio: 1;
    background: var(--cream);
    cursor: pointer;
}

.gallery-item--wide {
    grid-column: span 2;
    aspect-ratio: 16/9;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.35s;
}

.gallery-item:hover img {
    transform: scale(1.05);
}

.gallery-caption {
    position: absolute;
    bottom: 0;
    right: 0;
    left: 0;
    padding: 0.75rem 0.75rem 0.6rem;
    background: linear-gradient(
        to top,
        rgba(44, 26, 10, 0.7) 0%,
        transparent 100%
    );
    color: #fff;
    font-size: 0.78rem;
    font-weight: 600;
    opacity: 0;
    transform: translateY(4px);
    transition:
        opacity 0.25s,
        transform 0.25s;
}

.gallery-item:hover .gallery-caption {
    opacity: 1;
    transform: translateY(0);
}

/* ════ RESPONSIVE — DESKTOP ════ */
@media (min-width: 900px) {
    .profile-page {
        padding-top: 72px;
    }

    .profile-banner {
        height: 260px;
    }

    .profile-card {
        padding: 0 2rem 2rem;
        margin-top: -56px;
        display: grid;
        grid-template-columns: auto 1fr auto;
        grid-template-rows: auto auto;
        column-gap: 1.5rem;
    }

    .profile-avatar-wrap {
        grid-column: 1;
        grid-row: 1 / 3;
        margin-top: -56px;
        align-self: start;
    }

    .profile-avatar {
        width: 110px;
        height: 110px;
    }

    .profile-info {
        grid-column: 2;
        grid-row: 1 / 3;
        padding-top: 0.5rem;
    }

    .profile-actions {
        grid-column: 3;
        grid-row: 1;
        flex-direction: column;
        align-self: start;
        padding-top: 0.5rem;
        min-width: 120px;
    }

    .profile-actions button {
        flex: unset;
    }

    .profile-tabs-wrap {
        top: 72px;
    }

    .products-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .gallery-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .gallery-item--wide {
        grid-column: span 2;
    }
}
