/* --- FEED & CARDS --- */
.feed-container { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
@media (min-width: 640px) { .feed-container { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 20px; } }

.post-card { background: var(--surface); border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-sm); display: flex; flex-direction: column; cursor: pointer; position: relative; border: 1px solid transparent; transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); }
.post-card:hover { transform: translateY(-5px); box-shadow: var(--shadow); }
.post-card.is-featured { border: 2px solid var(--vip-gold); }
.post-card.is-auction { border-color: var(--auction); }
.post-card.is-sold { opacity: 0.8; filter: grayscale(0.8); }

.badge-container { position: absolute; top: 8px; right: 8px; display: flex; flex-direction: column; gap: 4px; z-index: 5; }
.badge { font-size: 10px; font-weight: 800; padding: 4px 8px; border-radius: 20px; text-transform: uppercase; color: #fff; box-shadow: 0 2px 8px rgba(0,0,0,0.15); letter-spacing: 0.5px; backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
.badge-gold { background: var(--vip-gold); color: #000; }
.badge-auction { background: var(--auction); }
.badge-sold { background: var(--danger); }

.card-actions { position: absolute; top: 8px; left: 8px; z-index: 20; display:flex; gap:5px; }
.action-btn-card { background: var(--surface); border: 1px solid var(--border); border-radius: 50%; width: 32px; height: 32px; cursor: pointer; display: flex; align-items: center; justify-content: center; box-shadow: 0 4px 10px rgba(0,0,0,0.2); transition: all 0.2s; font-size: 15px; color: var(--text); }
.btn-delete:hover { background: #ffebee; color: #d32f2f; transform: scale(1.1); }

.post-card-img { width: 100%; aspect-ratio: 1/1; object-fit: cover; background: #eee; }
.post-content { padding: 10px; flex-grow: 1; display: flex; flex-direction: column; }
.post-price { font-size: 16px; font-weight: 800; color: var(--text); margin-bottom: 2px; }
.post-category { font-size: 9px; font-weight: 700; color: var(--primary); text-transform: uppercase; letter-spacing: 0.5px; }
.post-card h4 { margin: 4px 0; font-size: 14px; line-height: 1.3; font-weight: 700; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; color: var(--text); }
.post-card p { font-size: 12px; color: var(--text-light); margin: 4px 0 8px; line-height: 1.4; display: none; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

.auction-data { background: var(--primary-light); padding: 6px; border-radius: 6px; margin-top: auto; font-size: 11px; color: var(--auction); font-weight: 600; }
.post-footer { padding: 8px 10px; border-top: 1px solid var(--border); background: var(--surface); display: flex; justify-content: space-between; align-items: center; font-size: 10px; font-weight: 600; color: var(--secondary); }

@media (min-width: 640px) {
    .post-card-img { aspect-ratio: 4/3; }
    .post-content { padding: 15px; }
    .post-card h4 { font-size: 15px; }
    .post-card p { display: -webkit-box; }
    .post-footer { padding: 10px 15px; font-size: 11px; }
}

/* Skeleton Loading */
.skeleton-card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow);
}
.skeleton-img { width: 100%; aspect-ratio: 1/1; background: var(--bg); position: relative; overflow: hidden; }
@media (min-width: 640px) { .skeleton-img { aspect-ratio: 4/3; } }
.skeleton-content { padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.skeleton-line { height: 10px; background: var(--bg); border-radius: 4px; position: relative; overflow: hidden; }
.skeleton-line.short { width: 40%; }
.skeleton-line.medium { width: 70%; }
.skeleton-line.long { width: 90%; }

.skeleton-pulse::after {
    content: "";
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(90deg, transparent 0%, var(--border) 50%, transparent 100%);
    opacity: 0.6;
    transform: translateX(-100%);
    animation: shimmer 1.5s infinite;
}
@keyframes shimmer { 100% { transform: translateX(100%); } }

/* --- MODALS --- */
#lightbox { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.95); z-index: 3000; justify-content: center; align-items: center; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); cursor: zoom-out; }
#lightbox.active { display: flex; }
#lightbox img { max-width: 98%; max-height: 95%; border-radius: 4px; box-shadow: 0 0 30px rgba(0,0,0,0.5); object-fit: contain; }
.close-lightbox { position: absolute; top: 20px; right: 20px; color: white; font-size: 40px; cursor: pointer; font-weight: 200; z-index: 3010; }

#confirm-modal { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.6); z-index: 4000; justify-content: center; align-items: center; backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
#confirm-modal.active { display: flex; }
.modal-card { background: var(--surface); padding: 25px; border-radius: 16px; box-shadow: 0 10px 25px rgba(0,0,0,0.2); max-width: 90%; width: 320px; text-align: center; border: 1px solid var(--border); animation: popIn 0.2s ease; }
@keyframes popIn { from { transform: scale(0.9); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.modal-actions { display: flex; gap: 10px; margin-top: 20px; justify-content: center; }
.btn-cancel { background: var(--bg); color: var(--text); border: 1px solid var(--border); padding: 10px 20px; border-radius: 8px; cursor: pointer; font-weight: 600; }
.btn-confirm { background: var(--danger); color: white; border: none; padding: 10px 20px; border-radius: 8px; cursor: pointer; font-weight: 600; }

/* --- FORMS & BUTTONS --- */
.form-group { margin-bottom: 15px; }
.form-group label { display: block; font-size: 11px; font-weight: 800; text-transform: uppercase; margin-bottom: 5px; color: var(--secondary); }
.form-group input, .form-group textarea, .form-group select { width: 100%; padding: 12px; border: 1px solid var(--border); border-radius: 10px; box-sizing: border-box; font-family: inherit; background: var(--surface); color: var(--text); transition: all 0.2s; }
.form-group input:focus, .form-group textarea:focus, .form-group select:focus { border-color: var(--primary); outline: none; box-shadow: 0 0 0 3px var(--primary-light); }

/* Fix para Autofill en Chrome/Edge */
input:-webkit-autofill, input:-webkit-autofill:hover, input:-webkit-autofill:focus, textarea:-webkit-autofill, textarea:-webkit-autofill:hover, textarea:-webkit-autofill:focus, select:-webkit-autofill, select:-webkit-autofill:hover, select:-webkit-autofill:focus {
    -webkit-box-shadow: 0 0 0px 1000px var(--surface) inset;
    -webkit-text-fill-color: var(--text);
    transition: background-color 5000s ease-in-out 0s;
}

.image-upload-area { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 5px; }
.img-preview { width: 60px; height: 60px; border-radius: 8px; object-fit: cover; border: 1px solid var(--border); cursor: pointer; }
.btn-add-img { width: 60px; height: 60px; border-radius: 8px; border: 2px dashed var(--secondary); display: flex; align-items: center; justify-content: center; cursor: pointer; color: var(--secondary); font-size: 24px; }
.btn-main { background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%); color: white; border: none; width: 100%; padding: 14px; border-radius: 12px; font-weight: 700; cursor: pointer; margin-top: 10px; box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3); transition: all 0.2s; }
.btn-main:hover { transform: translateY(-2px); box-shadow: 0 6px 15px rgba(99, 102, 241, 0.4); }
.btn-main:disabled { background: #ccc; cursor: not-allowed; }
.btn-fb { background: #1877F2; color: white; border: none; padding: 12px; border-radius: 8px; font-weight: 700; cursor: pointer; width: 100%; }
.status-msg { margin-top: 10px; padding: 10px; border-radius: 8px; text-align: center; font-size: 13px; display: none; }
.status-msg.show { display: block; }
.error { background: #fee; color: #c00; }
.success { background: #dcfce7; color: #166534; }
.cost-pill { background: var(--bg); padding: 10px; border-radius: 8px; display: flex; justify-content: space-between; align-items: center; margin-bottom: 15px; border: 1px solid var(--border); }
.cost-pill span:last-child { font-weight: 800; color: var(--accent); }

.empty-state { grid-column: 1 / -1; text-align: center; padding: 40px 20px; color: var(--secondary); display: flex; flex-direction: column; align-items: center; gap: 10px; }
.warning-box { background: #fffbeb; border: 1px solid #fcd34d; color: #92400e; padding: 10px; border-radius: 8px; font-size: 12px; margin-bottom: 15px; display: flex; align-items: center; gap: 8px; }

.btn-action-img { flex: 1; background: var(--surface); border: 1px dashed var(--primary); color: var(--primary); padding: 12px; border-radius: 8px; font-weight: 700; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 8px; font-size: 13px; transition: background 0.2s; }
.btn-action-img:hover { background: var(--primary-light); }
.btn-action-img:active { transform: scale(0.98); }

.btn-tool {
    flex: 1;
    padding: 12px;
    border-radius: 8px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    box-shadow: var(--shadow);
    transition: transform 0.1s, box-shadow 0.1s, background-color 0.2s;
}
.btn-tool:active {
    transform: scale(0.95);
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.1);
}

#global-toast.show { animation: toastIn 0.3s; }
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, 10px); } to { opacity: 1; transform: translate(-50%, 0); } }

#recaptcha-container { margin: 15px 0; display: flex; justify-content: center; }