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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #0f1117;
    color: #e4e4e7;
    min-height: 100vh;
    line-height: 1.5;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
}

h1 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 2rem;
    color: #fff;
    letter-spacing: -0.02em;
}

.filter-bar {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 0.6rem 1.4rem;
    border: 1px solid #27272a;
    background: #18181b;
    color: #a1a1aa;
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    transform: translateY(0);
}

.filter-btn:hover {
    background: #27272a;
    color: #fff;
    transform: translateY(-2px);
}

.filter-btn.active {
    background: #fff;
    color: #09090b;
    border-color: #fff;
    transform: translateY(-2px);
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
    gap: 1.5rem;
}

.product-card {
    background: #18181b;
    border: 1px solid #27272a;
    border-radius: 1rem;
    overflow: hidden;
    transform: translateY(0);
    opacity: 0;
    animation: cardFadeIn 0.4s forwards;
}

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

.product-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(41, 57, 89, 0.59);
}

.product-card img {
    width: 100%;
    height: 220px;
    object-fit: cover;
    background: #27272a;
}

.product-info {
    padding: 1.25rem;
}

.product-category {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #71717a;
    margin-bottom: 0.5rem;
}

.product-name {
    font-size: 1.125rem;
    font-weight: 600;
    color: #fff;
    margin-bottom: 0.75rem;
}

.product-price {
    font-size: 1.25rem;
    font-weight: 700;
    color: #22c55e;
}

.message {
    text-align: center;
    padding: 4rem 1rem;
    font-size: 1.125rem;
    color: #71717a;
}

.message.error {
    color: #ef4444;
}

@media (max-width: 640px) {
    .product-grid {
        grid-template-columns: 1fr;
    }
    h1 {
        font-size: 1.5rem;
    }
}

.top-bar {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 1rem;
    gap: 0.5rem;
}

.admin-link {
    padding: 0.5rem 1rem;
    border: 1px solid #27272a;
    background: #18181b;
    color: #a1a1aa;
    border-radius: 9999px;
    font-size: 0.875rem;
    text-decoration: none;
    transition: all 0.3s ease, transform 0.3s ease;
    transform: translateY(0);
}

.admin-link:hover {
    background: #fff;
    color: #09090b;
    transform: translateY(-2px);
}

.admin-category {
    margin-bottom: 3rem;
}

.admin-category h2 {
    font-size: 1.25rem;
    margin-bottom: 1rem;
}

.admin-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem;
    border: 1px solid #27272a;
    border-radius: 0.75rem;
    margin-bottom: 0.75rem;
    background: #18181b;
    opacity: 0;
    transform: translateY(10px);
    animation: rowFadeIn 0.3s forwards;
}

@keyframes rowFadeIn {
    to { opacity: 1; transform: translateY(0); }
}

.admin-row img {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 0.5rem;
}

.admin-name {
    flex: 1;
}

.admin-price {
    width: 100px;
    color: #22c55e;
    font-weight: 600;
}

.admin-actions button {
    padding: 0.4rem 0.8rem;
    border: 1px solid #27272a;
    background: #27272a;
    color: #fff;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.3s ease, transform 0.2s ease;
    transform: translateY(0);
}

.admin-actions button:hover {
    background: #fff;
    color: #09090b;
    transform: translateY(-2px);
}

.admin-add-btn {
    margin-top: 0.5rem;
    padding: 0.6rem 1.4rem;
    border: 1px dashed #27272a;
    background: transparent;
    color: #a1a1aa;
    border-radius: 9999px;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.3s ease, transform 0.3s ease;
    transform: translateY(0);
}

.admin-add-btn:hover {
    border-color: #fff;
    color: #fff;
    transform: translateY(-2px);
}

.admin-input {
    flex: 1;
    padding: 0.5rem 0.75rem;
    border: 1px solid #27272a;
    background: #0f1117;
    color: #fff;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    transition: border-color 0.2s ease;
}

.admin-input:focus {
    outline: none;
    border-color: #22c55e;
}

.admin-input.file-input {
    flex: 0 0 120px;
    padding: 0.25rem;
}

@media (max-width: 640px) {
    .admin-row {
        flex-direction: column;
        align-items: flex-start;
    }
    .admin-price {
        width: 100%;
    }
    .top-bar {
        flex-direction: column;
        align-items: flex-start;
    }
}

@media (max-width: 640px) {
    .top-bar {
        display: flex;
        flex-direction: column;
        align-items: stretch;
    }

    .top-bar .admin-link {
        display: block;
        width: 100%;
        text-align: center;
        margin-bottom: 0.5rem;
    }

    .admin-row {
        flex-direction: column;
        align-items: flex-start;
    }

    .admin-price {
        width: 100%;
    }
}

.auth-modal {
    display: none;

    position: fixed;
    inset: 0;

    background: rgba(0,0,0,.55);

    justify-content: center;
    align-items: center;

    z-index: 1000;
}

.auth-modal.show {
    display: flex;
}

.auth-modal-content {
    width: min(420px, calc(100% - 32px));

    background: #18181b;
    border: 1px solid #27272a;
    border-radius: 18px;

    padding: 24px;

    display: flex;
    flex-direction: column;
    gap: 16px;

    box-shadow: 0 20px 60px rgba(0,0,0,.45);
}

.auth-modal-content h2 {
    margin: 0;
    color: white;
    text-align: center;
    font-size: 1.25rem;
}

.auth-provider {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;

    width: 100%;
    height: 54px;

    border-radius: 12px;
    border: 1px solid #3f3f46;

    background: #27272a;
    color: white;

    cursor: pointer;

    transition: all .25s ease;
}

.auth-provider img {
    width: 22px;
    height: 22px;
}

.auth-provider span {
    font-size: .95rem;
    font-weight: 500;
}

.auth-provider:hover {
    background: white;
    color: #111827;
    transform: translateY(-2px);
}

.auth-provider:active {
    transform: scale(.98);
}

.auth-cancel {
    background: transparent;
    color: #a1a1aa;

    border: none;

    cursor: pointer;

    padding: 8px;

    transition: color .2s;
}

.auth-cancel:hover {
    color: white;
}

[hidden] {
    display: none !important;
}

/******************************************************/

.auth-divider {
    display: flex;
    align-items: center;
    gap: 12px;
}

.auth-divider::before,
.auth-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: #3f3f46;
}

.auth-divider span {
    color: #71717a;
    font-size: .85rem;
}

.otp-login {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.otp-login h3 {
    margin: 0;
    color: white;
    font-size: 1rem;
    font-weight: 600;
    text-align: center;
}

.auth-input {
    width: 100%;
    height: 46px;
    padding: 0 14px;
    border-radius: 10px;
    border: 1px solid #3f3f46;
    background: #0f1117;
    color: white;
    font-size: .95rem;
}

.auth-input:focus {
    outline: none;
    border-color: #22c55e;
}

.otp-btn {
    height: 46px;
}

.otp-section {
    display: flex;
    flex-direction: column;
    gap: 12px;
    animation: fadeOtp .25s ease;
}

@keyframes fadeOtp {

    from {
        opacity: 0;
        transform: translateY(-6px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }

}

.otp-message {
    min-height: 18px;
    color: #22c55e;
    text-align: center;
    font-size: .85rem;
}