:root {
    --green-dark: #2d5016;
    --green: #4a7c2e;
    --green-light: #7cb342;
    --green-pale: #e8f5e9;
    --cream: #fefdf5;
    --brown: #5d4037;
    --brown-light: #8d6e63;
    --text: #333;
    --text-light: #666;
    --border: #d5d5c0;
    --shadow: 0 2px 8px rgba(0,0,0,0.08);
    --radius: 10px;
}

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

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: var(--cream);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a { color: var(--green); text-decoration: none; }
a:hover { color: var(--green-dark); }

/* HEADER */
.header {
    background: linear-gradient(135deg, var(--green-dark), var(--green));
    color: white;
    padding: 0;
    box-shadow: 0 2px 12px rgba(0,0,0,0.15);
    position: sticky;
    top: 0;
    z-index: 100;
}
.header-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
}
.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: white;
    display: flex;
    align-items: center;
    gap: 8px;
}
.logo:hover { color: var(--green-pale); }
.logo span { font-size: 1.8rem; }

.nav { display: flex; gap: 4px; align-items: center; }
.nav a {
    color: rgba(255,255,255,0.9);
    padding: 8px 14px;
    border-radius: 6px;
    font-size: 0.95rem;
    transition: background 0.2s;
}
.nav a:hover, .nav a.active {
    background: rgba(255,255,255,0.15);
    color: white;
}
.cart-badge {
    background: #ff7043;
    color: white;
    border-radius: 50%;
    padding: 1px 7px;
    font-size: 0.75rem;
    font-weight: 700;
    margin-left: 4px;
}

/* MAIN */
.main { flex: 1; max-width: 1200px; margin: 0 auto; padding: 30px 20px; width: 100%; }

/* HERO */
.hero {
    background: linear-gradient(135deg, var(--green-dark) 0%, var(--green) 50%, var(--green-light) 100%);
    color: white;
    text-align: center;
    padding: 60px 20px;
    border-radius: var(--radius);
    margin-bottom: 40px;
}
.hero h1 { font-size: 2.5rem; margin-bottom: 12px; }
.hero p { font-size: 1.2rem; opacity: 0.9; max-width: 600px; margin: 0 auto 24px; }
.hero .btn { font-size: 1.1rem; padding: 14px 32px; }

/* GRID */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 24px;
}

/* KARTA PRODUKTU */
.product-card {
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    flex-direction: column;
}
.product-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
}
.product-card-img {
    height: 200px;
    background: var(--green-pale);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 4rem;
    color: var(--green);
    overflow: hidden;
}
.product-card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.product-card-body {
    padding: 16px;
    flex: 1;
    display: flex;
    flex-direction: column;
}
.product-card-body h3 { font-size: 1.1rem; color: var(--green-dark); margin-bottom: 2px; }
.product-latin { font-style: italic; color: var(--text-light); font-size: 0.85rem; margin-bottom: 8px; }
.product-desc { font-size: 0.9rem; color: var(--text-light); flex: 1; margin-bottom: 12px; }
.product-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.product-price { font-size: 1.3rem; font-weight: 700; color: var(--green-dark); }

/* SZCZEGÓŁY PRODUKTU */
.product-detail {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 32px;
}
.product-detail-img {
    background: var(--green-pale);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 350px;
    font-size: 6rem;
    color: var(--green);
    overflow: hidden;
}
.product-detail-img img { width: 100%; height: 100%; object-fit: cover; border-radius: var(--radius); }
.product-detail-info h1 { color: var(--green-dark); margin-bottom: 4px; }
.product-detail-info .product-latin { font-size: 1rem; margin-bottom: 16px; }
.product-detail-info .product-price { font-size: 1.8rem; margin-bottom: 16px; display: block; }
.stock-info { color: var(--green); font-size: 0.9rem; margin-bottom: 20px; }
.stock-info.low { color: #e65100; }
.qty-input { width: 60px; padding: 8px; border: 1px solid var(--border); border-radius: 6px; text-align: center; font-size: 1rem; }

/* BUTTONS */
.btn {
    display: inline-block;
    padding: 10px 22px;
    border: none;
    border-radius: 6px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
    text-align: center;
}
.btn:active { transform: scale(0.97); }
.btn-primary { background: var(--green); color: white; }
.btn-primary:hover { background: var(--green-dark); color: white; }
.btn-secondary { background: var(--brown-light); color: white; }
.btn-secondary:hover { background: var(--brown); color: white; }
.btn-danger { background: #e53935; color: white; }
.btn-danger:hover { background: #c62828; color: white; }
.btn-sm { padding: 6px 14px; font-size: 0.85rem; }
.btn-outline {
    background: transparent;
    border: 2px solid var(--green);
    color: var(--green);
}
.btn-outline:hover { background: var(--green); color: white; }

/* TABELA KOSZYKA */
.cart-table { width: 100%; border-collapse: collapse; background: white; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.cart-table th { background: var(--green-pale); color: var(--green-dark); padding: 12px 16px; text-align: left; font-weight: 600; }
.cart-table td { padding: 12px 16px; border-bottom: 1px solid #eee; vertical-align: middle; }
.cart-table tr:last-child td { border-bottom: none; }
.cart-summary { background: white; border-radius: var(--radius); box-shadow: var(--shadow); padding: 24px; margin-top: 20px; text-align: right; }
.cart-summary .total { font-size: 1.4rem; font-weight: 700; color: var(--green-dark); }

/* FORMULARZE */
.form-card {
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 32px;
    max-width: 500px;
    margin: 0 auto;
}
.form-card h2 { color: var(--green-dark); margin-bottom: 20px; text-align: center; }
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-weight: 600; margin-bottom: 4px; color: var(--text); font-size: 0.9rem; }
.form-group input, .form-group textarea, .form-group select {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 1rem;
    transition: border-color 0.2s;
}
.form-group input:focus, .form-group textarea:focus {
    outline: none;
    border-color: var(--green);
    box-shadow: 0 0 0 3px rgba(74,124,46,0.1);
}
.form-group textarea { resize: vertical; min-height: 80px; }

/* FLASH */
.flash {
    padding: 12px 20px;
    border-radius: 6px;
    margin-bottom: 20px;
    font-weight: 500;
}
.flash-success { background: #e8f5e9; color: #2e7d32; border: 1px solid #a5d6a7; }
.flash-error { background: #ffebee; color: #c62828; border: 1px solid #ef9a9a; }
.flash-info { background: #e3f2fd; color: #1565c0; border: 1px solid #90caf9; }

/* FOOTER */
.footer {
    background: var(--green-dark);
    color: rgba(255,255,255,0.8);
    text-align: center;
    padding: 24px 20px;
    margin-top: auto;
    font-size: 0.9rem;
}
.footer a { color: var(--green-light); }

/* ADMIN */
.admin-table { width: 100%; border-collapse: collapse; background: white; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.admin-table th { background: var(--green-pale); padding: 10px 14px; text-align: left; color: var(--green-dark); font-size: 0.9rem; }
.admin-table td { padding: 10px 14px; border-bottom: 1px solid #eee; font-size: 0.9rem; }
.admin-actions { display: flex; gap: 6px; }
.dashboard-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 30px; }
.dash-card { background: white; border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; text-align: center; }
.dash-card .number { font-size: 2rem; font-weight: 700; color: var(--green-dark); }
.dash-card .label { color: var(--text-light); font-size: 0.9rem; }

/* EMPTY STATE */
.empty-state { text-align: center; padding: 60px 20px; color: var(--text-light); }
.empty-state .icon { font-size: 4rem; margin-bottom: 16px; }

/* PAGE TITLE */
.page-title { color: var(--green-dark); margin-bottom: 24px; font-size: 1.6rem; }

/* RESPONSIVE */
@media (max-width: 768px) {
    .product-detail { grid-template-columns: 1fr; }
    .header-inner { flex-wrap: wrap; height: auto; padding: 12px 16px; }
    .nav { width: 100%; justify-content: center; flex-wrap: wrap; padding-top: 8px; }
    .hero h1 { font-size: 1.8rem; }
    .products-grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
}
