﻿/* ====================== صفحة تفاصيل المنتج ====================== */

.product-details-wrapper {
    max-width: 1100px;
    margin: 0 auto;
    padding: 8px 0 32px;
}

/* ---- الكارد الرئيسية ---- */
.main-product-card {
    background: #fff;
    border-radius: 20px;
    overflow: hidden;
    border: 1px solid #e8edf3;
    box-shadow: 0 4px 24px rgba(0,0,0,0.06);
}

/* ---- الجزء العلوي: صورة + معلومات ---- */
.product-details-card {
    min-height: 480px;
}

/* ---- الصورة ---- */
.product-details-image {
    overflow: hidden;
    background: transparent;
    position: relative;
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-details-image img {
    max-width: 400px;
    max-height: 400px;
    width: auto;
    height: auto;
    object-fit: contain;
    object-position: center;
    transition: transform 0.5s ease;
    display: block;
    border-radius: 20px;
}

.product-details-image:hover img {
    transform: scale(1.05);
}

/* ---- المعلومات ---- */
.product-details-info {
    padding: 36px 40px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    text-align: right;
    gap: 4px;
}

.product-category-tag {
    display: inline-block;
    background: #f0f9e0;
    color: #5a8a00;
    font-size: 0.82rem;
    font-weight: 700;
    padding: 4px 14px;
    border-radius: 50px;
    width: fit-content;
    margin-bottom: 10px;
    letter-spacing: 0.3px;
}

.product-details-info h1 {
    font-size: 1.6rem;
    font-weight: 800;
    color: #1a1a1a;
    margin-bottom: 12px;
    line-height: 1.3;
}

/* ---- السعر والحالة في صف واحد ---- */
.price-status-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

/* ---- بادج التوفر ---- */
.available-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 50px;
    font-weight: 600;
    font-size: 0.75rem;
    width: fit-content;
}

.badge-available {
    background: #ecfdf5;
    color: #16a34a;
    border: 1px solid #bbf7d0;
}

.badge-unavailable {
    background: #fef2f2;
    color: #dc2626;
    border: 1px solid #fecaca;
}

/* ---- السعر ---- */
.product-price {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.price-original {
    font-size: 0.85rem;
    color: #94a3b8;
}

.price-discounted {
    font-size: 1.5rem;
    font-weight: 900;
    color: #87c508;
    line-height: 1;
}

.price-discounted span {
    font-size: 0.85rem;
    font-weight: 600;
    color: #64748b;
}

/* ---- فاصل ---- */
.divider {
    height: 1px;
    background: #f1f5f9;
    margin: 16px 0;
}

/* ---- الكمية ---- */
.quantity-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    flex-direction: row-reverse;
    justify-content: flex-end;
}

.quantity-row label {
    font-weight: 600;
    font-size: 0.85rem;
    color: #374151;
}

.quantity-controls {
    display: flex;
    align-items: center;
    border: 1.5px solid #e2e8f0;
    border-radius: 10px;
    overflow: hidden;
    background: #f8fafc;
}

.qty-btn {
    background: transparent;
    border: none;
    width: 32px;
    height: 32px;
    cursor: pointer;
    color: #64748b;
    font-size: 0.75rem;
    transition: background 0.2s, color 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.qty-btn:hover {
    background: #87c508;
    color: #fff;
}

.quantity-input {
    width: 44px;
    text-align: center;
    border: none;
    border-right: 1.5px solid #e2e8f0;
    border-left: 1.5px solid #e2e8f0;
    background: #fff;
    font-size: 0.9rem;
    font-weight: 700;
    color: #1a1a1a;
    height: 32px;
    outline: none;
    appearance: textfield;
    -moz-appearance: textfield;
}

.quantity-input::-webkit-outer-spin-button,
.quantity-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
}

/* ---- أزرار الإجراءات ---- */
.action-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

/* ---- زر الإضافة ---- */
.btn-add-cart {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: #87c508;
    color: #fff;
    border: none;
    border-radius: 12px;
    padding: 11px 16px;
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.25s, transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 3px 12px rgba(135,197,8,0.25);
}

.btn-add-cart:hover {
    background: #004282;
    transform: translateY(-2px);
    box-shadow: 0 5px 18px rgba(0,66,130,0.25);
}

/* ---- زر الواتساب ---- */
.btn-whatsapp {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: transparent;
    color: #87c508;
    border: 2px solid #87c508;
    border-radius: 12px;
    padding: 9px 16px;
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.25s;
    text-decoration: none;
}

.btn-whatsapp:hover {
    background: #87c508;
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 5px 18px rgba(135,197,8,0.25);
}

/* ====================== Accordion ====================== */

.accordion-section {
    border-top: 1px solid #ffffff;
}

.accordion-item {
    border-bottom: 1px solid #ffffff;
}

.accordion-item:last-child {
    border-bottom: none;
}

.accordion-header {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 20px;
    background: #fff;
    border: none;
    cursor: pointer;
    text-align: right;
    direction: rtl;
    transition: background 0.2s;
}

.accordion-header:hover {
    background: #f8fdf0;
}

.accordion-header.active {
    background: #ffffff;
}

.accordion-icon-wrap {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    background: #ffffff;
    color: #87c508;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    flex-shrink: 0;
    transition: background 0.2s, color 0.2s;
}

.accordion-header.active .accordion-icon-wrap {
    background: #87c508;
    color: #fff;
}

.accordion-title {
    flex: 1;
    font-size: 0.97rem;
    font-weight: 600;
    color: #000000;
}

.accordion-header.active .accordion-title {
    color: #000000;
}

.accordion-arrow {
    color: #94a3b8;
    font-size: 0.78rem;
    transition: transform 0.3s ease;
    flex-shrink: 0;
}

.accordion-header.active .accordion-arrow {
    transform: rotate(180deg);
    color: #87c508;
}

/* ---- محتوى الأكورديون ---- */
.accordion-body {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease;
    background: #ffffff;
    direction: rtl;
}

.accordion-body .product-text {
    padding: 12px 20px 16px;
}

/* ---- CKEditor Content ---- */
.ck-content {
    font-size: 1.05rem;
    line-height: 2;
    color: #374151;
    text-align: right;
}

.ck-content p { margin-bottom: 12px; }

.ck-content ul,
.ck-content ol {
    padding-right: 24px;
    margin-bottom: 12px;
}

.ck-content li { margin-bottom: 6px; }

.table-wrapper {
    overflow-x: auto;
    margin: 16px 0;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
}

.ck-content table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
}

.ck-content table th,
.ck-content table td {
    padding: 10px 16px;
    border: 1px solid #e2e8f0;
    text-align: right;
}

.ck-content table th {
    background: #ffffff;
    font-weight: 700;
    color: #374151;
}

/* ====================== Animations ====================== */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

.accordion-body.open .product-text {
    animation: fadeIn 0.35s ease;
}

/* ====================== Responsive ====================== */
@media (max-width: 992px) {
    .product-details-info h1 {
        font-size: 1.7rem;
    }

    .accordion-header {
        padding: 10px 14px;
    }

    .accordion-body .product-text {
        padding: 10px 14px 14px;
    }
}

@media (max-width: 640px) {
    .product-details-wrapper {
        padding: 4px 0 20px;
    }

    .main-product-card {
        border-radius: 14px;
    }

    .product-details-image {
        height: 300px;
        width: 100%;
    }

    .product-details-image img {
        max-width: 110%;
        max-height: 110%;
        width: auto;
        height: auto;
        object-fit: contain;
        object-position: center;
    }

    .product-details-info {
        padding: 20px 16px;
        gap: 2px;
    }

    .product-details-info h1 {
        font-size: 1.25rem;
        margin-bottom: 8px;
    }

    .price-status-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
        margin-bottom: 12px;
    }

    .price-discounted {
        font-size: 1.3rem;
    }

    .available-badge {
        font-size: 0.7rem;
        padding: 3px 8px;
    }

    .quantity-row {
        margin-bottom: 12px;
        justify-content: center;
    }

    .quantity-row label {
        font-size: 0.9rem;
    }

    .action-buttons {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }

    .btn-add-cart,
    .btn-whatsapp {
        width: 100%;
        padding: 13px 12px;
        font-size: 1.1rem;
        justify-content: center;
    }

    .btn-text {
        display: none;
    }

    .btn-add-cart i,
    .btn-whatsapp i {
        margin: 0;
    }

    .accordion-header {
        padding: 8px 10px;
        gap: 8px;
    }

    .accordion-icon-wrap {
        width: 26px;
        height: 26px;
        font-size: 0.75rem;
        border-radius: 6px;
    }

    .accordion-title {
        font-size: 0.88rem;
    }

    .accordion-body .product-text {
        padding: 8px 10px 12px;
    }

    .ck-content {
        font-size: 0.97rem;
    }
}
