:root {
    --primary: #1A4FA0;
    --primary-light: #2c68c4;
    --gray-bg: #f4f7f9;
    --text: #1f2937;
    --text-light: #6b7280;
    --border: #e5e7eb;
}

* { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Inter', sans-serif; }
body { background: var(--gray-bg); color: var(--text); -webkit-font-smoothing: antialiased; }

/* Header */
.header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 1rem 0;
    box-shadow: 0 4px 20px rgba(0,0,0,0.03);
    margin-bottom: 3rem;
    position: sticky; top: 0; z-index: 100;
}
.header .container {
    display: flex; justify-content: space-between; align-items: center;
}
.logo { font-size: 1.6rem; color: var(--primary); text-decoration: none; display: flex; align-items: center; gap: 12px; }
.logo-shield {
    background: linear-gradient(135deg, var(--primary), var(--primary-light)); color: white; border-radius: 10px;
    width: 44px; height: 44px; display: flex; align-items: center; justify-content: center; font-size: 1.2rem;
    font-weight: 800; box-shadow: 0 4px 10px rgba(26, 79, 160, 0.2);
}
.back-link {
    text-decoration: none; color: var(--text-light); font-weight: 600; font-size: 0.95rem;
    display: flex; align-items: center; gap: 6px; transition: color 0.2s;
}
.back-link:hover { color: var(--primary); }

.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }
.main-content { min-height: 70vh; }

/* Shop Typo */
.shop-header { text-align: center; margin-bottom: 3rem; }
.shop-title { font-size: 2.5rem; font-weight: 800; margin-bottom: 10px; letter-spacing: -1px; }
.shop-subtitle { font-size: 1.1rem; color: var(--text-light); max-width: 600px; margin: 0 auto; line-height: 1.6; }

/* Filter Bar */
.filter-bar {
    display: flex; gap: 12px; margin-bottom: 40px; flex-wrap: wrap; justify-content: center;
}
.filter-btn {
    background: white; border: 1px solid var(--border); padding: 10px 20px;
    border-radius: 30px; cursor: pointer; transition: all 0.2s ease; font-weight: 600;
    font-size: 0.9rem; color: var(--text-light); box-shadow: 0 2px 5px rgba(0,0,0,0.02);
}
.filter-btn:hover { border-color: var(--primary-light); color: var(--primary); transform: translateY(-1px); }
.filter-btn.active {
    background: var(--primary); color: white; border-color: var(--primary);
    box-shadow: 0 4px 12px rgba(26, 79, 160, 0.25);
}

/* Grid for Shop */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 30px;
}
.card {
    background: white; border-radius: 16px; overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.04); transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex; flex-direction: column; border: 1px solid rgba(0,0,0,0.02);
}
.card:hover { transform: translateY(-8px); box-shadow: 0 20px 40px rgba(0,0,0,0.08); }

.card-img-wrapper { position: relative; width: 100%; height: 260px; overflow: hidden; }
.card-img-wrapper img {
    width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s;
}
.card:hover .card-img-wrapper img { transform: scale(1.05); }

.condition-badge {
    position: absolute; top: 15px; right: 15px;
    background: rgba(255, 255, 255, 0.95); backdrop-filter: blur(5px);
    color: var(--text); padding: 6px 12px; border-radius: 20px; font-size: 0.8rem; font-weight: 700;
    display: flex; align-items: center; gap: 4px; box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.card-content { padding: 1.8rem; display: flex; flex-direction: column; flex-grow: 1; }
.category-label { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 1px; color: var(--primary); font-weight: 700; margin-bottom: 8px;}
.card-title { font-size: 1.3rem; margin-bottom: 12px; color: var(--text); font-weight: 700; line-height: 1.3; }
.card-desc { font-size: 0.95rem; color: var(--text-light); margin-bottom: 25px; line-height: 1.6; flex-grow: 1; }

.card-footer { 
    display: flex; justify-content: space-between; align-items: center; 
    border-top: 1px solid var(--border); padding-top: 20px; margin-top: auto; 
}
.price { font-weight: 800; font-size: 1.4rem; color: #10b981; }
.buy-btn { 
    background: #f1f5f9; color: var(--primary); padding: 8px 16px; border-radius: 8px; 
    font-weight: 700; font-size: 0.9rem; text-decoration: none; transition: 0.2s;
}
.buy-btn:hover { background: var(--primary); color: white; }

.empty-state { text-align: center; padding: 5rem 2rem; color: var(--text-light); background: white; border-radius: 16px; border: 1px dashed var(--border); }
.empty-state h2 { color: var(--text); margin-bottom: 10px; }

.footer { text-align: center; padding: 4rem 0; color: var(--text-light); margin-top: 4rem; font-size: 0.9rem; }

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Admin Panel Additions */
.admin-box {
    background: white; max-width: 600px; margin: 0 auto; padding: 2.5rem; border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.06); border: 1px solid rgba(0,0,0,0.02);
}
.form-group { margin-bottom: 1.5rem; }
.form-group label { display: block; margin-bottom: 8px; font-weight: 600; font-size: 0.95rem; color: var(--text);}
.form-control {
    width: 100%; padding: 14px; border: 1px solid var(--border); border-radius: 10px;
    font-size: 1rem; background: #f9fafb; transition: all 0.2s;
}
.form-control:focus { outline: none; border-color: var(--primary-light); background: white; box-shadow: 0 0 0 3px rgba(44, 104, 196, 0.1); }
.btn {
    background: var(--primary); color: white; border: none; padding: 16px 24px;
    border-radius: 10px; font-size: 1.05rem; font-weight: bold; cursor: pointer; width: 100%; transition: 0.2s;
}
.btn:hover { background: var(--primary-light); transform: translateY(-2px); box-shadow: 0 6px 15px rgba(26, 79, 160, 0.2); }
.btn:disabled { background: #cbd5e1; cursor: not-allowed; transform: none; box-shadow: none; color: #94a3b8; }

#preview-container { display: none; margin-bottom: 20px; }
#preview-img { width: 100%; border-radius: 10px; max-height: 350px; object-fit: contain; background: #f1f5f9; cursor: pointer; border: 2px dashed transparent; transition: 0.2s; }
#preview-img:hover { border-color: var(--primary-light); }

.spinner { display: inline-block; width: 18px; height: 18px; border: 3px solid rgba(26, 79, 160, 0.2); border-radius: 50%; border-top-color: var(--primary); animation: spin 0.8s linear infinite; vertical-align: middle; margin-right: 8px; }
@keyframes spin { to { transform: rotate(360deg); } }

.capture-btn {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    background: #f8fafc; border: 2px dashed #cbd5e1; border-radius: 16px;
    padding: 50px 20px; cursor: pointer; transition: all 0.2s ease; color: var(--primary); margin-bottom: 25px;
}
.capture-btn:hover { background: #f1f5f9; border-color: var(--primary-light); color: var(--primary-light); transform: translateY(-2px); box-shadow: 0 8px 20px rgba(0,0,0,0.03); }
.capture-btn i { font-size: 3.5rem; margin-bottom: 12px; }
#file-input { display: none; }
