/* ============================================================
   MADELINE - SHARED PRODUCT DETAILS MODAL
   Uses the site's existing product-card (dark) palette so the
   modal feels like a natural extension of the products theme.
   ============================================================ */

.product-modal-open {
    overflow: hidden;
}

.product-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 2000;
    background: rgba(11, 15, 20, 0.7);
    backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;

    opacity: 0;
    visibility: hidden;
    transition: opacity 0.35s ease, visibility 0.35s ease;
}

.product-modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.product-modal {
    background: #111827;
    border: 1px solid #1f2937;
    border-radius: 18px;
    width: 100%;
    max-width: 760px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 30px 60px -15px rgba(0, 0, 0, 0.6);

    transform: translateY(24px) scale(0.97);
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.product-modal-overlay.active .product-modal {
    transform: translateY(0) scale(1);
}

/* Close button */
.product-modal-close {
    position: absolute;
    top: 14px;
    left: 14px;
    z-index: 5;
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 50%;
    background: rgba(15, 23, 42, 0.75);
    color: #e2e8f0;
    font-size: 1.1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.product-modal-close:hover {
    background: #dc2626;
    color: #fff;
    transform: rotate(90deg);
}

/* Body layout: image + info side by side */
.product-modal-body {
    display: grid;
    grid-template-columns: 1fr 1fr;
}

.product-modal-media {
    position: relative;
    min-height: 100%;
}

.product-modal-media img {
    width: 100%;
    height: 100%;
    min-height: 320px;
    object-fit: cover;
    display: block;
}

.product-modal-info {
    padding: 28px 24px;
    display: flex;
    flex-direction: column;
}

.product-modal-title {
    font-size: 1.7rem;
    font-weight: 800;
    color: #ffffff;
    margin-bottom: 14px;
}

.product-modal-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 22px;
}

.product-modal-pill {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: rgba(30, 41, 59, 0.7);
    border: 1px solid #1f2937;
    color: #bfdbfe;
    border-radius: 999px;
    padding: 7px 14px;
    font-size: 0.95rem;
}

.product-modal-pill i {
    color: #60a5fa;
}

.product-modal-desc {
    margin-bottom: 24px;
}

.product-modal-desc h4 {
    font-size: 1.05rem;
    color: #bfdbfe;
    margin-bottom: 10px;
}

.product-modal-desc p {
    color: #e2e8f0;
    line-height: 1.9;
    font-size: 0.98rem;
    word-break: break-word;
    white-space: pre-line;
}

.product-modal-desc-empty {
    color: #94a3b8;
    font-style: italic;
}

/* Order button (reuses .order-btn visual language) */
.product-modal .order-btn {
    width: 100%;
    padding: 13px 18px;
    background: #2563eb;
    color: #fff;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    font-family: Vazirmatn, sans-serif;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.product-modal .order-btn:hover {
    background: #1d4ed8;
    transform: translateY(-2px);
}

/* Responsive */
@media (max-width: 700px) {
    .product-modal-body {
        grid-template-columns: 1fr;
    }

    .product-modal-media img {
        min-height: 240px;
        max-height: 300px;
    }

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

    .product-modal-reviews {
        padding: 20px 16px;
    }

    .product-modal-footer {
        padding: 16px 16px 20px;
    }
}

/* ============================================================
   RATING SUMMARY + CUSTOMER REVIEWS (inside product modal)
   ============================================================ */

.madelline-stars {
    color: #fbbf24;
    letter-spacing: 2px;
    white-space: nowrap;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    gap: 2px;
}

.madelline-stars-empty {
    color: #64748b;
}

/* Rating summary block (title / meta / desc / rating) */
.product-modal-rating {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px 12px;
    background: rgba(30, 41, 59, 0.5);
    border: 1px solid #1f2937;
    border-radius: 12px;
    padding: 12px 16px;
    margin-bottom: 22px;
}

.product-modal-rating .madelline-stars {
    font-size: 1.15rem;
    letter-spacing: 3px;
}

.product-modal-rating-value {
    color: #ffffff;
    font-weight: 700;
    font-size: 1.05rem;
}

.product-modal-rating-count {
    color: #94a3b8;
    font-size: 0.9rem;
}

.product-modal-rating-empty {
    color: #94a3b8;
    font-size: 0.92rem;
}

.product-modal-rating-loading,
.product-modal-reviews-loading {
    color: #94a3b8;
    font-size: 0.92rem;
}

/* Customer reviews section (full width under the image/info grid) */
.product-modal-reviews {
    border-top: 1px solid #1f2937;
    padding: 26px 28px;
}

.product-modal-reviews-title {
    color: #bfdbfe;
    font-size: 1.1rem;
    margin-bottom: 18px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.product-modal-reviews-title i {
    color: #60a5fa;
}

.product-modal-reviews-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.product-modal-reviews-empty {
    color: #94a3b8;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.product-modal-review {
    background: rgba(30, 41, 59, 0.45);
    border: 1px solid #1f2937;
    border-radius: 12px;
    padding: 16px 18px;
}

.product-modal-review-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}

.product-modal-review-name {
    color: #ffffff;
    font-weight: 600;
    font-size: 0.98rem;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.product-modal-review-name i {
    color: #60a5fa;
}

.product-modal-review-stars .madelline-stars {
    font-size: 0.95rem;
    letter-spacing: 2px;
}

.product-modal-review-text {
    color: #e2e8f0;
    line-height: 1.8;
    word-break: break-word;
    white-space: pre-line;
}

.product-modal-review-date {
    display: block;
    color: #64748b;
    font-size: 0.8rem;
    margin-top: 10px;
}

/* Footer order CTA (moved below the reviews) */
.product-modal-footer {
    border-top: 1px solid #1f2937;
    padding: 18px 28px 24px;
}

.product-modal-footer .order-btn {
    width: 100%;
    padding: 13px 18px;
    background: #2563eb;
    color: #ffffff;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    font-family: Vazirmatn, sans-serif;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.product-modal-footer .order-btn:hover {
    background: #1d4ed8;
    transform: translateY(-2px);
}