/* تنسيقات الصفحة العامة */
:root {
    --primary-color: #3498db;
    --secondary-color: #2ecc71;
    --accent-color: #f39c12;
    --text-color: #333;
    --text-light: #777;
    --light-bg: #f8f9fa;
    --border-color: #eaeaea;
    --card-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    --hover-shadow: 0 5px 15px rgba(0, 0, 0, 0.15);
    --transition: all 0.3s ease;
}

/* تنسيقات قسم السلايدر الرئيسي */
.hero-slider-section {
    padding: 40px 0 20px;
    background-color: #f9f9f9;
    border-bottom: 1px solid #eee;
}

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

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

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

/* تنسيقات سلايدر الأوول كاروسيل */
.frontpage-slider-posts {
    position: relative;
    margin-bottom: 30px;
}

.slider-style-two .owl-nav {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    transform: translateY(-50%);
    z-index: 2;
    display: flex;
    justify-content: space-between;
    pointer-events: none;
}

.slider-style-two .owl-nav button {
    background-color: rgba(255, 255, 255, 0.9) !important;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    pointer-events: auto;
    transition: var(--transition);
}

.slider-style-two .owl-nav button:hover {
    background-color: var(--primary-color) !important;
    color: #fff !important;
}

.slider-style-two .owl-nav button i {
    font-size: 18px;
}

.slider-item {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--card-shadow);
    background-color: #fff;
    transition: var(--transition);
    height: 100%;
}

.slider-item:hover {
    transform: translateY(-5px);
    box-shadow: var(--hover-shadow);
}

.slider-thumb {
    position: relative;
    margin: 0;
    height: 180px;
    width: 100%;
    overflow: hidden;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.slider-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.featured-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background-color: var(--accent-color);
    color: #fff;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.content-entry-wrap {
    padding: 15px;
}

.entry-content .entry-title {
    font-size: 15px;
    margin: 0 0 5px;
    font-weight: 600;
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.entry-content .entry-title a {
    color: var(--text-color);
    text-decoration: none;
    transition: var(--transition);
}

.entry-content .entry-title a:hover {
    color: var(--primary-color);
}

.rating {
    display: flex;
    margin: 5px 0;
}

.star {
    color: var(--accent-color);
    margin-left: 2px;
}

.star.empty {
    color: #ddd;
}

.entry-date {
    margin-top: 10px;
}

.badge {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

.badge-primary {
    background-color: var(--primary-color);
    color: white;
}

/* تنسيقات قسم العنوان الرئيسي */
.page-hero {
    background-color: #fff;
    padding: 40px 0;
    text-align: center;
    border-bottom: 1px solid var(--border-color);
}

.page-title {
    font-size: 32px;
    margin-bottom: 10px;
    color: var(--text-color);
    font-weight: 700;
}

.page-subtitle {
    font-size: 16px;
    color: var(--text-light);
    margin-bottom: 15px;
}

.breadcrumb {
    display: flex;
    justify-content: center;
    padding: 0;
    margin-bottom: 0;
    list-style: none;
    background-color: transparent;
}

.breadcrumb-item {
    display: flex;
    align-items: center;
}

.breadcrumb-item + .breadcrumb-item::before {
    content: ">";
    padding: 0 8px;
    color: var(--text-light);
}

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

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

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

/* تنسيقات قسم البحث والتصفية */
.search-section {
    background-color: #fff;
    padding: 20px 0;
    margin-bottom: 30px;
}

.search-container {
    background-color: var(--light-bg);
    border-radius: 10px;
    padding: 20px;
    box-shadow: var(--card-shadow);
}

.search-input {
    position: relative;
}

.search-icon {
    position: absolute;
    top: 50%;
    right: 15px;
    transform: translateY(-50%);
    color: var(--text-light);
}

.btn-clear-search {
    position: absolute;
    top: 50%;
    left: 15px;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-light);
    cursor: pointer;
    padding: 0;
}

.form-control {
    height: 45px;
    padding-right: 40px;
    padding-left: 40px;
    border-radius: 5px;
    border: 1px solid var(--border-color);
}

.form-control:focus {
    box-shadow: none;
    border-color: var(--primary-color);
}

.select-container {
    position: relative;
}

.filter-icon {
    position: absolute;
    top: 50%;
    right: 15px;
    transform: translateY(-50%);
    color: var(--text-light);
    z-index: 1;
}

.form-select {
    height: 45px;
    padding-right: 40px;
    border-radius: 5px;
    cursor: pointer;
    border: 1px solid var(--border-color);
}

.form-select:focus {
    box-shadow: none;
    border-color: var(--primary-color);
}

.featured-filter-container {
    display: flex;
    height: 45px;
    align-items: center;
}

.featured-checkbox {
    display: flex;
    align-items: center;
    cursor: pointer;
    margin: 0;
    user-select: none;
}

.featured-checkbox input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.checkmark {
    position: relative;
    height: 22px;
    width: 22px;
    background-color: #fff;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    margin-left: 10px;
}

.featured-checkbox input:checked ~ .checkmark {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.checkmark:after {
    content: "\f00c";
    font-family: 'Font Awesome 5 Free';
    font-weight: 900;
    position: absolute;
    display: none;
    color: white;
    font-size: 12px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.featured-checkbox input:checked ~ .checkmark:after {
    display: block;
}

.featured-label {
    font-size: 14px;
    color: var(--text-color);
}

.featured-label i {
    color: var(--accent-color);
    margin-right: 5px;
}

.btn-reset {
    width: 100%;
    height: 45px;
    background-color: #f1f1f1;
    border: 1px solid var(--border-color);
    color: var(--text-color);
    border-radius: 5px;
    transition: var(--transition);
}

.btn-reset:hover {
    background-color: #e9e9e9;
}

.btn-reset i {
    margin-right: 5px;
}

/* تنسيقات قسم النتائج */
.families-section {
    padding-bottom: 60px;
}

.results-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.results-count {
    font-size: 16px;
    color: var(--text-color);
}

#total-results {
    font-weight: 700;
    color: var(--primary-color);
}

.featured-count {
    margin-right: 15px;
    font-size: 14px;
    color: var(--text-light);
}

#featured-count {
    font-weight: 700;
    color: var(--accent-color);
}

.view-toggle {
    display: flex;
}

.btn-view-mode {
    background: none;
    border: 1px solid var(--border-color);
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-light);
    cursor: pointer;
    transition: var(--transition);
}

.btn-view-mode.grid {
    border-radius: 5px 0 0 5px;
}

.btn-view-mode.list {
    border-radius: 0 5px 5px 0;
    border-right: 1px solid var(--border-color);
}

.btn-view-mode.active {
    background-color: var(--primary-color);
    color: #fff;
    border-color: var(--primary-color);
}

/* تنسيقات مؤشر التحميل */
#loading-indicator {
    text-align: center;
    padding: 30px 0;
}

.spinner-border {
    width: 3rem;
    height: 3rem;
    margin-bottom: 15px;
}

/* تنسيقات الشبكة الرئيسية */
.families-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

/* تنسيقات كرت العائلة المنتجة */
.family-card {
    background-color: #fff;
    border-radius: 8px;
    box-shadow: var(--card-shadow);
    transition: var(--transition);
    overflow: hidden;
    position: relative;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.family-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--hover-shadow);
}

.family-card-link {
    text-decoration: none;
    color: inherit;
    display: block;
    flex: 1;
}

.family-inner {
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* تنسيقات صورة العائلة */
.family-media {
    position: relative;
    height: 200px;
    overflow: hidden;
}

.family-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.family-card:hover .family-image {
    transform: scale(1.05);
}

.family-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.family-card:hover .family-overlay {
    opacity: 1;
}

.family-view {
    background: #fff;
    color: #333;
    padding: 8px 15px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
    transform: translateY(20px);
    transition: transform 0.3s ease;
}

.family-card:hover .family-view {
    transform: translateY(0);
}

.family-featured {
    position: absolute;
    top: 10px;
    left: 10px;
    background: var(--accent-color);
    color: #fff;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

/* تنسيقات معلومات العائلة */
.family-info {
    padding: 15px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.family-name {
    font-size: 18px;
    margin: 0 0 10px 0;
    font-weight: 600;
    color: var(--text-color);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.family-category {
    display: inline-block;
    padding: 4px 10px;
    background-color: #e9ecef;
    color: #495057;
    border-radius: 20px;
    font-size: 12px;
    margin-bottom: 12px;
    font-weight: 500;
}

/* تنسيقات مخصصة لكل فئة */
.category-حلويات-ومخبوزات {
    background-color: #ffe0b2;
    color: #e65100;
}

.category-مهن-وحرف {
    background-color: #c8e6c9;
    color: #2e7d32;
}

.category-عطور-وبخور-وحنة {
    background-color: #e1bee7;
    color: #6a1b9a;
}

.category-اكسسوارات-وملابس {
    background-color: #bbdefb;
    color: #0d47a1;
}

.category-أخرى {
    background-color: #cfd8dc;
    color: #455a64;
}

.family-description {
    font-size: 14px;
    color: var(--text-light);
    margin-bottom: 12px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* تنسيقات المنتجات */
.family-products-preview {
    margin-top: auto;
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.product-tag {
    font-size: 12px;
    padding: 3px 8px;
    background-color: #f1f3f5;
    border-radius: 4px;
    color: #495057;
}

.more-products {
    font-size: 12px;
    padding: 3px 8px;
    background-color: #e9ecef;
    border-radius: 4px;
    color: #6c757d;
}

/* تنسيقات أزرار العمليات */
.family-actions {
    display: flex;
    border-top: 1px solid #eee;
}

.btn-action {
    flex: 1;
    padding: 12px;
    text-align: center;
    color: #6c757d;
    background: #f8f9fa;
    text-decoration: none;
    transition: var(--transition);
    font-size: 16px;
}

.btn-action:hover {
    background: #e9ecef;
}

.btn-action.call:hover {
    color: #28a745;
}

.btn-action.whatsapp:hover {
    color: #25d366;
}

.btn-action.details:hover {
    color: #007bff;
}

/* تنسيقات العرض كقائمة */
.families-list .family-card {
    flex-direction: row;
    height: 150px;
}

.families-list .family-card-link {
    display: flex;
    width: 100%;
}

.families-list .family-inner {
    flex-direction: row;
    width: 100%;
}

.families-list .family-media {
    width: 35%;
    min-width: 150px;
    height: 150px;
}

.families-list .family-info {
    width: 65%;
}

.families-list .family-actions {
    position: absolute;
    right: 10px;
    bottom: 10px;
    flex-direction: row;
    border: none;
    background: transparent;
}

.families-list .btn-action {
    margin-right: 5px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

/* تنسيقات حالة عدم وجود نتائج */
.no-results {
    text-align: center;
    padding: 40px 0;
}

.no-results-icon {
    font-size: 50px;
    color: #adb5bd;
    margin-bottom: 15px;
}

/* تنسيقات الترقيم */
.pagination-container {
    margin-top: 30px;
}

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 5px;
}

.page-nav, .page-num {
    min-width: 40px;
    height: 40px;
    border: 1px solid var(--border-color);
    background-color: #fff;
    border-radius: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    color: var(--text-color);
    cursor: pointer;
    transition: var(--transition);
}

.page-nav {
    padding: 0 15px;
}

.page-num.active {
    background-color: var(--primary-color);
    color: #fff;
    border-color: var(--primary-color);
}

.page-nav:hover, .page-num:hover {
    background-color: #f1f1f1;
}

.page-nav.disabled {
    color: #ccc;
    background-color: #f9f9f9;
    cursor: not-allowed;
}

.page-dots {
    margin: 0 5px;
    color: var(--text-light);
}

/* زر العودة للأعلى */
.back-to-top {
    position: fixed;
    bottom: 20px;
    left: 20px;
    width: 45px;
    height: 45px;
    background-color: var(--primary-color);
    color: #fff;
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
    z-index: 999;
}

.back-to-top.show {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    background-color: var(--secondary-color);
}

/* تحريك الظهور */
.animate-fadeIn {
    animation: fadeIn 0.6s ease forwards;
}

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

/* تنسيقات مسؤولة */
@media (max-width: 992px) {
    .families-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    }
    
    .slider-thumb {
        height: 160px;
    }
}

@media (max-width: 768px) {
    .page-title {
        font-size: 28px;
    }
    
    .families-list .family-card {
        height: auto;
    }
    
    .families-list .family-inner {
        flex-direction: column;
    }
    
    .families-list .family-media {
        width: 100%;
    }
    
    .families-list .family-info {
        width: 100%;
    }
    
    .families-list .family-actions {
        position: static;
        display: flex;
        justify-content: center;
        margin-top: 10px;
    }
    
    .slider-thumb {
        height: 140px;
    }
}

@media (max-width: 576px) {
    .families-grid {
        grid-template-columns: 1fr;
    }
    
    .page-title {
        font-size: 24px;
    }
    
    .page-hero {
        padding: 30px 0;
    }
    
    .btn-view-mode {
        width: 36px;
        height: 36px;
    }
}
