/* Hide theme footer on mobile for logged-in users (app-like experience) */
@media (max-width: 767px) {
    body.logged-in footer,
    body.logged-in .site-footer,
    body.logged-in #colophon,
    body.logged-in .footer {
        display: none !important;
    }
}

/**
 * Bakkegaard Plugin – Frontend Design System
 * Mobile-first approach
 *
 * Design tokens:
 *   --bkg-color-accent:    #d26c3d  (links, dates, times)
 *   --bkg-color-text:      #3C2313  (headings, body text)
 *   --bkg-color-bg:        #FBF3DB  (page background)
 *   --bkg-color-btn-bg:    #3c4f5c  (button background)
 *   --bkg-color-btn-text:  #fffaed  (button text)
 *   --bkg-font-primary:    'Nagel', sans-serif
 *   --bkg-font-secondary:  'Eponymous', serif
 */

:root {
    --bkg-color-accent: #d26c3d;
    --bkg-color-text: #3C2313;
    --bkg-color-bg: #FBF3DB;
    --bkg-color-btn-bg: #3c4f5c;
    --bkg-color-btn-text: #fffaed;
    --bkg-color-border: #e0d5c0;
    --bkg-color-card-bg: #ffffff;
    --bkg-color-error: #c0392b;
    --bkg-color-success: #27ae60;
    --bkg-font-primary: 'Nagel', sans-serif;
    --bkg-font-secondary: 'Eponymous', serif;
    --bkg-radius: 8px;
    --bkg-spacing-xs: 4px;
    --bkg-spacing-sm: 8px;
    --bkg-spacing-md: 16px;
    --bkg-spacing-lg: 24px;
    --bkg-spacing-xl: 32px;
}

/* ─── Toolbar (Facebook-style icon bar) ──────────────────── */

.bkg-toolbar {
    display: block;
    background: white;
    border-top: 1px solid #e8e0d0;
    padding: 6px 0;
    padding-bottom: calc(6px + env(safe-area-inset-bottom, 0px));
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 9000;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.06);
}

.bkg-toolbar-inner {
    display: flex;
    justify-content: space-around;
    align-items: center;
    max-width: 1232px;
    margin: 0 auto;
}

/* Add bottom padding to body so content isn't hidden behind toolbar */
body:has(.bkg-toolbar) {
    padding-bottom: calc(64px + env(safe-area-inset-bottom, 0px)) !important;
}

/* On desktop: keep toolbar at bottom (avoids clash with WP admin bar at top for admin users) */

.bkg-toolbar-item {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;
    padding: 12px 0;
    color: #999;
    text-decoration: none;
    position: relative;
    transition: color 0.15s;
    border-bottom: 3px solid transparent;
    min-height: 44px;
}

.bkg-toolbar-item:hover {
    color: var(--bkg-color-text);
    text-decoration: none;
}

.bkg-toolbar-item.active {
    color: var(--bkg-color-accent, #d26c3d);
    border-bottom-color: var(--bkg-color-accent, #d26c3d);
}

.bkg-toolbar-item svg {
    display: block;
}

.bkg-toolbar-badge {
    position: absolute;
    top: 4px;
    right: calc(50% - 18px);
    background: #d26c3d;
    color: white;
    font-size: 10px;
    font-weight: 700;
    min-width: 16px;
    height: 16px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 3px;
}

/* ─── Shop grid ──────────────────────────────────────────── */

.bkg-shop-section {
    margin-bottom: var(--bkg-spacing-lg);
}

.bkg-shop-section h2 {
    margin: 0 0 10px;
    font-size: 1.1rem;
}

.bkg-shop-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.bkg-shop-item {
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: var(--bkg-color-text);
    border-radius: 8px;
    overflow: hidden;
    background: white;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
    transition: transform 0.1s;
}

.bkg-shop-item:active { transform: scale(0.97); }
.bkg-shop-item:hover { text-decoration: none; }

.bkg-shop-item-img {
    width: 100%;
    aspect-ratio: 1;
    overflow: hidden;
}

.bkg-shop-item-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f0ebe0;
}

.bkg-shop-item-info {
    padding: 8px 10px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.bkg-shop-item-info strong {
    font-size: 0.85rem;
    line-height: 1.2;
}

.bkg-shop-item-price {
    color: var(--bkg-color-accent);
    font-weight: 700;
    font-size: 0.9rem;
}

/* Notification item hover */
.bkg-notif-item {
    transition: background 0.15s;
}
.bkg-notif-item:hover {
    background: #faf6ee !important;
}

@media (min-width: 400px) {
    .bkg-shop-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Base container */
.bkg-container {
    max-width: 600px;
    margin: 0 auto;
    padding: var(--bkg-spacing-md) 0;
    font-family: var(--bkg-font-primary);
    color: var(--bkg-color-text);
}

/* Typography */
.bkg-container h1,
.bkg-container h2,
.bkg-container h3 {
    font-family: var(--bkg-font-primary);
    color: var(--bkg-color-text);
    margin-top: 0;
}

.bkg-container h1 { font-size: 1.75rem; }
.bkg-container h2 { font-size: 1.375rem; }
.bkg-container h3 { font-size: 1.125rem; }

@media (max-width: 425px){
    .bkg-container h1 { font-size: 1.3rem; }
    .bkg-container h2 { font-size: 1.15rem; }
    .bkg-container h3 { font-size: 1.0rem; }
}

/* Links */
.bkg-container a {
    color: var(--bkg-color-accent);
    text-decoration: none;
}

.bkg-container a:hover {
    text-decoration: underline;
}

/* Date/time accent */
.bkg-date,
.bkg-time {
    color: var(--bkg-color-accent);
    font-weight: 600;
}

/* Buttons */
.bkg-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 14px 28px;
    font-family: var(--bkg-font-primary);
    font-size: 1rem;
    font-weight: 600;
    border: none;
    border-radius: var(--bkg-radius);
    cursor: pointer;
    text-decoration: none;
    transition: opacity 0.2s, transform 0.1s;
    -webkit-tap-highlight-color: transparent;
    min-height: 48px; /* Mobile touch target */
}

.bkg-btn:active {
    transform: scale(0.98);
}

.bkg-btn-primary {
    background-color: var(--bkg-color-btn-bg);
    color: var(--bkg-color-btn-text) !important;
}

.bkg-btn-primary:hover {
    opacity: 0.9;
    text-decoration: none !important;
    color: var(--bkg-color-btn-text);
}

.bkg-btn-secondary {
    background-color: transparent;
    color: var(--bkg-color-btn-bg);
    border: 2px solid var(--bkg-color-btn-bg);
}

.bkg-btn-full {
    width: 100%;
}

.bkg-btn-lg {
    padding: 18px 32px;
    font-size: 1.125rem;
    min-height: 56px;
}

/* Cards */
.bkg-card {
    display: block;
    background: var(--bkg-color-card-bg);
    border-radius: var(--bkg-radius);
    padding: var(--bkg-spacing-lg);
    margin-bottom: var(--bkg-spacing-md);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

/* Event card image – mobile: full-width above text */
.bkg-card-image {
    margin: calc(-1 * var(--bkg-spacing-lg)) calc(-1 * var(--bkg-spacing-lg)) var(--bkg-spacing-md);
    border-radius: var(--bkg-radius) var(--bkg-radius) 0 0;
    overflow: hidden;
}

.bkg-card-img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    display: block;
}

/* Form elements */
.bkg-input {
    width: 100%;
    padding: 14px 16px;
    font-family: var(--bkg-font-primary);
    font-size: 1rem;
    border: 2px solid var(--bkg-color-border);
    border-radius: var(--bkg-radius);
    background: var(--bkg-color-card-bg);
    color: var(--bkg-color-text);
    box-sizing: border-box;
    min-height: 48px;
    transition: border-color 0.2s;
}

.bkg-input:focus {
    outline: none;
    border-color: var(--bkg-color-btn-bg);
}

.bkg-input::placeholder {
    color: #999;
}

.bkg-label {
    display: block;
    margin-bottom: var(--bkg-spacing-xs);
    font-weight: 600;
    font-size: 0.875rem;
}

.bkg-form-group {
    margin-bottom: var(--bkg-spacing-lg);
}

/* Price display */
.bkg-price {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--bkg-color-text);
}

.bkg-price-small {
    font-size: 1rem;
}

/* Status badges */
.bkg-badge {
    display: inline-block;
    padding: 0px 10px;
    font-size: 10px;
    font-weight: 600;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    word-break: keep-all;
}

.bkg-badge-active {
    background: #e8f5e9;
    color: var(--bkg-color-success);
}

.bkg-badge-expired {
    background: #fce4ec;
    color: var(--bkg-color-error);
}

.bkg-badge-pending {
    background: #fff3e0;
    color: #e67e22;
}

/* Alert/notice */
.bkg-alert {
    padding: var(--bkg-spacing-md);
    border-radius: var(--bkg-radius);
    margin-bottom: var(--bkg-spacing-md);
    font-size: 0.9rem;
}

.bkg-alert-info {
    background: #e3f2fd;
    color: #1565c0;
}

.bkg-alert-success {
    background: #e8f5e9;
    color: var(--bkg-color-success);
}

.bkg-alert-error {
    background: #fce4ec;
    color: var(--bkg-color-error);
}

.bkg-alert-warning {
    background: #fff3e0;
    color: #e67e22;
}

/* Deadline warning */
.bkg-deadline {
    display: flex;
    align-items: center;
    gap: var(--bkg-spacing-sm);
    padding: var(--bkg-spacing-md);
    background: #fff3e0;
    border-radius: var(--bkg-radius);
    color: #e67e22;
    font-weight: 600;
    margin-bottom: var(--bkg-spacing-md);
}

/* List items */
.bkg-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.bkg-list-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--bkg-spacing-md);
    border-bottom: 1px solid var(--bkg-color-border);
}

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

/* Loading spinner */
.bkg-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--bkg-spacing-xl);
}

.bkg-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--bkg-color-border);
    border-top-color: var(--bkg-color-btn-bg);
    border-radius: 50%;
    animation: bkg-spin 0.8s linear infinite;
}

@keyframes bkg-spin {
    to { transform: rotate(360deg); }
}

/* ─── Group Wall ──────────────────────────────────────────── */

.bkg-wall-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.bkg-wall-avatar-sm {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

/* Composer */
.bkg-wall-composer-row {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.bkg-wall-composer-input {
    flex: 1;
    min-height: 60px;
    padding: 10px 14px;
    border: 2px solid var(--bkg-color-border);
    border-radius: var(--bkg-radius);
    font-family: var(--bkg-font-primary);
    font-size: 0.95rem;
    color: var(--bkg-color-text);
    outline: none;
    word-break: break-word;
}

.bkg-wall-composer-input:focus {
    border-color: var(--bkg-color-btn-bg);
}

.bkg-wall-composer-input:empty:before {
    content: attr(data-placeholder);
    color: #999;
    pointer-events: none;
}

.bkg-wall-composer-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 10px;
}

.bkg-wall-composer-buttons {
    display: flex;
    gap: 8px;
}

.bkg-wall-upload-btn,
.bkg-wall-emoji-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: none;
    background: #f0f0f0;
    border-radius: 50%;
    cursor: pointer;
    color: #666;
    transition: background 0.2s;
}

.bkg-wall-upload-btn:hover,
.bkg-wall-emoji-btn:hover {
    background: #e0e0e0;
}

/* Send button (paper plane icon) */
.bkg-wall-send-btn {
        display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    min-width: 36px;
    border: none;
    background: none;
    cursor: pointer;
    border-radius: 50%;
    transition: background 0.2s, transform 0.1s !important;
    padding: 0 !important;
    flex-shrink: 0;
    color: #3c4f5c !important;
    background-color: transparent !important;
}

.bkg-wall-send-btn:hover {
    background: rgba(60, 79, 92, 0.08);
}

.bkg-wall-send-btn:active {
    transform: scale(0.88);
}

/* Emoji picker */
.bkg-emoji-picker {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    padding: 10px;
    background: var(--bkg-color-card-bg);
    border: 1px solid var(--bkg-color-border);
    border-radius: var(--bkg-radius);
    margin-top: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.bkg-emoji-picker .bkg-emoji-btn {
    font-size: 1.3rem;
    border: none;
    background: none;
    cursor: pointer;
    padding: 4px 6px;
    border-radius: 4px;
}

.bkg-emoji-picker .bkg-emoji-btn:hover {
    background: #f0f0f0;
}

/* Attachments preview */
.bkg-wall-attachments {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.bkg-wall-attachment-preview {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 8px;
    background: #f5f5f5;
    border-radius: 6px;
    font-size: 0.8rem;
    overflow: hidden;
}

.bkg-wall-attachment-preview.is-video,
.bkg-wall-attachment-preview:has(img) {
    padding: 0;
    background: transparent;
}

.bkg-wall-attachment-preview img,
.bkg-wall-attachment-preview video {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 6px;
    display: block;
    background: #000;
}

.bkg-wall-attachment-preview.is-video .bkg-wall-attachment-play {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 24px;
    text-shadow: 0 1px 4px rgba(0,0,0,0.6);
    pointer-events: none;
}

.bkg-wall-attachment-name {
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.bkg-wall-attachment-progress {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 4px;
    background: rgba(0,0,0,0.15);
    overflow: hidden;
}

.bkg-wall-attachment-progress-bar {
    height: 100%;
    background: var(--bkg-color-accent, #d26c3d);
    transition: width 0.15s linear;
}

.bkg-wall-comment-upload-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    color: #666;
    cursor: pointer;
    flex-shrink: 0;
}

.bkg-wall-comment-upload-btn:hover {
    color: var(--bkg-color-accent, #d26c3d);
    background: rgba(0,0,0,0.04);
}

.bkg-wall-comment-attachments-rendered {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 6px;
}

.bkg-wall-comment-image {
    max-width: 200px;
    max-height: 200px;
    border-radius: 6px;
    object-fit: cover;
    cursor: pointer;
}

.bkg-wall-comment-attachments-rendered .bkg-wall-video {
    max-width: 240px;
    max-height: 180px;
    border-radius: 6px;
}

.bkg-wall-attachment-remove {
    position: absolute;
    top: -6px;
    right: -6px;
    width: 22px;
    height: 22px;
    min-width: 22px;
    min-height: 22px;
    padding: 0;
    border: 2px solid #fff;
    background: #e74c3c;
    color: #fff;
    border-radius: 50%;
    font-size: 14px;
    line-height: 1;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
}

/* Mention dropdown */
.bkg-mention-dropdown {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 100%;
    margin-bottom: 4px;
    background: white;
    border: 1px solid var(--bkg-color-border);
    border-radius: var(--bkg-radius);
    box-shadow: 0 -4px 12px rgba(0,0,0,0.12);
    max-height: 180px;
    overflow-y: auto;
    z-index: 100;
}

.bkg-mention-item {
    padding: 8px 14px;
    cursor: pointer;
    font-size: 0.9rem;
}

.bkg-mention-item:hover {
    background: #f5f5f5;
}

/* Post */
.bkg-wall-post {
    position: relative;
}

.bkg-wall-post-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.bkg-wall-post-header strong {
    font-size: 0.95rem;
}

.bkg-wall-time {
    font-size: 0.75rem;
    color: #999;
}

/* Three-dot menu wrapper */
.bkg-wall-menu-wrap {
    position: relative;
    margin-left: auto;
    flex-shrink: 0;
}

.bkg-wall-menu-btn {
    border: none !important;
    background: none !important;
    cursor: pointer;
    font-size: 20px;
    color: #999;
    padding: 4px 8px !important;
    border-radius: 50%;
    min-height: auto !important;
    min-width: auto !important;
    line-height: 1 !important;
    line-height: 1;
}

.bkg-wall-menu-btn:hover {
    background: rgba(0,0,0,0.05);
    color: #666;
}

/* Dropdown menu from three-dot */
.bkg-wall-menu {
    position: absolute;
    right: 0;
    top: 100%;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
    min-width: 220px;
    z-index: 50;
    overflow: hidden;
}

.bkg-wall-menu-item {
    display: block;
    width: 100%;
    padding: 10px 16px;
    border: none;
    background: none;
    text-align: left;
    font-size: 0.9rem;
    cursor: pointer;
    color: var(--bkg-color-text);
}

.bkg-wall-menu-item:hover {
    background: #f5f5f5;
}

/* Group three-dot menu: wider, smaller text (more menu items) */
#bkg-group-menu {
    min-width: 240px;
    max-width: calc(100vw - 24px);
    width: max-content;
}
#bkg-group-menu .bkg-wall-menu-item {
    font-size: 0.75rem;
    padding: 7px 12px;
    line-height: 1.35;
}

/* Floating context menu (for long-press on mobile) */
.bkg-context-menu {
    position: fixed;
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.2);
    min-width: 180px;
    z-index: 10000;
    overflow: hidden;
    animation: bkg-menu-in 0.15s ease-out;
}

@keyframes bkg-menu-in {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

.bkg-context-menu-item {
    display: flex !important;
    align-items: center;
    width: 100%;
    padding: 12px 18px !important;
    border: none !important;
    background: none !important;
    text-align: left;
    font-size: 0.7rem;
    cursor: pointer;
    color: var(--bkg-color-text);
    border-bottom: 1px solid #f0f0f0;
    min-height: auto !important;
    border-radius: 0 !important;
}

.bkg-context-menu-item:last-child {
    border-bottom: none;
}

.bkg-context-menu-item:hover,
.bkg-context-menu-item:active {
    background: #f5f5f5;
}

.bkg-ctx-icon {
    display: inline-flex;
    align-items: center;
    margin-right: 10px;
    vertical-align: middle;
    color: #666;
}

.bkg-context-menu-item[style*="color:#c0392b"] .bkg-ctx-icon {
    color: #c0392b;
}

/* Emoji picker grid (inline, below reactions) */
.bkg-emoji-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 2px;
    padding: 8px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
    margin: 8px 0;
    max-width: 280px;
}

.bkg-emoji-grid-btn {
    width: 36px;
    height: 36px;
    border: none;
    background: none;
    cursor: pointer;
    font-size: 1.2rem;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.1s;
}

.bkg-emoji-grid-btn:hover,
.bkg-emoji-grid-btn:active {
    background: #f0f0f0;
    transform: scale(1.15);
}


.bkg-wall-action-btn {
    border: none;
    background: none;
    cursor: pointer;
    font-size: 0.85rem;
    opacity: 0.5;
    padding: 4px;
}

.bkg-wall-action-btn:hover {
    opacity: 1;
}

.bkg-wall-post-content {
    font-size: 0.95rem;
    line-height: 1.5;
    word-break: break-word;
    margin-bottom: 8px;
}

.bkg-wall-post-content.bkg-wall-editing {
    border: 2px solid var(--bkg-color-accent);
    border-radius: var(--bkg-radius);
    padding: 8px;
    outline: none;
}

.bkg-wall-mention {
    color: var(--bkg-color-accent);
}

/* Post attachments */
.bkg-wall-post-attachments {
    margin: 8px 0;
}

/* Image grid for multiple images */
.bkg-img-grid {
    display: grid;
    gap: 3px;
    border-radius: var(--bkg-radius);
    overflow: hidden;
    margin: 8px 0;
}

.bkg-img-grid-1 { grid-template-columns: 1fr; }
.bkg-img-grid-2 { grid-template-columns: 1fr 1fr; }
.bkg-img-grid-3 { grid-template-columns: 1fr 1fr; grid-template-rows: auto auto; }
.bkg-img-grid-3 .bkg-img-grid-item:first-child { grid-column: 1 / -1; }
.bkg-img-grid-4 { grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; }

.bkg-img-grid-item {
    position: relative;
    cursor: pointer;
    overflow: hidden;
}

.bkg-img-grid-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    min-height: 120px;
    max-height: 350px;
    transition: transform 0.15s;
}

.bkg-img-grid-1 .bkg-img-grid-item img {
    max-height: 450px;
    min-height: auto;
}

.bkg-img-grid-item:hover img { transform: scale(1.02); }

.bkg-img-grid-more {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.5);
    color: white;
    font-size: 1.5rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Lightbox */
.bkg-lightbox {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.92);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: bkg-fade-in 0.2s;
}

@keyframes bkg-fade-in { from { opacity: 0; } to { opacity: 1; } }

.bkg-lightbox-content { display: flex; align-items: center; justify-content: center; }
.bkg-lightbox-content img,
.bkg-lightbox-content video { border-radius: 4px; }

.bkg-lightbox-close {
    position: absolute !important;
    top: 16px; right: 16px;
    background: none !important;
    border: none !important;
    color: white;
    font-size: 2rem;
    cursor: pointer;
    padding: 8px !important;
    min-height: auto !important;
    z-index: 2;
}

.bkg-lightbox-prev,
.bkg-lightbox-next {
    position: absolute !important;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255,255,255,0.15) !important;
    border: none !important;
    color: white;
    font-size: 2rem;
    cursor: pointer;
    padding: 12px 16px !important;
    min-height: auto !important;
    border-radius: 50% !important;
    z-index: 2;
}

.bkg-lightbox-prev { left: 12px; }
.bkg-lightbox-next { right: 12px; }
.bkg-lightbox-prev:hover,
.bkg-lightbox-next:hover { background: rgba(255,255,255,0.3) !important; }

.bkg-lightbox-counter {
    position: absolute;
    bottom: 16px;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255,255,255,0.7);
    font-size: 0.85rem;
}

/* Sort toggle buttons */
.bkg-wall-sort-btn {
    border: none !important;
    cursor: pointer;
    color: #4d4c4c;
    padding: 6px 10px !important;
    min-height: auto !important;
    border-radius: 6px !important;
    display: inline-flex;
    align-items: center;
    transition: color 0.15s, background 0.15s;
    background: rgba(0, 0, 0, 0.06) !important;
}

.bkg-wall-sort-btn:hover {
    color: #999;
    background: rgba(0,0,0,0.20) !important;
}

.bkg-wall-sort-btn.active {
    color: var(--bkg-color-text) !important;
    background: rgba(0,0,0,0.20) !important;
}

/* Reaction bar with icon buttons */
.bkg-wall-react-btn {
    border: none !important;
    background: none !important;
    cursor: pointer;
    color: #999;
    padding: 4px !important;
    min-height: auto !important;
    display: inline-flex;
    align-items: center;
}

.bkg-wall-react-btn:hover { color: var(--bkg-color-text); }

.bkg-wall-video {
    max-width: 100%;
    border-radius: var(--bkg-radius);
}

.bkg-wall-file-link {
    display: inline-block;
    padding: 6px 12px;
    background: #f5f5f5;
    border-radius: 6px;
    font-size: 0.85rem;
    margin: 4px 0;
}

/* Reactions */
.bkg-wall-reactions {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin: 4px 0;
}

.bkg-wall-reaction-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px !important;
    border: 1px solid var(--bkg-color-border);
    border-radius: 20px;
    background: white;
    font-size: 0.8rem;
    cursor: pointer;
}

.bkg-wall-reaction-badge.active {
    border-color: var(--bkg-color-accent);
    background: #fef3ee;
}

.bkg-wall-reaction-bar {
    display: flex;
    gap: 4px;
    padding-top: 8px;
    border-top: 1px solid var(--bkg-color-border);
    margin-top: 8px;
}

button.bkg-wall-toggle-comments {
    border: none !important;
    background: none !important;
    cursor: pointer;
    font-size: 0.85rem;
    color: #999;
    min-height: auto !important;
    padding: 4px 8px !important;
    display: inline-flex !important;
    align-items: center;
    gap: 4px;
    margin: 0 0 0 auto;
    padding: 0 !important;
}
.bkg-wall-toggle-comments:hover {
    color: var(--bkg-color-text);
}

/* Comments */
.bkg-wall-comments {
    padding-top: 12px;
    margin-top: 8px;
    border-top: 1px solid var(--bkg-color-border);
}

.bkg-wall-comment {
    padding: 8px 0;
}

.bkg-wall-comment-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}

.bkg-wall-comment-header strong {
    font-size: 0.85rem;
}

.bkg-wall-comment-content {
    font-size: 0.9rem;
    line-height: 1.4;
    padding-left: 36px;
}

.bkg-wall-comment-form {
    margin-top: 8px;
}

.bkg-wall-delete-comment {
    margin-left: auto;
    font-size: 1rem;
}

/* ─── Notification preferences ───────────────────────────── */

.bkg-notif-push-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0;
    margin-bottom: 12px;
    border-bottom: 1px solid var(--bkg-color-border);
}

.bkg-notif-push-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
}

.bkg-notif-push-status {
    font-size: 0.75rem;
    color: #999;
    white-space: nowrap;
}

.bkg-notif-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.bkg-notif-table thead th {
    padding: 6px 0;
    text-align: center;
    font-size: 1.1rem;
    width: 36px;
    font-weight: normal;
    padding-right: 4px;
}

.bkg-notif-table thead th:first-child {
    text-align: left;
    width: auto;
}

.bkg-notif-table tbody td {
    padding: 10px 0;
    text-align: center;
    border-top: 1px solid #f0ebe0;
}

.bkg-notif-table tbody td:first-child {
    text-align: left;
    padding-right: 8px;
}

.bkg-notif-cat {
    font-weight: 500;
    font-size: 0.85rem;
}

.bkg-notif-table input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--bkg-color-btn-bg);
}

/* ─── Mobile optimizations ───────────────────────────────── */

/* Mobile: edge-to-edge cards, warm background */
@media (max-width: 767px) {
    .bkg-container {
        padding: var(--bkg-spacing-sm) 0;
    }

    .bkg-card {
        border-radius: 0;
        margin-left: -0px;
        margin-right: -0px;
        margin-bottom: var(--bkg-spacing-sm);
        box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
        border-top: 0px solid var(--bkg-color-border);
        border-bottom: 0px solid var(--bkg-color-border);
        margin: 0 calc(-1 * var(--bkg-spacing-md));
        margin-bottom: 16px;
        border-top-left-radius: 8px;
        border-top-right-radius: 8px;
    }
    .products-list .bkg-card {
        margin: 0 auto;
        width: 100%;
    }

    /* Wall posts: tighter spacing on mobile */
    .bkg-wall-post {
        padding: var(--bkg-spacing-md);
        margin-bottom: 16px;
    }

    .bkg-wall-composer {
        padding: var(--bkg-spacing-md);
    }

    .bkg-wall-comment-content {
        padding-left: 36px;
    }

    /* Full-width images on mobile */
    .bkg-card [style*="margin:-24px"] {
    }
}

/* Warm background for the whole page when plugin content is shown */
.bkg-container {
    min-height: 60vh;
}
.products-list{
    display:grid;
    grid-template-columns:repeat(1, 1fr);
    gap:12px;
}

body:has(.bkg-container) {
    background-color: #fffaee;
}

/* Fallback for browsers without :has() */
.bkg-wall {
    background-color: #fffaee;
    /*margin: 0 calc(-1 * var(--bkg-spacing-md));*/
    padding: 0;
}

/* Event cards: horizontal layout from 650px */

.bkg-event-grid .bkg-card {
    display: flex;
    align-items: stretch;
}

.bkg-event-grid .bkg-card-image {
    flex: 0 0 200px;
    margin: 0 20px 0 0;
    border-radius: 8px;
}

.bkg-event-grid .bkg-card-img {
    height: 100%;
}

.bkg-event-grid .bkg-card-body {
    flex: 1;
    min-width: 0;
    overflow: hidden;
}
.bkg-event-grid .bkg-date, .bkg-event-grid .bkg-time{
    font-size: 0.85rem;
}
@media (max-width: 650px) {
    .bkg-event-grid .bkg-card-image {
        flex: 0 0 144px;
        margin: 0 20px 0 0;
        border-radius: 8px;
        height: 144px;
    }
    .bkg-container h2 {
        font-size: 1.1rem;
        white-space: nowrap;
    }
    .bkg-event-grid .bkg-date, .bkg-event-grid .bkg-time, .bkg-event-grid .bkg-deadline{
        font-size: 0.7rem !important;
    }
}
@media (max-width: 380px) {
    .bkg-event-grid .bkg-card-image {
        flex: 0 0 100px;
        margin: 0 20px 0 0;
        border-radius: 8px;
        height: 100px;
    }
}

/* Responsive: tablet and up */
@media (min-width: 768px) {
    .bkg-container {
        max-width: 720px;
        padding: var(--bkg-spacing-xl);
    }

    .bkg-wall {
        margin: 0;
        padding: 0;
    }
}

#bkg-show-members{
    background:none;
    border:none;
    padding:0 !important;
    cursor:pointer;
    font-size:0.9rem;
    color:var(--bkg-color-accent);
    text-transform: capitalize;
    font-weight: 700;
    letter-spacing: 1px !important;
}
#bkg-show-members:active, #bkg-show-members:focus, #bkg-show-members:hover, #bkg-show-members:target, #bkg-show-members:focus-visible, #bkg-show-members:focus-within{
    box-shadow: none !important;
}

/* ─── User Profile Card Modal ──────────────────────────── */

.bkg-user-card-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: bkg-fade-in 0.15s ease;
}

@keyframes bkg-fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

.bkg-user-card {
    background: white;
    border-radius: 16px;
    padding: 28px 24px;
    max-width: 320px;
    width: calc(100% - 40px);
    text-align: center;
    box-shadow: 0 12px 40px rgba(0,0,0,0.2);
    animation: bkg-card-slide-up 0.2s ease;
}

@keyframes bkg-card-slide-up {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.bkg-user-card-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--bkg-color-border);
    margin-bottom: 12px;
}

.bkg-user-card-name {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--bkg-color-text);
    margin: 0 0 4px;
}

.bkg-user-card-groups {
    font-size: 0.8rem;
    color: #888;
    margin: 0 0 20px;
    line-height: 1.4;
}

.bkg-user-card-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

.bkg-user-card-action {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    text-decoration: none;
    color: var(--bkg-color-btn-bg);
    background: #f5f0e6;
    border-radius: 12px;
    padding: 12px 16px;
    min-width: 72px;
    font-size: 0.75rem;
    font-weight: 600;
    transition: background 0.15s;
    border: none;
    cursor: pointer;
}

.bkg-user-card-action:hover,
.bkg-user-card-action:active {
    background: #ebe5d5;
    text-decoration: none;
    color: var(--bkg-color-btn-bg);
}

.bkg-user-card-action svg {
    width: 22px;
    height: 22px;
}

.bkg-user-card-nocontact {
    font-size: 0.8rem;
    color: #aaa;
    margin: 0;
    font-style: italic;
}

.bkg-user-card-close {
    position: absolute;
    top: 8px;
    right: 12px;
    background: none;
    border: none;
    font-size: 1.4rem;
    color: #999;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
}

.bkg-user-card-loading {
    padding: 20px;
    text-align: center;
    color: #999;
    font-size: 0.85rem;
}

/* Clickable user names */
.bkg-user-link {
    cursor: pointer;
    color: inherit;
}

.bkg-user-link:hover {
    text-decoration: underline;
}

/* Member list clickable items */
#bkg-members-panel .bkg-member-item {
    cursor: pointer;
    border-radius: 8px;
    padding: 8px;
    transition: background 0.15s;
}

#bkg-members-panel .bkg-member-item:hover {
    background: #f5f0e6;
}
