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

html,
body {
    height: 100%;
}

.section {
    flex: 1;
}

body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    font-family: Arial, sans-serif;
    background: #f4f7fb;
    color: #222;
    line-height: 1.6;
}

.container {
    width: min(1180px, 92%);
    margin: auto;
}

.site-header {
    background: #0b3d2e;
    color: #fff;
    padding: 16px 0;
}

.nav-wrap {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

.logo {
    color: #fff;
    text-decoration: none;
    font-size: 24px;
    font-weight: 700;
}

nav a {
    color: #fff;
    text-decoration: none;
    margin-left: 18px;
    font-weight: 600;
}

.hero {
    padding: 60px 0;
    text-align: center;
    background: linear-gradient(135deg, #0b3d2e, #13845f);
    color: #fff;
}

.hero h1 {
    font-size: clamp(32px, 5vw, 54px);
    margin-bottom: 12px;
}

.section {
    padding: 45px 0;
}

.section-title {
    margin-bottom: 22px;
    font-size: 30px;
    color: #0b3d2e;
}

.grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    /* grid-template-columns: repeat(auto-fit, minmax(220px, 2fr)); */
    gap: 22px;
}

.card {
    background: #fff;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
    transition: 0.3s;
}

.card:hover {
    transform: translateY(-5px);
}

.card img {
    width: 100%;
    height: 210px;
    object-fit: contain;
    padding: 10px;
}

.card-content {
    padding: 18px;
    display: flex;
    flex-direction: column;
    justify-content: center; /* Centers items vertically */
    align-items: center;     /* Centers items horizontally */
    text-align: center; 
}

.card h3 {
    margin-bottom: 8px;
    color: #0b3d2e;
}

.btn {
    display: inline-block;
    margin-top: 12px;
    padding: 10px 16px;
    background: #0b3d2e;
    color: #fff;
    text-decoration: none;
    border-radius: 8px;
    border: none;
    cursor: pointer;
}

.btn-danger {
    background: #c62828;
}

.btn-edit {
    background: #1565c0;
}

.admin-layout {
    display: grid;
    grid-template-columns: 230px 1fr;
    min-height: calc(100vh - 64px);
}

.sidebar {
    background: #102820;
    padding: 24px;
}

.sidebar a {
    display: block;
    color: #fff;
    text-decoration: none;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 8px;
}

.sidebar a:hover {
    background: #1d6049;
}

.admin-content {
    padding: 30px;
}

.form-box, .table-box {
    background: #fff;
    padding: 22px;
    border-radius: 12px;
    margin-bottom: 24px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.07);
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 15px;
}

label {
    font-weight: 600;
}

input, select, textarea {
    width: 100%;
    padding: 11px;
    margin-top: 6px;
    border: 1px solid #ccc;
    border-radius: 8px;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    padding: 12px;
    border-bottom: 1px solid #ddd;
    text-align: left;
}

.thumb {
    width: 70px;
    height: 55px;
    object-fit: cover;
    border-radius: 8px;
}

.site-footer {
    margin-top: auto;
    text-align: center;
    padding: 18px;
    background: #0b3d2e;
    color: #fff;
    margin-top: 40px;
}

@media (max-width: 768px) {
    .nav-wrap, .admin-layout {
        display: block;
    }

    nav {
        margin-top: 10px;
    }

    nav a {
        margin: 0 12px 0 0;
    }

    .sidebar {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }
    .grid{
        grid-template-columns: repeat(2, 1fr);
    }
    table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }
}

.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: linear-gradient(135deg, #0b3d2e, #13845f);
}

.auth-box {
    width: min(430px, 100%);
    background: #fff;
    padding: 28px;
    border-radius: 16px;
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.18);
}

.auth-box h1 {
    margin-bottom: 18px;
    color: #0b3d2e;
    text-align: center;
}

.full-btn {
    width: 100%;
    text-align: center;
}

.auth-links {
    margin-top: 16px;
    text-align: center;
}

.auth-links a {
    color: #0b3d2e;
    font-weight: 700;
}

.small-text {
    margin-top: 12px;
    font-size: 13px;
    color: #666;
    text-align: center;
}

.alert {
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 15px;
    font-weight: 600;
}

.alert.success {
    background: #e6f4ea;
    color: #137333;
}

.alert.error {
    background: #fdecea;
    color: #b3261e;
}

.auth-form-box {
    max-width: 520px;
}

.product-card img {
    cursor: zoom-in;
}

.lightbox {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(0, 0, 0, 0.88);
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.lightbox.active {
    display: flex;
}

.lightbox-image {
    max-width: 95%;
    max-height: 90vh;
    border-radius: 12px;
    background: #fff;
}

.lightbox-close {
    position: absolute;
    top: 18px;
    right: 28px;
    color: #fff;
    font-size: 42px;
    font-weight: 700;
    cursor: pointer;
}
