@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+KR:wght@400;500;700&display=swap');

:root {
    --primary-color: #2563eb;
    --primary-dark: #1e40af;
    --accent-color: #f59e0b;
    --danger-color: #dc2626;
    --success-color: #10b981;
    --bg-color: #f3f4f6;
    --card-bg: #ffffff;
    --text-main: #1f2937;
    --text-sub: #6b7280;
    --border-radius: 16px;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

body {
    font-family: 'Noto Sans KR', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    margin: 0;
    padding: 0;
    line-height: 1.5;
}

/* Header */
header {
    background-color: var(--card-bg);
    padding: 1.5rem 0;
    text-align: center;
    box-shadow: var(--shadow-sm);
    margin-bottom: 2rem;
}

header h1 {
    margin: 0;
    font-size: 1.5rem;
    color: var(--primary-dark);
    font-weight: 800;
    letter-spacing: -0.025em;
}

.container {
    max-width: 768px; /* 모바일 친화적인 폭 */
    margin: 0 auto;
    padding: 0 1.5rem 3rem;
}

/* Info Header */
#info-header {
    text-align: center;
    margin-bottom: 2rem;
}

.vendor-name {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-main);
}

.date-warning {
    display: inline-block;
    margin-top: 0.5rem;
    padding: 0.25rem 0.75rem;
    background-color: #fef2f2;
    color: var(--danger-color);
    font-size: 0.875rem;
    border-radius: 9999px;
    font-weight: 500;
    border: 1px solid #fee2e2;
}

/* Controls */
.controls {
    background: var(--card-bg);
    padding: 1.5rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-md);
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.25rem;
    margin-bottom: 2rem;
}

.control-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-sub);
}

select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    font-size: 0.95rem;
    color: var(--text-main);
    background-color: #f9fafb;
    transition: all 0.2s;
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 0.75rem center;
    background-repeat: no-repeat;
    background-size: 1.5em 1.5em;
}

select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
    background-color: #fff;
}

/* Results - Card */
#results {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.item-card {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-md);
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
    border: 1px solid #f3f4f6;
}

.item-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.card-header {
    padding: 1.5rem 1.5rem 0.5rem;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.item-info h2 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-main);
}

.origin-badge {
    display: inline-block;
    font-size: 0.75rem;
    padding: 2px 8px;
    background-color: #eff6ff;
    color: var(--primary-color);
    border-radius: 6px;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.card-body {
    padding: 0 1.5rem 1.5rem;
}

/* 가격 정보 섹션 */
.price-section {
    background-color: #f8fafc;
    border-radius: 12px;
    padding: 1.25rem;
    margin-top: 1rem;
    text-align: center;
}

.final-price-label {
    font-size: 0.875rem;
    color: var(--text-sub);
    margin-bottom: 0.25rem;
}

.final-price {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--primary-dark);
    line-height: 1;
}

/* 상세 정보 리스트 */
.info-list {
    margin-top: 1rem;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

.info-item {
    font-size: 0.9rem;
    color: var(--text-sub);
    display: flex;
    flex-direction: column;
}

.info-label {
    font-size: 0.75rem;
    font-weight: 500;
    color: #9ca3af;
}

.info-value {
    font-weight: 600;
    color: var(--text-main);
}

/* 계산 원리 토글 */
.calc-toggle-wrapper {
    text-align: center;
    margin-top: 1rem;
}

.calc-toggle-btn {
    background: none;
    border: none;
    font-size: 0.85rem;
    color: var(--text-sub);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    transition: background 0.2s;
}

.calc-toggle-btn:hover {
    background-color: #f3f4f6;
    color: var(--primary-color);
}

.calc-details {
    display: none; /* 기본 숨김 */
    margin-top: 0.5rem;
    padding: 1rem;
    background-color: #fff;
    border: 1px dashed #e5e7eb;
    border-radius: 8px;
    font-size: 0.85rem;
}

.calc-details.visible {
    display: block;
    animation: slideDown 0.2s ease-out;
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-5px); }
    to { opacity: 1; transform: translateY(0); }
}

.calc-formula {
    color: var(--text-sub);
    line-height: 1.8;
}

.calc-formula .highlight {
    color: var(--primary-dark);
    font-weight: 700;
}

/* 주문 버튼 */
.order-btn {
    width: 100%;
    margin-top: 1.25rem;
    padding: 1rem;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.1s;
    box-shadow: 0 4px 6px rgba(37, 99, 235, 0.2);
}

.order-btn:hover {
    background-color: var(--primary-dark);
    transform: translateY(-1px);
}

.order-btn:active {
    transform: translateY(0);
}

/* Order Section */
.order-section {
    background: var(--card-bg);
    padding: 2rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    margin-top: 3rem;
}

.order-section h3 {
    margin-top: 0;
    font-size: 1.25rem;
    color: var(--text-main);
}

textarea {
    width: 100%;
    height: 200px;
    padding: 1rem;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    margin-top: 1rem;
    font-family: monospace;
    font-size: 0.95rem;
    resize: vertical;
}

.copy-btn {
    width: 100%;
    padding: 1rem;
    background-color: var(--success-color);
    color: white;
    border: none;
    border-radius: 12px;
    font-weight: 700;
    margin-top: 1rem;
    cursor: pointer;
    font-size: 1rem;
}

.copy-btn:hover {
    background-color: #059669;
}

.hidden { display: none; }
.placeholder { text-align: center; padding: 3rem; color: var(--text-sub); }

@media (max-width: 600px) {
    .info-list { grid-template-columns: 1fr; }
}