/*
 * Shared components for blog, shop, and events templates.
 */

.sidebar-widget {
    background: #ffffff;
    border-radius: 20px;
    padding: 24px;
    box-shadow: var(--dch-shadow-card);
    border: 1px solid rgba(15, 23, 42, 0.04);
    margin-bottom: 24px;
}

.sidebar-widget__title {
    margin: 0 0 18px;
    font-size: var(--text-lg);
    font-weight: var(--dch-font-bold);
    color: var(--dch-navy);
    padding-bottom: 12px;
    border-bottom: 1px solid var(--dch-border);
}

.sidebar-search__input-wrapper {
    position: relative;
}

.sidebar-search__input,
.form-input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--dch-border);
    border-radius: 8px;
    font-size: 0.95rem;
    transition: all 0.2s ease;
    outline: none;
}

.sidebar-search__input:focus,
.form-input:focus {
    border-color: var(--dch-navy);
    box-shadow: 0 0 0 2px rgba(38, 57, 151, 0.1);
}

.sidebar-categories {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.sidebar-categories a {
    display: flex;
    align-items: center;
    color: #475569;
    padding: 8px 0;
    font-size: var(--text-sm);
    font-weight: var(--dch-font-normal);
    transition: color 0.2s ease;
}

.sidebar-categories a i {
    margin-right: 8px;
    color: var(--dch-red);
    font-size: 0.7rem;
    transition: color 0.2s ease;
}

.sidebar-categories a span {
    margin-left: auto;
    background: #eef2f7;
    color: #64748b;
    border-radius: 999px;
    padding: 2px 8px;
    font-size: var(--text-xs);
    font-weight: var(--dch-font-bold);
}

.sidebar-categories a:hover {
    color: var(--dch-navy);
}

.sidebar-categories a:hover i {
    color: var(--dch-navy);
}

.sidebar-posts {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.sidebar-post,
.sidebar-event-card {
    display: flex;
    gap: 14px;
}

.sidebar-post__image,
.sidebar-event-img {
    width: 80px;
    height: 80px;
    flex-shrink: 0;
}

.sidebar-post__image img,
.sidebar-event-img img,
.sidebar-event-img > img {
    width: 100%;
    height: 100%;
    border-radius: 14px;
    object-fit: cover;
    display: block;
}

.sidebar-post__content h4,
.sidebar-event-info h4 {
    margin: 0 0 6px;
    font-size: var(--text-sm);
    line-height: var(--dch-leading-snug);
    color: var(--dch-navy);
    font-weight: var(--dch-font-bold);
    transition: color 0.2s ease;
}

.sidebar-post:hover .sidebar-post__content h4,
.sidebar-event-card:hover .sidebar-event-info h4 {
    color: var(--dch-red);
}

.sidebar-post__content span,
.sidebar-event-date {
    color: var(--dch-text-muted);
    font-size: 0.75rem;
}

.blog-pagination {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 40px;
    flex-wrap: wrap;
}

.pagination__item {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 14px;
    border-radius: 12px;
    background: #ffffff;
    color: var(--dch-navy);
    font-weight: var(--dch-font-medium);
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08);
}

.pagination__item.current,
.pagination__item:hover {
    background: var(--dch-navy);
    color: #ffffff;
}

.share-buttons {
    display: flex;
    gap: 12px;
}

.share-btn {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-size: var(--text-lg);
    transition: all 0.2s ease;
}

.share-btn:hover {
    transform: translateY(-2px);
    opacity: 0.9;
    color: #ffffff;
}

@media (max-width: 768px) {
    .sidebar-widget {
        padding: 20px;
    }
}

/* ── Product Badges ── */
.dch-badge {
    position: absolute;
    z-index: 2;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    line-height: 1;
    pointer-events: none;
}

.dch-badge i {
    margin-inline-end: 4px;
}

.dch-badge--offer {
    top: 16px;
    right: -30px;
    padding: 6px 40px;
    background: #bf2527;
    color: #fff;
    transform: rotate(45deg);
    box-shadow: 0 2px 6px rgba(191, 37, 39, 0.3);
}

.dch-badge--coming_soon {
    top: 12px;
    left: 12px;
    padding: 5px 12px;
    background: #f59e0b;
    color: #fff;
    border-radius: 20px;
    font-size: 10px;
}

.dch-badge--new {
    top: 12px;
    left: 12px;
    width: 42px;
    height: 42px;
    background: #10b981;
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    flex-direction: column;
    gap: 1px;
}

.dch-badge--new i {
    font-size: 8px;
    margin-inline-end: 0;
}

.dch-badge--best_seller {
    top: 0;
    left: 0;
    right: 0;
    padding: 5px 12px;
    background: var(--dch-navy, #263997);
    color: #fff;
    text-align: center;
    font-size: 10px;
}

/* ── Single Product Badge Wrapper ── */
.dch-single-badge-wrapper {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 10;
    pointer-events: none;
}
.dch-single-badge-wrapper .dch-badge {
    position: relative;
    top: auto;
    left: auto;
    right: auto;
    display: inline-block;
    margin: 12px;
}
