/* Fonts */
@font-face {
    font-family: 'FactorB';
    src: url('FactorB-Regular.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'FactorB';
    src: url('FactorB-Bold.ttf') format('truetype');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

/* Theme variables */
:root{
    --bg: #283851;              /* slate-900 background behind everything */
    --surface: #ffffff;         /* white cards */
    --muted-surface: #f8fafc;   /* very light surface */
    --text: #283851;            /* primary text */
    --muted: #64748b;           /* muted text */
    --primary: #b2a384;         /* brand */
    --primary-600: #b2a384;
    --danger: #f08272;
    --success: #74c582;
    --ring: rgba(37,99,235,.35);
    --border: #e2e8f0;
    --shadow: 0 8px 30px rgba(2,8,23,.08);
    --radius: 12px;
}

/* Base */
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
    margin: 0;
    font-family: 'FactorB', system-ui, -apple-system, Segoe UI, Roboto, "Helvetica Neue", Arial, "Noto Sans", "Liberation Sans", sans-serif;
    background:
        radial-gradient(1200px 800px at 100% -10%, #1e293b 0%, transparent 60%),
        radial-gradient(900px 600px at -10% 0%, #0b1222 0%, transparent 55%),
        var(--bg);
    color: var(--text);
    line-height: 1.6;
}
h1, h2, h3, h4, h5, h6, strong, b { font-weight: 700; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Loading Spinner */
.spinner-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    backdrop-filter: blur(2px);
}

.spinner {
    display: flex;
    align-items: center;
    justify-content: center;
}

.spinner-circle {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* Layout containers */
.container{
    max-width: 760px;
    margin: 0 auto;
    padding: 28px 16px 48px;
}

/* App header */
.header{
    background: linear-gradient(180deg, rgba(255,255,255,.85), #fff 60%);
    backdrop-filter: blur(6px);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px 16px;
    margin-bottom: 20px;
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
    align-items: flex-start;
}
.header .user-info{
    color: var(--muted);
    font-size: 13px;
}

 /* Logo Header Styles */
    .logo-inline {
        display: flex;
        align-items: center;
        margin-right: 20px;
    }
    
    .social-logo {
        height: 40px;
        width: auto;
        max-width: 100%;
        display: block;
    }
    
    @media (max-width: 768px) {
        .logo-inline {
            margin-right: 15px;
        }
        
        .social-logo {
            height: 32px;
        }
    }
    
    @media (max-width: 480px) {
        .logo-inline {
            margin-right: 10px;
        }
        
        .social-logo {
            height: 28px;
        }
    }
    
    /* Page Tabs Styles */
    .page-tabs {
        display: flex;
        gap: 4px;
        margin: 20px 0;
        background: var(--bg-secondary, #f5f5f5);
        border-radius: 8px;
        overflow: hidden;
    }
    
    .tab-button {
        flex: 1;
        padding: 14px 20px;
        background: transparent;
        border: none;
        cursor: pointer;
        font-size: 1rem;
        font-weight: 600;
        color: var(--text-secondary, #666);
        transition: all 0.2s;
        position: relative;
    }
    
    .tab-button:hover {
        background: rgba(0, 0, 0, 0.05);
        color: var(--text-primary, #1a1a1a);
    }
    
    .tab-button.active {
        background: white;
        color: var(--primary, #007bff);
        border-bottom: 3px solid var(--primary, #007bff);
    }
    
    .tab-content {
        display: none;
        animation: fadeIn 0.3s ease-in;
    }
    
    @keyframes fadeIn {
        from {
            opacity: 0;
            transform: translateY(-10px);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }
    
    .info-section {
        background: white;
        padding: 24px;
        border-radius: 8px;
        margin-bottom: 20px;
    }
    
    .info-section h2 {
        margin-top: 0;
        color: var(--text-primary, #1a1a1a);
        font-size: 1.8rem;
        margin-bottom: 16px;
    }
    
    .group-description {
        line-height: 1.6;
        color: var(--text-secondary, #666);
        margin-bottom: 24px;
        white-space: pre-wrap;
    }
    
    .group-rules {
        padding-top: 24px;
        border-top: 1px solid var(--border, #e0e0e0);
    }
    
    .group-rules h3 {
        color: var(--text-primary, #1a1a1a);
        font-size: 1.4rem;
        margin-bottom: 12px;
    }
    
    .rules-content {
        line-height: 1.6;
        color: var(--text-secondary, #666);
    }
    
    @media (max-width: 768px) {
        .page-tabs {
            gap: 2px;
        }
        
        .tab-button {
            padding: 12px 10px;
            font-size: 0.9rem;
        }
    }
    
    @media (max-width: 480px) {
        .page-tabs {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 8px;
        }
        
        .tab-button {
            padding: 10px 8px;
            font-size: 0.85rem;
        }
    }

/* Messages */
.message{
    padding: 12px 14px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--surface);
    box-shadow: var(--shadow);
    margin-bottom: 14px;
    font-size: 14px;
}
.message.success{ border-color: #86efac; background: #f0fdf4; color: #166534; }
.message.error  { border-color: #fecaca; background: #fef2f2; color: #7f1d1d; }

/* Buttons (generic) */
button{
    appearance: none;
    border: 0;
    border-radius: 10px;
    padding: 10px 16px;
    font-weight: 700;
    font-size: 14px;
    color: #fff;
    background: var(--primary);
    box-shadow: 0 6px 8px rgba(37,99,235,.25);
    cursor: pointer;
    transition: transform .06s ease, box-shadow .15s ease, background .15s ease;
}
button:hover{ background: var(--primary-600); }
button:active{ transform: translateY(1px); }

/* Secondary button style (anchor-based) */
.btn{
    appearance: none;
    border: 0;
    border-radius: 10px;
    padding: 8px 12px;
    font-weight: 700;
    font-size: 14px;
    color: #fff;
    background: var(--primary);
    box-shadow: 0 6px 8px rgba(37,99,235,.25);
    cursor: pointer;
}

/* Emphasis buttons used in feed */
.btn-delete{
    background: var(--danger);
    box-shadow: 0 6px 8px rgba(239,68,68,.25);
}
.btn-comment{
    background: var(--primary);
    box-shadow: 0 6px 8px rgba(22,163,74,.25);
}

/* Cards and admin layout pieces */
.card{
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 16px;
}
h2.page-title{ color: #fff; margin: 0 0 12px; }  /* optional helper if needed */

/* Form primitives */
label{
    display: block;
    color: var(--muted);
    font-weight: 600;
    margin-bottom: 6px;
    font-size: 12px;
    letter-spacing: .2px;
}
input[type="text"],
input[type="number"],
textarea{
    width: 100%;
    padding: 12px 14px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--muted-surface);
    color: var(--text);
    font-size: 14px;
    outline: none;
    transition: border-color .15s, box-shadow .15s, background .15s;
    font-family: 'FactorB', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif; /* ensure FactorB for textarea */
}
textarea{ min-height: 120px; }
input:focus, textarea:focus{
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--ring);
    background: #fff;
}
input[type="file"]{
    width: 100%;
    padding: 10px;
    border-radius: 10px;
    border: 1px dashed var(--border);
    background: var(--muted-surface);
    color: var(--muted);
}

/* Admin form grid helpers */
.form-grid{
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
.form-grid-1{
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}
.row{ display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.row-3{ display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }
.check-row{
    display: flex; flex-wrap: wrap; gap: 12px; align-items: center;
    margin-top: 4px;
}
.check-row label{
    display: inline-flex; align-items: center; gap: 8px; margin: 0;
    font-weight: 700; color: var(--text);
}
.dim{ color: var(--muted); font-size: 13px; }
.actions{ display: flex; justify-content: flex-end; gap: 10px; margin-top: 8px; }

/* Groups list (groups.php) */
.activities{ display: flex; flex-direction: column; gap: 14px; }
.activity{
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 16px;
}
.activity-header{
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}
.activity-author{
    color: var(--text);
    font-weight: 800;
    letter-spacing: .2px;
}
.group-meta{
    color: var(--muted);
    font-size: 12px;
}
.group-cover{
    width: 100%;
    height: 160px;
    object-fit: cover;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: #eef2f7;
    margin: 6px 0 10px;
}
.group-desc{
    color: var(--muted);
    font-size: 14px;
}
.empty{
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 24px;
    text-align: center;
    color: var(--muted);
}

/* Group hero header (index.php) */
.group-header{
    position: relative;
    width: 100%;
    min-height: 220px;
    border-radius: calc(var(--radius) + 4px);
    margin-bottom: 20px;
    display: flex;
    align-items: flex-end;
    padding: 24px;
    color: #fff;
    overflow: hidden;
    box-shadow: var(--shadow);
    background-size: cover;
    background-position: center;
}
.group-header::after{
    content: "";
    position: absolute; inset: 0;
    background: linear-gradient(180deg, rgba(0,0,0,.0) 20%, rgba(0,0,0,.55) 90%);
    pointer-events: none;
}
.group-header .group-logo{
    position: absolute;
    top: 16px; left: 16px;
    width: 72px; height: 72px;
    border-radius: 16px;
    background: #fff;
    object-fit: contain;
    border: 2px solid rgba(255,255,255,.85);
    box-shadow: 0 8px 30px rgba(0,0,0,.25);
}
.group-header .group-info{
    position: relative; z-index: 1;
    margin-left: 96px;
    text-shadow: 0 2px 10px rgba(0,0,0,.35);
}
.group-header h2{
    margin: 0 0 6px 0;
    font-weight: 800;
    letter-spacing: .2px;
}
.group-header p{ margin: 0; opacity: .95; }

/* Composer (index.php) */
.post-form{
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 16px;
    margin-bottom: 16px;
}
.post-form h2{
    margin: 2px 0 10px;
    font-size: 18px;
    color: var(--text);
    font-weight: 700;
}
.form-group{ margin-bottom: 12px; }

#membership-container{
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 16px;
    margin: 16px 0;
    text-align: center;
}

/* Feed specifics (index.php) */
.activity-header{
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 10px;
}
.activity-time{
    color: var(--muted);
    font-size: 12px;
}
.activity-content{
    color: var(--text);
    margin: 8px 0 10px;
    word-wrap: break-word;
    font-size: 15px;
}

/* Attachments gallery */
.gallery{
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
    margin: 6px 0 10px;
}
.gallery img{
    width: 100%;
    height: 180px;
    object-fit: cover;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: #eef2f7;
    transition: transform .12s ease, box-shadow .12s ease;
    cursor: zoom-in;
}
.gallery img:hover{
    transform: translateY(-1px);
    box-shadow: 0 8px 24px rgba(2,8,23,.15);
}

/* Lightbox */
.lightbox{
    display: none;
    position: fixed; inset: 0;
    background: rgba(2,8,23,.85);
    align-items: center; justify-content: center;
    z-index: 1000;
}
.lightbox img{
    max-width: min(92vw, 1200px);
    max-height: 86vh;
    border-radius: 12px;
    box-shadow: 0 12px 40px rgba(0,0,0,.5);
}
.lightbox .nav{
    position: absolute; top: 50%; transform: translateY(-50%);
    font-size: 34px; color: #fff; cursor: pointer; user-select: none;
    background: rgba(255,255,255,.12);
    width: 44px; height: 44px; border-radius: 50%;
    display: grid; place-items: center;
}
.lightbox .prev{ left: 24px; }
.lightbox .next{ right: 24px; }
.lightbox .close{
    position: absolute; top: 18px; right: 18px;
    font-size: 28px; color: #fff; cursor: pointer;
    background: rgba(255,255,255,.12);
    width: 40px; height: 40px; border-radius: 50%;
    display: grid; place-items: center;
}

/* OG link preview */
.og-preview{
    margin-top: 10px;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 12px;
    background: var(--surface);
    display: none;
}
.og-preview.loading{ display:block; opacity:.6; }
.og-preview__wrap{
    display: grid;
    grid-template-columns: 120px 1fr;
    gap: 12px; align-items: start;
}
.og-preview__thumb{
    width: 120px; height: 120px; object-fit: cover;
    border-radius: 10px; background: #eef2f7; border: 1px solid var(--border);
}
.og-preview__title{ margin: 0 0 6px 0; font-weight: 800; color: var(--text); }
.og-preview__desc{ margin: 0; color: var(--muted); font-size: 14px; }
.og-preview__url{ margin-top: 6px; font-size: 12px; color: var(--primary); word-break: break-all; }

/* Selected-photo previews (pre-upload) */
.photo-preview{
    display: flex; flex-wrap: wrap; gap: 10px; margin-top: 8px;
}
.photo-preview__item{
    position: relative; width: 100px; height: 100px;
}
.photo-preview__img{
    width: 100%; height: 100%; object-fit: cover;
    border-radius: 10px; border: 1px solid var(--border); background: #eef2f7;
}
.photo-preview__remove{
    position: absolute; top: 4px; right: 4px;
    width: 22px; height: 22px; border: none; border-radius: 50%;
    background: rgba(0,0,0,.65); color: #fff; cursor: pointer;
    display: grid; place-items: center; font-size: 14px; line-height: 1;
}

/* Comments */
.comments-section{
    border-top: 1px solid var(--border);
    padding-top: 12px; margin-top: 6px;
}
.comment{
    background: var(--muted-surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 10px;
    margin-bottom: 8px;
}
.comment-author{
    font-weight: 700; font-size: 13px; color: var(--text); margin-bottom: 4px;
}
.comment-text{
    font-size: 14px; color: var(--muted);
}
.comment-form { align-items: flex-start; } /* align button to top of textarea */
.comment-input {
    min-height: 42px;
    resize: vertical;
    line-height: 1.4;
}
.comment-input:focus{ border-color: var(--primary); box-shadow: 0 0 0 4px var(--ring); }

/* Empty state in feed */
.no-activities{
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 40px;
    text-align: center;
    color: var(--muted);
}

/* Pagination */
.pagination{
    display: flex;
    align-items: center;
    gap: 10px;
    justify-content: space-between;
}
.page-btn{
    display: inline-block;
    padding: 8px 12px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--primary);
    text-decoration: none;
    font-weight: 700;
    font-size: 14px;
    box-shadow: var(--shadow);
    transition: background .15s ease, transform .06s ease;
}
.page-btn:hover{ background: var(--muted-surface); text-decoration: none; }
.page-btn:active{ transform: translateY(1px); }
.page-btn.disabled{ opacity: .5; pointer-events: none; cursor: default; }
.page-indicator{ color: var(--muted); font-size: 13px; margin: 0 6px; }

/* Spinner */
.spinner{
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 3px solid rgba(0,0,0,.1);
    border-top-color: var(--primary);
    animation: spin .8s linear infinite;
    display: inline-block;
    vertical-align: middle;
    margin-right: 8px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Optional accessibility: pause animation if user prefers reduced motion */
@media (prefers-reduced-motion: reduce) {
    .spinner { animation: none; }
}

/* Event autocomplete (index.php) */
.event-autocomplete {
    position: relative;
    margin-top: 10px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    box-shadow: var(--shadow);
    max-width: 400px;
}
.event-search {
    padding: 12px;
    border-bottom: 1px solid var(--border);
}
.event-search input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--muted-surface);
    font-size: 14px;
    outline: none;
}
.event-search input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--ring);
}
.event-results { max-height: 300px; overflow-y: auto; }
.event-item {
    padding: 12px;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    transition: background-color 0.15s ease;
}
.event-item:last-child { border-bottom: none; }
.event-item:hover { background: var(--muted-surface); }
.event-item-title { font-weight: 700; color: var(--text); margin-bottom: 4px; }
.event-item-details { font-size: 12px; color: var(--muted); }
.event-loading {
    padding: 20px;
    text-align: center;
    color: var(--muted);
}
.event-no-results {
    padding: 20px;
    text-align: center;
    color: var(--muted);
    font-style: italic;
}

/* Place autocomplete (index.php) */
.place-autocomplete {
    position: relative;
    margin-top: 10px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    box-shadow: var(--shadow);
    max-width: 400px;
}
.place-search { padding: 12px; border-bottom: 1px solid var(--border); }
.place-search input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--muted-surface);
    font-size: 14px;
    outline: none;
}
.place-search input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--ring);
}
.place-results { max-height: 300px; overflow-y: auto; }
.place-item {
    padding: 12px;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    transition: background-color 0.15s ease;
}
.place-item:last-child { border-bottom: none; }
.place-item:hover { background: var(--muted-surface); }
.place-item-title { font-weight: 700; color: var(--text); margin-bottom: 4px; }
.place-item-details { font-size: 12px; color: var(--muted); }
.place-loading {
    padding: 20px;
    text-align: center;
    color: var(--muted);
}
.place-no-results {
    padding: 20px;
    text-align: center;
    color: var(--muted);
    font-style: italic;
}

/* Icon button */
.icon-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--muted-surface);
    border: 1px solid var(--border);
    cursor: pointer;
    font-size: 18px;
    transition: background .15s ease, box-shadow .15s ease;
}
.icon-button:hover {
    background: var(--surface);
    box-shadow: 0 4px 12px rgba(2,8,23,.1);
}
.icon-button:active { transform: translateY(1px); }

/* Products Section */
.product-container {
    background-color: var(--surface);
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    border-radius: 8px;
}
.product-header {
    margin-bottom: 30px;
}
.product-title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 10px;
    color: var(--text-primary, #1a1a1a);
}
.product-short-desc {
    font-size: 1.1rem;
    color: var(--text-secondary, #666);
    margin-bottom: 15px;
}
.product-price {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 10px;
}
.product-offer {
    display: inline-block;
    background: #ff4444;
    color: white;
    padding: 4px 12px;
    border-radius: 4px;
    font-weight: 600;
    margin-left: 10px;
}
.product-category {
    display: inline-block;
    background: var(--muted-surface);
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 0.9rem;
    color: var(--text-secondary, #666);
    margin-bottom: 20px;
}
.product-body {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    margin-bottom: 40px;
}
.product-gallery {
    position: relative;
}
.gallery-main {
    width: 100%;
    aspect-ratio: 1;
    border-radius: 12px;
    overflow: hidden;
    background: var(--muted-surface);
    margin-bottom: 10px;
    cursor: pointer;
    border: 1px solid var(--border);
}
.gallery-main img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.gallery-thumbnails {
    display: flex;
    gap: 10px;
    overflow-x: auto;
}
.gallery-thumb {
    width: 80px;
    height: 80px;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
    flex-shrink: 0;
    background: var(--muted-surface);
}
.gallery-thumb.active {
    border-color: var(--primary);
}
.gallery-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.product-details {
    display: flex;
    flex-direction: column;
}
.product-description {
    line-height: 1.6;
    color: var(--text);
    margin-bottom: 30px;
    white-space: pre-wrap;
}
.product-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: auto;
}
.btn-primary {
    display: inline-block;
    padding: 12px 24px;
    background: var(--primary);
    color: white;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: background 0.2s;
}
.btn-primary:hover {
    background: var(--primary-600);
}
.btn-secondary {
    display: inline-block;
    padding: 12px 24px;
    background: var(--muted-surface);
    color: var(--text);
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: background 0.2s;
}
.btn-secondary:hover {
    background: var(--border);
}
.share-button {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 12px 24px;
    background: var(--muted-surface);
    color: var(--text);
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: background 0.2s;
}
.share-button:hover {
    background: var(--border);
}

/* Lightbox */
.lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 9999;
    align-items: center;
    justify-content: center;
}
.lightbox.active {
    display: flex;
}
.lightbox-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
}
.lightbox-content img {
    max-width: 100%;
    max-height: 90vh;
    object-fit: contain;
}
.lightbox-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}
.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}
.lightbox-prev {
    left: 20px;
}
.lightbox-next {
    right: 20px;
}
.lightbox-counter {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    color: white;
    background: rgba(0, 0, 0, 0.7);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
}

/* Products List */
.products-list {
    max-width: 1200px;
    margin: 0 auto;
}
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
    margin-top: 30px;
}
.product-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--border);
    transition: box-shadow 0.2s;
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
}
.product-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}
.product-card-image {
    width: 100%;
    aspect-ratio: 1;
    background: var(--muted-surface);
    overflow: hidden;
}
.product-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.product-card-content {
    padding: 16px;
    flex: 1;
    display: flex;
    flex-direction: column;
}
.product-card-title {
    font-weight: 700;
    font-size: 1.1rem;
    margin-bottom: 8px;
    color: var(--text);
}
.product-card-desc {
    color: var(--muted);
    font-size: 0.9rem;
    margin-bottom: 12px;
    flex: 1;
}
.product-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.product-card-price {
    font-weight: 700;
    color: var(--primary);
    font-size: 1.2rem;
}
.product-card-offer {
    background: #ff4444;
    color: white;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: 600;
}
.back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--primary);
    text-decoration: none;
    margin-bottom: 20px;
    font-weight: 600;
}
.back-link:hover {
    text-decoration: underline;
}

/* Partner Info Card */
.partner-info-card {
    background: white;
    border-radius: 12px;
    padding: 32px;
    margin-bottom: 20px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
}
.partner-logo-container {
    text-align: center;
    margin-bottom: 24px;
}
.partner-logo {
    max-width: 200px;
    max-height: 120px;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 8px;
}
.partner-name {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text);
    margin: 0 0 12px 0;
    text-align: center;
}
.partner-short-desc {
    font-size: 1.1rem;
    color: var(--muted);
    text-align: center;
    margin: 0 0 24px 0;
    line-height: 1.6;
}
.partner-description {
    line-height: 1.8;
    color: var(--text);
    margin-bottom: 24px;
    padding: 20px;
    background: var(--muted-surface);
    border-radius: 8px;
    border-left: 4px solid var(--primary);
}
.partner-detail {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 16px;
    padding: 12px;
    background: var(--muted-surface);
    border-radius: 8px;
}
.partner-icon {
    font-size: 1.2rem;
    flex-shrink: 0;
}
.partner-contact-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin: 24px 0;
}
.partner-contact-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: white;
    border: 2px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    text-decoration: none;
    font-weight: 600;
    transition: all 0.2s ease;
    flex: 1;
    min-width: 200px;
}
.partner-contact-btn:hover {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    text-decoration: none;
}
.partner-contact-label {
    font-size: 0.9rem;
}
.partner-social-section {
    margin-top: 32px;
    padding-top: 24px;
    border-top: 2px solid var(--border);
    text-align: center;
}
.partner-social-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text);
    margin: 0 0 16px 0;
}
.partner-social-icons {
    display: flex;
    justify-content: center;
    gap: 16px;
    flex-wrap: wrap;
}
.partner-social-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    transition: all 0.3s ease;
    text-decoration: none;
}
.partner-social-fb {
    background: #1877f2;
    color: white;
}
.partner-social-fb:hover {
    background: #145dbf;
    transform: scale(1.1);
}
.partner-social-insta {
    background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
    color: white;
}
.partner-social-insta:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(188, 24, 136, 0.4);
}
.partner-social-yt {
    background: #ff0000;
    color: white;
}
.partner-social-yt:hover {
    background: #cc0000;
    transform: scale(1.1);
}
.partner-social-li {
    background: #0077b5;
    color: white;
}
.partner-social-li:hover {
    background: #005885;
    transform: scale(1.1);
}

/* Responsive tweaks */
@media (max-width: 680px){
    .container{ padding: 20px 12px 40px; }
    .gallery{ grid-template-columns: repeat(2, 1fr); }
    .og-preview__wrap{ grid-template-columns: 1fr; }
    .group-header{ min-height: 200px; }
    .group-header .group-logo{ width: 64px; height: 64px; }
    .group-header .group-info{ margin-left: 84px; }
    .row, .row-3{ grid-template-columns: 1fr; }
    .form-grid{ grid-template-columns: 1fr; }
    .partner-info-card{ padding: 20px; }
    .partner-name{ font-size: 1.5rem; }
    .partner-short-desc{ font-size: 1rem; }
    .partner-contact-btn{ min-width: 100%; }
    .partner-contact-label{ font-size: 0.85rem; }
    .product-body{ grid-template-columns: 1fr; gap: 20px; }
}
