:root {
    --bg: #f6f7fb;
    --card: #ffffff;
    --text: #111827;
    --muted: #6b7280;
    --border: #e5e7eb;
    --primary: #111827;
    --primary-hover: #000000;
    --whatsapp: #25D366;
    --danger: #dc2626;
    --success-bg: #dcfce7;
    --success-text: #166534;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--text);
    background: var(--bg);
    line-height: 1.5;
}

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

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

.site-header {
    background: rgba(255,255,255,.9);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 20;
    backdrop-filter: blur(12px);
}

.nav {
    min-height: 68px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
}

.brand {
    font-weight: 800;
    font-size: 1.1rem;
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 18px;
}

.admin-link {
    color: var(--muted);
}

.hero {
    padding: 72px 0 34px;
    max-width: 760px;
}

.hero h1,
.form-card h1,
.auth-card h1,
.admin-head h1,
.detail-content h1 {
    font-size: clamp(2rem, 5vw, 4rem);
    line-height: 1.05;
    margin: 8px 0 12px;
    letter-spacing: -0.04em;
}

.hero p,
.auth-card p {
    color: var(--muted);
    font-size: 1.05rem;
}

.eyebrow {
    display: inline-block;
    font-size: .8rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .12em;
    color: var(--muted);
}

.search-form {
    display: flex;
    gap: 10px;
    margin-top: 26px;
}

.search-form input {
    flex: 1;
}

input,
textarea,
button {
    font: inherit;
}

input,
textarea {
    width: 100%;
    padding: 13px 14px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #fff;
    outline: none;
}

input:focus,
textarea:focus {
    border-color: #9ca3af;
    box-shadow: 0 0 0 3px rgba(17,24,39,.06);
}

button,
.btn {
    border: 0;
    border-radius: 12px;
    background: var(--primary);
    color: white;
    font-weight: 700;
    padding: 12px 18px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: .2s ease;
}

button:hover,
.btn:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
    padding-bottom: 70px;
}

.product-card,
.form-card,
.auth-card,
.empty-state,
.table-wrap,
.product-detail {
    background: var(--card);
    border: 1px solid var(--border);
    box-shadow: 0 10px 35px rgba(17,24,39,.05);
}

.product-card {
    border-radius: 20px;
    overflow: hidden;
}

.product-image-wrap {
    display: block;
    aspect-ratio: 4 / 3;
    background: #eef0f4;
}

.product-image,
.detail-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.placeholder {
    display: grid;
    place-items: center;
    color: var(--muted);
    background: #eef0f4;
    min-height: 240px;
}

.product-card-body {
    padding: 18px;
}

.product-card h2 {
    margin: 0 0 6px;
    font-size: 1.12rem;
}

.desc {
    color: var(--muted);
    min-height: 48px;
}

.card-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-top: 18px;
}

.product-detail {
    margin: 48px 0 70px;
    border-radius: 24px;
    padding: 22px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 36px;
}

.detail-image-wrap {
    aspect-ratio: 1 / 1;
    border-radius: 18px;
    overflow: hidden;
    background: #eef0f4;
}

.detail-content {
    padding: 28px 18px 28px 0;
    align-self: center;
}

.detail-content p {
    color: var(--muted);
    white-space: normal;
}

.price {
    font-size: 1.6rem;
    font-weight: 800;
    margin: 16px 0;
}

.btn-whatsapp {
    background: var(--whatsapp);
    color: #062c13;
    margin-top: 20px;
    width: 100%;
    padding: 15px 18px;
}

.btn-whatsapp:hover {
    background: #1fb95a;
}

.auth-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
}

.auth-card {
    width: min(430px, 100%);
    border-radius: 22px;
    padding: 30px;
}

.form-stack {
    display: grid;
    gap: 18px;
}

.form-stack label {
    display: grid;
    gap: 7px;
    font-weight: 600;
}

.muted-link {
    display: inline-block;
    color: var(--muted);
    margin-top: 20px;
}

.alert {
    padding: 12px 14px;
    border-radius: 12px;
    margin: 14px 0;
}

.alert.error {
    background: #fee2e2;
    color: #991b1b;
}

.admin-main {
    padding: 48px 0 70px;
}

.admin-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 22px;
}

.admin-head h1 {
    font-size: 2.4rem;
    margin-bottom: 0;
}

.table-wrap {
    border-radius: 18px;
    overflow-x: auto;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 760px;
}

.admin-table th,
.admin-table td {
    padding: 16px 18px;
    border-bottom: 1px solid var(--border);
    text-align: left;
}

.admin-table th {
    font-size: .78rem;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--muted);
}

.admin-table tr:last-child td {
    border-bottom: 0;
}

.right {
    text-align: right !important;
}

.actions {
    display: flex;
    justify-content: flex-end;
    gap: 14px;
}

.actions form {
    margin: 0;
}

.link-button {
    padding: 0;
    background: none;
    color: inherit;
    border-radius: 0;
    font-weight: 500;
}

.link-button:hover {
    background: none;
    transform: none;
}

.danger {
    color: var(--danger);
}

.status {
    display: inline-block;
    padding: 5px 10px;
    border-radius: 999px;
    font-size: .8rem;
    font-weight: 700;
}

.status.active {
    background: var(--success-bg);
    color: var(--success-text);
}

.status.inactive {
    background: #f3f4f6;
    color: #4b5563;
}

.admin-product {
    display: flex;
    gap: 12px;
    align-items: center;
}

.admin-product img {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    object-fit: cover;
}

.admin-product small {
    display: block;
    color: var(--muted);
    margin-top: 2px;
}

.narrow {
    max-width: 760px;
    padding: 48px 0 70px;
}

.form-card {
    border-radius: 22px;
    padding: 28px;
}

.form-card h1 {
    font-size: 2.2rem;
}

.form-preview {
    width: 180px;
    height: 140px;
    object-fit: cover;
    border-radius: 12px;
    border: 1px solid var(--border);
}

.checkbox-row {
    grid-template-columns: 20px 1fr !important;
    align-items: center;
    font-weight: 500 !important;
}

.checkbox-row input {
    width: 18px;
    height: 18px;
}

.empty-state {
    border-radius: 18px;
    padding: 38px;
    text-align: center;
    color: var(--muted);
}

.empty-state h2 {
    color: var(--text);
    margin: 0 0 6px;
}

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

    .product-detail {
        grid-template-columns: 1fr;
    }

    .detail-content {
        padding: 10px 4px 12px;
    }
}

@media (max-width: 600px) {
    .container {
        width: min(100% - 22px, 1120px);
    }

    .hero {
        padding-top: 44px;
    }

    .product-grid {
        grid-template-columns: 1fr;
    }

    .search-form {
        flex-direction: column;
    }

    .admin-head {
        align-items: stretch;
        flex-direction: column;
    }

    .product-detail {
        margin-top: 22px;
        padding: 14px;
        gap: 16px;
    }
}
