/* 리셋 및 기본 스타일 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Sans KR', sans-serif;
    line-height: 1.6;
    color: #333;
    background: #ffffff;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* 헤더 */
.site-header {
    background: #ffffff;
    border-bottom: 1px solid #e0e0e0;
}

/* 상단 유틸리티 바 */
.top-bar {
    background: #f8f8f8;
    border-bottom: 1px solid #e0e0e0;
    padding: 8px 0;
}

.top-bar-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.top-left-nav,
.top-right-nav {
    display: flex;
    gap: 20px;
}

.top-left-nav a,
.top-right-nav a {
    font-size: 12px;
    color: #666;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

.top-left-nav a:hover,
.top-right-nav a:hover {
    color: #000;
}

/* 로고 영역 */
.logo-area {
    text-align: center;
    padding: 30px 0;
}

.logo {
    display: inline-block;
    text-decoration: none;
}

.logo img {
    max-width: 200px;
    height: auto;
    display: block;
}

/* 메인 카테고리 메뉴 */
.main-menu-bar {
    background: #fff;
    border-top: 1px solid #e0e0e0;
    border-bottom: 2px solid #000;
}

.category-nav {
    display: flex;
    justify-content: center;
    gap: 40px;
    padding: 16px 0;
}

.category-nav a {
    color: #333;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: color 0.2s;
    position: relative;
}

.category-nav a:hover {
    color: #000;
}

.category-nav a::after {
    content: '';
    position: absolute;
    bottom: -17px;
    left: 0;
    right: 0;
    height: 2px;
    background: #000;
    transform: scaleX(0);
    transition: transform 0.2s;
}

.category-nav a:hover::after {
    transform: scaleX(1);
}

/* 메인 콘텐츠 */
.main-content {
    min-height: calc(100vh - 200px);
    padding: 0;
}

/* 메인 배너 */
.main-banner {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 100px 0;
    text-align: center;
    color: #fff;
    margin: 0;
    min-height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.banner-content h1 {
    font-size: 48px;
    font-weight: 700;
    margin-bottom: 20px;
    letter-spacing: -1px;
}

.banner-content p {
    font-size: 18px;
    margin-bottom: 40px;
    opacity: 0.9;
}

.banner-content .btn {
    background: #fff;
    color: #667eea;
    border-color: #fff;
}

.banner-content .btn:hover {
    background: rgba(255, 255, 255, 0.9);
}

/* 옵션 선택 라디오 버튼 스타일 */
label:has(input[type="radio"]) {
    cursor: pointer;
}

label:has(input[type="radio"]:checked) {
    background: #000;
    color: #fff;
    border-color: #000;
}

label:has(input[type="radio"]) input[type="radio"] {
    cursor: pointer;
}

.btn {
    display: inline-block;
    height: 44px;
    padding: 0 28px;
    background: #000;
    color: #fff;
    text-decoration: none;
    border: 1px solid #000;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    line-height: 42px;
    text-align: center;
    white-space: nowrap;
}

.btn:hover {
    background: #333;
    border-color: #333;
}

.btn-secondary {
    background: #fff;
    color: #000;
}

.btn-secondary:hover {
    background: #f5f5f5;
}

button.btn,
input[type="submit"].btn {
    line-height: normal;
    padding: 12px 28px;
}

/* 상품 그리드 */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 24px;
    margin-top: 0;
}

.product-card {
    text-decoration: none;
    color: inherit;
    display: block;
    transition: transform 0.2s;
}

.product-card:hover {
    transform: translateY(-4px);
}

.product-image {
    width: 100%;
    aspect-ratio: 1;
    background: #f5f5f5;
    border: 1px solid #e0e0e0;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-placeholder {
    font-size: 48px;
    color: #ccc;
}

.product-info h3 {
    font-size: 16px;
    font-weight: 500;
    margin-bottom: 8px;
}

.product-price {
    font-size: 18px;
    font-weight: 700;
}

/* 상품 상세 */
.product-detail {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    margin-top: 40px;
}

.product-detail-image {
    width: 500px;
    height: 500px;
    background: #f5f5f5;
    border: 1px solid #e0e0e0;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.product-detail-info h1 {
    font-size: 32px;
    margin-bottom: 16px;
    font-weight: 600;
}

.product-detail-price {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 24px;
}

.product-detail-description {
    color: #666;
    margin-bottom: 40px;
    line-height: 1.8;
}

.product-detail-description img {
    max-width: 100%;
    height: auto;
    margin: 20px 0;
}

.product-detail-description p {
    margin-bottom: 16px;
}

.product-detail-description ul,
.product-detail-description ol {
    margin-left: 20px;
    margin-bottom: 16px;
}

.product-detail-description h2,
.product-detail-description h3 {
    margin-top: 24px;
    margin-bottom: 12px;
    font-weight: 600;
}

/* 폼 스타일 */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    font-size: 14px;
    color: #333;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="tel"],
.form-group input[type="number"],
.form-group input[type="password"],
.form-group input[type="date"],
.form-group input[type="datetime-local"],
.form-group textarea,
.form-group select,
input[type="text"],
input[type="email"],
input[type="tel"],
input[type="number"],
input[type="password"],
input[type="date"],
input[type="datetime-local"],
textarea,
select {
    width: 100%;
    height: 44px;
    padding: 0 14px;
    border: 1px solid #e0e0e0;
    font-size: 14px;
    font-family: inherit;
    background: #fff;
    transition: border-color 0.2s;
    line-height: 44px;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus,
input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: #333;
}

.form-group input:disabled,
.form-group textarea:disabled,
.form-group select:disabled,
input:disabled,
textarea:disabled,
select:disabled {
    background: #f5f5f5;
    color: #999;
    cursor: not-allowed;
}

.form-group textarea,
textarea {
    height: auto;
    min-height: 120px;
    padding: 12px 14px;
    resize: vertical;
    line-height: 1.6;
}

.form-group select,
select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23333' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

.form-group input[type="file"] {
    height: auto;
    padding: 10px 0;
    border: none;
    line-height: normal;
}

.form-group small {
    display: block;
    margin-top: 6px;
    font-size: 13px;
    color: #666;
}

/* 라디오, 체크박스 */
.form-group input[type="radio"],
.form-group input[type="checkbox"] {
    width: auto;
    height: auto;
    margin-right: 6px;
}

.form-group label input[type="radio"],
.form-group label input[type="checkbox"] {
    margin-right: 8px;
}

/* 장바구니 */
.cart-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 40px;
}

.cart-table th,
.cart-table td {
    padding: 16px;
    text-align: left;
    border-bottom: 1px solid #e0e0e0;
    vertical-align: middle;
}

.cart-table th {
    font-weight: 600;
    background: #f8f8f8;
    font-size: 14px;
}

.cart-table td {
    font-size: 14px;
}

.cart-item-image {
    width: 80px;
    height: 80px;
    background: #f5f5f5;
    border: 1px solid #e0e0e0;
}

.cart-item-info {
    display: flex;
    gap: 20px;
    align-items: center;
}

.quantity-control {
    display: flex;
    align-items: center;
    gap: 8px;
}

.quantity-control input[type="number"] {
    width: 60px;
    height: 50px;
    text-align: center;
    border: 1px solid #e0e0e0;
    font-size: 16px;
    line-height: 50px;
    padding: 0;
    background: #fff;
}

.quantity-btn {
    width: 50px;
    height: 50px;
    border: 1px solid #e0e0e0;
    background: #fff;
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
}

.quantity-btn:hover {
    background: #f5f5f5;
    border-color: #333;
}

/* 상품 옵션 드롭다운 */
.product-option-select {
    width: 100%;
    height: 42px;
    padding: 0 12px;
    border: 1px solid #ddd;
    background: #fff;
    font-size: 14px;
    cursor: pointer;
    transition: border-color 0.2s;
}

.product-option-select:focus {
    outline: none;
    border-color: #333;
}

.product-option-select option:disabled {
    color: #999;
}

/* 배송 옵션 드롭다운 */
.shipping-option-select {
    width: 100%;
    height: 42px;
    padding: 0 12px;
    border: 1px solid #ddd;
    background: #fff;
    font-size: 14px;
    cursor: pointer;
    transition: border-color 0.2s;
}

.shipping-option-select:focus {
    outline: none;
    border-color: #333;
}

/* 선택된 옵션 목록 */
.selected-options-container {
    border: 1px solid #e0e0e0;
    background: #fff;
}

.selected-option-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    border-bottom: 1px solid #e0e0e0;
    gap: 10px;
}

.selected-option-item:last-child {
    border-bottom: none;
}

.selected-option-info {
    flex: 1;
    min-width: 0;
}

.selected-option-name {
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 4px;
    color: #333;
}

.selected-option-price {
    font-size: 13px;
    color: #666;
}

.selected-option-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.selected-option-total {
    font-size: 16px;
    font-weight: 700;
    min-width: 100px;
    text-align: right;
    color: #000;
}

.btn-remove {
    padding: 8px 12px;
    background: #fff;
    border: 1px solid #ddd;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
    white-space: nowrap;
}

.btn-remove:hover {
    background: #f5f5f5;
    border-color: #999;
}

/* 총 금액 섹션 */
#total-price-section {
    margin-top: 20px;
    padding: 20px;
    background: #f8f8f8;
    border: 2px solid #333;
}

#total-price-section strong {
    font-size: 16px;
}

#total-price {
    font-size: 24px;
    color: #000;
    font-weight: 700;
}

.cart-summary {
    max-width: 400px;
    margin-left: auto;
    padding: 24px;
    background: #f8f8f8;
    border: 1px solid #e0e0e0;
}

.cart-summary h2 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 20px;
}

.cart-summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    font-size: 14px;
    line-height: 1.6;
}

.cart-summary-total {
    font-size: 20px;
    font-weight: 700;
    padding-top: 16px;
    margin-top: 8px;
    border-top: 2px solid #333;
}

/* 체크아웃 */
.checkout-section {
    margin-bottom: 40px;
}

.checkout-section h2 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid #e0e0e0;
}

/* 입력 필드 일관성 */
.checkout-section input[type="text"],
.checkout-section input[type="email"],
.checkout-section input[type="tel"],
.checkout-section textarea {
    height: 44px;
}

.checkout-section textarea {
    height: auto;
    min-height: 100px;
}

/* 관리자 */
.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
}

.admin-header h1 {
    font-size: 28px;
    font-weight: 600;
}

.admin-nav {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.admin-nav a {
    color: #666;
    text-decoration: none;
    font-size: 14px;
    transition: color 0.2s;
}

.admin-nav a:hover {
    color: #000;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
}

.admin-table th,
.admin-table td {
    padding: 14px 16px;
    text-align: left;
    border-bottom: 1px solid #e0e0e0;
    vertical-align: middle;
}

.admin-table th {
    background: #f8f8f8;
    font-weight: 600;
    font-size: 14px;
}

.admin-table td {
    font-size: 14px;
}

.admin-actions {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

/* 관리자 폼 섹션 */
.admin-form-section {
    background: #f8f8f8;
    padding: 30px;
    border: 1px solid #e0e0e0;
    margin-bottom: 40px;
}

.admin-form-section h2 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 24px;
}

.btn-small {
    height: 32px;
    padding: 0 16px;
    font-size: 13px;
    line-height: 30px;
}

button.btn-small,
input[type="submit"].btn-small {
    padding: 6px 16px;
    line-height: normal;
}

.status-badge {
    display: inline-block;
    padding: 4px 10px;
    font-size: 12px;
    border: 1px solid #e0e0e0;
    background: #f8f8f8;
    white-space: nowrap;
    line-height: 1.4;
}

/* 로그인 페이지 */
.login-container {
    max-width: 420px;
    margin: 80px auto;
    padding: 40px;
    background: #fff;
    border: 1px solid #e0e0e0;
}

.login-container h1 {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 32px;
    text-align: center;
}

.login-container .form-group {
    margin-bottom: 20px;
}

.login-container input[type="text"],
.login-container input[type="email"],
.login-container input[type="password"] {
    height: 44px;
}

/* 푸터 */
.site-footer {
    background: #f8f8f8;
    border-top: 1px solid #e0e0e0;
    padding: 40px 0 20px;
    margin-top: 80px;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    margin-bottom: 24px;
}

.footer-info h3 {
    font-size: 18px;
    margin-bottom: 8px;
}

.footer-info p {
    color: #666;
    font-size: 14px;
}

.footer-links {
    display: flex;
    gap: 16px;
}

.footer-links a {
    color: #666;
    text-decoration: none;
    font-size: 14px;
}

.footer-bottom {
    padding-top: 20px;
    border-top: 1px solid #e0e0e0;
    text-align: center;
    color: #999;
    font-size: 14px;
}

/* 유틸리티 */
.text-center {
    text-align: center;
}

.mt-20 {
    margin-top: 20px;
}

.mb-20 {
    margin-bottom: 20px;
}

/* 정보 박스 */
.info-box {
    padding: 14px 16px;
    margin-bottom: 16px;
    background: #f8f8f8;
    border: 1px solid #e0e0e0;
    font-size: 14px;
    line-height: 1.6;
}

.info-box a {
    color: #000;
    text-decoration: underline;
}

/* 통일된 카드 스타일 */
.card {
    padding: 24px;
    background: #f8f8f8;
    border: 1px solid #e0e0e0;
}

.card-white {
    background: #fff;
}

/* 세션 박스 (쿠폰, 안내 등) */
.session-box {
    padding: 16px;
    margin-bottom: 16px;
    border: 1px solid #e0e0e0;
}

.session-box-success {
    background: #f0fdf4;
    border-color: #86efac;
}

.session-box-success strong,
.session-box-success p {
    color: #166534;
}

/* 통일된 spacing */
h2 {
    font-weight: 600;
}

h3 {
    font-weight: 600;
}

.alert {
    padding: 14px 16px;
    margin-bottom: 20px;
    border: 1px solid #e0e0e0;
    font-size: 14px;
    line-height: 1.5;
}

.alert-success {
    background: #f0fdf4;
    border-color: #86efac;
    color: #166534;
}

.alert-error {
    background: #fef2f2;
    border-color: #fca5a5;
    color: #991b1b;
}

/* 반응형 */
/* 옵션 카드 스타일 (배송옵션, 결제수단) */
.option-card {
    position: relative;
    padding: 16px 20px;
    border: 2px solid #e0e0e0;
    background: #fff;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-bottom: 12px;
}

.option-card:hover {
    border-color: #999;
    background: #f8f8f8;
}

.option-card.selected {
    border-color: #000;
    background: #f8f8f8;
}

.option-card input[type="radio"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.option-card-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.option-card-label {
    font-size: 15px;
    font-weight: 500;
    color: #333;
}

.option-card.selected .option-card-label {
    color: #000;
    font-weight: 600;
}

.option-card-info {
    font-size: 13px;
    color: #666;
    margin-top: 4px;
}

/* 주소 검색 스타일 */
.address-search-group {
    display: flex;
    gap: 8px;
    align-items: flex-start;
}

.address-search-group input[readonly] {
    background: #f5f5f5;
}

.btn-address-search {
    flex-shrink: 0;
    white-space: nowrap;
    height: 44px;
}

/* 쿠폰 모달 */
.coupon-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 9999;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.coupon-modal.active {
    display: flex;
}

.coupon-modal-content {
    background: #fff;
    max-width: 600px;
    width: 100%;
    max-height: 80vh;
    overflow-y: auto;
    border: 1px solid #e0e0e0;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.coupon-modal-header {
    padding: 24px;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    background: #fff;
    z-index: 1;
}

.coupon-modal-header h3 {
    font-size: 20px;
    font-weight: 600;
    margin: 0;
}

.coupon-modal-close {
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: #666;
    line-height: 1;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
}

.coupon-modal-close:hover {
    color: #000;
}

.coupon-modal-body {
    padding: 24px;
}

.coupon-list-item {
    padding: 20px;
    border: 1px solid #e0e0e0;
    background: #f8f8f8;
    margin-bottom: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.coupon-list-item:hover {
    border-color: #999;
    background: #fff;
}

.coupon-list-item.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: #f5f5f5;
}

.coupon-list-item.disabled:hover {
    border-color: #e0e0e0;
    background: #f5f5f5;
}

.coupon-item-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 12px;
}

.coupon-item-name {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin-bottom: 4px;
}

.coupon-item-discount {
    font-size: 20px;
    font-weight: 700;
    color: #e74c3c;
}

.coupon-item-code {
    font-size: 13px;
    color: #666;
    font-family: monospace;
    background: #fff;
    padding: 4px 8px;
    border: 1px solid #e0e0e0;
    display: inline-block;
    margin-bottom: 8px;
}

.coupon-item-details {
    font-size: 13px;
    color: #666;
    line-height: 1.6;
}

.coupon-item-details div {
    margin-bottom: 4px;
}

.coupon-item-reason {
    margin-top: 8px;
    padding: 8px 12px;
    background: #fff3cd;
    border: 1px solid #ffc107;
    font-size: 13px;
    color: #856404;
}

.coupon-empty {
    text-align: center;
    padding: 40px 20px;
    color: #666;
}

.coupon-actions {
    display: flex;
    gap: 8px;
    margin-top: 16px;
}

@media (max-width: 768px) {
    .top-bar-content {
        flex-direction: column;
        gap: 8px;
    }
    
    .top-left-nav,
    .top-right-nav {
        gap: 12px;
    }
    
    .logo img {
        max-width: 150px;
    }
    
    .logo-area {
        padding: 20px 0;
    }
    
    .category-nav {
        gap: 20px;
        flex-wrap: wrap;
        padding: 12px 0;
    }
    
    .category-nav a {
        font-size: 13px;
    }
    
    .main-banner {
        padding: 60px 20px;
    }
    
    .banner-content h1 {
        font-size: 32px;
    }
    
    .banner-content p {
        font-size: 16px;
    }
    
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 20px;
    }
    
    .product-detail {
        grid-template-columns: 1fr;
        gap: 40px;
    }
    
    .product-detail-image {
        width: 100%;
        height: auto;
        aspect-ratio: 1;
        max-width: 600px;
        margin: 0 auto;
    }
    
    .selected-option-item {
        flex-wrap: wrap;
        gap: 12px;
    }
    
    .selected-option-info {
        width: 100%;
    }
    
    .selected-option-controls {
        flex: 1;
    }
    
    .selected-option-total {
        min-width: auto;
        text-align: right;
    }
    
    .quantity-control input {
        width: 40px !important;
    }
    
    #total-price-section {
        padding: 16px;
    }
    
    #total-price {
        font-size: 20px;
    }
    
    .cart-table {
        font-size: 13px;
    }
    
    .cart-table th,
    .cart-table td {
        padding: 10px 8px;
    }
    
    .footer-content {
        flex-direction: column;
        gap: 24px;
    }
    
    .btn {
        height: 44px;
        padding: 0 20px;
        font-size: 14px;
    }
    
    button.btn {
        padding: 11px 20px;
    }
    
    .login-container {
        margin: 40px auto;
        padding: 30px 20px;
    }
    
    .admin-table {
        font-size: 13px;
    }
    
    .admin-table th,
    .admin-table td {
        padding: 10px 8px;
    }
    
    .address-search-group {
        flex-direction: column;
    }
    
    .btn-address-search {
        width: 100%;
    }
    
    .coupon-modal-content {
        max-height: 90vh;
    }
    
    .option-card-content {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }
}

