/* === RESET & BASE === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    color: #1a1a2e;
    background: #f8f9fc;
    line-height: 1.6;
}
.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }
.view { display: none; }
.view.active { display: block; }

/* === HEADER === */
.header {
    background: #fff;
    border-bottom: 1px solid #e8eaf0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.logo { display: flex; align-items: baseline; gap: 8px; cursor: pointer; }
.logo-label { font-size: 24px; font-weight: 700; color: #e63946; letter-spacing: -0.5px; }
.logo-sub { font-size: 12px; color: #8a8fa8; font-weight: 400; }
.nav { display: flex; gap: 8px; align-items: center; }
.nav-link {
    padding: 8px 16px;
    border-radius: 8px;
    text-decoration: none;
    color: #5a5f7a;
    font-weight: 500;
    font-size: 14px;
    transition: all 0.2s;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
}
.nav-link:hover { background: #f0f1f5; color: #1a1a2e; }
.nav-link.active { background: #e63946; color: #fff; }
.cart-count {
    background: #fff;
    color: #e63946;
    font-size: 11px;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 10px;
    min-width: 18px;
    text-align: center;
}

/* === BREADCRUMB === */
.breadcrumb-bar {
    background: #fff;
    border-bottom: 1px solid #f0f1f5;
    padding: 10px 0;
    font-size: 13px;
    color: #8a8fa8;
}
.breadcrumb-bar .container { display: flex; align-items: center; gap: 8px; }
.crumb { cursor: pointer; transition: color 0.2s; }
.crumb:hover { color: #e63946; }
.crumb-sep { color: #ddd; }
.crumb-active { color: #1a1a2e; font-weight: 600; }

/* === HERO === */
.hero {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    color: #fff;
    padding: 72px 0;
    text-align: center;
}
.hero h1 { font-size: 40px; font-weight: 800; margin-bottom: 16px; letter-spacing: -1px; }
.hero p { font-size: 17px; color: rgba(255,255,255,0.7); max-width: 560px; margin: 0 auto; }

/* === SECTIONS === */
.section { padding: 60px 0; }
.section-alt { background: #fff; }
.section-title { font-size: 28px; font-weight: 700; text-align: center; margin-bottom: 8px; }
.section-subtitle { text-align: center; color: #8a8fa8; font-size: 15px; margin-bottom: 40px; }

/* === CATEGORY CARDS (home) === */
.category-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; max-width: 900px; margin: 0 auto; }
@media (max-width: 700px) { .category-cards { grid-template-columns: 1fr; } }
.category-card {
    background: #fff;
    border-radius: 20px;
    padding: 40px 32px;
    border: 2px solid #f0f1f5;
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
}
.category-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 5px;
    background: var(--cat-color, #e63946);
}
.category-card:hover {
    border-color: var(--cat-color);
    transform: translateY(-6px);
    box-shadow: 0 16px 40px rgba(0,0,0,0.1);
}
.cat-icon {
    width: 64px; height: 64px;
    border-radius: 16px;
    background: color-mix(in srgb, var(--cat-color) 10%, white);
    color: var(--cat-color);
    display: flex; align-items: center; justify-content: center;
    font-size: 28px;
    margin-bottom: 20px;
}
.category-card h3 { font-size: 22px; font-weight: 700; margin-bottom: 10px; }
.category-card > p { font-size: 14px; color: #8a8fa8; line-height: 1.6; margin-bottom: 20px; }
.cat-features {
    display: flex; flex-direction: column; gap: 6px;
    margin-bottom: 24px;
    font-size: 13px; color: #5a5f7a;
}
.cat-features i { color: var(--cat-color); margin-right: 6px; font-size: 11px; }
.cat-cta {
    font-weight: 600; font-size: 14px;
    color: var(--cat-color);
    display: flex; align-items: center; gap: 8px;
}

/* === MATERIALS GRID (category view) === */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 20px;
}
.material-card {
    background: #fff;
    border-radius: 16px;
    padding: 28px 24px;
    border: 2px solid #f0f1f5;
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
}
.material-card::before {
    content: '';
    position: absolute; top: 0; left: 0; right: 0;
    height: 4px;
    background: var(--mat-color, #e63946);
    transform: scaleX(0);
    transition: transform 0.3s;
}
.material-card:hover {
    border-color: var(--mat-color);
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(0,0,0,0.08);
}
.material-card:hover::before { transform: scaleX(1); }
.mat-icon { font-size: 36px; margin-bottom: 14px; color: var(--mat-color, #e63946); }
.material-card h4 { font-size: 16px; font-weight: 700; margin-bottom: 6px; }
.material-card p { font-size: 13px; color: #8a8fa8; line-height: 1.5; }
.mat-finishes { font-size: 12px; color: #5a5f7a; margin-top: 12px; font-weight: 500; }
.mat-finishes i { color: var(--mat-color); margin-right: 4px; }
.product-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 12px;
}
.badge-standard { background: #e8f5e9; color: #2e7d32; }
.badge-premium { background: #fff3e0; color: #e65100; }
.badge-eco { background: #e0f2f1; color: #00695c; }
.badge-rush { background: #fce4ec; color: #c62828; }
.badge-special { background: #ede7f6; color: #4527a0; }

/* === PRODUCT LAYOUT === */
.product-layout { display: grid; grid-template-columns: 1fr 380px; gap: 32px; align-items: start; }
@media (max-width: 900px) { .product-layout { grid-template-columns: 1fr; } }

.product-header {
    background: #f8f9fc;
    border-radius: 16px;
    padding: 28px;
    margin-bottom: 20px;
    border: 1px solid #e8eaf0;
}
.product-header h2 { font-size: 22px; font-weight: 700; margin-bottom: 6px; display: flex; align-items: center; gap: 10px; }
.product-header h2 i { color: var(--mat-color, #e63946); }
.product-header .product-desc { font-size: 14px; color: #8a8fa8; }
.product-header .product-app-badge {
    display: inline-block; padding: 4px 12px; border-radius: 6px;
    font-size: 12px; font-weight: 600; margin-top: 10px;
}
.app-badge-manual { background: #e3f2fd; color: #1565c0; }
.app-badge-auto { background: #fce4ec; color: #c62828; }

/* === FINISH OPTIONS === */
.finish-options { display: flex; flex-direction: column; gap: 8px; }
.finish-option {
    display: flex; align-items: center; gap: 12px;
    padding: 12px 16px;
    border: 2px solid #e8eaf0;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
    background: #fff;
}
.finish-option:hover { border-color: #e63946; }
.finish-option.active { border-color: #e63946; background: #fef2f2; }
.finish-radio {
    width: 20px; height: 20px;
    border: 2px solid #ccc;
    border-radius: 50%;
    flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    transition: all 0.2s;
}
.finish-option.active .finish-radio { border-color: #e63946; }
.finish-option.active .finish-radio::after {
    content: '';
    width: 10px; height: 10px;
    background: #e63946;
    border-radius: 50%;
}
.finish-name { font-size: 14px; font-weight: 500; }

/* === CONFIG CARDS === */
.config-card {
    background: #f8f9fc;
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 20px;
    border: 1px solid #e8eaf0;
}
.config-card h3 {
    font-size: 15px; font-weight: 600; margin-bottom: 16px;
    color: #1a1a2e;
    display: flex; align-items: center; gap: 10px;
}
.config-card h3 i { color: #e63946; font-size: 16px; }

/* === FORMS === */
.form-group { margin-bottom: 16px; }
.form-group:last-child { margin-bottom: 0; }
.form-group label {
    display: block; font-size: 12px; font-weight: 600;
    color: #5a5f7a; margin-bottom: 6px;
    text-transform: uppercase; letter-spacing: 0.5px;
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-control {
    width: 100%; padding: 10px 14px;
    border: 2px solid #e8eaf0; border-radius: 10px;
    font-size: 15px; font-family: inherit;
    transition: border-color 0.2s; background: #fff;
}
.form-control:focus { outline: none; border-color: #e63946; }
select.form-control { cursor: pointer; }
.form-hint { font-size: 12px; color: #8a8fa8; margin-top: 6px; line-height: 1.4; }
.toggle-group { display: flex; gap: 8px; }
.toggle-btn {
    flex: 1; padding: 10px 16px;
    border: 2px solid #e8eaf0; border-radius: 10px;
    background: #fff; cursor: pointer;
    font-size: 14px; font-weight: 500;
    transition: all 0.2s; font-family: inherit;
    display: flex; align-items: center; justify-content: center; gap: 8px;
}
.toggle-btn:hover { border-color: #e63946; }
.toggle-btn.active { border-color: #e63946; background: #e63946; color: #fff; }

/* === SHAPES === */
.shape-selector { display: flex; gap: 10px; flex-wrap: wrap; }
.shape-btn {
    padding: 8px 16px;
    border: 2px solid #e8eaf0; border-radius: 10px;
    background: #fff; cursor: pointer;
    font-size: 13px; font-weight: 500;
    transition: all 0.2s; font-family: inherit;
}
.shape-btn:hover { border-color: #e63946; }
.shape-btn.active { border-color: #e63946; background: #e63946; color: #fff; }

/* === ORIENTATION === */
.orientation-selector { display: flex; gap: 8px; }
.orient-btn {
    flex: 1; padding: 10px;
    border: 2px solid #e8eaf0; border-radius: 10px;
    background: #fff; cursor: pointer;
    font-size: 13px; font-weight: 500;
    transition: all 0.2s; font-family: inherit;
    text-align: center;
}
.orient-btn:hover { border-color: #e63946; }
.orient-btn.active { border-color: #e63946; background: #e63946; color: #fff; }

/* === LABEL PREVIEW === */
.label-preview {
    background: #fff; border-radius: 12px; padding: 24px;
    display: flex; align-items: center; justify-content: center;
    min-height: 140px; border: 2px dashed #e8eaf0; margin-top: 12px;
}
.label-shape {
    border: 3px solid #e63946;
    display: flex; align-items: center; justify-content: center;
    transition: all 0.3s; background: rgba(230, 57, 70, 0.05);
}
.label-dims { font-size: 12px; font-weight: 600; color: #e63946; white-space: nowrap; }

/* === SERIES === */
.series-row { margin-bottom: 12px; }
.series-fields { display: flex; flex-direction: column; gap: 6px; }
.series-top { display: flex; gap: 8px; align-items: center; }
.series-top .form-control { flex: 1; }
.file-upload { display: block; cursor: pointer; }
.file-upload input[type="file"] { display: none; }
.file-upload-btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 6px 12px; border-radius: 8px;
    background: #f0f1f5; color: #5a5f7a;
    font-size: 12px; font-weight: 500;
    transition: all 0.2s;
}
.file-upload-btn:hover { background: #e8eaf0; color: #e63946; }
.file-upload-name {
    font-size: 12px; color: #4caf50; font-weight: 500;
    margin-left: 8px;
}
.file-upload-name:empty { display: none; }
.btn-icon {
    width: 36px; height: 36px; border: none; border-radius: 8px;
    background: #fee; color: #e63946; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: all 0.2s; flex-shrink: 0;
}
.btn-icon:hover { background: #e63946; color: #fff; }

/* === BUTTONS === */
.btn {
    display: inline-flex; align-items: center; justify-content: center;
    gap: 8px; padding: 12px 24px; border: none; border-radius: 10px;
    font-size: 15px; font-weight: 600; font-family: inherit;
    cursor: pointer; transition: all 0.2s;
}
.btn-primary { background: #e63946; color: #fff; }
.btn-primary:hover { background: #d32f3f; transform: translateY(-1px); box-shadow: 0 4px 12px rgba(230,57,70,0.3); }
.btn-success { background: #4caf50; color: #fff; }
.btn-success:hover { background: #43a047; transform: translateY(-1px); box-shadow: 0 4px 12px rgba(76,175,80,0.3); }
.btn-outline { background: transparent; border: 2px solid #e8eaf0; color: #5a5f7a; }
.btn-outline:hover { border-color: #e63946; color: #e63946; }
.btn-sm { padding: 8px 16px; font-size: 13px; }
.btn-lg { padding: 14px 28px; font-size: 16px; }
.btn-block { width: 100%; }
.btn-danger { background: #fff; color: #e63946; border: 1px solid #fcc; }
.btn-danger:hover { background: #fef2f2; }

/* === PRICE PANEL === */
.price-panel { position: sticky; top: 88px; }
.price-card {
    background: #fff; border-radius: 16px;
    border: 2px solid #e8eaf0; overflow: hidden;
}
.price-card-header {
    background: linear-gradient(135deg, #1a1a2e, #0f3460);
    color: #fff; padding: 20px 24px;
}
.price-card-title { font-size: 16px; font-weight: 600; }
.price-card-body { padding: 20px; }
.price-hint { text-align: center; color: #8a8fa8; font-size: 14px; padding: 20px 0; }

.price-result { display: none; }
.price-result.visible { display: block; }
.price-total-row {
    display: flex; justify-content: space-between; align-items: baseline;
    padding: 16px 0; border-bottom: 1px solid #f0f1f5;
}
.price-total-label { font-size: 14px; color: #5a5f7a; }
.price-total-value { font-size: 32px; font-weight: 800; color: #1a1a2e; }
.price-total-value small { font-size: 16px; font-weight: 400; color: #8a8fa8; }
.price-detail-row {
    display: flex; justify-content: space-between;
    padding: 8px 0; font-size: 13px; color: #5a5f7a;
}
.price-detail-row.highlight { font-weight: 600; color: #1a1a2e; border-top: 1px solid #f0f1f5; margin-top: 4px; padding-top: 12px; }
.price-per-unit {
    background: #f8f9fc; padding: 10px 14px; border-radius: 8px;
    margin-top: 12px; font-size: 13px; font-weight: 600;
    display: flex; justify-content: space-between;
}
.price-card-body .btn { margin-top: 12px; }

/* === CART === */
.empty-cart { text-align: center; padding: 60px 0; color: #8a8fa8; }
.empty-cart i { font-size: 48px; margin-bottom: 16px; display: block; color: #ddd; }
.empty-cart p { margin-bottom: 20px; }

.cart-item {
    background: #fff; border-radius: 16px; padding: 24px;
    border: 1px solid #e8eaf0; margin-bottom: 16px;
    display: grid; grid-template-columns: 1fr auto; gap: 20px; align-items: start;
}
.cart-item-info h4 { font-size: 16px; font-weight: 600; margin-bottom: 4px; }
.cart-item-details { font-size: 13px; color: #5a5f7a; line-height: 1.8; }
.cart-item-price { text-align: right; }
.cart-item-price .price { font-size: 20px; font-weight: 700; }
.cart-item-price .price-sub { font-size: 12px; color: #8a8fa8; }

.cart-footer {
    background: #fff; border-radius: 16px; padding: 24px;
    border: 2px solid #e8eaf0; margin-top: 24px;
}
.cart-total {
    display: flex; justify-content: space-between; align-items: baseline;
    font-size: 20px; font-weight: 700; margin-bottom: 16px;
}
.cart-note { font-size: 12px; color: #8a8fa8; margin-top: 12px; text-align: center; }
.cart-files { margin-top: 10px; }
.cart-file {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 4px 10px; border-radius: 6px;
    background: #e8f5e9; color: #2e7d32;
    font-size: 12px; font-weight: 500;
    margin-right: 6px; margin-bottom: 4px;
}
.cart-file i { font-size: 11px; }
.cart-series-label { font-size: 11px; color: #8a8fa8; text-transform: uppercase; font-weight: 600; margin-top: 8px; }
.cart-series-item { font-size: 13px; color: #5a5f7a; padding: 4px 0; display: flex; align-items: center; gap: 8px; }

/* === LOADING & TOAST === */
.loading-overlay {
    position: fixed; inset: 0;
    background: rgba(26, 26, 46, 0.8);
    display: none; align-items: center; justify-content: center;
    flex-direction: column; gap: 16px;
    z-index: 1000; color: #fff; font-size: 16px;
    backdrop-filter: blur(4px);
}
.loading-overlay.active { display: flex; }
.spinner {
    width: 48px; height: 48px;
    border: 4px solid rgba(255,255,255,0.2);
    border-top-color: #e63946; border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.toast-container { position: fixed; bottom: 24px; right: 24px; z-index: 1001; display: flex; flex-direction: column; gap: 8px; }
.toast {
    padding: 14px 20px; border-radius: 12px; font-size: 14px;
    font-weight: 500; color: #fff;
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
    animation: slideIn 0.3s ease; max-width: 360px;
}
.toast-success { background: #4caf50; }
.toast-error { background: #e63946; }
.toast-info { background: #1565c0; }
@keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* === FOOTER === */
.footer { background: #111; color: #8a8fa8; padding: 24px 0; text-align: center; font-size: 13px; }
.footer a { color: #e63946; text-decoration: none; }
.footer a:hover { text-decoration: underline; }

/* === RESPONSIVE === */
@media (max-width: 768px) {
    .hero h1 { font-size: 28px; }
    .hero p { font-size: 15px; }
    .section { padding: 40px 0; }
}
