:root {
    --primary-color: #1a1f36;
    --accent-color: #1a73e8;
    --bg-color: #f4f7f9;
    --card-bg: #ffffff;
    --border-color: #eef2f7;
    --text-main: #2d3436;
    --text-sub: #94a3b8;
    --font-family: 'Noto Sans KR', 'Pretendard', sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-family);
    background-color: var(--bg-color);
    color: var(--text-main);
}

.main-container {
    max-width: 1100px;
    margin: 40px auto;
    display: flex;
    gap: 20px;
    padding: 0 20px;
    align-items: stretch;
}

/* LEFT PANEL */
.left-panel {
    width: 380px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
}

.right-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.preview-card {
    flex: 1;
    display: flex;
    flex-direction: column;
    margin-bottom: 0;
}

.preview-card .card-body {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.selection-card {
    flex: 1;
}

.processing-card {
    margin-bottom: 0;
}

.card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 32px;
    margin-bottom: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.03);
    overflow: visible;
}

.card-header {
    padding: 24px 28px;
    display: flex;
    gap: 16px;
    align-items: center;
}

.card-icon {
    width: 44px;
    height: 44px;
    background: #f1f5f9;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #64748b;
    font-size: 18px;
}

.card-title-group h2 {
    font-size: 17px;
    font-weight: 800;
    color: #1a1f36;
}

.card-title-group p {
    font-size: 12px;
    color: var(--text-sub);
}

.card-body {
    padding: 0 28px 28px;
}

.main-select-btn {
    width: 100%;
    height: 50px;
    background: #1a1f36;
    color: white;
    border: none;
    border-radius: 14px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.input-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 24px;
}

.input-field.full {
    grid-column: span 2;
}

.input-field label {
    display: block;
    font-size: 12px;
    font-weight: 800;
    color: #64748b;
    margin-bottom: 6px;
}

.select-box {
    position: relative;
}

.select-box select,
.input-field input {
    width: 100%;
    height: 46px;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 0 12px;
    font-size: 14px;
    font-weight: 700;
    background: #fcfdfe;
    transition: 0.2s;
}

.select-box select {
    appearance: none;
}

.select-box i {
    position: absolute;
    right: 12px;
    top: 16px;
    color: #cbd5e0;
    pointer-events: none;
}

.size-indicator {
    padding: 15px;
    background: #ffffff;
    border-radius: 18px;
    border: 2px solid #f1f5f9;
}

.dim-label-top {
    text-align: center;
    margin-bottom: 15px;
}

.dim-label-top span {
    font-size: 11px;
    font-weight: 900;
    color: var(--accent-color);
    font-family: 'Roboto Mono';
}

.visual-blueprint-area {
    width: 100%;
    height: 340px;
    position: relative;
    background: #fdfdfd;
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px dashed #cbd5e0;
}

.grid-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: linear-gradient(rgba(226, 232, 240, 0.4) 1px, transparent 1px),
        linear-gradient(90deg, rgba(226, 232, 240, 0.4) 1px, transparent 1px);
    background-size: 15px 15px;
}

#blueprint-svg {
    width: 100%;
    height: 100%;
    z-index: 2;
}


.options-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.shape-option {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 12px;
    text-align: center;
    cursor: pointer;
    transition: 0.2s;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.shape-option.active {
    border: 2.5px solid #1a1f36;
    background: #f0f7ff;
}

.shape-option img {
    width: 44px;
    height: 44px;
    object-fit: contain;
    margin-bottom: 8px;
}

.shape-option span {
    font-size: 11px;
    font-weight: 800;
}

.active-check {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 16px;
    height: 16px;
    background: #1a1f36;
    color: white;
    border-radius: 50%;
    font-size: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
}

.shape-option.active .active-check {
    opacity: 1;
}

/* RIGHT PANEL - PREMIUM PREVIEW */
.right-panel {
    flex: 1;
}

.preview-card {
    border-radius: 40px;
}

.card-header.headline {
    justify-content: space-between;
    padding: 32px 40px 24px;
    border-bottom: none;
}

.header-left-title {
    display: flex;
    gap: 16px;
    align-items: center;
}

.header-price-right {
    font-size: 32px;
    font-weight: 900;
    color: #1a1f36;
    letter-spacing: -0.5px;
}

.header-price-right small {
    font-size: 16px;
    font-weight: 700;
    color: #64748b;
    margin-left: 4px;
}

.material-hero-section {
    margin: 0 10px 15px;
    background: #f8fafc;
    border-radius: 24px;
    overflow: hidden;
    border: 1px solid #f0f3f6;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.hero-image-wrapper {
    width: 100%;
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

#big-material-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 16px;
}

.board-detail-footer {
    padding: 0 40px;
    margin-bottom: 40px;
}

.mat-info-block {
    margin-bottom: 30px;
}

.mat-info-block h4 {
    font-size: 24px;
    font-weight: 900;
    margin-bottom: 8px;
    color: #1a1f36;
}

.mat-info-block p {
    font-size: 15px;
    color: #94a3b8;
}

.applied-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 20px;
}

.option-row {
    background: #f8fafc;
    border-radius: 14px;
    padding: 12px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 1px solid #edf2f7;
}

.cart-action-area {
    padding: 0 40px 40px;
    margin-top: auto;
}

.cart-btn {
    width: 100%;
    height: 72px;
    background: #1a1f36;
    color: white;
    border: none;
    border-radius: 20px;
    font-size: 20px;
    font-weight: 900;
    cursor: pointer;
    transition: 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.cart-btn:hover {
    background: #000;
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.final-hint {
    text-align: center;
    font-size: 13px;
    color: #a0aec0;
    margin-top: 15px;
    font-weight: 600;
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background: white;
    width: 720px;
    max-height: 95vh;
    border-radius: 40px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.modal-header {
    padding: 24px 32px;
    border-bottom: 1px solid #f1f5f9;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-body {
    padding: 24px;
    overflow-y: auto;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 15px;
}

.mat-item {
    border: 2px solid transparent;
    border-radius: 20px;
    cursor: pointer;
    background: #f8fafc;
    transition: 0.2s;
    overflow: hidden;
}

.mat-item:hover {
    border-color: #e2e8f0;
    transform: translateY(-2px);
}

.mat-item.active {
    border-color: #1a1f36;
    background: #f0f7ff;
}

.mat-item img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
}

.mat-item p {
    padding: 12px;
    font-size: 14px;
    font-weight: 800;
    text-align: center;
}