/* ============================================
   modal.css — Product Details Modal
   ============================================ */

.product-modal-overlay {
    position: fixed;
    inset: 0;
    background-color: rgba(17, 24, 39, 0.55);
    z-index: 1300;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease;
}
.product-modal-overlay.open {
    opacity: 1;
    visibility: visible;
}

.product-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.95);
    width: 480px;
    max-width: calc(100vw - 32px);
    max-height: calc(100vh - 32px);
    background-color: #FFFFFF;
    z-index: 1310;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease, transform 0.25s ease;
}
.product-modal.open {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, -50%) scale(1);
}

.product-modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 36px;
    height: 36px;
    background-color: rgba(255, 255, 255, 0.92);
    border: none;
    border-radius: 50%;
    color: #374151;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
    transition: background-color 0.2s, color 0.2s;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}
.product-modal-close:hover {
    background-color: #F3F4F6;
    color: #111827;
}
[dir="rtl"] .product-modal-close {
    right: auto;
    left: 12px;
}

.product-modal-image-wrap {
    width: 100%;
    aspect-ratio: 4 / 3;
    background-color: #F8F8F8;
    overflow: hidden;
    flex-shrink: 0;
}
.product-modal-image-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.product-modal-body {
    padding: 20px 22px 22px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    overflow-y: auto;
    flex: 1;
}
.product-modal-title {
    font-family: 'Poppins', sans-serif;
    font-size: 20px;
    font-weight: 700;
    color: #111827;
    margin: 0;
    line-height: 1.3;
    padding-right: 40px;
}
[dir="rtl"] .product-modal-title {
    padding-right: 0;
    padding-left: 40px;
}
.product-modal-price {
    font-family: 'Poppins', sans-serif;
    font-size: 22px;
    font-weight: 700;
    color: #10B981;
    direction: ltr;
    text-align: start;
}
.product-modal-description {
    font-family: 'Poppins', sans-serif;
    font-size: 14px;
    line-height: 1.6;
    color: #4B5563;
    margin: 0;
    white-space: pre-wrap;
    word-wrap: break-word;
}
.product-modal-description:empty {
    display: none;
}
.product-modal-model {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-family: 'Poppins', sans-serif;
    font-size: 12px;
    font-weight: 500;
    color: #6B7280;
    background: #F3F4F6;
    border: 1px solid #E5E7EB;
    border-radius: 20px;
    padding: 2px 10px;
    margin-bottom: 4px;
}
.product-modal-model::before {
    content: "\f4d5";
    font-family: 'Bootstrap Icons';
    font-size: 11px;
    color: #9CA3AF;
}
.product-modal-note-label {
    font-family: 'Poppins', sans-serif;
    font-size: 13px;
    font-weight: 600;
    color: #374151;
    margin-top: 4px;
}
.product-modal-note {
    width: 100%;
    min-height: 80px;
    padding: 10px 12px;
    border: 1px solid #E5E7EB;
    border-radius: 10px;
    background-color: #F8F8F8;
    font-family: 'Poppins', sans-serif;
    font-size: 14px;
    color: #111827;
    resize: vertical;
    transition: border-color 0.2s, background-color 0.2s;
    box-sizing: border-box;
}
.product-modal-note:focus {
    outline: none;
    border-color: #10B981;
    background-color: #FFFFFF;
}
.product-modal-add-btn {
    width: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

/* Share button in modal — matches product.php styling */
.product-modal-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 12px;
}

.product-modal-actions .product-modal-add-btn,
.product-modal-actions .product-share-btn {
    width: 100%;
    min-height: 48px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 16px;
    font-weight: 600;
    font-family: 'Poppins', sans-serif;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.2s, border-color 0.2s, color 0.2s;
}

/* Specific styling for Share Button (Secondary action) */
.product-modal-actions .product-share-btn {
    color: #374151;
    background-color: #FFFFFF;
    border: 1px solid #E5E7EB;
}

.product-modal-actions .product-share-btn:hover {
    background-color: #F8F8F8;
}

.product-modal-actions .product-share-btn.copied {
    color: #10B981;
    border-color: #10B981;
}

@media (max-width: 480px) {
    .product-modal {
        width: calc(100vw - 24px);
        max-height: calc(100vh - 24px);
    }
    .product-modal-title {
        font-size: 18px;
    }
    .product-modal-price {
        font-size: 20px;
    }
}
