/* --- Reset di Base --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg-color: #f9f9f9;
    --card-bg: #ffffff;
    --text-main: #2c3e50;
    --text-muted: #7f8c8d;
    --accent: #b89775;
    --accent-dark: #9a7e5f;
    --border-color: #e2e8f0;
    --danger: #e74c3c;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    line-height: 1.5;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* --- Layout Header --- */
.main-header {
    background-color: var(--card-bg);
    border-bottom: 1px solid var(--border-color);
    padding: 20px 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-flex {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.logo {
    font-family: "Georgia", serif;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.nav-filters {
    display: flex;
    align-items: center;
    gap: 10px;
}

.custom-select {
    padding: 8px 16px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background-color: var(--card-bg);
    color: var(--text-main);
    cursor: pointer;
}

/* --- Griglia e Colonne Principali --- */
.main-layout {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 30px;
    margin: 40px auto 60px auto;
}

@media (max-width: 900px) {
    .main-layout {
        grid-template-columns: 1fr;
    }
}

/* --- Box Biografia Artista --- */
.artist-bio-card {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 20px;
    display: flex;
    gap: 20px;
    margin-bottom: 30px;
    align-items: center;
}

.artist-photo {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--accent);
}

.artist-country {
    font-size: 0.85rem;
    text-transform: uppercase;
    color: var(--accent);
    font-weight: 600;
    display: block;
    margin-bottom: 4px;
}

.bio-text {
    color: var(--text-muted);
    font-size: 0.95rem;
}

/* --- Griglia Card Opere --- */
.artworks-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
}

.artwork-card {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform 0.2s, box-shadow 0.2s;
}

.artwork-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.05);
}

.artwork-img-wrapper {
    position: relative;
    width: 100%;
    padding-top: 75%; /* Ratio 4:3 */
    background-color: #f0f0f0;
}

.artwork-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.artwork-details {
    padding: 20px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.artwork-title {
    font-size: 1.1rem;
    margin-bottom: 6px;
}

.artwork-meta {
    font-size: 0.9rem;
    font-weight: 500;
}

.artwork-medium {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 15px;
    font-style: italic;
}

.artwork-footer {
    margin-top: auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.artwork-price {
    font-size: 1.15rem;
    font-weight: 700;
}

/* --- Classi di Stato (Dinamiche) --- */
.sold-status {
    opacity: 0.6;
}

.sold-badge {
    position: absolute;
    top: 15px;
    left: 15px;
    background-color: var(--danger);
    color: white;
    padding: 4px 12px;
    font-size: 0.75rem;
    font-weight: bold;
    text-transform: uppercase;
    border-radius: 4px;
}

.in-cart-status {
    border-color: var(--accent);
}

/* --- Bottoni Globali --- */
.btn {
    padding: 8px 14px;
    border: none;
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
}

.btn-primary {
    background-color: var(--text-main);
    color: white;
}

.btn-primary:hover {
    background-color: var(--accent);
}

.btn:disabled {
    background-color: #e2e8f0;
    color: #94a3b8;
    cursor: not-allowed;
}

/* --- Sidebar Carrello --- */
.sidebar-cart {
    position: sticky;
    top: 100px;
    align-self: start;
}

.cart-box {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 20px;
}

.cart-items-list {
    list-style: none;
    max-height: 240px;
    overflow-y: auto;
    margin-bottom: 20px;
}

.cart-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid var(--bg-color);
}

.cart-item-info {
    display: flex;
    flex-direction: column;
}

.cart-item-title {
    font-size: 0.9rem;
    font-weight: 600;
}

.cart-item-artist {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.cart-item-price {
    font-size: 0.9rem;
    font-weight: 700;
}

.btn-remove {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.4rem;
    cursor: pointer;
}

.btn-remove:hover {
    color: var(--danger);
}

.cart-summary {
    border-top: 1px solid var(--border-color);
    padding-top: 15px;
}

.cart-total-row {
    display: flex;
    justify-content: space-between;
    font-weight: 700;
    margin-bottom: 15px;
}

.btn-checkout {
    width: 100%;
    background-color: var(--accent);
    color: white;
    padding: 12px;
    font-size: 1rem;
}

.btn-checkout:hover {
    background-color: var(--accent-dark);
}

/* --- Footer --- */
.main-footer {
    text-align: center;
    padding: 30px 0;
    background-color: var(--card-bg);
    border-top: 1px solid var(--border-color);
    color: var(--text-muted);
    font-size: 0.85rem;
}
