:root {
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --bg: #f8fafc;
    --card: #ffffff;
    --text: #111827;
    --muted: #6b7280;
    --border: #e5e7eb;
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 18px 60px rgba(0, 0, 0, 0.18);
    --radius: 18px;
    --radius-md: 14px;
    --radius-sm: 12px;
    --transition: 0.2s ease;
}

/* =========================
   PROFILE PAGE
========================= */
.profile-page {
    max-width: 1200px;
    margin: 30px auto;
    padding: 0 20px;
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 24px;
    direction: rtl;
    align-items: start;
}

.profile-sidebar {
    background: var(--card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 22px;
    height: fit-content;
}

.profile-user-box {
    text-align: center;
    margin-bottom: 22px;
}

.profile-avatar {
    width: 72px;
    height: 72px;
    margin: 0 auto 12px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--primary-hover));
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    font-weight: 700;
}

.profile-user-box h3 {
    font-size: 18px;
    margin: 0 0 6px;
    color: var(--text);
}

.profile-user-box p {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
}

.profile-menu {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.menu-item,
.logout-link {
    width: 100%;
    text-align: right;
    border: 1px solid transparent;
    background: #f9fafb;
    color: #374151;
    padding: 13px 14px;
    border-radius: 12px;
    font-size: 14px;
    cursor: pointer;
    text-decoration: none;
    transition: var(--transition);
}

.menu-item:hover,
.logout-link:hover {
    background: #eff6ff;
    color: var(--primary);
    border-color: #dbeafe;
}

.menu-item.active {
    background: var(--primary);
    color: #fff;
}

.profile-content {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.profile-card {
    display: none;
    background: var(--card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 24px;
}

.profile-card.active {
    display: block;
}

.card-header,
.modal-header,
.info-item-row,
.address-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
}

.card-header {
    margin-bottom: 20px;
}

.card-header h2,
.section-simple-header h2 {
    font-size: 22px;
    margin: 0;
    color: var(--text);
}

.card-subtitle,
.modal-subtitle {
    margin: 6px 0 0;
    color: var(--muted);
    font-size: 13px;
}

/* دکمه ویرایش اطلاعات */
.btn-edit-trigger {
    position: relative;
    z-index: 5;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px;
    border: 1px solid #bfdbfe !important;
    background: #eff6ff !important;
    color: #1d4ed8 !important;
    opacity: 1 !important;
    visibility: visible !important;
    filter: none !important;
    transform: none;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.08);
    transition:
        background-color 0.2s ease,
        border-color 0.2s ease,
        color 0.2s ease,
        box-shadow 0.2s ease,
        transform 0.2s ease;
}

.btn-edit-trigger:hover {
    background: #2563eb !important;
    border-color: #2563eb !important;
    color: #ffffff !important;
    opacity: 1 !important;
    visibility: visible !important;
    filter: none !important;
    transform: translateY(-2px);
    box-shadow: 0 8px 18px rgba(37, 99, 235, 0.24);
}

.btn-edit-trigger:focus,
.btn-edit-trigger:focus-visible,
.btn-edit-trigger:active {
    background: #1d4ed8 !important;
    border-color: #1d4ed8 !important;
    color: #ffffff !important;
    opacity: 1 !important;
    visibility: visible !important;
    filter: none !important;
    outline: none;
    transform: translateY(0);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.18);
}


/* =========================
   INFO / BADGES / EMPTY
========================= */
.info-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.info-item-row {
    padding: 16px;
    background: #f9fafb;
    border-radius: 14px;
    gap: 18px;
}

.info-label {
    display: block;
    color: var(--muted);
    font-size: 13px;
    margin-bottom: 5px;
}

.info-value {
    color: var(--text);
    font-size: 15px;
}

.badge {
    display: inline-block;
    padding: 7px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
}

.badge-success { background: #d1fae5; color: #065f46; }
.badge-danger { background: #fee2e2; color: #991b1b; }
.badge-warning { background: #fef3c7; color: #92400e; }

.empty-state {
    background: #f9fafb;
    border: 1px dashed #d1d5db;
    padding: 18px;
    border-radius: 14px;
    color: var(--muted);
    text-align: center;
    font-size: 14px;
}

/* =========================
   MODAL
========================= */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(17, 24, 39, 0.55);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 20px;
}

.modal-overlay.active {
    display: flex;
}

.modal-container {
    width: 100%;
    max-width: 520px;
    background: var(--card);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.address-modal-width {
    max-width: 760px;
}

.modal-header {
    align-items: flex-start;
    padding: 20px 22px;
    border-bottom: 1px solid var(--border);
}

.modal-header h3 {
    margin: 0;
    font-size: 20px;
    color: var(--text);
}

.modal-close-btn {
    width: 38px;
    height: 38px;
    flex: 0 0 auto;
    border-radius: 10px;
    border: none;
    background: #f3f4f6;
    color: #374151;
    font-size: 24px;
    cursor: pointer;
    transition: var(--transition);
}

.modal-close-btn:hover {
    background: #e5e7eb;
}

.modal-body {
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}

.modal-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-size: 14px;
    color: #374151;
    font-weight: 600;
}

.modal-input,
.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    border: 1px solid #d1d5db;
    border-radius: 12px;
    padding: 12px 14px;
    font-family: inherit;
    font-size: 14px;
    outline: none;
    background: #fff;
    box-sizing: border-box;
    transition: border-color var(--transition), box-shadow var(--transition);
}

.modal-input:focus,
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.08);
}

.modal-input-ltr {
    direction: ltr;
    text-align: left;
}

.birth-date-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.modal-actions,
.form-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    flex-wrap: wrap;
    margin-top: 6px;
}

.btn-cancel,
.btn-submit,
.btn {
    border: none;
    border-radius: 12px;
    padding: 11px 16px;
    cursor: pointer;
    font-weight: 700;
    font-family: inherit;
    transition: var(--transition);
}

.btn-cancel,
.btn.btn-secondary {
    background: #e5e7eb;
    color: #111827;
}

.btn-submit,
.btn.btn-primary {
    background: var(--primary);
    color: #fff;
}

.btn-cancel:hover,
.btn-submit:hover,
.btn.btn-secondary:hover,
.btn.btn-primary:hover {
    opacity: 0.92;
}

/* =========================
   ADDRESSES
========================= */
.addresses-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 15px;
}

.address-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-top: 1rem;
}

.add-address-card,
.address-card {
    background: #fff;
    border-radius: 14px;
    transition: all 0.25s ease;
}

.add-address-card {
    border: 2px dashed #d1d5db;
    padding: 16px 20px;
    cursor: pointer;
    background-color: #f9fafb;
}

.add-address-card:hover {
    border-color: #3b82f6;
    background-color: #eff6ff;
}

.add-address-card .card-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.add-address-card .add-text {
    font-size: 15px;
    font-weight: 600;
    color: #4b5563;
    transition: color 0.2s;
}

.add-address-card:hover .add-text {
    color: var(--primary);
}

.add-address-card .plus-icon {
    font-size: 22px;
    font-weight: 500;
    color: #6b7280;
    background-color: #e5e7eb;
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.25s ease-in-out;
}

.add-address-card:hover .plus-icon {
    background-color: #3b82f6;
    color: #fff;
    transform: rotate(90deg);
}

.address-card {
    border: 1px solid #e2e8f0;
    padding: 1.5rem;
    position: relative;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.address-card:hover {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    border-color: #cbd5e1;
}

.address-card.is-default {
    border: 2px solid #3b82f6;
    background-color: #eff6ff;
}

.address-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #1e293b;
}

.badge-default {
    background-color: #3b82f6;
    color: #fff;
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    border-radius: 9999px;
}

.address-details {
    font-size: 0.9rem;
    color: #475569;
    line-height: 1.6;
    margin-bottom: 1rem;
}

.address-actions {
    display: flex;
    gap: 0.75rem;
    border-top: 1px solid #f1f5f9;
    padding-top: 1rem;
    margin-top: auto;
}

/* =========================
   MAP
========================= */
.map-section {
    margin-bottom: 15px;
    text-align: right;
}

.section-title {
    font-size: 14px;
    font-weight: 700;
    color: #374151;
    margin-bottom: 8px;
}

#address-map-container,
#map-container {
    width: 100%;
    height: 320px;
    background: #f3f4f6;
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    margin-bottom: 15px;
    position: relative;
    z-index: 1;
}

.custom-map-marker {
    background-color: #ff5a5f;
    border: 3px solid #fff;
    border-radius: 50% 50% 50% 0;
    transform: rotate(-45deg);
    width: 20px;
    height: 20px;
    position: absolute;
    left: 50%;
    top: 50%;
    margin-left: -10px;
    margin-top: -10px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.custom-map-marker::after {
    content: '';
    width: 6px;
    height: 6px;
    margin: 4px 0 0 4px;
    background: #fff;
    position: absolute;
    border-radius: 50%;
}

/* جلوگیری از اسکرول پشت مودال */
body.modal-open {
    overflow: hidden;
}

/* =========================
   CART TOAST
========================= */
#cart-toast-container {
    position: fixed;
    top: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(-120%);
    z-index: 10000;
    width: 90%;
    max-width: 380px;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
    padding: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    opacity: 0;
    visibility: hidden;
    direction: rtl;
    border-top: 4px solid #ef4056;
}

#cart-toast-container.show {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

#cart-toast-container.error {
    border-top-color: #ff9800;
}

#cart-toast-container.error .toast-subtitle {
    color: #ff9800;
}

.toast-content {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.toast-img {
    width: 50px;
    height: 50px;
    border-radius: 8px;
    object-fit: cover;
    background: #f8f8f8;
    flex: 0 0 auto;
}

.toast-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.toast-title {
    font-size: 13px;
    font-weight: 700;
    color: #333;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.toast-subtitle {
    font-size: 11px;
    color: #28a745;
    margin-top: 4px;
}

.toast-btn {
    background-color: #ef4056;
    color: #fff !important;
    text-decoration: none;
    font-size: 11px;
    font-weight: 700;
    padding: 8px 12px;
    border-radius: 8px;
    white-space: nowrap;
    transition: var(--transition);
    flex: 0 0 auto;
}

.toast-btn:hover {
    background-color: #d83044;
}
/* =========================
   RESPONSIVE
========================= */
@media (max-width: 992px) {
    .profile-page {
        display: flex;
        flex-direction: column;
        gap: 16px;
        padding: 10px;
        margin: 10px auto;
        width: 100%;
        grid-template-columns: 1fr;
    }

    .profile-sidebar {
        order: 1;
        width: 100%;
        box-sizing: border-box;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
    }

    .profile-content {
        order: 2;
        width: 100%;
    }

    .profile-avatar {
        width: 85px;
        height: 85px;
        font-size: 32px;
    }

    .menu-item,
    .logout-link {
        padding: 16px;
        font-weight: 500;
    }
}

@media (max-width: 768px) {
    .modal-overlay {
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 16px;
    }

    .modal-container,
    .address-modal-width {
        width: 100%;
        max-width: 100%;
        height: auto;
        max-height: calc(100vh - 32px);
        margin: 0;
        border-radius: 20px;
        overflow: hidden;
    }

    .modal-body {
        padding: 15px;
        padding-bottom: 80px;
        overflow-y: auto;
        overscroll-behavior: contain;
        -webkit-overflow-scrolling: touch;
    }

    #address-map-container,
    #map-container {
        height: 200px;
        margin-bottom: 12px;
    }
}


/* ===========================================================
                پیام تایید یا ارور پروفایل
============================================================== */

.site-toast-container {
    position: fixed;
    top: 24px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 99999;
    width: min(420px, calc(100% - 28px));
    direction: rtl;
    pointer-events: none;
}

.site-toast {
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 68px;
    padding: 18px 22px 22px;
    border-radius: 14px;
    color: #ffffff;
    text-align: center;
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0)),
        linear-gradient(135deg, #16a34a 0%, #15803d 100%);
    border: 1px solid rgba(255, 255, 255, 0.24);
    box-shadow:
        0 18px 38px rgba(21, 128, 61, 0.28),
        0 8px 18px rgba(15, 23, 42, 0.14);
    animation: site-toast-life 5s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.site-toast::before {
    content: "";
    width: 30px;
    height: 30px;
    flex: 0 0 30px;
    margin-left: 12px;
    border-radius: 50%;
    background:
        radial-gradient(circle at center, #ffffff 0 34%, transparent 35%),
        rgba(255, 255, 255, 0.18);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.22);
}

.site-toast::after {
    content: "";
    position: absolute;
    top: -40%;
    right: -18%;
    width: 150px;
    height: 150px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
}

.site-toast-content {
    position: relative;
    z-index: 1;
    font-size: 15px;
    font-weight: 800;
    line-height: 1.8;
    color: #ffffff;
}

.site-toast-progress {
    position: absolute;
    right: 0;
    bottom: 0;
    width: 115%;
    height: 5px;
    background: linear-gradient(90deg, #ef4444, #b91c1c);
    transform-origin: left center;
    animation: site-toast-progress 5s linear forwards;
}

@keyframes site-toast-life {
    0% {
        opacity: 0;
        transform: translateY(-22px) scale(0.96);
    }

    9% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }

    84% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }

    100% {
        opacity: 0;
        transform: translateY(-18px) scale(0.98);
        visibility: hidden;
    }
}

@keyframes site-toast-progress {
    from {
        transform: scaleX(1);
    }

    to {
        transform: scaleX(0);
    }
}

@media (max-width: 576px) {
    .site-toast-container {
        top: 14px;
        width: calc(100% - 24px);
    }

    .site-toast {
        min-height: 62px;
        padding: 15px 16px 19px;
        border-radius: 12px;
    }

    .site-toast::before {
        width: 26px;
        height: 26px;
        flex-basis: 26px;
        margin-left: 10px;
    }

    .site-toast-content {
        font-size: 14px;
    }
}
.add-address-card.is-disabled {
    opacity: 0.5;
    pointer-events: none;
    cursor: not-allowed;
}
.modal-input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 8px;
    background-color: #fff;
    display: block;
}
.product-action-cubes {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    width: 100%;
    margin-top: 15px;
}

.action-cube {
    aspect-ratio: 1 / 1;
    min-width: 0;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    background: #ffffff;
    color: #4b5563;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.action-cube svg {
    width: 21px;
    height: 21px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.action-cube:hover {
    color: #ef4056;
    border-color: #ef4056;
    background: #fff7f8;
    transform: translateY(-2px);
}

.action-cube:active {
    transform: scale(0.95);
}

.wishlist-btn.active {
    color: #ef4056;
}

.wishlist-btn.active svg {
    fill: currentColor;
}



/* =========================================================
   چهار دکمه کنترل محصول
   ترتیب از چپ به راست: قلب | اشتراک‌گذاری | نمودار قیمت | مقایسه
========================================================= */
.product-action-cubes {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
    width: 100%;
    margin-top: 16px;
    direction: ltr;
}

.product-action-cubes .action-cube {
    display: flex;
    align-items: center;
    justify-content: center;
    aspect-ratio: 1 / 1;
    padding: 0;
    color: #374151;
    background: #fff;
    border: 1px solid #d4dbe3;
    border-radius: 7px;
    cursor: pointer;
    transition:
        color 0.2s ease,
        background-color 0.2s ease,
        border-color 0.2s ease,
        transform 0.2s ease,
        box-shadow 0.2s ease;
}

.product-action-cubes .action-cube svg {
    width: 24px;
    height: 24px;
    display: block;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
    pointer-events: none;
}

.product-action-cubes .action-cube:hover {
    color: #ef4056;
    background: #fff5f6;
    border-color: #ef4056;
    box-shadow: 0 5px 12px rgba(239, 64, 86, 0.12);
    transform: translateY(-2px);
}

.product-action-cubes .action-cube:active {
    transform: scale(0.96);
}

.product-action-cubes .wishlist-btn.is-active {
    color: #ef4056;
    background: #fff5f6;
    border-color: #ef4056;
}

.product-action-cubes .wishlist-btn.is-active svg,
.product-action-cubes .wishlist-btn.is-active svg path {
    fill: #ef4056;
    stroke: #ef4056;
}

.product-action-cubes .wishlist-btn.is-loading {
    opacity: 0.6;
    cursor: wait;
    pointer-events: none;
}

@keyframes heartBeat {
    0% { transform: scale(1); }
    50% { transform: scale(1.35); }
    100% { transform: scale(1); }
}

.product-action-cubes .wishlist-btn.is-active svg {
    animation: heartBeat 0.35s ease;
}
/* =========================================================
   MOBILE PRODUCT ACTIONS MENU
   فقط مخصوص منوی سه‌نقطه در موبایل
========================================================= */

/* در دسکتاپ منوی موبایل اصلاً دیده نشود */
.mobile-actions-menu-wrap {
    display: none;
}

/* دسکتاپ: چهار دکمهٔ اصلی بدون تغییر باقی می‌مانند */
.product-action-cubes-desktop {
    display: grid;
}

@media (max-width: 1024px) {
    .product-detail-page .add-to-cart-form .action-buttons-group {
        display: flex;
        width: 100%;
        gap: 10px;
        align-items: stretch;
    }

    /* سه نقطه: اندازه ثابت */
    .product-detail-page .add-to-cart-form .mobile-actions-menu-wrap {
        flex: 0 0 48px;
    }

    /* افزودن به سبد خرید: فضای بیشتر */
    .product-detail-page .add-to-cart-form .btn-buy {
        flex: 1.7 1 0;
        min-width: 0;
    }

    /* بازگشت: فضای کمتر */
    .product-detail-page .add-to-cart-form .btn-back {
        flex: 1 1 0;
        min-width: 0;
    }
    /* چهار دکمهٔ قدیمی در موبایل مخفی می‌شوند */
    .product-detail-page .product-action-cubes-desktop {
        display: none !important;
    }

    /* ظرف دکمه سه نقطه */
    .product-detail-page .mobile-actions-menu-wrap {
        display: block;
        position: relative;
        flex: 0 0 auto;
        z-index: 20;
    }

    /* دکمهٔ سه نقطه */
    .product-detail-page .mobile-actions-toggle {
        width: 48px;
        height: 48px;
        min-width: 48px;
        padding: 0;
        border: 1px solid #d4dbe3;
        border-radius: 10px;
        background: #ffffff;
        color: #374151;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        transition:
            color 0.2s ease,
            background-color 0.2s ease,
            border-color 0.2s ease,
            transform 0.2s ease,
            box-shadow 0.2s ease;
    }

    .product-detail-page .mobile-actions-toggle svg {
        width: 24px;
        height: 24px;
        fill: currentColor;
        pointer-events: none;
    }

    .product-detail-page .mobile-actions-toggle:hover,
    .product-detail-page .mobile-actions-toggle.is-open {
        color: #ef4056;
        background: #fff5f6;
        border-color: #ef4056;
        box-shadow: 0 5px 12px rgba(239, 64, 86, 0.12);
    }

    .product-detail-page .mobile-actions-toggle:active {
        transform: scale(0.95);
    }

    .product-detail-page .mobile-actions-toggle:focus-visible {
        outline: 3px solid rgba(239, 64, 86, 0.2);
        outline-offset: 2px;
    }

    /* منوی بازشونده */
    .product-detail-page .mobile-dropdown-menu {
        position: absolute;
        right: 0;
        bottom: calc(100% + 10px);
        width: 190px;
        padding: 7px;
        border: 1px solid #e5e7eb;
        border-radius: 13px;
        background: #ffffff;
        box-shadow: 0 14px 34px rgba(15, 23, 42, 0.18);
        display: none;
        flex-direction: column;
        gap: 3px;
        direction: rtl;
        z-index: 999;
    }

    .product-detail-page .mobile-dropdown-menu.is-visible {
        display: flex;
        animation: mobileActionsMenuIn 0.18s ease-out;
    }

    /* هر آیتم داخل منو */
    .product-detail-page .mobile-dropdown-action {
        width: 100%;
        min-height: 43px;
        padding: 9px 11px;
        border: 0;
        border-radius: 9px;
        background: transparent;
        color: #374151;
        display: flex;
        align-items: center;
        justify-content: flex-start;
        gap: 10px;
        font-family: inherit;
        font-size: 13px;
        font-weight: 600;
        text-align: right;
        cursor: pointer;
        transition:
            color 0.2s ease,
            background-color 0.2s ease;
    }

    .product-detail-page .mobile-dropdown-action:hover,
    .product-detail-page .mobile-dropdown-action:active {
        color: #ef4056;
        background: #fff5f6;
    }

    .product-detail-page .mobile-dropdown-action svg {
        width: 20px;
        height: 20px;
        flex: 0 0 20px;
        fill: none;
        stroke: currentColor;
        stroke-width: 1.8;
        stroke-linecap: round;
        stroke-linejoin: round;
        pointer-events: none;
    }

    /* قلب در وضعیت علاقه‌مندی */
    .product-detail-page .mobile-dropdown-action.is-wishlisted {
        color: #ef4056;
        background: #fff8f8;
    }

    .product-detail-page .mobile-dropdown-action.is-wishlisted .icon-heart,
    .product-detail-page .mobile-dropdown-action.is-wishlisted .icon-heart path {
        fill: currentColor;
        stroke: currentColor;
    }

    /*
      اگر action-buttons-group از قبل flex است،
      سه‌نقطه در RTL به دلیل اولین عنصر بودن، سمت راست دکمه خرید قرار می‌گیرد.
    */
    .product-detail-page .action-buttons-group {
        align-items: center;
    }
}

@keyframes mobileActionsMenuIn {
    from {
        opacity: 0;
        transform: translateY(7px) scale(0.97);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}





/* تنظیمات پایه دکمه‌ها */
.related-add-to-cart-btn,
.related-contact-btn {
    display: flex;
    flex-direction: row;        /* چیدمان قطعی در یک ردیف افقی */
    align-items: center;
    justify-content: center;
    gap: 6px;                   /* فاصله مناسب بین آیکون و متن */
    width: 100%;
    box-sizing: border-box;     /* جلوگیری از بیرون زدن عرض دکمه */
    padding: 10px 8px;          /* پدینگ بهینه شده تا فضای کافی وجود داشته باشد */
    border-radius: 10px;
    font-weight: 700;
    font-size: 0.85rem;         /* اندازه فونت متناسب */
    white-space: nowrap;        /* جلوگیری قطعی از شکستن متن به دو خط */
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    border: none;
    text-decoration: none;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}


/* استایل دکمه افزودن به سبد */
.related-add-to-cart-btn {
    background: #0f172a; /* رنگ سرمه‌ای تیره */
    color: #ffffff;
}

.related-add-to-cart-btn:hover {
    background: #1e293b;
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(15, 23, 42, 0.2);
}

/* استایل دکمه تماس */
.related-contact-btn {
    background: #f8fafc;
    color: #475569;
    border: 1px solid #e2e8f0;
}

.related-contact-btn:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
    color: #0f172a;
    transform: translateY(-2px);
}

/* حالت غیرفعال */
.related-add-to-cart-btn.disabled {
    background: #f1f5f9;
    color: #94a3b8;
    cursor: not-allowed;
    box-shadow: none;
    border: 1px solid #e2e8f0;
}

/* تنظیم اندازه آیکون‌ها */
.related-product-action svg {
    flex-shrink: 0;
}
/* تنظیمات پایه دکمه‌ها */
.related-add-to-cart-btn, .related-contact-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px; /* فاصله آیکون و متن */
    width: 100%;
    padding: 12px 16px;
    border-radius: 10px;
    font-weight: 700;
    font-size: 0.9rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    border: none;
    text-decoration: none;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

/* استایل دکمه افزودن به سبد */
.related-add-to-cart-btn {
    background: #0f172a; /* رنگ سرمه‌ای تیره */
    color: #ffffff;
}

.related-add-to-cart-btn:hover {
    background: #1e293b;
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(15, 23, 42, 0.2);
}

/* استایل دکمه تماس */
.related-contact-btn {
    background: #f8fafc;
    color: #475569;
    border: 1px solid #e2e8f0;
}

.related-contact-btn:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
    color: #0f172a;
    transform: translateY(-2px);
}

/* حالت غیرفعال */
.related-add-to-cart-btn.disabled {
    background: #f1f5f9;
    color: #94a3b8;
    cursor: not-allowed;
    box-shadow: none;
    border: 1px solid #e2e8f0;
}

/* تنظیم اندازه آیکون‌ها */
.related-product-action svg {
    flex-shrink: 0;
}
/* دکمه افزودن به سبد - تک‌خطی و متناسب */
.related-add-to-cart-btn {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex-direction: row !important; /* چینش افقی */
    gap: 8px !important;            /* فاصله بین آیکون و متن */
    width: 100% !important;
    min-height: 42px !important;
    padding: 8px 12px !important;
    white-space: nowrap !important; /* جلوگیری قطعی از رفتن به خط بعد */
    font-size: 0.85rem !important;   /* اندازه فونت متناسب با عرض کارت */
    font-weight: 700 !important;
    border-radius: 10px !important;
    border: none !important;
    background: #32679a !important; /* سرمه‌ای تیره */
    color: #ffffff !important;
    cursor: pointer !important;
    box-sizing: border-box !important;
    transition: all 0.25s ease !important;
}

/* آیکون داخل دکمه */
.related-add-to-cart-btn svg {
    flex-shrink: 0 !important;      /* جلوگیری از فشرده شدن آیکون */
    width: 17px !important;
    height: 17px !important;
}

/* متن داخل دکمه */
.related-add-to-cart-btn span {
    white-space: nowrap !important;
    line-height: 1 !important;
}

/* افکت هاور */
.related-add-to-cart-btn:hover {
    background: #1e293b !important;
    transform: translateY(-2px);
    box-shadow: 0 6px 14px rgba(15, 23, 42, 0.25);
}
/* Container اصلی اسلایدر محصولات */
.related-products-slider-wrap {
    display: flex;
    overflow-x: auto;
    scroll-behavior: smooth;
    cursor: grab;
    user-select: none;
    -webkit-user-select: none;
    -webkit-overflow-scrolling: touch;
}

/* حالت فعال هنگام درگ کردن */
/* کانتینر اسلایدر */
.related-products-slider-wrap {
    display: block;
    width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    cursor: grab;
    user-select: none;
    -webkit-user-select: none;
    scrollbar-width: none; /* مخفی کردن اسکرول‌بار در فایرفاکس */
}

.related-products-slider-wrap::-webkit-scrollbar {
    display: none; /* مخفی کردن اسکرول‌بار در کروم و اج */
}

.related-products-slider-wrap.is-dragging {
    cursor: grabbing !important;
}

/* جلوگیری قطعی از کشیده شدن فایل تصاویر و لینک‌ها با ماوس دسکتاپ */
.related-products-slider-wrap img,
.related-products-slider-wrap a {
    -webkit-user-drag: none !important;
    -webkit-user-select: none !important;
    user-select: none !important;
}
/* استایل دکمه تماس در حالت عادی */
.call-to-action-box,
.add-to-cart-btn.contact-btn {
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1) !important;
    position: relative;
    overflow: hidden;
    user-select: none;
}

/* افکت فوق‌العاده شیک و مدرن هنگام کپی موفقیت‌آمیز */
.copied-success {
    background: linear-gradient(135deg, #22c55e, #16a34a) !important;
    border-color: #16a34a !important;
    color: #ffffff !important;
    box-shadow: 0 4px 14px rgba(34, 197, 94, 0.38) !important;
    transform: scale(1.02);
}

/* چیدمان متن و آیکون */
.copied-success span,
.copied-success #btn-text,
.copied-success .btn-text {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

/* انیمیشن جهش و باز شدن آیکون تیک */
.copy-check-icon {
    animation: checkmarkPop 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
    vertical-align: middle;
}

@keyframes checkmarkPop {
    0% {
        transform: scale(0) rotate(-45deg);
        opacity: 0;
    }
    100% {
        transform: scale(1) rotate(0);
        opacity: 1;
    }
}
