:root {
    --pink-bg:   #FFF0F6;
    --pink-100:  #FFD6E7;
    --pink-300:  #FFB3D1;
    --pink-400:  #FF80B5;
    --pink-500:  #F06292;
    --pink-600:  #E91E8C;
    --pink-700:  #C2185B;
    --pink-dark: #880E4F;
    --text:      #3D0030;
    --muted:     #9E5070;
    --white:     #FFFFFF;
    --shadow:    rgba(194, 24, 91, 0.14);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: 'Nunito', sans-serif;
    background: var(--pink-bg);
    color: var(--text);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ── Header ─────────────────────────────────────────── */
header {
    background: linear-gradient(135deg, var(--pink-dark) 0%, var(--pink-600) 60%, var(--pink-400) 100%);
    padding: 0 2rem;
    box-shadow: 0 3px 20px var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
}
.header-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 68px;
}
.brand {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    text-decoration: none;
    color: white;
    overflow: hidden;
    max-height: 68px;
}
.brand-icon { font-size: 1.9rem; }
.brand-text {
    font-family: 'Playfair Display', serif;
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: 0.3px;
}
nav { display: flex; align-items: center; gap: 1.2rem; }
nav a {
    color: rgba(255,255,255,0.88);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.92rem;
    transition: color 0.2s;
}
nav a:hover { color: white; }
.btn-nav {
    background: rgba(255,255,255,0.18);
    padding: 0.38rem 1.1rem;
    border-radius: 20px;
    border: 1.5px solid rgba(255,255,255,0.35);
    transition: background 0.2s !important;
}
.btn-nav:hover { background: rgba(255,255,255,0.32) !important; }

/* ── Layout ─────────────────────────────────────────── */
main {
    flex: 1;
    padding: 2.2rem 1.2rem;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}
footer {
    background: var(--pink-dark);
    color: rgba(255,255,255,0.8);
    text-align: center;
    padding: 1rem;
    font-size: 0.88rem;
}

/* ── Page title ─────────────────────────────────────── */
.page-title {
    text-align: center;
    margin-bottom: 1.8rem;
}
.page-title h1 {
    font-family: 'Playfair Display', serif;
    font-size: 2.1rem;
    color: var(--pink-700);
    line-height: 1.2;
}
.page-title p {
    color: var(--muted);
    margin-top: 0.4rem;
    font-size: 0.97rem;
}

/* ── Category filters ───────────────────────────────── */
.filters {
    display: flex;
    gap: 0.65rem;
    flex-wrap: wrap;
    justify-content: center;
    margin-bottom: 2rem;
}
.filter-btn {
    padding: 0.48rem 1.3rem;
    border: 2px solid var(--pink-300);
    background: white;
    color: var(--pink-600);
    border-radius: 25px;
    font-weight: 700;
    font-size: 0.88rem;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s;
    font-family: 'Nunito', sans-serif;
    white-space: nowrap;
}
.filter-btn:hover, .filter-btn.active {
    background: var(--pink-600);
    border-color: var(--pink-600);
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(233,30,140,0.25);
}

/* ── Card grid ──────────────────────────────────────── */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 1.4rem;
}
.card {
    background: white;
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 3px 14px var(--shadow);
    transition: transform 0.25s, box-shadow 0.25s;
    border: 1.5px solid var(--pink-100);
}
.card:hover {
    transform: translateY(-6px);
    box-shadow: 0 10px 32px rgba(233,30,140,0.2);
}
.card-img-wrap {
    width: 100%;
    height: 200px;
    background: linear-gradient(135deg, var(--pink-100), #fff0f9);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.card-img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.card-placeholder { font-size: 3.2rem; }
.card-body { padding: 1rem 1.1rem 1.2rem; }
.card-category {
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: var(--pink-500);
    margin-bottom: 0.25rem;
}
.card-name {
    font-family: 'Playfair Display', serif;
    font-size: 1.08rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 0.4rem;
    line-height: 1.3;
}
.card-desc {
    font-size: 0.83rem;
    color: var(--muted);
    line-height: 1.55;
    margin-bottom: 0.55rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.card-price {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--pink-700);
}

/* ── Pagination ─────────────────────────────────────── */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.45rem;
    margin-top: 2.5rem;
    flex-wrap: wrap;
}
.page-btn {
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    text-decoration: none;
    font-weight: 700;
    font-size: 0.88rem;
    border: 2px solid var(--pink-300);
    color: var(--pink-600);
    background: white;
    transition: all 0.2s;
}
.page-btn:hover, .page-btn.active {
    background: var(--pink-600);
    border-color: var(--pink-600);
    color: white;
}
.page-btn.wide { width: auto; padding: 0 0.9rem; border-radius: 20px; font-size: 1rem; }
.page-btn.disabled { opacity: 0.38; pointer-events: none; }

/* ── Empty state ────────────────────────────────────── */
.empty-state {
    text-align: center;
    padding: 4rem 1rem;
    color: var(--muted);
}
.empty-state .em { font-size: 3.5rem; margin-bottom: 0.6rem; }
.empty-state p { font-size: 1rem; }

/* ── Login ──────────────────────────────────────────── */
.login-wrap {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 60vh;
}
.login-card {
    background: white;
    border-radius: 22px;
    padding: 2.6rem 2.2rem;
    width: 100%;
    max-width: 390px;
    box-shadow: 0 12px 45px var(--shadow);
    border: 1.5px solid var(--pink-100);
}
.login-card .icon { text-align: center; font-size: 2.8rem; margin-bottom: 0.3rem; }
.login-card h2 {
    font-family: 'Playfair Display', serif;
    text-align: center;
    color: var(--pink-700);
    font-size: 1.75rem;
    margin-bottom: 0.25rem;
}
.login-card .sub {
    text-align: center;
    color: var(--muted);
    font-size: 0.88rem;
    margin-bottom: 1.8rem;
}

/* ── Forms ──────────────────────────────────────────── */
.form-group { margin-bottom: 1.15rem; }
.form-group label {
    display: block;
    font-weight: 700;
    font-size: 0.88rem;
    margin-bottom: 0.38rem;
    color: var(--text);
}
.form-control {
    width: 100%;
    padding: 0.68rem 1rem;
    border: 2px solid var(--pink-100);
    border-radius: 11px;
    font-size: 0.93rem;
    font-family: 'Nunito', sans-serif;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    color: var(--text);
    background: white;
}
.form-control:focus {
    border-color: var(--pink-400);
    box-shadow: 0 0 0 3px rgba(240,98,146,0.12);
}
textarea.form-control { resize: vertical; min-height: 78px; }
select.form-control { cursor: pointer; }

.btn-primary {
    width: 100%;
    padding: 0.82rem;
    background: linear-gradient(135deg, var(--pink-700), var(--pink-500));
    color: white;
    border: none;
    border-radius: 11px;
    font-size: 0.97rem;
    font-weight: 800;
    font-family: 'Nunito', sans-serif;
    cursor: pointer;
    transition: opacity 0.2s, transform 0.15s;
    letter-spacing: 0.3px;
}
.btn-primary:hover { opacity: 0.9; transform: translateY(-1px); }
.btn-primary:active { transform: translateY(0); }

.alert-error {
    background: #FFF0F0;
    border: 1.5px solid #FFCCCC;
    color: #C62828;
    padding: 0.65rem 1rem;
    border-radius: 9px;
    font-size: 0.88rem;
    margin-bottom: 1rem;
    text-align: center;
    font-weight: 600;
}
.alert-success {
    background: #F0FFF4;
    border: 1.5px solid #A5D6A7;
    color: #1B5E20;
    padding: 0.65rem 1rem;
    border-radius: 9px;
    font-size: 0.88rem;
    margin-bottom: 1.2rem;
    text-align: center;
    font-weight: 600;
}

/* ── Admin ──────────────────────────────────────────── */
.admin-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.8rem;
    flex-wrap: wrap;
    gap: 0.75rem;
}
.admin-topbar h1 {
    font-family: 'Playfair Display', serif;
    color: var(--pink-700);
    font-size: 1.85rem;
}
.admin-topbar-actions { display: flex; gap: 0.6rem; }

.btn-outline {
    padding: 0.42rem 1.2rem;
    border: 2px solid var(--pink-300);
    background: white;
    color: var(--pink-600);
    border-radius: 20px;
    font-weight: 700;
    font-size: 0.85rem;
    cursor: pointer;
    text-decoration: none;
    font-family: 'Nunito', sans-serif;
    transition: all 0.2s;
    display: inline-block;
}
.btn-outline:hover {
    background: var(--pink-600);
    border-color: var(--pink-600);
    color: white;
}

.admin-layout {
    display: grid;
    grid-template-columns: 360px 1fr;
    gap: 1.8rem;
    align-items: start;
}

.panel {
    background: white;
    border-radius: 18px;
    padding: 1.6rem;
    box-shadow: 0 4px 16px var(--shadow);
    border: 1.5px solid var(--pink-100);
}
.panel h3 {
    font-family: 'Playfair Display', serif;
    color: var(--pink-700);
    font-size: 1.2rem;
    margin-bottom: 1.2rem;
    padding-bottom: 0.7rem;
    border-bottom: 2px solid var(--pink-100);
}

/* Image preview upload area */
.img-drop {
    width: 100%;
    height: 155px;
    border: 2.5px dashed var(--pink-300);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.3rem;
    cursor: pointer;
    overflow: hidden;
    transition: border-color 0.2s, background 0.2s;
    background: var(--pink-bg);
    margin-bottom: 0.5rem;
    position: relative;
}
.img-drop:hover { border-color: var(--pink-500); background: var(--pink-100); }
.img-drop img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.img-drop .drop-hint { font-size: 0.85rem; color: var(--muted); text-align: center; padding: 0 1rem; pointer-events: none; }
.img-drop .drop-icon { font-size: 2rem; pointer-events: none; }
input[type=file] { display: none; }

/* Admin list */
.admin-list-item {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--pink-100);
}
.admin-list-item:last-child { border-bottom: none; }
.admin-thumb {
    width: 54px;
    height: 54px;
    border-radius: 11px;
    overflow: hidden;
    background: linear-gradient(135deg, var(--pink-100), #fff0f9);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    border: 1.5px solid var(--pink-100);
}
.admin-thumb img { width: 100%; height: 100%; object-fit: cover; }
.admin-item-info { flex: 1; min-width: 0; }
.admin-item-name {
    font-weight: 700;
    font-size: 0.93rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.admin-item-meta { font-size: 0.78rem; color: var(--muted); margin-top: 0.1rem; }

.btn-delete {
    padding: 0.32rem 0.85rem;
    font-size: 0.8rem;
    font-weight: 700;
    border: 1.5px solid #FFCCCC;
    background: #FFF0F0;
    color: #C62828;
    border-radius: 8px;
    cursor: pointer;
    font-family: 'Nunito', sans-serif;
    transition: all 0.2s;
    white-space: nowrap;
}
.btn-delete:hover { background: #FFEBEE; border-color: #EF9A9A; }

.count-badge {
    display: inline-block;
    background: var(--pink-100);
    color: var(--pink-700);
    font-size: 0.75rem;
    font-weight: 800;
    padding: 0.1rem 0.55rem;
    border-radius: 12px;
    margin-left: 0.5rem;
    vertical-align: middle;
}

/* ── Brand logo ─────────────────────────────────────── */
.brand-logo {
    height: 46px;
    width: auto;
    max-width: 140px;
    max-height: 46px;
    object-fit: contain;
    border-radius: 6px;
    flex-shrink: 0;
    display: block;
}

/* ── Logo panel (admin) ─────────────────────────────── */
.logo-panel {
    margin-bottom: 1.8rem;
}
.logo-layout {
    display: flex;
    align-items: center;
    gap: 2rem;
    flex-wrap: wrap;
}
.logo-preview-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
}
.logo-preview-img {
    height: 80px;
    width: auto;
    max-width: 220px;
    object-fit: contain;
    border-radius: 10px;
    border: 2px solid var(--pink-100);
    background: var(--pink-bg);
    padding: 6px;
}
.logo-placeholder {
    font-size: 3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 80px;
    height: 80px;
    background: var(--pink-bg);
    border: 2px dashed var(--pink-300);
    border-radius: 10px;
}
.logo-hint {
    font-size: 0.78rem;
    color: var(--muted);
    text-align: center;
}
.logo-actions {
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
}
.logo-form {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex-wrap: wrap;
}
.logo-file-label {
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}
.logo-file-label input[type=file] { display: none; }
.logo-submit {
    width: auto;
    padding: 0.42rem 1.2rem;
    font-size: 0.88rem;
}

/* ── Lightbox ───────────────────────────────────────── */
.lb-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(61, 0, 48, 0.75);
    z-index: 500;
    align-items: center;
    justify-content: center;
    padding: 1.2rem;
    backdrop-filter: blur(4px);
}
.lb-overlay.active { display: flex; }

.lb-box {
    background: white;
    border-radius: 20px;
    overflow: hidden;
    max-width: 860px;
    width: 100%;
    display: flex;
    flex-direction: row;
    max-height: 90vh;
    box-shadow: 0 24px 64px rgba(0,0,0,0.35);
    animation: lb-in 0.22s ease;
}
@keyframes lb-in {
    from { opacity: 0; transform: scale(0.93); }
    to   { opacity: 1; transform: scale(1); }
}

.lb-img {
    width: 55%;
    max-height: 90vh;
    object-fit: contain;
    background: linear-gradient(135deg, var(--pink-100), #fff0f9);
    flex-shrink: 0;
}

.lb-info {
    padding: 2rem 1.8rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0.6rem;
    overflow-y: auto;
}
.lb-category {
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: var(--pink-500);
}
.lb-name {
    font-family: 'Playfair Display', serif;
    font-size: 1.45rem;
    font-weight: 700;
    color: var(--text);
    line-height: 1.3;
}
.lb-desc {
    font-size: 0.92rem;
    color: var(--muted);
    line-height: 1.6;
}
.lb-price {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--pink-700);
}

.lb-close {
    position: fixed;
    top: 1rem;
    right: 1.2rem;
    background: white;
    border: none;
    border-radius: 50%;
    width: 38px;
    height: 38px;
    font-size: 1rem;
    cursor: pointer;
    color: var(--pink-700);
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 501;
    transition: background 0.15s;
}
.lb-close:hover { background: var(--pink-100); }

.card { cursor: pointer; }

@media (max-width: 620px) {
    .lb-box { flex-direction: column; max-height: 92vh; }
    .lb-img { width: 100%; max-height: 55vw; }
    .lb-info { padding: 1.2rem 1.2rem 1.5rem; }
}

/* ── Responsive ─────────────────────────────────────── */
@media (max-width: 900px) {
    .admin-layout { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
    .brand-text { font-size: 1.1rem; }
    main { padding: 1.5rem 0.9rem; }
    .page-title h1 { font-size: 1.65rem; }
    .admin-topbar h1 { font-size: 1.5rem; }
}
