* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: #f8fff8;
    color: #333;
    line-height: 1.6;
}

.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

/* Capçalera */
header {
    background-color: #1a5c2c;
    color: white;
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.header-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    flex-wrap: wrap;
}

.logo {
    margin-right: 10px;
    flex-shrink: 0;
}

.logo-img {
    height: 25px;
    width: auto;
    max-width: 100px;
    transition: all 0.3s ease;
    border-radius: 5px;
}

.logo-img:hover {
    transform: scale(1.03);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.header-content {
    display: flex;
    align-items: center;
    flex-grow: 1;
    justify-content: space-between;
}

.site-title {
    color: #fff;
    font-size: 1.8rem;
    font-weight: bold;
    text-align: center;
    flex-grow: 1;
}

.cart-btn {
    background-color: #ffd700;
    color: #2d5016;
    border: none;
    padding: 10px 15px;
    border-radius: 50px;
    cursor: pointer;
    display: flex;
    align-items: center;
    font-weight: bold;
    transition: background-color 0.3s;
    text-decoration: none;
    flex-shrink: 0;
}

.cart-btn:hover {
    background-color: #e6c200;
}

.cart-icon {
    margin-right: 8px;
    font-size: 1.2rem;
}

/* Navegació */
nav {
    background-color: #2d7d3d;
    padding: 0.5rem 0;
}

nav ul {
    display: flex;
    justify-content: center;
    list-style: none;
    flex-wrap: wrap;
}

nav ul li {
    margin: 0 15px;
}

nav ul li a {
    color: white;
    text-decoration: none;
    padding: 10px 15px;
    display: block;
    transition: background-color 0.3s;
    border-radius: 5px;
}

nav ul li a:hover {
    background-color: #236532;
}

/* Hero Section */
.hero {
    background: linear-gradient(rgba(0,0,0,0.6), rgba(0,0,0,0.6)), url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100" viewBox="0 0 100 100"><rect width="100" height="100" fill="%232d7d3d"/></svg>');
    background-size: cover;
    color: white;
    text-align: center;
    padding: 4rem 1rem;
    margin-bottom: 2rem;
    border-radius: 10px;
}

.hero h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.hero p {
    font-size: 1.2rem;
    max-width: 800px;
    margin: 0 auto;
}

/* Botons de seccions */
.sections {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 2rem;
    margin: 3rem 0;
}

.section-btn {
    background-color: white;
    border: 2px solid #2d7d3d;
    border-radius: 10px;
    padding: 2rem;
    width: 250px;
    text-align: center;
    cursor: pointer;
    transition: transform 0.3s, box-shadow 0.3s;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    text-decoration: none;
    color: inherit;
    display: block;
}

.section-btn:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0,0,0,0.2);
}

.section-icon {
    font-size: 3rem;
    color: #2d7d3d;
    margin-bottom: 1rem;
}

.section-btn h2 {
    color: #2d7d3d;
    margin-bottom: 1rem;
}

/* Informació del centre */
.info {
    background-color: white;
    padding: 3rem;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    margin: 3rem 0;
}

.info h2 {
    color: #2d7d3d;
    margin-bottom: 1.5rem;
    text-align: center;
}

.info-content {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
}

.info-item {
    flex: 1;
    min-width: 250px;
}

.info-item h3 {
    color: #2d7d3d;
    margin-bottom: 0.5rem;
}

/* Formularis */
.form-container {
    background-color: white;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    margin: 2rem auto;
    max-width: 800px;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: bold;
    color: #2d7d3d;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 1rem;
}

.form-group textarea {
    min-height: 100px;
    resize: vertical;
}

.btn {
    background-color: #2d7d3d;
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: bold;
    transition: background-color 0.3s;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.btn:hover {
    background-color: #236532;
}

.btn-secondary {
    background-color: #6c757d;
}

.btn-secondary:hover {
    background-color: #5a6268;
}

/* Productes */
.productes {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 2rem;
    margin: 2rem 0;
}

.producte {
    background-color: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    transition: transform 0.3s;
    position: relative;
}

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

.producte img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.producte-info {
    padding: 1.5rem;
}

.producte-titol {
    color: #2d7d3d;
    margin-bottom: 0.5rem;
}

.producte-desc {
    margin-bottom: 1rem;
    color: #666;
}

.producte-preu {
    font-weight: bold;
    font-size: 1.2rem;
    margin-bottom: 1rem;
    color: #333;
}

/* Estils per producte sense estoc */
.producte-sense-estoc {
    opacity: 0.7;
    pointer-events: none;
}

.etiqueta-estoc {
    position: absolute;
    top: 10px;
    right: 10px;
    background-color: #2d7d3d;
    color: white;
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 0.8rem;
    font-weight: bold;
}

/* Millores per a la quantitat */
.quantitat-simplificada {
    margin-bottom: 1rem;
}

.quantitat-simplificada label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: bold;
    color: #2d7d3d;
}

.quantitat-simplificada input {
    width: 80px;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 5px;
    text-align: center;
}

/* Missatges d'error */
.error-message {
    background-color: #ffebee;
    color: #c62828;
    padding: 1rem;
    border-radius: 5px;
    margin-bottom: 1rem;
    border-left: 4px solid #c62828;
}

/* Missatges d'èxit */
.missatge-exit {
    background-color: #d4edda;
    color: #155724;
    padding: 1rem;
    border-radius: 5px;
    margin-bottom: 1rem;
    border-left: 4px solid #28a745;
}

/* Peu de pàgina */
footer {
    background-color: #1a5c2c;
    color: white;
    padding: 2rem 0;
    margin-top: 3rem;
}

.footer-content {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 2rem;
}

.footer-section {
    flex: 1;
    min-width: 250px;
}

.footer-section h3 {
    margin-bottom: 1rem;
    color: #ffd700;
}

.footer-bottom {
    text-align: center;
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid #2d7d3d;
}

/* Login */
.login-container {
    max-width: 400px;
    margin: 3rem auto;
    padding: 2rem;
    background-color: white;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.login-container h2 {
    text-align: center;
    color: #2d7d3d;
    margin-bottom: 1.5rem;
}

/* Admin */
.admin-menu {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 2rem;
    margin: 2rem 0;
}

.admin-card {
    background-color: white;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    text-align: center;
    transition: transform 0.3s;
}

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

.admin-card h3 {
    color: #2d7d3d;
    margin-bottom: 1rem;
}

/* Taules */
.taula {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
    background-color: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

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

.taula th {
    background-color: #2d7d3d;
    color: white;
}

.taula tr:hover {
    background-color: #f5f5f5;
}

/* Estils per a la cistella */
.cistella-buida {
    text-align: center;
    padding: 2rem;
    background-color: white;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.cistella-buida h2 {
    color: #2d7d3d;
    margin-bottom: 1rem;
}

.taula-container {
    background-color: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    margin-bottom: 2rem;
}

.total-row {
    background-color: #f5f5f5;
    font-weight: bold;
}

.quantitat-input {
    width: 60px;
    padding: 5px;
    border: 1px solid #ddd;
    border-radius: 4px;
    text-align: center;
}

.btn-eliminar {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.2rem;
    padding: 5px;
    color: #dc3545;
}

.btn-eliminar:hover {
    color: #c82333;
}

.cistella-accions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    flex-wrap: wrap;
}

.btn-actualitzar {
    background-color: #2d7d3d;
}

.btn-buidar {
    background-color: #d32f2f;
}

.btn-buidar:hover {
    background-color: #c62828;
}

.btn-finalitzar {
    background-color: #1976d2;
}

.btn-finalitzar:hover {
    background-color: #1565c0;
}

/* Estils per processar comanda */
.resum-comanda {
    background-color: #f9f9f9;
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 2rem;
}

.resum-comanda h3 {
    color: #2d7d3d;
    margin-bottom: 1rem;
}

.resum-comanda ul {
    list-style: none;
    margin-bottom: 1rem;
}

.resum-comanda li {
    padding: 0.5rem 0;
    border-bottom: 1px solid #eee;
}

.total-comanda {
    font-size: 1.2rem;
    font-weight: bold;
    text-align: right;
    color: #2d7d3d;
}

.form-accions {
    display: flex;
    justify-content: space-between;
    margin-top: 2rem;
    gap: 1rem;
}

/* Estils per confirmació de comanda */
.confirmacio-comanda {
    text-align: center;
    padding: 2rem;
    background-color: white;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.icona-confirmacio {
    font-size: 4rem;
    color: #2d7d3d;
    margin-bottom: 1rem;
}

.detalls-comanda {
    text-align: left;
    margin: 2rem 0;
    padding: 1.5rem;
    background-color: #f9f9f9;
    border-radius: 8px;
}

.detalls-comanda h3 {
    color: #2d7d3d;
    margin-bottom: 1rem;
}

.botons-confirmacio {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 2rem;
    flex-wrap: wrap;
}

.btn-primary {
    background-color: #2d7d3d;
}

/* Responsive */
@media (max-width: 768px) {
    .header-container {
        flex-direction: column;
        text-align: center;
        padding: 10px;
    }
    
    .logo {
        margin-right: 0;
        margin-bottom: 10px;
    }
    
    .logo-img {
        height: 50px;
    }
    
    .header-content {
        flex-direction: column;
        gap: 1rem;
    }
    
    .site-title {
        font-size: 1.5rem;
    }
    
    .sections {
        flex-direction: column;
        align-items: center;
    }
    
    .section-btn {
        width: 100%;
        max-width: 300px;
    }
    
    .hero h1 {
        font-size: 2rem;
    }
    
    .hero p {
        font-size: 1rem;
    }
    
    .info-content {
        flex-direction: column;
    }
    
    nav ul {
        flex-direction: column;
        align-items: center;
    }
    
    nav ul li {
        margin: 5px 0;
    }
    
    .productes {
        grid-template-columns: 1fr;
    }
    
    .footer-content {
        flex-direction: column;
    }
    
    .cistella-accions {
        flex-direction: column;
    }
    
    .form-accions {
        flex-direction: column;
    }
    
    .botons-confirmacio {
        flex-direction: column;
    }
    
    .taula {
        font-size: 0.9rem;
    }
    
    .taula th,
    .taula td {
        padding: 0.5rem;
    }
    
    .admin-menu {
        grid-template-columns: 1fr;
    }
    
    .info {
        padding: 1.5rem;
    }
    
    .form-container {
        padding: 1.5rem;
    }
}

/* Estils addicionals per a millorar l'experiència mòbil */
@media (max-width: 480px) {
    .container {
        width: 95%;
        padding: 0 10px;
    }
    
    .hero {
        padding: 2rem 1rem;
    }
    
    .hero h1 {
        font-size: 1.8rem;
    }
    
    .section-btn {
        padding: 1.5rem;
    }
    
    .section-icon {
        font-size: 2.5rem;
    }
    
    .btn {
        padding: 10px 16px;
        font-size: 0.9rem;
    }
    
    .producte-info {
        padding: 1rem;
    }
}

/* Animacions suaus */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.5s ease-in-out;
}

/* Estils per a estats de loading */
.loading {
    opacity: 0.7;
    pointer-events: none;
}

.loading::after {
    content: " ...";
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0%, 100% { content: " ."; }
    33% { content: " .."; }
    66% { content: " ..."; }
}

/* Millores d'accessibilitat */
.btn:focus,
.cart-btn:focus,
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: 2px solid #2d7d3d;
    outline-offset: 2px;
}

/* Estils per a enllaços */
a {
    color: #2d7d3d;
    transition: color 0.3s ease;
}

a:hover {
    color: #236532;
}

/* Estils per a llistes */
ul, ol {
    margin-left: 1.5rem;
    margin-bottom: 1rem;
}

/* Estils per a codi i preformatejat */
code {
    background-color: #f4f4f4;
    padding: 2px 6px;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
}

pre {
    background-color: #f4f4f4;
    padding: 1rem;
    border-radius: 5px;
    overflow-x: auto;
    margin-bottom: 1rem;
}
