@import url('https://fonts.googleapis.com/css2?family=Nunito+Sans:wght@400;700&display=swap');

/* ==============================
   Design tokens
   ============================== */
:root {
    --primaryColor: #6B9094;
    --secondaryColor: #946F6B;
    --backgroundColor: #1C1C1C;
    --textColor: #fff;
    --formBackground: #f2f2f2;
    --entryBackground: #ffffff;
    --borderColor: #ddd;
    --fontFamily: 'Nunito Sans', sans-serif;
}

/* ==============================
   Base / layout
   ============================== */
html,
body {
    min-height: 100%;
}

body {
    font-family: var(--fontFamily);
    background-color: var(--backgroundColor);
    color: var(--textColor);
    margin: 0;
    display: flex;
    flex-direction: column;
}

header {
    background-color: var(--primaryColor);
    padding: 20px;
    text-align: center;
    color: var(--textColor);
    box-shadow: rgba(0, 0, 0, 0.17) 0 -23px 25px 0 inset,
        rgba(0, 0, 0, 0.15) 0 -36px 30px 0 inset,
        rgba(0, 0, 0, 0.1) 0 -79px 40px 0 inset,
        rgba(0, 0, 0, 0.06) 0 2px 1px,
        rgba(0, 0, 0, 0.09) 0 4px 2px,
        rgba(0, 0, 0, 0.09) 0 8px 4px,
        rgba(0, 0, 0, 0.09) 0 16px 8px,
        rgba(0, 0, 0, 0.09) 0 32px 16px;
}

header h1 {
    margin: 0;
    font-size: 2em;
}

header img.logo {
    max-width: 320px;
    border-radius: 5px;
    display: block;
    margin: 0 auto;
}

nav {
    background-color: var(--secondaryColor);
    padding: 10px;
    text-align: center;
    box-shadow: rgba(0, 0, 0, 0.35) 0 -50px 36px -28px inset;
}

nav a {
    color: var(--textColor);
    text-decoration: none;
    margin: 0 15px;
    font-weight: 700;
    position: relative;
    transition: color .3s;
}

nav a:hover {
    color: #fff;
}

nav a.active::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: -6px;
    height: 3px;
    background: #fff;
    border-radius: 3px;
    opacity: .9;
}

main {
    flex: 1;
    background: #2a2a2a;
    text-align: left;
    padding: 24px 16px;
}

.container,
.entries-container {
    max-width: 1200px;
    margin: 0 auto;
}

footer {
    background-color: var(--primaryColor);
    padding: 20px;
    text-align: center;
    color: var(--textColor);
    box-shadow: rgba(0, 0, 0, 0.17) 0 -23px 25px 0 inset,
        rgba(0, 0, 0, 0.15) 0 -36px 30px 0 inset,
        rgba(0, 0, 0, 0.1) 0 -79px 40px 0 inset,
        rgba(0, 0, 0, 0.06) 0 2px 1px,
        rgba(0, 0, 0, 0.09) 0 4px 2px,
        rgba(0, 0, 0, 0.09) 0 8px 4px,
        rgba(0, 0, 0, 0.09) 0 16px 8px,
        rgba(0, 0, 0, 0.09) 0 32px 16px;
}

footer .footer-links {
    display: flex;
    gap: 25px;
    justify-content: center;
    flex-wrap: wrap;
}

footer .footer-links a {
    color: var(--textColor);
    text-decoration: none;
    opacity: .9;
}

footer .footer-links a:hover {
    opacity: 1;
}

/* ==============================
   Forms / entries
   ============================== */
.entry-container {
    background: var(--formBackground);
    padding: 10px;
    margin: 20px auto;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, .1);
    max-width: 350px;
    color: #333;
}

.entry {
    margin-bottom: 10px;
}

.entry label {
    display: block;
    margin-bottom: 5px;
    font-weight: 700;
    color: #222;
}

.entry input,
.entry textarea,
.data input[type="text"],
.data input[type="number"],
.data textarea {
    width: 90%;
    padding: 5px;
    border: 1px solid var(--borderColor);
    border-radius: 4px;
    font-size: 16px;
    background: #fff;
    color: #222;
    box-sizing: border-box;
}

.entry textarea,
.data textarea {
    resize: vertical;
    min-height: 100px;
}

button {
    display: inline-block;
    padding: 10px 15px;
    background: var(--primaryColor);
    color: var(--textColor);
    border: 0;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 700;
    transition: background-color .2s, filter .2s, transform .06s ease;
}

button:hover {
    background: var(--secondaryColor);
    filter: brightness(1.05);
}

button:active {
    transform: translateY(1px);
}

button:disabled {
    opacity: .6;
    cursor: not-allowed;
}

button.clear-button {
    background: #f44336;
}

button.clear-button:hover {
    background: #e53935;
}

#entries-container {
    margin: 20px 0;
}

.data {
    background: var(--entryBackground);
    padding: 15px;
    margin-bottom: 15px;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, .1);
    min-width: 200px;
}

/* ==============================
   Product grid & cards
   ============================== */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    align-items: stretch;
    justify-items: stretch;
}

.product-item {
    background: var(--entryBackground);
    color: #222;
    border: 1px solid var(--borderColor);
    border-radius: 16px;
    padding: 14px;
    box-shadow: 0 6px 18px rgba(0, 0, 0, .08);
    display: flex;
    flex-direction: column;
    gap: 8px;
    transition: transform .12s ease, box-shadow .12s ease;
    text-align: left;
}

.product-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 22px rgba(0, 0, 0, .12);
}

.product-item img {
    width: 100%;
    height: 160px;
    object-fit: contain;
    border-radius: 12px;
    background: #fafafa;
    border: 1px solid #eee;
}

.product-item h3 {
    margin: 6px 0 0;
    font-size: 1.05rem;
    line-height: 1.3;
    color: #222;
    overflow: auto;
}

.product-item .meta {
    color: #666;
    font-size: .85rem;
    margin: .1rem 0 .4rem;
}

.product-item .our-price {
    margin: 2px 0 8px;
    font-weight: 700;
    color: #1b1b1b;
}

.cta-button {
    display: inline-block;
    text-align: center;
    padding: 10px 14px;
    border-radius: 999px;
    text-decoration: none;
    font-weight: 700;
    background: var(--secondaryColor);
    color: var(--textColor);
}

.cta-button:hover {
    filter: brightness(1.05);
}

.aff-note {
    color: #666;
    font-size: .82rem;
    margin-top: 6px;
}

/* ==============================
   Admin / utility
   ============================== */
.admin-bar {
    display: flex;
    gap: 10px;
    justify-content: center;
    align-items: center;
    padding: 10px;
    background: #2a2a2a;
}

.admin-bar small {
    color: #ccc;
    opacity: .85;
}

.chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 999px;
    background: #eef2f3;
    color: #333;
    font-size: .85rem;
}

.danger {
    background: #fef0f0;
    border: 1px solid #f4caca;
}

.section-card {
    background: var(--entryBackground);
    color: #222;
    border: 1px solid var(--borderColor);
    border-radius: 12px;
    padding: 14px;
    margin: 14px 0;
}

.grid-2 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 12px;
}

.inline {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.muted {
    color: #666;
}

.kicker {
    font-size: .9rem;
    opacity: .85;
    margin-top: 4px;
}

.thumb {
    width: 160px;
    height: 120px;
    object-fit: contain;
    background: #fafafa;
    border: 1px solid #eee;
    border-radius: 8px;
}

.row-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 8px;
}

/* ==============================
   Modal
   ============================== */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    inset: 0;
    background-color: rgba(0, 0, 0, .7);
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-content {
    background: var(--entryBackground);
    padding: 20px;
    border-radius: 8px;
    text-align: center;
}

#part-image {
    max-width: 100%;
    max-height: 80vh;
    border-radius: 8px;
    background: #fafafa;
    border: 1px solid #eee;
}

/* ==============================
   Lists / notes
   ============================== */
#note-list li {
    cursor: pointer;
}

.note-item {
    width: auto;
    overflow: hidden;
}

/* ==============================
   Accessibility / focus
   ============================== */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 3px solid #9ad1d4;
    outline-offset: 2px;
    border-radius: 6px;
}

.visually-hidden {
    position: absolute !important;
    clip: rect(1px, 1px, 1px, 1px);
    clip-path: inset(50%);
    height: 1px;
    width: 1px;
    overflow: hidden;
    white-space: nowrap;
    border: 0;
    padding: 0;
    margin: -1px;
}

#login-form {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin: 10px;

}

/* ==============================
   Images (header, product)
   ============================== */
header img {
    max-width: 380px;
    border-radius: 5px;
}

/* ==============================
   Responsive tweaks
   ============================== */
@media (max-width: 768px) {
    header h1 {
        font-size: 1.5em;
    }

    nav a {
        font-size: 14px;
    }

    main {
        padding: 20px 12px;
    }

    header img.logo {
        max-width: 240px;
    }

    .product-item img {
        height: 140px;
    }

    .entry-container,
    .data {
        padding: 15px;
    }
}