:root {
    --md-sys-color-primary: #005cbb;
    --md-sys-color-on-primary: #ffffff;
    --md-sys-color-surface: #fdfcff;
    --md-sys-color-surface-container: #f0f4f9;
    --md-sys-color-on-surface: #1a1c1e;
    --md-sys-color-outline-variant: #c3c7cf;
    
    --md-elevation-1: 0px 1px 3px 1px rgba(0, 0, 0, 0.15), 0px 1px 2px 0px rgba(0, 0, 0, 0.3);
    --md-elevation-3: 0px 4px 8px 3px rgba(0, 0, 0, 0.15), 0px 1px 3px 0px rgba(0, 0, 0, 0.3);
}

body {
    margin: 0;
    font-family: 'Roboto', sans-serif;
    background-color: var(--md-sys-color-surface-container);
    color: var(--md-sys-color-on-surface);
}

/* Header */
.top-app-bar {
    background: var(--md-sys-color-surface);
    padding: 1rem 2rem;
    display: flex;
    align-items: center;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 10;
}

.logo { height: 40px; margin-right: 1rem; }
.title { font-size: 1.3rem; font-weight: 500; }

/* Grid */
main { padding: 2rem; max-width: 1200px; margin: 0 auto; }
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

/* Cards */
.card {
    background: var(--md-sys-color-surface);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--md-elevation-1);
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
    display: flex;
    flex-direction: column;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: var(--md-elevation-3);
}

.card-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    background-color: #e0e0e0;
}

.card-content { padding: 1rem; flex-grow: 1; }
.card-title { margin: 0 0 0.5rem 0; font-size: 1.1rem; font-weight: 500; }
.card-summary { color: #444; font-size: 0.9rem; white-space: pre-line; line-height: 1.4; }

/* Dialog / Modal */
dialog {
    border: none;
    border-radius: 28px;
    padding: 0;
    max-width: 800px;
    width: 90%;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    background: var(--md-sys-color-surface);
}

dialog::backdrop { background: rgba(0, 0, 0, 0.5); }

.dialog-container { display: flex; flex-direction: column; max-height: 90vh; }
.dialog-header { padding: 1.5rem; display: flex; justify-content: space-between; align-items: start; }
.dialog-header h2 { margin: 0; font-size: 1.5rem; }

.icon-button {
    background: none; border: none; cursor: pointer; padding: 8px; border-radius: 50%;
}
.icon-button:hover { background-color: rgba(0,0,0,0.05); }

.dialog-content { padding: 0 1.5rem 1.5rem; overflow-y: auto; }

/* Carousel */
.carousel-container { 
    overflow-x: auto; 
    white-space: nowrap; 
    margin-bottom: 1.5rem; 
    padding-bottom: 10px;
}
.carousel-track { display: flex; gap: 10px; }
.carousel-img {
    height: 250px;
    border-radius: 12px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

/* Specs Table */
.specs-table { width: 100%; border-collapse: collapse; margin-top: 1rem; }
.specs-table td { padding: 8px 0; border-bottom: 1px solid var(--md-sys-color-outline-variant); }
.specs-table td:first-child { font-weight: 500; width: 40%; color: #555; }

/* Buttons */
.dialog-actions {
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    border-top: 1px solid #eee;
}

.btn-text {
    background: none; border: none; color: var(--md-sys-color-primary);
    font-weight: 500; cursor: pointer; padding: 10px 20px; border-radius: 20px;
}

.btn-filled {
    background: var(--md-sys-color-primary);
    color: var(--md-sys-color-on-primary);
    border: none; padding: 10px 24px; border-radius: 20px;
    font-weight: 500; cursor: pointer; display: flex; align-items: center; gap: 8px;
}
.btn-filled:hover { opacity: 0.9; }