/* Components: fullscreen modal styling and behaviors. */

/* استایل جدید برای مودال تمام صفحه */
.fullscreen-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--white);
    z-index: 2000;
    animation: slideUp 0.3s;
}

.account-route-shell-hidden {
    display: none !important;
}

body.account-route-page-active {
    overflow: auto;
}

#manageStoresModal.account-route-page {
    position: relative;
    inset: auto;
    width: 100%;
    min-height: 100vh;
    height: auto;
    z-index: auto;
    overflow: visible;
    animation: none;
    background-color: var(--light-gray);
}

@keyframes slideUp {
    from {transform: translateY(100%);}
    to {transform: translateY(0);}
}

.fullscreen-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    border: 1px solid rgba(255, 255, 255, 0.28);
    background: linear-gradient(135deg, rgba(32, 32, 36, 0.68), rgba(18, 18, 22, 0.58));
    backdrop-filter: blur(30px) saturate(180%) contrast(110%);
    -webkit-backdrop-filter: blur(30px) saturate(180%) contrast(110%);
    box-shadow: 0 10px 26px rgba(0, 0, 0, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.24);
    border-radius: 15px;
    margin: 10px 10px 0;
    position: sticky;
    top: 12px;
    z-index: 1200;
    isolation: isolate;
    overflow: hidden;
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
}

.fullscreen-modal-header.glass-header {
    background: linear-gradient(135deg, rgba(32, 32, 36, 0.68), rgba(18, 18, 22, 0.58)) !important;
    backdrop-filter: blur(30px) saturate(180%) contrast(110%) !important;
    -webkit-backdrop-filter: blur(30px) saturate(180%) contrast(110%) !important;
    box-shadow: 0 10px 26px rgba(0, 0, 0, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.24) !important;
    border: 1px solid rgba(255, 255, 255, 0.28) !important;
    border-radius: 15px !important;
}


.fullscreen-modal-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: #ffffff;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    white-space: nowrap;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

/* استایل جدید برای مودال تمام صفحه (ادامه) */
.back-button {
    background: transparent;
    border: none;
    font-size: 1.2rem;
    color: #ffffff;
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s;
}

.back-button:hover {
    background-color: transparent;
}

#manageStoresBackBtn,
#closeProductModal,
#closeStoreModal,
#closeAvatarPickerModal {
    border-radius: 0;
    color: #ffffff;
    padding: 0;
}

#manageStoresBackBtn svg,
#closeProductModal svg,
#closeStoreModal svg,
#closeAvatarPickerModal svg {
    width: 23px;
    height: 23px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.header-share-btn {
    width: 40px;
    height: 40px;
    box-shadow: none;
}

.header-share-btn.hidden {
    visibility: hidden;
    pointer-events: none;
}

.fullscreen-modal-content {
    padding: 20px;
    overflow-y: auto;
    height: calc(100% - 60px);
    position: relative;
    background: transparent;
}

.product-details-fullscreen {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.product-detail-image-container {
    text-align: center;
    margin-bottom: 20px;
    position: relative;
    border-radius: 0;
    overflow: visible;
    box-shadow: none;
    background: transparent;
}

.product-detail-image {
    max-width: 100%;
    max-height: 350px;
    object-fit: cover;
    border-radius: 0;
    box-shadow: none;
    display: block;
    margin: 0 auto;
}

.product-image-slider {
    position: relative;
    width: 100%;
}

.slider-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 34px;
    height: 34px;
    border: none;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.45);
    color: #fff;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    z-index: 2;
}

.slider-nav.prev {
    right: 10px;
}

.slider-nav.next {
    left: 10px;
}

.slider-dots {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-top: 10px;
}

.slider-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    border: none;
    background: #c8c8c8;
    cursor: pointer;
}

.slider-dot.active {
    background: var(--primary-color);
}

.product-detail-info h2 {
    margin-bottom: 15px;
    color: var(--text-color);
    font-size: 1.5rem;
    line-height: 1.4;
}

.product-detail-price {
    font-size: 1.4rem;
    font-weight: bold;
    color: var(--secondary-color);
    margin-bottom: 20px;
    display: inline-block;
    padding: 5px 15px;
    background-color: rgba(45, 206, 137, 0.1);
    border-radius: 20px;
}

.product-detail-description {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--medium-gray);
}

/* Fullscreen modals: glass header identical to product details header */
#manageStoresModal .fullscreen-modal-header,
#storeModal .fullscreen-modal-header,
#productModal .fullscreen-modal-header,
#shopProductModal .fullscreen-modal-header,
#productDetailsModal .fullscreen-modal-header,
#editProductModal .fullscreen-modal-header,
#storeDetailsModal .fullscreen-modal-header,
#avatarPickerModal .fullscreen-modal-header {
    position: sticky;
    top: 12px;
    left: auto;
    right: auto;
    margin: 10px 10px 0;
    z-index: 1200;
    padding: 15px;
    background: linear-gradient(135deg, rgba(32, 32, 36, 0.68), rgba(18, 18, 22, 0.58)) !important;
    backdrop-filter: blur(30px) saturate(180%) contrast(110%) !important;
    -webkit-backdrop-filter: blur(30px) saturate(180%) contrast(110%) !important;
    box-shadow: 0 10px 26px rgba(0, 0, 0, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.24) !important;
    border: 1px solid rgba(255, 255, 255, 0.28) !important;
    border-radius: 15px !important;
    isolation: isolate;
    overflow: hidden;
}

#manageStoresModal .fullscreen-modal-content,
#storeModal .fullscreen-modal-content,
#productModal .fullscreen-modal-content,
#shopProductModal .fullscreen-modal-content,
#productDetailsModal .fullscreen-modal-content,
#editProductModal .fullscreen-modal-content,
#storeDetailsModal .fullscreen-modal-content,
#avatarPickerModal .fullscreen-modal-content {
    padding: 94px 20px 20px;
    overflow-y: auto;
    height: calc(100% - 60px);
    position: relative;
    margin-top: -74px;
    background: transparent;
}

#manageStoresModal.account-route-page .fullscreen-modal-content {
    min-height: calc(100vh - 60px);
    height: auto;
    overflow: visible;
}

#shopProductModal {
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}

#shopProductModal .fullscreen-modal-content {
    margin-top: 0;
    height: auto;
    min-height: calc(100% - 92px);
    padding: 18px clamp(12px, 3vw, 46px) 24px;
    overflow: visible;
}

.product-detail-description h3 {
    font-size: 1.1rem;
    margin-bottom: 12px;
    color: var(--text-color);
}

.product-detail-description p {
    line-height: 1.7;
    color: var(--dark-gray);
    text-align: justify;
    white-space: pre-line;
    word-break: break-word;
}

.product-detail-store {
    margin-top: 18px;
    padding: 14px;
    border: 1px solid rgba(255, 255, 255, 0.28);
    border-radius: 15px;
    background: linear-gradient(135deg, rgba(32, 32, 36, 0.68), rgba(18, 18, 22, 0.58));
    backdrop-filter: blur(30px) saturate(180%) contrast(110%);
    -webkit-backdrop-filter: blur(30px) saturate(180%) contrast(110%);
    box-shadow: 0 10px 26px rgba(0, 0, 0, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.24);
    color: #ffffff;
}

.product-detail-store h3 {
    margin-bottom: 10px;
}

.product-store-link-btn {
    width: 100%;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(32, 32, 36, 0.62), rgba(18, 18, 22, 0.52));
    color: #ffffff;
    backdrop-filter: blur(20px) saturate(155%) contrast(108%);
    -webkit-backdrop-filter: blur(20px) saturate(155%) contrast(108%);
    padding: 8px 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9rem;
    box-shadow: 0 10px 22px rgba(0, 0, 0, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.22);
    transition: box-shadow 0.2s ease;
    font-family: inherit;
}

.product-jump-feedback-btn {
    width: auto;
    min-width: 0;
    flex: 0 0 auto;
    padding: 5px 9px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.72) !important;
    background: linear-gradient(135deg, rgba(32, 32, 36, 0.68), rgba(18, 18, 22, 0.58)) !important;
    backdrop-filter: blur(30px) saturate(180%) contrast(110%) !important;
    -webkit-backdrop-filter: blur(30px) saturate(180%) contrast(110%) !important;
    color: #ffffff;
    font-size: 0.76rem;
    font-weight: 700;
    box-shadow: 0 6px 16px rgba(31, 42, 97, 0.14), inset 0 1px 0 rgba(255, 255, 255, 0.85) !important;
    gap: 0;
    justify-content: center !important;
    align-items: center !important;
    text-align: center;
}

.product-jump-feedback-btn span {
    flex: 0 0 auto !important;
    text-align: center !important;
    width: auto;
}

.product-jump-feedback-btn i {
    display: none;
}

.product-jump-feedback-btn:hover {
    box-shadow: 0 5px 12px rgba(31, 42, 97, 0.14), inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

.product-store-link-btn:hover {
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.26), inset 0 1px 0 rgba(255, 255, 255, 0.28);
}

.product-store-link-btn:active {
    transform: none;
}

.product-store-link-btn span {
    flex: 1;
    text-align: right;
    color: inherit;
}

.product-store-link-btn .view-channel-logo {
    width: 18px;
    height: 18px;
    object-fit: contain;
    display: block;
}

.product-store-actions {
    display: flex;
    flex-direction: row;
    gap: 8px;
    flex-wrap: wrap;
}

.product-store-actions .product-store-link-btn {
    flex: 0 0 calc(50% - 4px);
}

.product-store-actions .product-store-link-btn i {
    margin-left: 4px;
}

.product-store-actions .product-store-chat-btn {
    flex: 1 0 100%;
    display: flex;
    background: linear-gradient(135deg, rgba(32, 32, 36, 0.62), rgba(18, 18, 22, 0.52));
    color: #ffffff;
    box-shadow: 0 10px 22px rgba(0, 0, 0, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.22);
    align-items: center;
    justify-content: center;
    direction: rtl;
    flex-direction: row;
    white-space: nowrap;
    position: relative;
    overflow: hidden;
    justify-content: center;
}

.product-store-actions .product-store-chat-btn span {
    flex: 0 0 auto;
    text-align: center;
}

.product-store-actions .product-store-chat-btn i {
    flex: 0 0 auto;
    margin: 0;
}

.product-store-actions .product-store-chat-btn .product-store-chat-avatar-bg {
    position: absolute;
    right: 27%;
    top: 50%;
    width: 28px;
    height: 28px;
    transform: translate(50%, -50%);
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(15, 118, 110, 0.2);
    opacity: 1;
    pointer-events: none;
    z-index: 0;
}

.product-store-actions .product-store-chat-btn .chat-btn-label {
    position: relative;
    z-index: 1;
    flex: 0 0 auto;
    text-align: center;
    padding: 0 12px;
}

.product-store-title-inline {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 10px;
    color: #ffffff;
}

.product-store-name-inline {
    color: #ffffff;
    font-weight: 700;
}

.channel-btn-icon {
    width: 18px;
    height: 18px;
    margin-left: 4px;
    display: inline-block;
    flex-shrink: 0;
}

.view-in-channel-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 30px;
    background: linear-gradient(135deg, rgba(32, 32, 36, 0.68), rgba(18, 18, 22, 0.58));
    color: #ffffff;
    padding: 13px 15px;
    border-radius: 12px;
    text-align: center;
    transition: all 0.3s;
    border: 1px solid rgba(255, 255, 255, 0.28);
    backdrop-filter: blur(30px) saturate(180%) contrast(110%);
    -webkit-backdrop-filter: blur(30px) saturate(180%) contrast(110%);
    cursor: pointer;
    width: 100%;
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 600;
    box-shadow: 0 10px 26px rgba(0, 0, 0, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.24);
}

.view-in-channel-btn:hover {
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.32), inset 0 1px 0 rgba(255, 255, 255, 0.28);
}

.view-in-channel-btn:disabled,
.view-in-channel-btn.is-unavailable {
    background: rgba(148, 163, 184, 0.18);
    color: #64748b;
    border-color: rgba(148, 163, 184, 0.36);
    box-shadow: none;
    cursor: not-allowed;
}

.view-in-channel-btn i {
    margin-left: 10px;
    font-size: 1.1rem;
}

.management-product-actions {
    position: sticky;
    bottom: 0;
    background: var(--white);
    padding-top: 14px;
}
