﻿/* =========================
   ADMIN SHELL (layout)
   ========================= */

.admin-shell {
    display: flex;
    min-height: calc(100vh - 220px);
    gap: 16px;
    padding: 16px;
}

.admin-side {
    width: 260px;
    background: #fff;
    border: 1px solid rgba(0,0,0,.08);
    border-radius: 14px;
    box-shadow: 0 8px 24px rgba(0,0,0,.06);
    padding: 14px;
    display: flex;
    flex-direction: column;
}

.admin-brand {
    padding: 8px 8px 14px;
    border-bottom: 1px solid rgba(0,0,0,.08);
    margin-bottom: 10px;
}

.admin-title {
    font-weight: 800;
    font-size: 18px;
}

.admin-sub {
    opacity: .7;
    font-size: 13px;
}

.admin-nav {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding-top: 10px;
}

.admin-link {
    display: block;
    padding: 10px 10px;
    border-radius: 10px;
    text-decoration: none;
    color: #111;
    font-weight: 700;
}

    .admin-link.active {
        background: rgba(42,108,255,.12);
        color: #2a6cff;
    }

.admin-footer {
    margin-top: auto;
    border-top: 1px solid rgba(0,0,0,.08);
    padding-top: 10px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.admin-main {
    flex: 1;
    background: #fff;
    border: 1px solid rgba(0,0,0,.08);
    border-radius: 14px;
    box-shadow: 0 8px 24px rgba(0,0,0,.06);
    padding: 16px;
}

.admin-topbar {
    border-bottom: 1px solid rgba(0,0,0,.08);
    padding-bottom: 10px;
    margin-bottom: 14px;
}

.admin-h {
    margin: 0;
    font-size: 20px;
    font-weight: 800;
}

.admin-content {
    padding-top: 6px;
}


/* =========================
   PRODUCTS TOOLBAR (ProductList)
   ========================= */

.products-toolbar {
    --side: 120px;
    display: grid;
    grid-template-columns: var(--side) 1fr var(--side);
    align-items: center;
    gap: 12px;
    margin: 16px 0;
    padding: 12px 14px;
    background: #fff;
    border: 1px solid rgba(0,0,0,.08);
    border-radius: 14px;
    box-shadow: 0 6px 18px rgba(0,0,0,.05);
}

.products-title {
    margin: 0;
    font-size: 24px;
    font-weight: 800;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.products-toolbar-left,
.products-toolbar-center,
.products-toolbar-right {
    display: flex;
    align-items: center;
    min-width: 0;
}

.products-toolbar-left {
    justify-content: flex-start;
}

.products-toolbar-center {
    justify-content: center;
}

.products-toolbar-right {
    justify-content: flex-end;
}

.products-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.products-empty {
    text-align: center;
    padding: 30px 16px;
    background: #fff;
    border: 1px dashed rgba(0,0,0,.2);
    border-radius: 14px;
    margin-top: 20px;
}


/* =========================
   SPINNER SLOT (keeps layout stable)
   ========================= */

.spinner-slot {
    width: 46px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

.spinner-hidden {
    visibility: hidden;
}


/* =========================
   AUTH FORMS (Login/Register)
   ========================= */

.auth-wrap {
    max-width: 520px;
    margin: 40px auto;
    padding: 28px;
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 8px 24px rgba(0,0,0,.08);
    border: 1px solid rgba(0,0,0,.06);
}

.auth-title {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 18px;
}

.auth-row {
    margin-bottom: 14px;
}

.auth-label {
    display: block;
    font-weight: 600;
    margin-bottom: 6px;
}

.auth-input {
    width: 100%;
    height: 44px;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid rgba(0,0,0,.15);
    outline: none;
}

    .auth-input:focus {
        border-color: rgba(0,0,0,.35);
        box-shadow: 0 0 0 3px rgba(0,0,0,.06);
    }

.auth-actions {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-top: 18px;
}

.auth-btn {
    height: 42px;
    padding: 0 16px;
    border-radius: 10px;
    border: none;
    cursor: pointer;
    font-weight: 600;
}

.auth-btn-primary {
    background: #2a6cff;
    color: white;
}

.auth-btn-link {
    background: transparent;
    color: #2a6cff;
    text-decoration: underline;
}

.auth-error {
    margin-top: 12px;
    padding: 10px 12px;
    border-radius: 10px;
    background: #ffecec;
    border: 1px solid #ffbaba;
    color: #a30000;
}


/* =========================
   PRODUCT CARD (Shop/Admin)
   ========================= */

.product-card {
    height: 100%;
    background: #fff;
    border: 1px solid rgba(0,0,0,.08);
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 8px 24px rgba(0,0,0,.06);
    transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
    display: flex;
    flex-direction: column;
}

    .product-card:hover {
        transform: translateY(-2px);
        box-shadow: 0 14px 40px rgba(0,0,0,.10);
        border-color: rgba(0,0,0,.12);
    }

.product-card__image {
    position: relative;
    width: 100%;
    height: 190px;
    background: #f5f6f7;
    overflow: hidden;
}

    .product-card__image img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        display: block;
        transition: transform .25s ease;
    }

.product-card:hover .product-card__image img {
    transform: scale(1.03);
}

.product-card__image::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 40px;
    background: linear-gradient(to top, rgba(0,0,0,.18), rgba(0,0,0,0));
    pointer-events: none;
}

.product-card__body {
    padding: 14px 16px 10px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
}

.product-card__title {
    font-weight: 800;
    font-size: 16px;
    line-height: 1.25;
    color: rgba(0,0,0,.9);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-card__category {
    font-size: 13px;
    color: rgba(0,0,0,.55);
}

.product-card__desc {
    margin-top: 2px;
    font-size: 13px;
    color: rgba(0,0,0,.75);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-card__price {
    margin-top: auto;
    padding-top: 8px;
    font-weight: 900;
    font-size: 18px;
    color: rgba(0,0,0,.92);
}

.product-card__footer {
    display: flex;
    gap: 10px;
    padding: 12px 16px 16px;
    border-top: 1px solid rgba(0,0,0,.08);
    background: rgba(0,0,0,.01);
}

.product-card__btn {
    height: 42px;
    padding: 0 14px;
    border-radius: 14px;
    border: 1px solid transparent;
    cursor: pointer;
    font-weight: 800;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform .12s ease, filter .12s ease, box-shadow .12s ease;
    flex: 1;
}

    .product-card__btn:active {
        transform: translateY(1px);
    }

.product-card__btn--primary {
    background: #2a6cff;
    color: #fff;
    box-shadow: 0 10px 22px rgba(42,108,255,.22);
}

    .product-card__btn--primary:hover {
        filter: brightness(1.03);
        transform: translateY(-1px);
        box-shadow: 0 14px 28px rgba(42,108,255,.25);
    }

.product-card__btn--danger {
    background: #ff4d4f;
    color: #fff;
    box-shadow: 0 10px 22px rgba(255,77,79,.18);
}

    .product-card__btn--danger:hover {
        filter: brightness(1.03);
        transform: translateY(-1px);
        box-shadow: 0 14px 28px rgba(255,77,79,.22);
    }


/* =========================
   RESPONSIVE tweaks
   ========================= */

@media (max-width: 576px) {
    .product-card__image {
        height: 160px;
    }

    .products-title {
        font-size: 20px;
    }

    .products-toolbar {
        --side: 56px;
        padding: 10px 12px;
    }

    .admin-shell {
        flex-direction: column;
    }

    .admin-side {
        width: 100%;
    }
}
