/* ======= صفحة تفاصيل الأسرة المنتجة ======= */

:root {
    --primary-color: #2E2857;
    --primary-light: #3a3478;
    --primary-dark: #211d40;
    --secondary-color: #FFC107;
    --accent-color: #FF6B6B;
    --success-color: #28a745;
    --info-color: #17a2b8;
    --warning-color: #ffc107;
    --danger-color: #dc3545;
    --whatsapp-color: #25D366;
    --text-color: #333;
    --light-text: #666;
    --border-color: #e0e0e0;
    --light-bg: #f8f9fa;
    --card-shadow: 0 3px 10px rgba(0, 0, 0, 0.08);
    --hover-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
    --transition: all 0.3s ease;
    --card-radius: 12px;
    --btn-radius: 8px;
    
    /* ألوان الفئات */
    --category-sweets: #e91e63;
    --category-crafts: #2196f3;
    --category-perfumes: #9c27b0;
    --category-clothes: #ff9800;
    --category-other: #607d8b;
}

/* ======= إعادة تعريف عناصر Bootstrap ======= */
.btn {
    border-radius: var(--btn-radius);
    transition: var(--transition);
    padding: 10px 20px;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn i {
    margin-left: 8px;
}

.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-primary:hover {
    background-color: var(--primary-dark);
    border-color: var(--primary-dark);
}

.btn-whatsapp {
    background-color: var(--whatsapp-color);
    border-color: var(--whatsapp-color);
    color: white;
}

.btn-whatsapp:hover {
    background-color: #128C7E;
    border-color: #128C7E;
    color: white;
}

.btn-outline-secondary {
    color: var(--text-color);
    border-color: var(--border-color);
}

.btn-outline-secondary:hover {
    background-color: #f0f0f0;
    color: var(--primary-color);
    border-color: var(--border-color);
}

/* ======= قسم العنوان الرئيسي ======= */
.page-header {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: #fff;
    padding: 50px 0;
    text-align: center;
    margin-bottom: 40px;
    border-radius: 0 0 50px 50px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
}

.page-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('../../assets/img/pattern.png');
    opacity: 0.1;
    z-index: 1;
}

.page-title {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 15px;
    text-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    position: relative;
    z-index: 2;
    animation: fadeInDown 0.8s ease;
}

.breadcrumb {
    display: inline-flex;
    background: rgba(255, 255, 255, 0.15);
    padding: 10px 20px;
    border-radius: 30px;
    margin-top: 15px;
    position: relative;
    z-index: 2;
    animation: fadeIn 1s ease;
}

.breadcrumb-item {
    color: rgba(255, 255, 255, 0.8);
}

.breadcrumb-item a {
    color: #666666;
    text-decoration: none;
    transition: var(--transition);
}

.breadcrumb-item a:hover {
    color: var(--secondary-color);
}

.breadcrumb-item.active {
    color: var(--secondary-color);
}

.breadcrumb-item+.breadcrumb-item::before {
    color: rgba(255, 255, 255, 0.5);
}

.family-badges {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 20px;
    position: relative;
    z-index: 2;
    animation: fadeInUp 0.8s ease;
}

.category-badge {
    display: inline-block;
    background-color: rgba(255, 255, 255, 0.15);
    color: #fff;
    padding: 6px 15px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
}

/* ألوان الفئات في صفحة التفاصيل */
.category-حلويات-ومخبوزات {
    background-color: var(--category-sweets);
}

.category-مهن-وحرف {
    background-color: var(--category-crafts);
}

.category-عطور-وبخور-وحنة {
    background-color: var(--category-perfumes);
}

.category-اكسسوارات-وملابس {
    background-color: var(--category-clothes);
}

.category-أخرى {
    background-color: var(--category-other);
}

.featured-badge {
    display: inline-flex;
    align-items: center;
    background-color: var(--secondary-color);
    color: var(--text-color);
    padding: 6px 15px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
}

.featured-badge i {
    margin-left: 5px;
}

/* ======= قسم تفاصيل الأسرة المنتجة ======= */
.family-details {
    padding: 0 0 60px;
    animation: fadeIn 1s ease;
}

/* معرض الصور */
.family-gallery {
    position: relative;
    margin-bottom: 30px;
}

.main-image {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--card-shadow);
    height: 400px;
}

.main-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.main-image:hover img {
    transform: scale(1.03);
}

.gallery-zoom {
    position: absolute;
    bottom: 15px;
    right: 15px;
    width: 40px;
    height: 40px;
    background-color: rgba(0, 0, 0, 0.6);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.3s ease;
    z-index: 3;
}

.main-image:hover .gallery-zoom {
    opacity: 1;
    transform: translateY(0);
}

.thumbnails-container {
    margin-top: 20px;
}

.thumbnails-title {
    font-size: 16px;
    color: var(--text-color);
    margin-bottom: 10px;
    font-weight: 600;
}

.thumbnails {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 10px;
}

.thumbnail-item {
    cursor: pointer;
    border-radius: 8px;
    overflow: hidden;
    height: 70px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    border: 2px solid transparent;
    position: relative;
}

.thumbnail-item.active {
    border-color: var(--primary-color);
}

.thumbnail-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 10px rgba(0, 0, 0, 0.1);
}

.thumbnail {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hidden-gallery-link {
    display: none;
}

/* معلومات الأسرة المنتجة */
.family-info {
    background-color: #fff;
    border-radius: 12px;
    padding: 25px;
    box-shadow: var(--card-shadow);
    height: 100%;
    transition: var(--transition);
}

.family-info:hover {
    box-shadow: var(--hover-shadow);
}

.family-name {
    color: var(--primary-color);
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #f0f0f0;
}

.family-description {
    color: var(--text-color);
    font-size: 16px;
    line-height: 1.7;
    margin-bottom: 25px;
}

.family-products {
    background-color: #f9f9f9;
    padding: 20px;
    border-radius: 10px;
    margin: 25px 0;
}

.family-products h3 {
    color: var(--primary-color);
    font-size: 18px;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
}

.family-products h3 i {
    margin-left: 8px;
}

.products-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.product-tag {
    display: inline-block;
    background-color: white;
    color: var(--text-color);
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 14px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    border: 1px solid #eee;
    transition: var(--transition);
}

.product-tag:hover {
    background-color: var(--light-bg);
    transform: translateY(-2px);
}

.family-contact-info {
    margin-top: 25px;
}

.family-contact-info h3 {
    color: var(--primary-color);
    font-size: 18px;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
}

.family-contact-info h3 i {
    margin-left: 8px;
}

.contact-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.contact-list li {
    display: flex;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px dashed #eee;
}

.contact-list li:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.contact-icon {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    background-color: var(--light-bg);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-color);
    margin-left: 15px;
}

.contact-details {
    flex-grow: 1;
}

.contact-label {
    display: block;
    color: var(--light-text);
    font-size: 14px;
    margin-bottom: 5px;
}

.contact-value {
    display: block;
    color: var(--text-color);
    font-weight: 500;
}

.phone-link, .whatsapp-link {
    color: var(--primary-color);
    text-decoration: none;
    transition: var(--transition);
}

.phone-link:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

.whatsapp-link {
    color: var(--whatsapp-color);
}

.whatsapp-link:hover {
    color: #128C7E;
    text-decoration: underline;
}

.contact-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 25px;
}

.contact-buttons .btn {
    flex: 1;
    min-width: 120px;
}

.share-container {
    margin-top: 20px;
    position: relative;
}

.btn-share {
    width: 100%;
    background-color: var(--light-bg);
    color: var(--text-color);
    border: none;
    transition: var(--transition);
}

.btn-share:hover {
    background-color: #eee;
}

.share-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background-color: #fff;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    padding: 10px;
    z-index: 10;
    display: none;
    margin-top: 10px;
}

.share-dropdown.show {
    display: block;
    animation: fadeInUp 0.3s ease;
}

.share-link {
    display: flex;
    align-items: center;
    padding: 10px 15px;
    text-decoration: none;
    color: var(--text-color);
    border-radius: 5px;
    margin-bottom: 5px;
    transition: var(--transition);
}

.share-link:last-child {
    margin-bottom: 0;
}

.share-link i {
    margin-left: 10px;
    width: 20px;
    text-align: center;
}

.share-link.facebook {
    color: #3b5998;
}

.share-link.twitter {
    color: #1da1f2;
}

.share-link.whatsapp {
    color: var(--whatsapp-color);
}

.share-link.copy {
    color: var(--info-color);
    border: none;
    background: none;
    width: 100%;
    text-align: right;
    cursor: pointer;
}

.share-link:hover {
    background-color: var(--light-bg);
}

/* ======= قسم الأسر المنتجة المشابهة ======= */
.similar-families-section {
    padding: 60px 0;
    background-color: var(--light-bg);
    margin-top: 40px;
    animation: fadeIn 1.2s ease;
}

.section-header {
    text-align: center;
    margin-bottom: 30px;
}

.section-title {
    font-size: 28px;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 10px;
}

.section-subtitle {
    font-size: 16px;
    color: var(--light-text);
}

.similar-families-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
    gap: 25px;
    margin-bottom: 30px;
}

/* ======= تأثيرات انتقالية ======= */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fadeIn {
    animation: fadeIn 0.5s ease forwards;
}

/* ======= تعديلات للشاشات المختلفة ======= */
@media (max-width: 1200px) {
    .similar-families-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    }
}

@media (max-width: 992px) {
    .page-header {
        padding: 40px 0;
    }
    
    .page-title {
        font-size: 28px;
    }
    
    .main-image {
        height: 350px;
    }
    
    .thumbnails {
        grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
    }
    
    .family-name {
        font-size: 24px;
    }
    
    .similar-families-grid {
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    }
}

@media (max-width: 768px) {
    .page-header {
        padding: 35px 0;
        border-radius: 0 0 30px 30px;
    }
    
    .page-title {
        font-size: 24px;
    }
    
    .main-image {
        height: 300px;
    }
    
    .thumbnail-item {
        height: 60px;
    }
    
    .family-name {
        font-size: 22px;
    }
    
    .family-description, .family-products p {
        font-size: 15px;
    }
    
    .contact-buttons .btn {
        width: 100%;
        margin-bottom: 10px;
    }
    
    .similar-families-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 15px;
    }
}

@media (max-width: 576px) {
    .page-header {
        padding: 30px 0;
    }
    
    .page-title {
        font-size: 22px;
    }
    
    .main-image {
        height: 250px;
    }
    
    .thumbnails {
        grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
    }
    
    .family-info {
        padding: 20px 15px;
    }
    
    .family-name {
        font-size: 20px;
    }
    
    .family-products, .family-contact-info {
        padding: 15px;
    }
    
    .family-products h3, .family-contact-info h3 {
        font-size: 16px;
    }
    
    .contact-icon {
        width: 35px;
        height: 35px;
        margin-left: 10px;
    }
    
    .contact-label {
        font-size: 13px;
    }
    
    .contact-value {
        font-size: 15px;
    }
    
    .similar-families-grid {
        grid-template-columns: 1fr;
    }
    
    .section-title {
        font-size: 24px;
    }
    
    .section-subtitle {
        font-size: 14px;
    }
}