/**
 * Condolence/Funeral System Styles
 */

/* Banner */
.cbb-condolence-banner {
    background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
    color: white;
    padding: 60px 20px;
    text-align: center;
    margin-bottom: 40px;
    border-radius: 12px;
}

.cbb-banner-content h1 {
    font-size: 36px;
    margin: 0 0 15px 0;
    font-weight: 600;
}

.cbb-banner-content p {
    font-size: 18px;
    opacity: 0.9;
    margin: 0;
}

/* Progress Steps */
.cbb-condolence-progress {
    display: flex;
    justify-content: space-between;
    margin: 40px 0;
    padding: 0 20px;
}

.cbb-progress-step {
    flex: 1;
    text-align: center;
    position: relative;
    padding: 20px 10px;
}

.cbb-progress-step::before {
    content: '';
    position: absolute;
    top: 30px;
    left: 50%;
    width: 100%;
    height: 3px;
    background: #e5e7eb;
    z-index: 0;
}

.cbb-progress-step:first-child::before {
    display: none;
}

.cbb-progress-step .step-number {
    display: inline-block;
    width: 50px;
    height: 50px;
    line-height: 50px;
    border-radius: 50%;
    background: #e5e7eb;
    color: #6b7280;
    font-weight: 600;
    font-size: 20px;
    position: relative;
    z-index: 1;
    transition: all 0.3s;
}

.cbb-progress-step.active .step-number {
    background: #1e293b;
    color: white;
}

.cbb-progress-step.completed .step-number {
    background: #10B981;
    color: white;
}

.cbb-progress-step .step-label {
    display: block;
    margin-top: 10px;
    font-size: 14px;
    color: #6b7280;
}

.cbb-progress-step.active .step-label {
    color: #1e293b;
    font-weight: 600;
}

/* Type Grid */
.cbb-type-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 25px;
    margin: 30px 0;
}

.cbb-type-card {
    background: white;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    padding: 30px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
}

.cbb-type-card:hover {
    border-color: #1e293b;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    transform: translateY(-5px);
}

.cbb-type-card.selected {
    border-color: #1e293b;
    background: #f8fafc;
    box-shadow: 0 4px 12px rgba(30,41,59,0.2);
}

.cbb-type-card .type-icon {
    font-size: 60px;
    margin-bottom: 15px;
}

.cbb-type-card h3 {
    font-size: 20px;
    margin: 10px 0;
    color: #1e293b;
}

.cbb-type-card .type-name-ar {
    font-size: 16px;
    color: #6b7280;
    margin: 5px 0;
}

.cbb-type-card .type-description {
    font-size: 14px;
    color: #6b7280;
    margin: 10px 0 20px 0;
}

/* Products Grid */
.cbb-products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
    margin: 30px 0;
}

.cbb-product-card {
    background: white;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s;
    cursor: pointer;
}

.cbb-product-card:hover {
    border-color: #1e293b;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.cbb-product-card.selected {
    border-color: #1e293b;
    box-shadow: 0 4px 12px rgba(30,41,59,0.2);
}

.cbb-product-card .product-image {
    width: 100%;
    height: 250px;
    overflow: hidden;
}

.cbb-product-card .product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cbb-product-card .product-info {
    padding: 20px;
}

.cbb-product-card h3 {
    font-size: 18px;
    margin: 0 0 10px 0;
    color: #1e293b;
}

.cbb-product-card p {
    font-size: 14px;
    color: #6b7280;
    margin: 10px 0;
}

.cbb-product-card .product-price {
    font-size: 24px;
    font-weight: 600;
    color: #1e293b;
    margin: 15px 0;
}

/* Form Sections */
.cbb-form-section {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 25px;
    margin: 20px 0;
}

.cbb-form-section h3 {
    font-size: 20px;
    margin: 0 0 20px 0;
    color: #1e293b;
    border-bottom: 2px solid #1e293b;
    padding-bottom: 10px;
}

.cbb-form-row {
    margin-bottom: 20px;
}

.cbb-form-row label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: #374151;
}

.cbb-form-row input[type="text"],
.cbb-form-row input[type="tel"],
.cbb-form-row input[type="date"],
.cbb-form-row input[type="time"],
.cbb-form-row textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s;
}

.cbb-form-row input:focus,
.cbb-form-row textarea:focus {
    outline: none;
    border-color: #1e293b;
}

.cbb-form-row textarea {
    resize: vertical;
    min-height: 100px;
}

.required {
    color: #dc2626;
}

.field-hint {
    font-size: 14px;
    color: #6b7280;
    margin: 10px 0;
}

/* ========================================================= */
/* التعديل هنا: قسم Suggestions (لتقسيم الأزرار إلى 3 أعمدة) */
/* ========================================================= */
.cbb-message-suggestions,
.cbb-ribbon-suggestions {
    margin: 20px 0;
    /* إضافة حدود وخلفية للقسم بالكامل */
    padding: 10px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    background-color: #fafafa;
}

.suggestion-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.suggestion-tab,
.ribbon-tab {
    padding: 10px 20px;
    border: 2px solid #d1d5db;
    background: white;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 600;
    color: #1e293b;
}

.suggestion-tab.active,
.ribbon-tab.active {
    background: #1e293b;
    color: white;
    border-color: #1e293b;
}

.suggestion-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px; /* تقليل المسافة البينية قليلاً */
}

.suggestion-btn {
    /* تجعل المربعات تتوزع 3 في كل صف */
    flex: 1 1 calc(33.333% - 8px); 
    min-width: 150px;
    padding: 12px 10px; /* زيادة حجم البادينج */
    border: 1px solid #ddd; /* تقليل سمك الحدود */
    background: #ffffff; /* خلفية بيضاء */
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 14px;
    color: #1e293b;
    font-weight: 500;
    text-align: center;
    line-height: 1.3;
}
/* تأثير عند المرور */
.suggestion-btn:hover {
    background-color: #eeeeee;
    border-color: #bbbbbb;
}

.suggestion-btn.selected {
    background: #1e293b;
    color: white;
    border-color: #1e293b;
    font-weight: 600;
}
/* ========================================================= */

/* Summary */
.cbb-condolence-summary {
    background: #f8fafc;
    border: 2px solid #1e293b;
    border-radius: 12px;
    padding: 25px;
    margin: 30px 0;
}

.cbb-condolence-summary h3 {
    font-size: 22px;
    margin: 0 0 20px 0;
    color: #1e293b;
}

.summary-item {
    padding: 12px 0;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
}

.summary-item:last-child {
    border-bottom: none;
}

.summary-item strong {
    color: #374151;
    min-width: 150px;
}

/* Buttons */
.cbb-btn {
    padding: 14px 30px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.cbb-btn-primary {
    background: #1e293b;
    color: white;
}

.cbb-btn-primary:hover {
    background: #0f172a;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(30,41,59,0.3);
}

.cbb-btn-secondary {
    background: #e5e7eb;
    color: #374151;
}

.cbb-btn-secondary:hover {
    background: #d1d5db;
}

.cbb-btn-select,
.cbb-btn-select-product {
    width: 100%;
    margin-top: 10px;
}

/* Navigation */
.cbb-form-navigation {
    display: flex;
    justify-content: space-between;
    gap: 15px;
    margin: 40px 0;
    padding: 20px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* Loading */
.cbb-loading {
    text-align: center;
    padding: 40px;
    font-size: 18px;
    color: #6b7280;
}

/* Responsive */
@media (max-width: 768px) {
    .cbb-banner-content h1 {
        font-size: 28px;
    }
    
    .cbb-condolence-progress {
        flex-wrap: wrap;
    }
    
    .cbb-progress-step {
        flex: 1 1 50%;
        margin-bottom: 20px;
    }
    
    .cbb-type-grid,
    .cbb-products-grid {
        grid-template-columns: 1fr;
    }
    
    .cbb-form-navigation {
        flex-direction: column;
    }
    
    .suggestion-tabs {
        flex-direction: column;
    }
    /* تعديل: جعل الأزرار تأخذ صف كامل في الموبايل */
    .suggestion-btn {
        flex: 1 1 100% !important; 
        min-width: unset;
    }
}

/* Print Styles */
@media print {
    .cbb-condolence-banner,
    .cbb-condolence-progress,
    .cbb-form-navigation {
        display: none;
    }
}