/* =========================================
   Base & Overflow Prevention
   ========================================= */
.sg-news-carousel-wrapper {
    max-width: 100%;
    width: 100%;
    margin: 40px auto;
    padding: 0 20px;
    font-family: 'Vazirmatn FD', sans-serif;
    overflow: hidden;
    box-sizing: border-box;
}

.sg-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sg-section-title {
    font-size: 1.2rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
}

.sg-title-divider {
    display: inline-block;
    width: 4px;
    height: 24px;
    border-radius: 2px;
}

.sg-view-all-link {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--sg-muted);
    text-decoration: none;
    transition: color 0.2s, transform 0.2s;
}
.sg-view-all-link:hover svg { transform: translateX(-3px); }

/* =========================================
   Swiper Container & Slides
   ========================================= */
.sg-swiper-container {
    width: 100%;
    overflow: hidden;
}

.sg-swiper-container .swiper-wrapper {
    width: 100%;
}

.sg-swiper-container .swiper-slide {
    width: 260px;
    height: auto;
    flex-shrink: 0;
}

/* =========================================
   Cards Styling
   ========================================= */
.sg-news-card, .sg-promo-card {
    background: #FFFFFF;
    box-shadow: 0 2px 4px -1px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid rgba(0,0,0,0.04);
    cursor: pointer;
    height: 100%;
    text-decoration: none;
    color: inherit;
}

.sg-card-content { padding: 16px; flex-grow: 1; display: flex; flex-direction: column; }

.sg-badges-wrapper {
    display: flex;
    gap: 6px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.sg-card-badge {
    display: inline-block;
    background: #F1F5F9;
    padding: 3px 10px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--sg-muted);
    align-self: flex-start;
}

.sg-badge-new {
    background: var(--sg-new-badge, #EF4444);
    color: white;
    animation: sg-pulse 2s infinite;
}

@keyframes sg-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.sg-card-title {
    font-weight: 700;
    margin-bottom: 8px;
    line-height: 1.5;
    color: var(--sg-text);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.sg-card-summary {
    color: var(--sg-muted);
    margin-bottom: 14px;
    flex-grow: 1;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.6;
}

.sg-card-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.7rem;
    color: var(--sg-muted);
    margin-bottom: 12px;
    padding-top: 12px;
    border-top: 1px solid #F1F5F9;
}

.sg-btn-details {
    width: 100%;
    padding: 8px;
    border: none;
    border-radius: 8px;
    background: var(--sg-text);
    color: white;
    font-family: inherit;
    font-weight: 600;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}
.sg-btn-details:hover { background: var(--sg-primary); }

/* =========================================
   Promo Card Specifics
   ========================================= */
.sg-promo-card {
    background: linear-gradient(135deg, #FDF2F4 0%, #F5D5DC 100%);
    border: 2px solid var(--sg-primary);
}
.sg-promo-content { padding: 20px; flex-grow: 1; display: flex; flex-direction: column; align-items: center; text-align: center; }
.sg-promo-icon {
    width: 56px; height: 56px; background: white; border-radius: 50%;
    display: flex; align-items: center; justify-content: center; margin-bottom: 16px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}
.sg-promo-title { font-size: 1rem; font-weight: 800; color: var(--sg-text); margin-bottom: 8px; }
.sg-promo-description { font-size: 0.8rem; color: var(--sg-primary); margin-bottom: 16px; line-height: 1.6; flex-grow: 1; }
.sg-promo-cta {
    display: inline-flex; align-items: center; gap: 6px; padding: 8px 16px;
    background: var(--sg-text); color: white; border-radius: 8px; font-size: 0.8rem; font-weight: 600; transition: all 0.2s;
}
.sg-promo-card:hover .sg-promo-cta { background: var(--sg-primary); }

/* =========================================
   Modal Styles
   ========================================= */
.sg-modal-overlay {
    position: fixed; inset: 0; background: rgba(15, 23, 42, 0.5); backdrop-filter: blur(6px);
    z-index: 9999; display: flex; align-items: center; justify-content: center; padding: 16px;
    opacity: 0; visibility: hidden; transition: all 0.3s ease;
}
.sg-modal-overlay.active { opacity: 1; visibility: visible; }

.sg-modal-content {
    background: white; width: 100%; max-width: 500px; max-height: 75vh;
    border-radius: 16px; padding: 24px; position: relative; overflow-y: auto;
    transform: scale(0.95); transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    scrollbar-width: thin;
    scrollbar-color: #CBD5E1 transparent;
}
.sg-modal-overlay.active .sg-modal-content { transform: scale(1); }
.sg-modal-content::-webkit-scrollbar { width: 5px; }
.sg-modal-content::-webkit-scrollbar-track { background: transparent; }
.sg-modal-content::-webkit-scrollbar-thumb { background: #CBD5E1; border-radius: 10px; }

.sg-modal-close {
    position: absolute; top: 14px; left: 14px; width: 32px; height: 32px; border-radius: 50%;
    border: none; background: #F1F5F9; color: var(--sg-text); cursor: pointer;
    display: flex; align-items: center; justify-content: center; transition: all 0.2s;
}
.sg-modal-close:hover { background: #E2E8F0; transform: rotate(90deg); }

.sg-modal-title { font-size: 1.15rem; font-weight: 700; margin-bottom: 12px; padding-left: 36px; line-height: 1.5; color: var(--sg-text); }
.sg-modal-meta { display: flex; gap: 14px; font-size: 0.75rem; color: var(--sg-muted); margin-bottom: 20px; align-items: center; }
.sg-modal-meta span { display: flex; align-items: center; gap: 5px; }
.sg-modal-body { font-size: 0.9rem; line-height: 1.7; color: #334155; margin-bottom: 20px; }
.sg-modal-body p { margin-bottom: 14px; }

.sg-inline-promotion {
    background: #FDF2F4; border: 1px solid #F5D5DC; border-radius: 10px; padding: 12px 14px; margin: 16px 0; transition: all 0.2s;
}
.sg-inline-promotion:hover { border-color: var(--sg-primary); box-shadow: 0 2px 8px rgba(141, 31, 60, 0.1); }
.sg-inline-promo-header { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.sg-inline-promo-icon {
    width: 24px; height: 24px; background: white; border-radius: 6px;
    display: flex; align-items: center; justify-content: center; flex-shrink: 0; border: 1px solid #F5D5DC;
}
.sg-inline-promo-title { font-size: 0.8rem; font-weight: 700; color: var(--sg-text); flex-grow: 1; }
.sg-inline-promo-badge { font-size: 0.6rem; background: var(--sg-primary); color: white; padding: 2px 6px; border-radius: 4px; font-weight: 600; }
.sg-inline-promo-description { font-size: 0.75rem; color: var(--sg-primary); margin-bottom: 8px; line-height: 1.4; }
.sg-inline-promo-link {
    display: inline-flex; align-items: center; gap: 4px; padding: 5px 10px;
    background: var(--sg-text); color: white; border-radius: 6px; font-size: 0.7rem; font-weight: 600; text-decoration: none; transition: all 0.2s;
}
.sg-inline-promo-link:hover { background: var(--sg-primary); }

.sg-modal-actions { display: flex; gap: 10px; flex-wrap: wrap; border-top: 1px solid #F1F5F9; padding-top: 16px; }
.sg-btn-action {
    flex: 1; min-width: 110px; padding: 8px 12px; border-radius: 8px; border: 1px solid #E2E8F0;
    background: white; color: var(--sg-text); font-family: inherit; font-weight: 600; font-size: 0.8rem;
    cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 5px; transition: all 0.2s; text-decoration: none;
}
.sg-btn-action:hover { border-color: var(--sg-primary); color: var(--sg-primary); background: #FDF2F4; }
.sg-btn-action.sg-btn-primary { background: var(--sg-primary); color: white; border-color: var(--sg-primary); }
.sg-btn-action.sg-btn-primary:hover { background: var(--sg-primary-hover, #6B1730); border-color: var(--sg-primary-hover, #6B1730); }

.sg-toast {
    position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(100px);
    background: #0F172A; color: white; padding: 10px 20px; border-radius: 50px; font-size: 0.85rem; font-weight: 500;
    opacity: 0; transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55); z-index: 10000;
    display: flex; align-items: center; gap: 6px;
}
.sg-toast.show { transform: translateX(-50%) translateY(0); opacity: 1; }

/* =========================================
   Responsive Adjustments
   ========================================= */
@media (max-width: 768px) {
    .sg-swiper-container .swiper-slide { width: 80vw; }
    .sg-modal-content { max-height: 80vh; padding: 20px; border-radius: 16px 16px 0 0; align-self: flex-end; margin-top: auto; }
    .sg-modal-overlay { align-items: flex-end; padding: 0; }
    .sg-modal-actions { flex-direction: column; }
    .sg-btn-action { width: 100%; }
    .sg-modal-title { padding-left: 32px; font-size: 1.05rem; }
}