/* --- Product Card (v5 - Bold & Sales Focused) --- */
.product-card {
    background-color: var(--color-white);
    border: 1px solid #eee;
    border-radius: var(--border-radius);
    overflow: hidden;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
    position: relative;
}

.product-card:hover {
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    transform: translateY(-5px);
    border-color: var(--color-gold);
}

/* منطقة الصور */
.card-image-container {
    position: relative;
    width: 100%;
    padding-top: 100%;
    background-color: #fafafa;
    overflow: hidden;
    border-bottom: 1px solid #f0f0f0;
}

.product-img {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

/* تكبير الصورة قليلاً عند الهوفر */
.product-card:hover .product-img {
    transform: scale(1.08);
}

.hover-img { opacity: 0; z-index: 2; }
.main-img { z-index: 1; }
.product-card:hover .hover-img { opacity: 1; }

/* شارة الخصم (حمراء وواضحة جداً) */
.sale-badge {
    position: absolute;
    top: 10px; right: 10px;
    background-color: #e63946; /* أحمر فاقع */
    color: #fff;
    font-size: 0.85rem;
    font-weight: 700;
    padding: 4px 12px;
    border-radius: 4px;
    z-index: 10;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

/* منطقة التفاصيل */
.card-details {
    padding: 1.25rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    align-items: center; /* توسيط كل شيء */
    justify-content: space-between;
    text-align: center;
}

.product-title {
    font-family: var(--font-primary);
    font-size: 1rem;
    font-weight: 600;
    color: var(--color-brown-dark);
    margin-bottom: 0.75rem;
    line-height: 1.4;
    height: 2.8em; /* حجز مساحة لسطرين */
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

/* ترتيب الأسعار تحت بعض */
.price-stack {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 1rem;
    line-height: 1.2;
}

.price.current {
    color: var(--color-brown-dark); /* لون غامق وواضح */
    font-weight: 800; /* خط عريض جداً */
    font-size: 1.25rem;
}

.price.old {
    color: #aaa;
    text-decoration: line-through;
    font-size: 0.9rem;
    margin-top: 2px;
}

/* الزر الظاهر والممتلئ */
.add-btn-solid {
    width: 100%;
    background-color: var(--color-brown-dark); /* خلفية غامقة */
    color: #fff;
    border: none;
    padding: 10px 0;
    font-family: var(--font-primary);
    font-weight: 600;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    justify-content: center;
    align-items: center;
}

.add-btn-solid:hover {
    background-color: var(--color-gold); /* يتحول للذهبي عند الهوفر */
    transform: scale(1.02); /* تكبير بسيط */
}

/* --- صفحة تفاصيل المنتج (Product Details View) --- */

.product-page-container {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 20px;
}

/* Breadcrumb */
.breadcrumb {
    margin-bottom: 2rem;
    font-size: 0.9rem;
    color: #888;
}
.breadcrumb a { color: var(--color-brown-medium); }
.breadcrumb .separator { margin: 0 10px; }
.breadcrumb .current { color: var(--color-gold); font-weight: 600; }

/* Layout Grid */
.product-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 3rem;
}

@media (min-width: 992px) {
    .product-layout {
        grid-template-columns: 45% 50%; /* مساحة للصور ومساحة للنص */
        align-items: start;
    }
}

/* --- Gallery Section --- */
.main-image-wrapper {
    position: relative;
    background-color: #fff;
    border-radius: 12px;
    border: 1px solid #eee;
    padding: 10px;
    overflow: hidden;
    margin-bottom: 1rem;
}

.gallery-main-img {
    width: 100%;
    height: auto;
    object-fit: cover;
    border-radius: 8px;
}

.details-sale-badge {
    position: absolute;
    top: 20px; right: 20px;
    background-color: #e63946;
    color: #fff;
    padding: 5px 15px;
    border-radius: 4px;
    font-weight: bold;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    z-index: 10;
}

.thumbnails-wrapper {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 5px;
}

.thumb-item {
    width: 80px;
    height: 80px;
    border: 2px solid transparent;
    border-radius: 8px;
    cursor: pointer;
    opacity: 0.6;
    transition: all 0.3s ease;
    flex-shrink: 0;
}
.thumb-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 6px;
}
.thumb-item.active, .thumb-item:hover {
    border-color: var(--color-gold);
    opacity: 1;
}

/* --- Info Section --- */
.brand-label {
    color: var(--color-gold);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
}

.details-title {
    font-family: var(--font-display);
    font-size: 2rem;
    color: var(--color-brown-dark);
    margin: 0.5rem 0 1.5rem;
    line-height: 1.3;
}

.details-price-box {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid #eee;
}

.price-stack-details {
    display: flex;
    flex-direction: column;
}

.price-stack-details .current {
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--color-brown-dark);
    line-height: 1;
}

.price-stack-details .old {
    font-size: 1.2rem;
    color: #aaa;
    text-decoration: line-through;
}

.saving-tag {
    background-color: #d4af37; /* ذهبي */
    color: #fff;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
}

.short-desc {
    font-size: 1.05rem;
    color: #666;
    line-height: 1.8;
    margin-bottom: 2rem;
}

/* Controls */
.purchase-controls {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.qty-wrapper {
    display: flex;
    align-items: center;
    border: 1px solid #ddd;
    border-radius: 8px;
    height: 50px;
}

.qty-btn {
    background: none;
    border: none;
    width: 40px;
    font-size: 1.2rem;
    cursor: pointer;
    color: var(--color-brown-dark);
    height: 100%;
}
.qty-btn:hover { background-color: #f5f5f5; }

.qty-input {
    width: 50px;
    text-align: center;
    border: none;
    font-weight: bold;
    font-size: 1.1rem;
    height: 100%;
}

.add-to-cart-large {
    flex-grow: 1;
    background-color: var(--color-brown-dark);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    height: 50px;
}
.add-to-cart-large:hover {
    background-color: var(--color-gold);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.15);
}

.divider {
    border: 0;
    border-top: 1px solid #eee;
    margin: 2rem 0;
}

/* تنسيق المحتوى القادم من المحرر (Full Description) */
.full-description-content .desc-heading {
    font-size: 1.4rem;
    color: var(--color-brown-dark);
    margin-bottom: 1rem;
    border-right: 4px solid var(--color-gold);
    padding-right: 10px;
}

/* تنسيق الـ HTML الداخلي لضمان الظهور بشكل جميل */
.html-content {
    color: #555;
    line-height: 1.8;
    font-size: 1rem;
}
.html-content p {
    margin-bottom: 0.8rem;
}
.html-content ul {
    margin-right: 20px;
    margin-bottom: 1rem;
}
.html-content strong {
    color: var(--color-brown-dark);
}

/* --- Product Card Link Fixes --- */

/* جعل الرابط يملأ مساحة الصورة بالكامل */
.product-link-wrapper {
    display: block;
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1; /* فوق الخلفية وتحت البادج */
}

/* تحسين رابط العنوان */
.product-title a {
    color: var(--color-brown-dark);
    text-decoration: none;
    transition: color 0.3s ease;
}

.product-title a:hover {
    color: var(--color-gold);
}
