@charset "utf-8";
* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Arial, sans-serif;
    background: #f5f5f5;
    color: #222;
}

.container {
    width: 95%;
    max-width: 1500px;
    margin: 30px auto;
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
    margin-bottom: 25px;
}

h1, h2, h3 {
    margin-top: 0;
}

a {
    color: inherit;
    text-decoration: none;
}

.btn {
    display: inline-block;
    background: #111;
    color: #fff;
    border: none;
    padding: 11px 16px;
    border-radius: 8px;
    cursor: pointer;
    text-decoration: none;
}

.btn:hover {
    background: #333;
}

.btn-secondary {
    background: #666;
}

.notice {
    background: #fff3cd;
    border: 1px solid #efd88c;
    padding: 14px;
    border-radius: 10px;
    margin-bottom: 20px;
}

.success {
    background: #e8f7ea;
    border: 1px solid #bddfbe;
    color: #1e6a2b;
    padding: 14px;
    border-radius: 10px;
    margin-bottom: 20px;
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 20px;
}

.card,
.product-card,
.detail-box,
.form-box,
.table-box {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 14px rgba(0,0,0,0.08);
}

.card,
.product-card {
    overflow: hidden;
}

.card-content,
.product-info {
    padding: 16px;
}

.product-card img,
.product-image img,
.card img {
    width: 100%;
    display: block;
    object-fit: cover;
    background: #eee;
}

.product-card img,
.card img {
    height: 220px;
}

.product-title {
    font-size: 17px;
    margin-bottom: 10px;
    min-height: 42px;
}

.product-price {
    font-size: 20px;
    font-weight: bold;
    color: #0a7a2f;
    margin: 10px 0;
}

.product-stock {
    font-size: 14px;
    color: #555;
}

.category-link {
    display: inline-block;
    margin-top: 12px;
}

.pagination {
    margin-top: 30px;
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}

.pagination a,
.pagination span {
    display: inline-block;
    padding: 10px 14px;
    border-radius: 8px;
    background: #fff;
    border: 1px solid #ddd;
}

.pagination .active {
    background: #111;
    color: #fff;
    border-color: #111;
}

.detail-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

.product-image img {
    height: 500px;
    border-radius: 12px;
}

.detail-box {
    padding: 24px;
}

.form-box {
    max-width: 800px;
    padding: 24px;
}

label {
    display: block;
    font-weight: bold;
    margin: 12px 0 6px;
}

input[type="text"],
input[type="number"],
input[type="password"],
textarea,
select {
    width: 100%;
    padding: 12px;
    border: 1px solid #ccc;
    border-radius: 8px;
}

textarea {
    min-height: 120px;
    resize: vertical;
}

.table-box {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
}

table th,
table td {
    padding: 12px;
    border-bottom: 1px solid #eee;
    text-align: left;
    vertical-align: top;
}

.admin-links {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.login-wrap {
    max-width: 420px;
    margin: 60px auto;
}

.small {
    font-size: 13px;
    color: #666;
}

@media (max-width: 1400px) {
    .product-grid {
        grid-template-columns: repeat(5, 1fr);
    }
}

@media (max-width: 1200px) {
    .product-grid {
        grid-template-columns: repeat(4, 1fr);
    }

    .card-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 900px) {
    .product-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .card-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .detail-layout {
        grid-template-columns: 1fr;
    }

    .product-image img {
        height: 380px;
    }
}

@media (max-width: 700px) {
    .product-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .card-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .product-grid {
        grid-template-columns: 1fr;
    }
}