/**
 * 쇼핑몰 스타일
 */

/* 품절 색상 표시 */
.color-item.out-of-stock {
    position: relative;
    opacity: 0.6;
}
.color-item.out-of-stock .color-swatch {
    filter: grayscale(50%);
}
.sold-out-badge {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    padding: 4px 8px;
    border-radius: 4px;
    white-space: nowrap;
}

/* ===== 공통 ===== */
.shop-container,
.cart-container,
.checkout-container,
.orders-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    min-height: calc(100vh - 140px);
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 14px;
    margin-bottom: 16px;
    transition: color 0.2s;
}
.back-link:hover {
    color: var(--text-color);
}

/* ===== 쇼핑몰 헤더 ===== */
.shop-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 30px;
}

.shop-title {
    font-size: 28px;
    font-weight: 800;
    margin: 0 0 8px;
}

.shop-subtitle {
    color: var(--text-muted);
    margin: 0;
}

.shop-header-actions {
    display: flex;
    gap: 12px;
}

.btn-cart,
.btn-orders {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: white;
    border: var(--border-width) solid var(--border-color);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-sm);
    text-decoration: none;
    color: var(--text-color);
    font-weight: 600;
    font-size: 14px;
    transition: all var(--transition-fast);
    position: relative;
}
.btn-cart:hover,
.btn-orders:hover {
    transform: translate(-2px, -2px);
    box-shadow: var(--shadow);
}

.cart-icon-wrapper {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.cart-badge {
    position: absolute;
    top: -8px;
    right: -12px;
    background: #FF5722;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 5px;
    border: 2px solid #fff;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

/* ===== 가격 안내 (슬림 버전) ===== */
.price-guide-slim {
    background: white;
    border: var(--border-width) solid var(--border-color);
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 24px;
}

.price-guide-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.price-guide-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-color);
}

.shipping-tag {
    font-size: 12px;
    color: var(--text-muted);
    background: #f5f5f5;
    padding: 4px 10px;
    border-radius: 12px;
}

.price-items {
    display: flex;
    gap: 8px;
}

.price-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 12px 8px;
    background: #fafafa;
    border-radius: 10px;
    position: relative;
}

.price-item.popular {
    background: #fffbeb;
    border: 1.5px solid var(--color-primary);
}

.price-item.best {
    background: #ecfdf5;
    border: 1.5px solid #10b981;
}

.item-badge {
    position: absolute;
    top: -8px;
    font-size: 9px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 8px;
    white-space: nowrap;
}

.price-item.popular .item-badge {
    background: var(--color-primary);
    color: var(--text-color);
}

.price-item.best .item-badge {
    background: #10b981;
    color: white;
}

.item-qty {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 2px;
}

.item-price {
    font-size: 18px;
    font-weight: 800;
    color: var(--text-color);
}

.price-item.popular .item-price {
    color: #b8860b;
}

.price-item.best .item-price {
    color: #10b981;
}

/* 기존 가격 안내 (레거시) */
.price-guide {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: var(--border-width) solid var(--border-color);
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 30px;
}

.price-guide h3 {
    margin: 0 0 16px;
    font-size: 16px;
    font-weight: 700;
}

.price-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 12px;
}

.price-card {
    background: white;
    border: var(--border-width) solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 16px;
    text-align: center;
    position: relative;
}
.price-card.popular {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 1px var(--color-primary);
}
.price-card.best {
    border-color: #10b981;
    box-shadow: 0 0 0 1px #10b981;
}

.price-badge {
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--color-primary);
    color: var(--text-color);
    font-size: 10px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 10px;
    white-space: nowrap;
}
.price-card.best .price-badge {
    background: #10b981;
    color: white;
}

.price-qty {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 4px;
}

.price-amount {
    font-size: 24px;
    font-weight: 800;
    color: var(--color-primary);
}
.price-card.best .price-amount {
    color: #10b981;
}

.price-per {
    font-size: 12px;
    color: var(--text-muted);
}

.shipping-notice {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 16px 0 0;
    font-size: 14px;
    color: var(--text-muted);
}

/* ===== 심플 가격 안내 ===== */
.price-info-simple {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 12px 20px;
    background: white;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    margin-bottom: 20px;
    font-size: 13px;
    font-weight: 600;
    flex-wrap: wrap;
}

.price-info-simple .separator {
    color: #ddd;
}

.price-info-simple .shipping {
    color: var(--text-muted);
}

/* ===== 색상 그리드 ===== */
.color-section {
    margin-bottom: 30px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 12px;
}

.section-header .section-title {
    margin: 0;
}

.bulk-change-btns {
    display: flex;
    align-items: center;
    gap: 6px;
}

.bulk-label {
    font-size: 12px;
    color: var(--text-muted);
    margin-right: 4px;
}

.bulk-btn {
    padding: 6px 12px;
    border: 1.5px solid var(--border-color);
    border-radius: 6px;
    background: white;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
}

.bulk-btn:hover {
    border-color: var(--primary-color);
    background: var(--primary-light);
}

.bulk-btn:active {
    transform: scale(0.95);
}

.color-section h2 {
    font-size: 18px;
    font-weight: 700;
    margin: 0 0 16px;
}

.color-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 10px;
}

.color-item {
    background: white;
    border: var(--border-width) solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 10px;
    cursor: pointer;
    transition: all var(--transition-fast);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}
.color-item:hover {
    transform: translate(-2px, -2px);
    box-shadow: var(--shadow);
}

.color-swatch {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    border: 1px solid rgba(0,0,0,0.1);
}
.color-image {
    width: 48px;
    height: 38px;
    border-radius: 6px;
    border: 1px solid rgba(0,0,0,0.1);
    object-fit: cover;
    aspect-ratio: 48 / 38;
}
.color-swatch.transparent-bg {
    background-image: linear-gradient(45deg, #ddd 25%, transparent 25%),
                      linear-gradient(-45deg, #ddd 25%, transparent 25%),
                      linear-gradient(45deg, transparent 75%, #ddd 75%),
                      linear-gradient(-45deg, transparent 75%, #ddd 75%);
    background-size: 8px 8px;
    background-position: 0 0, 0 4px, 4px -4px, -4px 0px;
}
.color-swatch.luminous-bg {
    box-shadow: 0 0 8px currentColor;
}

.color-info {
    text-align: center;
}

.color-number {
    display: block;
    font-size: 11px;
    color: var(--text-muted);
}

.color-name {
    display: block;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.2;
}

/* ===== 포인트 섹션 ===== */
.points-section {
    margin-bottom: 30px;
}

.points-card {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border: var(--border-width) solid #f59e0b;
    border-radius: var(--radius);
    padding: 20px;
    display: flex;
    align-items: flex-start;
    gap: 16px;
}

.points-icon {
    font-size: 32px;
}

.points-info h3 {
    margin: 0 0 4px;
    font-size: 14px;
    font-weight: 600;
}

.points-balance {
    font-size: 28px;
    font-weight: 800;
    color: #b45309;
}

.points-help {
    margin-left: auto;
    font-size: 13px;
    color: #92400e;
}

.points-help p {
    margin: 0 0 8px;
}

.points-help ul {
    margin: 0;
    padding-left: 16px;
}

.points-help li {
    margin-bottom: 4px;
}

/* ===== 모달 ===== */
.shop-modal-overlay,
.order-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
}
.shop-modal-overlay.show,
.order-modal-overlay.show {
    opacity: 1;
    visibility: visible;
}

.shop-modal,
.order-modal {
    background: white;
    border-radius: var(--radius);
    width: 90%;
    max-width: 400px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    transform: scale(0.9);
    transition: transform 0.3s;
}
.shop-modal-overlay.show .shop-modal,
.order-modal-overlay.show .order-modal {
    transform: scale(1);
}

.order-modal {
    max-width: 500px;
}

.modal-color-header {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
}

.modal-color-swatch,
.color-swatch-large {
    width: 64px;
    height: 64px;
    border-radius: 12px;
    border: 1px solid rgba(0,0,0,0.1);
}

.color-image-large {
    width: 100px;
    height: 79px;
    border-radius: 12px;
    border: 1px solid rgba(0,0,0,0.1);
    object-fit: cover;
}

.modal-color-number {
    display: block;
    font-size: 14px;
    color: var(--text-muted);
}

.modal-color-name {
    display: block;
    font-size: 20px;
    font-weight: 700;
}

.quantity-selection,
.count-selection {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
}

.quantity-selection h4,
.count-selection h4 {
    margin: 0 0 12px;
    font-size: 14px;
    font-weight: 600;
}

.quantity-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.quantity-option {
    cursor: pointer;
}

.quantity-option input {
    display: none;
}

.quantity-card {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    background: var(--bg-secondary);
    border: 2px solid transparent;
    border-radius: var(--radius-sm);
    transition: all 0.2s;
}

.quantity-option input:checked + .quantity-card {
    background: #e0f2fe;
    border-color: var(--color-primary);
}

.quantity-card .qty {
    font-weight: 600;
    margin-right: auto;
}

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

.quantity-card .tag {
    font-size: 10px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 8px;
    margin-left: 8px;
}
.quantity-card .tag.popular {
    background: var(--color-primary);
    color: var(--text-color);
}
.quantity-card .tag.best {
    background: #10b981;
    color: white;
}

.count-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
}

.count-btn {
    width: 40px;
    height: 40px;
    background: var(--bg-secondary);
    border: var(--border-width) solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 20px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
}
.count-btn:hover {
    background: var(--border-color);
}

.count-controls input {
    width: 60px;
    height: 40px;
    text-align: center;
    font-size: 18px;
    font-weight: 700;
    border: var(--border-width) solid var(--border-color);
    border-radius: var(--radius-sm);
}

.modal-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: var(--bg-secondary);
}

.total-label {
    font-weight: 600;
}

.total-amount {
    font-size: 24px;
    font-weight: 800;
    color: var(--color-primary);
}

.modal-actions {
    padding: 20px;
}

.btn-add-cart {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 24px;
    background: var(--color-primary);
    border: var(--border-width) solid var(--border-color);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-sm);
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all var(--transition-fast);
}
.btn-add-cart:hover {
    transform: translate(-2px, -2px);
    box-shadow: var(--shadow);
}

/* ===== 장바구니 ===== */
.cart-header,
.checkout-header,
.orders-header {
    margin-bottom: 24px;
}

.cart-header h1,
.checkout-header h1,
.orders-header h1 {
    font-size: 24px;
    font-weight: 800;
    margin: 0;
}

.cart-content {
    display: flex;
    flex-direction: column;
    gap: 24px;
    max-width: 800px;
    margin: 0 auto;
}

/* 모바일에서는 이미 1컬럼이므로 별도 처리 불필요 */

.cart-items {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.cart-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: white;
    border: var(--border-width) solid var(--border-color);
    border-radius: var(--radius-sm);
}

.item-color-swatch {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    border: 1px solid rgba(0,0,0,0.1);
    flex-shrink: 0;
}
.item-color-swatch.small {
    width: 32px;
    height: 32px;
    border-radius: 6px;
}

.item-details {
    flex: 1;
    min-width: 0;
}

.item-name {
    font-weight: 600;
    margin-bottom: 4px;
}

.item-quantity {
    font-size: 13px;
    color: var(--text-muted);
}

.item-price {
    font-size: 13px;
    color: var(--text-muted);
}

.item-count {
    display: flex;
    align-items: center;
    gap: 8px;
}

.item-count .count-btn {
    width: 28px;
    height: 28px;
    font-size: 16px;
}

.item-count span {
    min-width: 24px;
    text-align: center;
    font-weight: 600;
}

.item-subtotal {
    font-weight: 700;
    font-size: 16px;
    min-width: 80px;
    text-align: right;
}

.item-remove {
    background: none;
    border: none;
    padding: 8px;
    cursor: pointer;
    color: var(--text-muted);
    transition: color 0.2s;
}
.item-remove:hover {
    color: var(--color-error);
}

/* ===== 장바구니 요약 ===== */
.cart-summary {
    background: white;
    border: var(--border-width) solid var(--border-color);
    border-radius: var(--radius);
    padding: 20px;
    height: fit-content;
    position: sticky;
    top: 80px;
}

.cart-summary h3 {
    margin: 0 0 16px;
    font-size: 16px;
    font-weight: 700;
}

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

.summary-row.total-row {
    font-size: 18px;
    font-weight: 700;
}

.summary-row.points-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
}

.summary-row.points-row small {
    font-size: 12px;
    color: var(--text-muted);
}

.points-input-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
}

.points-input-wrap input {
    flex: 1;
    padding: 8px 12px;
    border: var(--border-width) solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 14px;
    text-align: right;
}

.btn-use-all {
    padding: 8px 12px;
    background: var(--bg-secondary);
    border: var(--border-width) solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
}

.points-notice {
    font-size: 11px;
    color: var(--text-muted);
    margin: 0 0 12px;
}

.summary-divider {
    height: 1px;
    background: var(--border-color);
    margin: 12px 0;
}

.btn-checkout {
    width: 100%;
    padding: 14px 24px;
    background: var(--color-primary, #FFF8E7);
    color: #1a1a1a;
    border: var(--border-width) solid var(--border-color);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-sm);
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all var(--transition-fast);
    -webkit-appearance: none;
    appearance: none;
}
.btn-checkout:hover {
    transform: translate(-2px, -2px);
    box-shadow: var(--shadow);
}

/* ===== 빈 장바구니 ===== */
.cart-empty,
.orders-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 60px 20px;
}

.empty-icon {
    color: var(--text-muted);
    margin-bottom: 20px;
}

.cart-empty h2,
.orders-empty h2 {
    margin: 0 0 8px;
    font-size: 20px;
}

.cart-empty p,
.orders-empty p {
    color: var(--text-muted);
    margin: 0 0 20px;
}

.btn-shop {
    display: inline-flex;
    align-items: center;
    padding: 12px 24px;
    background: var(--color-primary);
    border: var(--border-width) solid var(--border-color);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-sm);
    text-decoration: none;
    color: var(--text-color);
    font-weight: 700;
    transition: all var(--transition-fast);
}
.btn-shop:hover {
    transform: translate(-2px, -2px);
    box-shadow: var(--shadow);
}

/* ===== 결제 페이지 ===== */
.checkout-content {
    max-width: 600px;
}

.checkout-section {
    background: white;
    border: var(--border-width) solid var(--border-color);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 20px;
}

.checkout-section h2 {
    margin: 0 0 16px;
    font-size: 16px;
    font-weight: 700;
}

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 6px;
}

.form-group .required {
    color: var(--color-error);
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 10px 12px;
    border: var(--border-width) solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 14px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 14px;
}

.checkbox-label input {
    width: auto;
}

.order-items {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.order-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 0;
    border-bottom: 1px solid var(--border-color);
}
.order-item:last-child {
    border-bottom: none;
}

.item-info {
    flex: 1;
}

.item-info .item-name {
    font-size: 14px;
}

.item-info .item-qty {
    font-size: 12px;
    color: var(--text-muted);
}

.item-price {
    font-weight: 600;
}

.payment-methods {
    margin-bottom: 20px;
}

.payment-option {
    cursor: pointer;
}

.payment-option input {
    display: none;
}

.payment-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: var(--bg-secondary);
    border: 2px solid transparent;
    border-radius: var(--radius-sm);
    transition: all 0.2s;
}

.payment-option input:checked + .payment-card {
    background: #ffe0e0;
    border-color: #ff4444;
}

.paypay-text {
    font-size: 20px;
    font-weight: 800;
    color: #ff4444;
}

.checkout-summary {
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
    padding: 16px;
}

.checkout-actions {
    text-align: center;
}

.btn-pay {
    width: 100%;
    padding: 16px 24px;
    background: #ff4444;
    border: var(--border-width) solid var(--border-color);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-sm);
    color: white;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    transition: all var(--transition-fast);
}
.btn-pay:hover:not(:disabled) {
    transform: translate(-2px, -2px);
    box-shadow: var(--shadow);
}
.btn-pay:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.checkout-notice {
    font-size: 12px;
    color: var(--text-muted);
    margin: 12px 0 0;
}

/* ===== 주문 내역 ===== */
.success-banner {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px 20px;
    background: #d1fae5;
    border: var(--border-width) solid #10b981;
    border-radius: var(--radius);
    margin-bottom: 20px;
    color: #065f46;
}

.success-banner strong {
    display: block;
    margin-bottom: 4px;
}

.success-banner p {
    margin: 0;
    font-size: 13px;
}

.orders-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.order-card {
    background: white;
    border: var(--border-width) solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 16px;
    cursor: pointer;
    transition: all var(--transition-fast);
}
.order-card:hover {
    transform: translate(-2px, -2px);
    box-shadow: var(--shadow);
}

.order-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.order-number {
    font-weight: 700;
    font-size: 14px;
}

.order-status {
    font-size: 12px;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 12px;
}

.status-pending { background: #fef3c7; color: #92400e; }
.status-paid { background: #dbeafe; color: #1e40af; }
.status-preparing { background: #e0e7ff; color: #3730a3; }
.status-shipped { background: #d1fae5; color: #065f46; }
.status-delivered { background: #d1fae5; color: #065f46; }
.status-cancelled { background: #fee2e2; color: #991b1b; }
.status-refunded { background: #f3f4f6; color: #374151; }

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

.order-info {
    display: flex;
    gap: 16px;
    font-size: 13px;
    color: var(--text-muted);
}

.order-total {
    font-size: 18px;
    font-weight: 700;
}

.order-tracking {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border-color);
    font-size: 13px;
    color: var(--text-muted);
}

/* ===== 주문 상세 모달 ===== */
.order-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
}

.order-modal-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
}

.order-modal-content {
    padding: 20px;
    max-height: 70vh;
    overflow-y: auto;
}

.order-detail-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.order-number-large {
    font-size: 18px;
    font-weight: 700;
}

.order-detail-section {
    margin-bottom: 20px;
}

.order-detail-section h4 {
    font-size: 14px;
    font-weight: 600;
    margin: 0 0 12px;
    color: var(--text-muted);
}

.order-detail-items {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.detail-item {
    display: flex;
    align-items: center;
    gap: 12px;
}

.detail-item-color {
    width: 24px;
    height: 24px;
    border-radius: 4px;
    border: 1px solid rgba(0,0,0,0.1);
}

.detail-item-info {
    flex: 1;
    font-size: 13px;
}

.detail-item-info span {
    display: block;
}

.detail-item-info span:last-child {
    color: var(--text-muted);
    font-size: 12px;
}

.detail-item-price {
    font-weight: 600;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    font-size: 14px;
}

.detail-row.total {
    font-weight: 700;
    font-size: 16px;
    border-top: 1px solid var(--border-color);
    padding-top: 12px;
    margin-top: 4px;
}

.shipping-info {
    font-size: 14px;
    line-height: 1.6;
}

.shipping-info p {
    margin: 0;
}

.tracking-info {
    margin-top: 12px;
    padding: 12px;
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
    font-size: 14px;
}

.order-detail-actions {
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

.btn-cancel-order {
    width: 100%;
    padding: 12px;
    background: white;
    border: var(--border-width) solid var(--color-error);
    border-radius: var(--radius-sm);
    color: var(--color-error);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}
.btn-cancel-order:hover {
    background: #fee2e2;
}

/* ===== 페이지네이션 ===== */
.pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 24px;
}

.pagination button,
.pagination .current {
    min-width: 36px;
    height: 36px;
    padding: 0 12px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pagination button {
    background: white;
    border: var(--border-width) solid var(--border-color);
    cursor: pointer;
    transition: all 0.2s;
}
.pagination button:hover {
    background: var(--bg-secondary);
}

.pagination .current {
    background: var(--color-primary);
    border: var(--border-width) solid var(--border-color);
}

/* ===== 로딩 상태 ===== */
.loading-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
    color: var(--text-muted);
}

/* ===== 반응형 ===== */
@media (max-width: 640px) {
    .shop-header {
        flex-direction: column;
        align-items: stretch;
    }
    
    .shop-header-actions {
        justify-content: flex-end;
    }
    
    .cart-text {
        display: none;
    }
    
    .color-grid {
        grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    }
    
    .points-card {
        flex-direction: column;
    }
    
    .points-help {
        margin-left: 0;
        margin-top: 12px;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .cart-item {
        flex-wrap: wrap;
    }
    
    .item-subtotal {
        width: 100%;
        text-align: left;
        margin-top: 8px;
        padding-top: 8px;
        border-top: 1px solid var(--border-color);
    }
    
    /* 쇼핑몰 컨테이너 */
    .shop-container,
    .cart-container,
    .checkout-container,
    .orders-container {
        padding: 12px;
    }
    
    /* 체크아웃 */
    .checkout-content {
        max-width: 100%;
    }
    
    .checkout-section {
        padding: 16px;
    }
    
    .checkout-summary {
        padding: 16px;
    }
    
    .checkout-actions {
        flex-direction: column;
    }
    
    .checkout-actions button,
    .checkout-actions a {
        width: 100%;
        text-align: center;
    }
    
    /* 주문 모달 */
    #orderModal .modal-content {
        width: 95%;
        max-height: 90vh;
        border-radius: 12px;
    }
    
    #orderModal .modal-header {
        padding: 16px;
    }
    
    #orderModal .modal-body {
        padding: 16px;
    }
    
    /* 주문 테이블 */
    .order-items-table {
        font-size: 12px;
    }
    
    .order-items-table th,
    .order-items-table td {
        padding: 8px 6px;
    }
    
    /* 쇼핑몰 제목 */
    .shop-header h1 {
        font-size: 20px;
    }
    
    /* 장바구니 아이템 */
    .cart-item-info {
        flex-direction: column;
        gap: 8px;
    }
    
    .cart-item-actions {
        justify-content: space-between;
        width: 100%;
    }
    
    /* 주문 내역 카드 */
    .order-card {
        padding: 16px;
    }
    
    .order-card-header {
        flex-direction: column;
        gap: 8px;
        align-items: flex-start;
    }
    
    .order-card-footer {
        flex-direction: column;
        gap: 8px;
    }
}

/* ===== 주문 상세 모달 ===== */
#orderModal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s;
}
#orderModal.show {
    opacity: 1;
    visibility: visible;
}

#orderModal .modal-content {
    background: #fff;
    border-radius: 16px;
    width: 90%;
    max-width: 500px;
    max-height: 85vh;
    overflow-y: auto;
    transform: scale(0.9);
    transition: transform 0.2s;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}
#orderModal.show .modal-content {
    transform: scale(1);
}

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

#orderModal .modal-body {
    padding: 20px;
}

#orderModal .order-detail-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid #eee;
}
#orderModal .order-detail-header span:first-child {
    font-size: 16px;
    font-weight: 700;
    color: #1a1a1a;
}

#orderModal h4 {
    font-size: 14px;
    font-weight: 700;
    color: #666;
    margin: 20px 0 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

#orderModal .order-items-list {
    background: #f9f9f9;
    border-radius: 12px;
    padding: 12px;
}

#orderModal .order-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid #eee;
}
#orderModal .order-item:last-child {
    border-bottom: none;
}

#orderModal .order-item .item-color {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    border: 2px solid #ddd;
    flex-shrink: 0;
}

#orderModal .order-item .item-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
#orderModal .order-item .item-info span:first-child {
    font-weight: 600;
    font-size: 14px;
}
#orderModal .order-item .item-info span:last-child {
    color: #888;
    font-size: 12px;
}

#orderModal .order-item .item-price {
    font-weight: 700;
    font-size: 14px;
}

/* 일반 order-item 스타일 (fallback) */
.order-items-list .order-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid #eee;
}
.order-items-list .order-item:last-child {
    border-bottom: none;
}

#orderModal .order-summary {
    background: #f9f9f9;
    border-radius: 12px;
    padding: 16px;
    margin-top: 16px;
}

#orderModal .summary-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    font-size: 14px;
    color: #666;
}
#orderModal .summary-row.total {
    border-top: 2px solid #ddd;
    margin-top: 8px;
    padding-top: 12px;
    font-size: 16px;
    font-weight: 700;
    color: #1a1a1a;
}

#orderModal .shipping-info {
    background: #f9f9f9;
    border-radius: 12px;
    padding: 16px;
}
#orderModal .shipping-info p {
    margin: 4px 0;
    font-size: 14px;
    color: #555;
}
#orderModal .shipping-info p:first-child {
    font-weight: 700;
    font-size: 15px;
    color: #1a1a1a;
    margin-bottom: 8px;
}

#orderModal .tracking-info {
    background: #e3f2fd;
    border-radius: 8px;
    padding: 12px 16px;
    margin-top: 16px;
    font-size: 14px;
    color: #1565c0;
}

#orderModal .btn-cancel {
    width: 100%;
    margin-top: 20px;
    padding: 14px;
    background: #fff;
    border: 2px solid #f44336;
    border-radius: 10px;
    color: #f44336;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
}
#orderModal .btn-cancel:hover {
    background: #ffebee;
}

#orderModal .loading {
    text-align: center;
    padding: 40px;
    color: #888;
}
#orderModal .design-thumbnail {
    object-fit: cover;
    border: 2px solid #1a1a1a;
    flex-shrink: 0;
}

#orderModal .design-details {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
}

#orderModal .design-title {
    font-weight: 700;
    font-size: 14px;
    color: #1a1a1a;
}

#orderModal .design-view {
    font-size: 12px;
    color: #666;
}

#orderModal .design-link:hover .design-view {
    color: #1a1a1a;
}

/* ===== 새로운 쇼핑 UI ===== */

/* 색상 카드 그리드 */
.color-grid-new {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 12px;
}

.color-card {
    background: white;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
    position: relative;
}

.color-number {
    position: absolute;
    top: 6px;
    left: 8px;
    font-size: 11px;
    font-weight: 700;
    color: #999;
}

.color-card:hover {
    border-color: var(--primary-color);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.color-card.flash-unavailable {
    animation: flash-red 0.6s ease;
}

.color-card.flash-fallback {
    animation: flash-blue 0.6s ease;
}

@keyframes flash-red {
    0%, 100% { 
        background: white; 
        border-color: var(--border-color);
    }
    25%, 75% { 
        background: #fef2f2; 
        border-color: #ef4444;
    }
}

@keyframes flash-blue {
    0%, 100% { 
        background: white; 
        border-color: var(--border-color);
    }
    25%, 75% { 
        background: #eff6ff; 
        border-color: #3b82f6;
    }
}

.color-card.out-of-stock {
    opacity: 0.5;
    pointer-events: none;
}

.color-card-preview {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.color-card-preview .color-swatch {
    width: 48px;
    height: 48px;
}

.color-card-preview .color-image {
    width: 48px;
    height: 38px;
    object-fit: cover;
    border-radius: 6px;
}

.color-card-name {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-color);
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.color-card-controls {
    display: flex;
    gap: 6px;
    width: 100%;
    margin-top: 4px;
}

.qty-select {
    flex: 1;
    padding: 6px 4px;
    border: 1.5px solid var(--border-color);
    border-radius: 6px;
    font-size: 11px;
    background: white;
    cursor: pointer;
    min-width: 58px;
}

.qty-select:focus {
    outline: none;
    border-color: var(--primary-color);
}

.btn-add-item {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 8px;
    background: var(--primary-color);
    color: #1a1a1a;
    font-size: 20px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
}

.btn-add-item:hover {
    background: var(--primary-dark);
    transform: scale(1.05);
}

.btn-add-item:active {
    transform: scale(0.95);
}

.sold-out-label {
    font-size: 11px;
    color: #999;
    padding: 4px 8px;
    background: #f5f5f5;
    border-radius: 4px;
}

/* 선택 패널 */
.selection-panel {
    background: white;
    border: 2px solid var(--border-color);
    border-radius: 16px;
    margin-top: 24px;
    overflow: hidden;
    transition: all 0.3s;
}

.selection-panel.has-items {
    border-color: var(--primary-color);
    box-shadow: 0 4px 20px rgba(255, 213, 0, 0.2);
}

.selection-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: #fafafa;
    border-bottom: 1px solid var(--border-color);
}

.selection-header h3 {
    font-size: 16px;
    font-weight: 700;
    margin: 0;
}

.selection-total {
    font-size: 20px;
    font-weight: 800;
    color: var(--primary-dark);
}

.selection-list {
    padding: 16px 20px;
    max-height: 300px;
    overflow-y: auto;
}

.selection-empty {
    text-align: center;
    color: #999;
    padding: 20px;
    margin: 0;
}

.selection-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #f0f0f0;
    gap: 12px;
}

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

.selection-item-info {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 0;
}

.item-color-swatch {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    border: 1px solid rgba(0,0,0,0.1);
    flex-shrink: 0;
}

.item-color-swatch.small {
    width: 24px;
    height: 24px;
}

.item-color-swatch img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 5px;
}

.item-name {
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.item-qty-badge {
    font-size: 11px;
    background: #f0f0f0;
    padding: 2px 6px;
    border-radius: 4px;
    color: #666;
    flex-shrink: 0;
}

.selection-item-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.ctrl-btn {
    width: 28px;
    height: 28px;
    border: 1.5px solid var(--border-color);
    border-radius: 6px;
    background: white;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
}

.ctrl-btn:hover:not(:disabled) {
    border-color: var(--primary-color);
    background: var(--bg-light);
}

.ctrl-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.ctrl-btn.remove {
    color: #ef4444;
    border-color: #fecaca;
}

.ctrl-btn.remove:hover {
    background: #fef2f2;
    border-color: #ef4444;
}

.item-count {
    font-size: 14px;
    font-weight: 700;
    min-width: 20px;
    text-align: center;
}

.item-price {
    font-size: 14px;
    font-weight: 700;
    color: var(--primary-dark);
    min-width: 50px;
    text-align: right;
}

.selection-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: #fafafa;
    border-top: 1px solid var(--border-color);
    gap: 16px;
}

.selection-summary {
    flex: 1;
}

.shipping-note {
    font-size: 12px;
    color: #666;
}

.btn-add-all-cart {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: var(--primary-color);
    border: 2px solid #1a1a1a;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 3px 3px 0 #1a1a1a;
}

.btn-add-all-cart:hover:not(:disabled) {
    transform: translate(-2px, -2px);
    box-shadow: 5px 5px 0 #1a1a1a;
}

.btn-add-all-cart:active:not(:disabled) {
    transform: translate(1px, 1px);
    box-shadow: 2px 2px 0 #1a1a1a;
}

.btn-add-all-cart:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    box-shadow: none;
}

.btn-add-all-cart svg {
    flex-shrink: 0;
}

/* 토스트 메시지 */
.shop-toast {
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: #1a1a1a;
    color: white;
    padding: 12px 24px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    z-index: 9999;
    opacity: 0;
    transition: all 0.3s;
    white-space: nowrap;
}

.shop-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.shop-toast.error {
    background: #ef4444;
}

/* 로딩 스피너 */
.loading-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid #1a1a1a;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* 반응형 */
@media (max-width: 768px) {
    .color-grid-new {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
        gap: 8px;
    }
    
    .color-card {
        padding: 10px;
    }
    
    .color-card-preview {
        width: 40px;
        height: 40px;
    }
    
    .color-card-preview .color-swatch {
        width: 40px;
        height: 40px;
    }
    
    .color-card-name {
        font-size: 11px;
    }
    
    .qty-select {
        font-size: 10px;
        padding: 4px 2px;
    }
    
    .btn-add-item {
        width: 28px;
        height: 28px;
        font-size: 18px;
    }
    
    .selection-item {
        flex-wrap: wrap;
    }
    
    .selection-item-info {
        width: 100%;
    }
    
    .selection-item-controls {
        width: 100%;
        justify-content: flex-end;
        margin-top: 8px;
    }
    
    .selection-footer {
        flex-direction: column;
        gap: 12px;
    }
    
    .btn-add-all-cart {
        width: 100%;
        justify-content: center;
    }
}

