:root {
    --primary: #7c5cff;
    --secondary: #ff7aa8;
    --dark: #19142a;
    --muted: #6f6a7d;
    --soft: #f7f4ff;
    --white: #ffffff;
    --border: #ebe7f7;
    --shadow: 0 20px 55px rgba(35, 24, 76, .12);
    --radius: 24px;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: var(--dark);
    background: radial-gradient(circle at top left, #eee7ff 0, transparent 35%), linear-gradient(180deg, #fff 0%, #fbf9ff 100%);
    min-height: 100vh;
}

a {
    color: inherit;
    text-decoration: none;
}

img {
    width: 100%;
    display: block;
}

.navbar {
    width: min(1180px, calc(100% - 32px));
    margin: 18px auto 0;
    padding: 14px 18px;
    background: rgba(255, 255, 255, .8);
    border: 1px solid var(--border);
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    backdrop-filter: blur(14px);
    position: sticky;
    top: 14px;
    z-index: 10;
    box-shadow: 0 12px 35px rgba(124, 92, 255, .08);
}

.brand {
    font-size: 24px;
    font-weight: 900;
    letter-spacing: -.8px;
}

.brand span {
    color: var(--primary);
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 18px;
    color: var(--muted);
    font-weight: 600;
}

.btn {
    border: none;
    cursor: pointer;
    padding: 13px 20px;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: var(--white);
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 12px 24px rgba(124, 92, 255, .22);
    transition: .25s ease;
}

.btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 18px 30px rgba(124, 92, 255, .28);
}

.btn-small {
    padding: 9px 14px;
    font-size: 14px;
}

.btn-outline {
    color: var(--primary);
    background: #fff;
    border: 1px solid var(--border);
    box-shadow: none;
}

.hero {
    width: min(1180px, calc(100% - 32px));
    margin: 44px auto 20px;
    display: grid;
    grid-template-columns: 1.15fr .85fr;
    gap: 34px;
    align-items: center;
    min-height: 470px;
}

.hero h1 {
    font-size: clamp(42px, 6vw, 76px);
    line-height: .98;
    letter-spacing: -3px;
    margin: 14px 0 18px;
}

.hero-desc {
    color: var(--muted);
    font-size: 18px;
    line-height: 1.8;
    max-width: 620px;
    margin-bottom: 26px;
}

.badge {
    width: fit-content;
    padding: 9px 14px;
    border-radius: 999px;
    color: var(--primary);
    background: #f1ecff;
    font-weight: 800;
}

.hero-card {
    min-height: 390px;
    border-radius: 36px;
    background: linear-gradient(145deg, #ffffff 0%, #f2edff 100%);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    position: relative;
    display: grid;
    place-items: center;
    text-align: center;
    overflow: hidden;
    animation: float 4s ease-in-out infinite;
}

.hero-card::before {
    content: '';
    position: absolute;
    width: 240px;
    height: 240px;
    background: rgba(255, 122, 168, .2);
    border-radius: 50%;
    top: -60px;
    right: -60px;
}

.hanger {
    font-size: 120px;
    filter: drop-shadow(0 20px 30px rgba(124, 92, 255, .2));
}

.hero-card h3 {
    font-size: 28px;
    margin-top: -30px;
}

.hero-card p {
    color: var(--muted);
    margin-top: -38px;
    padding: 0 24px;
}

.floating-card {
    position: absolute;
    top: 38px;
    left: 34px;
    background: #fff;
    padding: 12px 18px;
    border-radius: 18px;
    box-shadow: var(--shadow);
    font-weight: 900;
    color: var(--secondary);
    animation: pulse 2s infinite;
}

.container {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
    padding: 46px 0 70px;
}

.section-title {
    text-align: center;
    margin-bottom: 24px;
}

.section-title p {
    color: var(--primary);
    font-weight: 900;
}

.section-title h2 {
    font-size: clamp(30px, 4vw, 48px);
    letter-spacing: -1.5px;
    margin-top: 8px;
}

.filter-box {
    background: rgba(255, 255, 255, .86);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    display: grid;
    grid-template-columns: 1fr 210px auto auto;
    gap: 12px;
    box-shadow: var(--shadow);
    margin-bottom: 28px;
}

input, select, textarea {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 14px 15px;
    outline: none;
    font: inherit;
    background: #fff;
    color: var(--dark);
    transition: .2s ease;
}

textarea {
    resize: vertical;
    min-height: 120px;
}

input:focus, select:focus, textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(124, 92, 255, .12);
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 22px;
}

.product-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: 0 12px 32px rgba(35, 24, 76, .08);
    transition: .3s ease;
    position: relative;
}

.product-card::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(120deg, transparent 0%, rgba(255,255,255,.5) 50%, transparent 100%);
    transform: translateX(-120%);
    transition: .55s ease;
    pointer-events: none;
}

.product-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 22px 52px rgba(35, 24, 76, .15);
}

.product-card:hover::after {
    transform: translateX(120%);
}

.product-img-wrap {
    height: 220px;
    background: var(--soft);
    position: relative;
    overflow: hidden;
}

.product-img-wrap img {
    height: 100%;
    object-fit: cover;
    transition: .35s ease;
}

.product-card:hover .product-img-wrap img {
    transform: scale(1.06);
}

.stock {
    position: absolute;
    right: 12px;
    top: 12px;
    background: rgba(25, 20, 42, .82);
    color: #fff;
    padding: 8px 11px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 800;
}

.stock.habis {
    background: rgba(255, 64, 99, .9);
}

.product-content {
    padding: 18px;
}

.category {
    display: inline-flex;
    color: var(--primary);
    background: #f2eeff;
    padding: 7px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 900;
    margin-bottom: 12px;
}

.product-content h3 {
    font-size: 19px;
    margin-bottom: 8px;
}

.product-content p {
    color: var(--muted);
    line-height: 1.55;
    min-height: 74px;
    font-size: 14px;
}

.product-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-top: 16px;
}

.product-footer strong {
    color: var(--dark);
    font-size: 17px;
}

.empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 50px 20px;
    background: #fff;
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

.footer {
    text-align: center;
    padding: 26px;
    color: var(--muted);
    border-top: 1px solid var(--border);
}

.admin-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 30px 16px;
}

.login-card {
    width: min(440px, 100%);
    background: rgba(255,255,255,.9);
    border: 1px solid var(--border);
    border-radius: 30px;
    padding: 32px;
    box-shadow: var(--shadow);
    animation: pop .45s ease both;
}

.login-card h1 {
    font-size: 32px;
    margin-bottom: 8px;
}

.login-card p {
    color: var(--muted);
    margin-bottom: 22px;
}

.form-group {
    margin-bottom: 14px;
}

.form-group label {
    display: block;
    font-weight: 800;
    margin-bottom: 8px;
}

.alert {
    padding: 13px 15px;
    border-radius: 16px;
    margin-bottom: 14px;
    font-weight: 700;
}

.alert-error {
    background: #ffe8ef;
    color: #be204b;
}

.alert-success {
    background: #e8fff3;
    color: #14824d;
}

.admin-layout {
    width: min(1180px, calc(100% - 32px));
    margin: 28px auto;
}

.admin-topbar {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 26px;
    padding: 18px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    box-shadow: 0 12px 32px rgba(35, 24, 76, .08);
    margin-bottom: 22px;
}

.admin-topbar h1 {
    font-size: clamp(24px, 4vw, 34px);
}

.admin-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 22px;
}

.stat-card {
    background: linear-gradient(145deg, #fff, #f6f1ff);
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 22px;
    box-shadow: 0 12px 32px rgba(35, 24, 76, .08);
}

.stat-card span {
    color: var(--muted);
    font-weight: 700;
}

.stat-card h2 {
    font-size: 36px;
    margin-top: 6px;
}

.panel {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 26px;
    padding: 22px;
    box-shadow: 0 12px 32px rgba(35, 24, 76, .08);
}

.table-responsive {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 820px;
}

th, td {
    padding: 14px;
    border-bottom: 1px solid var(--border);
    text-align: left;
    vertical-align: middle;
}

th {
    color: var(--muted);
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: .6px;
}

.table-img {
    width: 62px;
    height: 62px;
    border-radius: 16px;
    object-fit: cover;
    background: var(--soft);
}

.action-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.btn-danger {
    background: linear-gradient(135deg, #ff4d6d, #ff8fa3);
}

.form-card {
    width: min(820px, 100%);
    margin: 30px auto;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 28px;
    padding: 24px;
    box-shadow: var(--shadow);
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.form-grid .full {
    grid-column: 1 / -1;
}

.preview-img {
    width: 120px;
    height: 120px;
    object-fit: cover;
    border-radius: 20px;
    border: 1px solid var(--border);
    margin-top: 10px;
}

.reveal {
    opacity: 0;
    transform: translateY(24px);
    transition: .7s ease;
}

.reveal.show {
    opacity: 1;
    transform: translateY(0);
}

.delay-1 {
    transition-delay: .12s;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-14px); }
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.06); }
}

@keyframes pop {
    from { opacity: 0; transform: scale(.94) translateY(18px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

@media (max-width: 980px) {
    .hero {
        grid-template-columns: 1fr;
    }
    .product-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .filter-box {
        grid-template-columns: 1fr 1fr;
    }
    .stats-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 620px) {
    .navbar {
        border-radius: 22px;
        align-items: flex-start;
    }
    .nav-menu {
        gap: 10px;
        font-size: 14px;
    }
    .hero {
        margin-top: 28px;
        min-height: auto;
    }
    .hero h1 {
        letter-spacing: -1.5px;
    }
    .hero-card {
        min-height: 300px;
    }
    .product-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
    }
    .filter-box,
    .form-grid {
        grid-template-columns: 1fr;
    }
    .product-card {
        border-radius: 18px;
    }
    .product-img-wrap {
        height: 150px;
    }
    .product-content {
        padding: 12px;
    }
    .category {
        font-size: 10px;
        padding: 5px 8px;
        margin-bottom: 8px;
    }
    .product-content h3 {
        font-size: 14px;
        line-height: 1.3;
    }
    .product-content p {
        display: none;
    }
    .product-footer {
        align-items: flex-start;
        flex-direction: column;
        gap: 8px;
        margin-top: 10px;
    }
    .product-footer strong {
        font-size: 13px;
    }
    .stock {
        right: 8px;
        top: 8px;
        font-size: 10px;
        padding: 5px 8px;
    }
    .admin-topbar {
        align-items: flex-start;
        flex-direction: column;
    }
    .login-card,
    .form-card {
        padding: 22px;
        border-radius: 24px;
    }
}
