/*
================================================================
Gold-Link - Premium Design System (Restored & Enhanced)
================================================================
[목차]
1. Fonts & Variables
2. Reset & Core Base
3. Layout (GRID/Flex)
4. Header & Top Nav
5. Navigation (Categories)
6. Product Catalog
7. Product Detail
8. Shopping Cart
9. Checkout & Forms
10. My Page & Dashboard
11. Modals & UI Components
12. Responsive Adjustments
================================================================
*/

/* 1. Fonts & Variables */
@font-face {
    font-family: 'NeoHyundai';
    src: url('fonts/NeoHyundai OTF R.otf') format('opentype'),
        url('fonts/NeoHyundai R.ttf') format('truetype');
    font-weight: 400;
}

@font-face {
    font-family: 'NeoHyundai';
    src: url('fonts/NeoHyundai OTF B.otf') format('opentype'),
        url('fonts/NeoHyundai B.ttf') format('truetype');
    font-weight: 700;
}

:root {
    --brand-font: 'NeoHyundai', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --brand-primary: #1c3d6e;
    --brand-secondary: #111111;
    --brand-accent: #00d2d3;
    --brand-bg: #ffffff;
    --brand-bg-sub: #f1f3f5;
    --brand-text: #111111;
    --brand-text-muted: #666666;
    --brand-border: #e9ecef;
    --brand-border-dark: #ced4da;

    --header-height: 110px;
    --container-width: 1200px;
    --card-radius: 20px;
    --input-radius: 12px;

    --shadow-soft: 0 4px 15px rgba(0, 0, 0, 0.05);
    --shadow-premium: 0 10px 40px rgba(0, 0, 0, 0.08);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --glass: rgba(255, 255, 255, 0.8);
}

/* 2. Reset & Core Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--brand-font);
    background-color: var(--brand-bg);
    color: var(--brand-text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

#mainContainer {
    flex: 1;
    width: 100%;
}

.hidden {
    display: none !important;
    opacity: 0 !important;
    pointer-events: none !important;
    visibility: hidden !important;
}

img {
    max-width: 100%;
    display: block;
}

button {
    font-family: inherit;
    cursor: pointer;
}

input {
    font-family: inherit;
}

/* 3. Layout */
.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 24px;
}

@media (max-width: 768px) {
    .container {
        padding: 0 12px;
    }
}

.view {
    animation: fadeIn 0.5s ease-out;
    background-color: var(--brand-bg);
    min-height: calc(100vh - var(--header-height));
    padding: 10px 0 80px;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* Breadcrumb Navigation Style */
.breadcrumb {
    padding: 0 0 5px;
    display: flex;
    align-items: center;
    font-size: 13px;
    font-weight: 600;
    color: var(--brand-text-muted);
}

.breadcrumb-item {
    cursor: pointer;
    transition: var(--transition);
}

.breadcrumb-item:hover {
    color: var(--brand-primary);
    text-decoration: underline;
}

.breadcrumb-separator {
    margin: 0 10px;
    color: #ced4da;
    font-weight: normal;
}

.breadcrumb-current {
    color: var(--brand-text);
    font-weight: 800;
    cursor: default;
}

.breadcrumb-current:hover {
    text-decoration: none;
}

/* 4. Header & Top Nav */
header {
    background-color: #ffffff;
    border-bottom: 1px solid var(--brand-border);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-top {
    height: 70px;
    display: flex;
    justify-content: flex-start;
    align-items: center;
    padding: 0 56px;
}

.logo img {
    height: 36px;
    cursor: pointer;
    transition: transform 0.2s;
}

.logo img:hover {
    transform: scale(1.03);
}

.header-user-point {
    background-color: #f8f9fa;
    border-radius: 50px;
    padding: 8px 20px;
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    margin-left: 20px;
    border: 1px solid var(--brand-border);
    transition: var(--transition);
}

#headerUserName {
    cursor: default !important;
    padding-right: 4px;
    background-color: transparent !important;
    text-decoration: none !important;
}

.header-user-suffix {
    font-size: 12px;
    color: var(--brand-text-muted);
    position: relative;
    top: 2px;
    margin-right: 4px;
}

#headerUserName:hover {
    background-color: transparent !important;
    text-decoration: none !important;
}

.clickable-user-info {
    cursor: pointer;
    padding: 4px 10px;
    border-radius: 20px;
    transition: var(--transition);
}

.clickable-user-info:hover {
    background-color: rgba(28, 61, 110, 0.1);
    color: var(--brand-primary);
    text-decoration: underline;
}

.info-divider {
    display: none;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-left: auto;
}

/* User Dropdown Style */
.user-dropdown {
    position: absolute;
    top: calc(100% + 15px);
    right: -10px;
    width: 200px;
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid var(--brand-border);
    border-radius: 18px;
    box-shadow: var(--shadow-premium);
    padding: 12px;
    z-index: 1100;
    animation: dropdownFadeIn 0.2s ease-out;
}

@keyframes dropdownFadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.dropdown-header {
    padding: 8px 12px;
    margin-bottom: 4px;
}

.dropdown-divider {
    height: 1px;
    background: var(--brand-border);
    margin: 8px 0;
}

.dropdown-list {
    list-style: none;
}

.dropdown-list li {
    padding: 10px 12px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 700;
    color: var(--brand-text);
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
}

.dropdown-list li:hover {
    background: var(--brand-bg-sub);
    color: var(--brand-primary);
}

.dropdown-logout-btn {
    width: 100%;
    background: none;
    border: none;
    padding: 10px;
    text-align: center;
    font-size: 13px;
    color: var(--brand-text-muted);
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
}

.dropdown-logout-btn:hover {
    color: #f44336;
    text-decoration: underline;
}

.nav-icon-btn {
    position: relative;
    padding: 8px;
    font-size: 20px;
    border: none;
    background: none;
    transition: var(--transition);
}

.nav-icon-btn:hover {
    transform: translateY(-2px);
}

.badge {
    position: absolute;
    top: 0;
    right: 0;
    background: var(--brand-primary);
    color: white;
    font-size: 10px;
    min-width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
}

.header-bottom {
    height: 48px;
    background: var(--brand-secondary);
    color: white;
    display: flex;
    align-items: center;
}

.header-bottom .container {
    display: flex;
    align-items: center;
    height: 100%;
}

.header-bottom span {
    margin-right: 32px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 700;
    transition: var(--transition);
    position: relative;
    padding: 14px 0;
}

.header-bottom span:hover {
    color: var(--brand-accent);
}

.header-bottom span::after {
    content: '';
    position: absolute;
    bottom: 8px;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--brand-accent);
    transition: var(--transition);
}

.header-bottom span:hover::after {
    width: 100%;
}

/* 5. Navigation */
.category-container {
    padding: 20px 0;
    overflow-x: auto;
    scrollbar-width: none;
}

.category-container::-webkit-scrollbar {
    display: none;
}

.category-list {
    display: inline-flex;
    gap: 10px;
}

.category-chip {
    padding: 10px 26px;
    background: var(--brand-bg-sub);
    border-radius: 30px;
    font-weight: 600;
    font-size: 14px;
    color: var(--brand-text-muted);
    border: 1px solid transparent;
    transition: var(--transition);
}

.category-chip.active {
    background: var(--brand-primary);
    color: #fff;
    box-shadow: 0 4px 15px rgba(28, 61, 110, 0.25);
}

/* 6. Product Catalog */
.content-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.sort-options button {
    background: none;
    border: none;
    font-size: 14px;
    color: var(--brand-text-muted);
    font-weight: 700;
    margin-left: 16px;
    padding: 4px 0;
    border-bottom: 2px solid transparent;
}

.sort-options button.active {
    color: var(--brand-text);
    border-bottom-color: var(--brand-text);
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 32px 40px;
}

.product-card {
    background: var(--brand-bg);
    border-radius: var(--card-radius);
    overflow: hidden;
    transition: var(--transition);
    border: 1px solid var(--brand-border);
    width: 280px;
    /* 고정 높이 제거하여 텍스트 겹침 방지 */
    height: auto;
    display: flex;
    flex-direction: column;
}

.product-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-premium);
    border-color: transparent;
}

.product-image-container {
    width: 280px;
    height: 280px;
    background: #f8f9fa;
    position: relative;
    overflow: hidden;
    margin-bottom: 10px;
}

.product-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s;
}

.product-card:hover .product-image {
    transform: scale(1.08);
}

.product-info {
    padding: 0 10px;
}

.product-brand {
    font-size: 13px;
    color: var(--brand-text-muted);
    font-weight: 700;
    text-transform: uppercase;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    letter-spacing: 0.5px;
}

.product-name {
    font-size: 14px;
    font-weight: 700;
    height: 32px;
    overflow: hidden;
    margin-bottom: 10px;
    color: #333;
    line-height: 1.1;
    /* 줄바꿈 시 여백 최소화 */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
}

.product-price {
    font-size: 20px;
    font-weight: 800;
    color: var(--brand-primary);
    font-family: 'NeoHyundai', sans-serif;
    display: flex;
    align-items: center;
    margin-bottom: 15px;
}

/* 7. Product Detail (PC 1:1 밸런스 스타일) */
.product-detail-container {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important; /* 이미지 1 : 정보 1 비율 */
    gap: 60px !important;
    margin-bottom: 60px !important;
    max-width: 1300px !important;
    margin-left: auto !important;
    margin-right: auto !important;
    align-items: start !important;
}

.detail-gallery {
    width: 100% !important;
    max-width: 600px !important; /* 부담스럽지 않은 최대 크기 */
    margin: 0 auto !important;
    position: sticky !important;
    top: 100px !important;
}

.image-slider-wrapper {
    width: 100% !important;
    aspect-ratio: 1/1 !important;
    background: #f8f9fa !important;
    border-radius: 20px !important;
    overflow: hidden !important;
    border: 1px solid var(--brand-border) !important;
}

.detail-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: opacity 0.3s ease;
}

.gallery-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 100%;
    display: flex;
    justify-content: space-between;
    padding: 0 16px;
    pointer-events: none;
}

.nav-btn {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--brand-border);
    cursor: pointer;
    pointer-events: auto;
    transition: var(--transition);
}

.nav-btn:hover {
    background: #fff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.gallery-dots {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
}

.dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    border: 1px solid var(--brand-text-muted);
    cursor: pointer;
}

.dot.active {
    background: var(--brand-text);
    border-color: var(--brand-text);
}

/* 우측 정보 영역 */
.product-detail-info {
    padding: 10px 0;
    position: sticky !important;
    top: 120px !important;
}

.detail-brand {
    font-size: 14px;
    font-weight: 800;
    margin-bottom: 12px;
}

.detail-name {
    font-size: 28px;
    font-weight: 800;
    line-height: 1.3;
    margin-bottom: 20px;
}

.detail-price-row {
    margin-bottom: 30px;
}

.detail-price {
    font-size: 28px;
    font-weight: 850;
    color: #000;
    display: flex;
    align-items: center;
    gap: 8px;
}

.price-unit {
    font-size: 24px;
    font-weight: 800;
}

/* 골드 단위 줄바꿈 방지 */
.gold-unit,
.product-price,
.detail-price,
.cart-item-price,
.order-price,
.total-price,
.point-row span:last-child {
    white-space: nowrap !important;
    display: inline-flex !important;
    align-items: center;
}

/* 옵션 영역 */
.detail-options {
    margin-bottom: 30px;
    border-top: 1px solid var(--brand-border);
    border-bottom: 1px solid var(--brand-border);
    padding: 20px 0;
}

.option-group {
    margin-bottom: 20px;
}

.option-group:last-child {
    margin-bottom: 0;
}


.option-label {
    font-size: 15px;
    font-weight: 800;
    margin-bottom: 15px;
}

.option-row {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.option-sub-label {
    font-size: 13px;
    color: var(--brand-text-muted);
    margin-bottom: 8px;
    width: 100%;
}

.option-thumb-btn {
    width: 60px;
    height: 60px;
    border: 1px solid var(--brand-border);
    border-radius: 8px;
    padding: 4px;
    cursor: pointer;
    background: #fff;
    transition: var(--transition);
}

.option-thumb-btn.active {
    border: 2px solid var(--brand-primary);
}

.option-thumb-btn img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.color-chip {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1px solid var(--brand-border);
    cursor: pointer;
    transition: var(--transition);
}

.color-chip.active {
    box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--brand-primary);
}

/* 수량 조절기 */
.qty-controller {
    display: flex;
    align-items: center;
    border: 1px solid #ced4da;
    border-radius: 4px;
    width: fit-content;
    margin-bottom: 40px;
}

.qty-btn {
    width: 36px;
    height: 36px;
    background: #f8f9fa;
    border: none;
    font-size: 18px;
    cursor: pointer;
}

.qty-input {
    width: 48px;
    height: 36px;
    border: none;
    border-left: 1px solid #ced4da;
    border-right: 1px solid #ced4da;
    text-align: center;
    font-weight: 700;
}

/* 액션 버튼 */
.detail-actions-3tier {
    display: flex;
    gap: 12px;
    align-items: stretch;
}

.action-btn-icon {
    width: 60px;
    border: 1px solid #000;
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #fff;
    cursor: pointer;
}

.action-btn-icon i {
    font-size: 20px;
    margin-bottom: 4px;
}

.action-btn-icon span {
    font-size: 10px;
    font-weight: 700;
}

.action-btn-secondary {
    flex: 1;
    border: 1px solid #000;
    border-radius: 10px;
    background: #fff;
    color: #000;
    font-size: 18px;
    font-weight: 800;
    cursor: pointer;
}

.action-btn-primary {
    flex: 1;
    background: #000;
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 18px;
    font-weight: 800;
    cursor: pointer;
}

/* 하단 탭 및 테이블 */
.detail-tabs {
    display: flex;
    border-top: 2px solid #000;
    margin-top: 80px;
}

.tab-item {
    flex: 1;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 800;
    cursor: pointer;
    border-right: 1px solid #ced4da;
    border-bottom: 1px solid #ced4da;
}

.tab-item:last-child {
    border-right: none;
}

.tab-item.active {
    border-bottom: none;
    background: #fff;
}

.tab-content {
    padding: 0px 0;
}

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

.spec-table tr {
    border-bottom: 1px solid #eee;
}

.spec-table th {
    width: 160px;
    background: #f8f9fa;
    padding: 16px 20px;
    text-align: left;
    font-weight: 700;
    color: #333;
}

.spec-table td {
    padding: 16px 20px;
    color: #333;
}

@media (max-width: 576px) {
    .spec-table th {
        width: 100px;
        padding: 12px;
        font-size: 13px;
    }
    .spec-table td {
        padding: 12px;
        font-size: 13px;
        word-break: keep-all;
    }
}

@media (max-width: 992px) {
    .product-detail-container {
        grid-template-columns: 1fr;
    }
}

/* 8. Shopping Cart */
.cart-layout {
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 40px;
}

.cart-global-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
    border-bottom: 2px solid var(--brand-text);
    margin-bottom: 10px;
}

.text-btn {
    background: none;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    font-weight: 700;
    color: var(--brand-text-muted);
    transition: var(--transition);
}

.text-btn:hover {
    color: #f44336;
}

.cart-item {
    display: flex;
    gap: 24px;
    padding: 32px 0;
    border-bottom: 1px solid var(--brand-border);
    align-items: center;
}

.cart-item-image {
    width: 140px;
    height: 140px;
    object-fit: cover;
    border-radius: 16px;
    background: #f8f9fa;
}

.cart-item-details {
    flex: 1;
}

.cart-item-name {
    font-size: 18px;
    font-weight: 800;
    margin-bottom: 8px;
}

.cart-item-option {
    font-size: 14px;
    color: var(--brand-text-muted);
    background: #f1f3f5;
    padding: 6px 12px;
    border-radius: 8px;
    display: inline-block;
}

.quantity-selector {
    display: flex;
    align-items: center;
    border: 1px solid var(--brand-border-dark);
    border-radius: 8px;
    overflow: hidden;
    width: fit-content;
}

.quantity-selector button {
    width: 40px;
    height: 40px;
    background: none;
    border: none;
    font-size: 18px;
    font-weight: 700;
    transition: background 0.2s;
}

.quantity-selector button:hover {
    background: #eee;
}

.quantity-selector span {
    width: 50px;
    text-align: center;
    font-weight: 700;
    border-left: 1px solid #ddd;
    border-right: 1px solid #ddd;
}

.cart-item-price {
    font-size: 22px;
    font-weight: 800;
    color: var(--brand-primary);
    min-width: 120px;
    text-align: right;
}

.cart-item-delete {
    background: none;
    border: none;
    font-size: 24px;
    color: #ccc;
    margin-left: 20px;
    transition: color 0.2s;
}

.cart-item-delete:hover {
    color: #f44336;
}

/* Sidebar Summary Card */
.checkout-summary-card {
    padding: 30px;
    border: 1px solid var(--brand-primary);
    border-radius: 24px;
    background: #fff;
    position: sticky;
    top: 130px;
    box-shadow: var(--shadow-premium);
}

.summary-title {
    font-size: 20px;
    font-weight: 850;
    margin-bottom: 24px;
    color: var(--brand-primary);
    border-bottom: 1px solid var(--brand-border);
    padding-bottom: 15px;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
    font-size: 15px;
    font-weight: 600;
    color: var(--brand-text);
}

.summary-row span:first-child {
    color: var(--brand-text-muted);
}

.summary-row.total {
    font-size: 24px;
    font-weight: 850;
    border-top: 2px solid var(--brand-primary);
    padding-top: 24px;
    margin-top: 24px;
    color: var(--brand-primary);
}

.summary-row.total span:first-child {
    color: var(--brand-text);
}

.summary-row.total .total-price {
    color: var(--brand-primary);
}

/* 9. Checkout & Forms */
.checkout-layout {
    max-width: 800px;
    margin: 0 auto;
}

.input-field {
    width: 100%;
    padding: 14px 18px;
    border: 1px solid var(--brand-border-dark);
    border-radius: var(--input-radius);
    font-size: 15px;
    font-weight: 500;
    font-family: inherit;
    outline: none;
    transition: var(--transition);
    background-color: #f8f9fa;
}

.input-field.mini {
    padding: 10px 14px;
    font-size: 14px;
    font-weight: 500;
    font-family: inherit;
    border-radius: 10px;
}

.input-field.mini::placeholder {
    font-size: 14px;
    font-weight: 500;
    font-family: inherit;
}

.input-field:focus {
    border-color: var(--brand-primary);
    background-color: #fff;
    box-shadow: 0 0 0 4px rgba(28, 61, 110, 0.08);
}

.form-group {
    margin-bottom: 24px;
    text-align: left;
}

.form-group label {
    display: block;
    font-weight: 800;
    margin-bottom: 12px;
    font-size: 15px;
    color: var(--brand-primary);
}

/* 10. My Page & Dashboard */
.mypage-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 40px;
}

.sidebar {
    padding: 24px;
    border-radius: 24px;
    background: #fff;
    border: 1px solid var(--brand-border);
    height: fit-content;
    position: sticky;
    top: 130px;
}

.sidebar h3 {
    font-size: 24px;
    font-weight: 800;
    margin-bottom: 30px;
}

.sidebar ul {
    list-style: none;
}

.sidebar li {
    padding: 16px 20px;
    border-radius: 12px;
    margin-bottom: 8px;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    color: var(--brand-text-muted);
}

.sidebar li.active,
.sidebar li:hover {
    background: var(--brand-bg-sub);
    color: var(--brand-primary);
}

.content.glass,
.mypage-main {
    padding: 24px;
    border-radius: 24px;
    background: #fff;
    border: 1px solid var(--brand-border);
    min-width: 0; /* Allow container to shrink in grid/flex */
    box-sizing: border-box;
    width: 100%;
}

@media (max-width: 768px) {
    .content.glass,
    .mypage-main {
        padding: 16px;
        border-radius: 16px;
        width: 100%;
        max-width: 100%;
        overflow-x: hidden; /* Prevent body overflow, inner containers will scroll */
    }

    .table-scroll-container {
        margin: 15px -16px; /* Negative margin to bleed to edges on mobile if desired, or keep 0 */
        width: calc(100% + 32px); 
        padding: 0 16px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
}

/* Responsive Table Utility */
.table-scroll-container {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 20px;
}

/* Mobile Toggle Button (Floating Action Button style) */
.mobile-mypage-toggle {
    display: none;
    color: #fff;
    border: none;
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    box-shadow: 0 6px 16px rgba(28, 61, 110, 0.3);
    transition: var(--transition);
}

.mobile-mypage-toggle:active {
    transform: scale(0.9);
}

/* My Page Sidebar User Card */
.user-summary {
    background: linear-gradient(135deg, var(--brand-primary) 0%, #002d5a 100%);
    padding: 30px 24px;
    border-radius: 20px;
    color: #fff;
    margin-bottom: 30px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    box-shadow: 0 10px 20px rgba(28, 61, 110, 0.15);
}

.user-summary .user-info h3 {
    font-size: 22px;
    font-weight: 850;
    margin-bottom: 6px;
    color: #fff;
}

.user-summary .user-info p {
    font-size: 14px;
    opacity: 0.85;
    font-weight: 500;
}

.user-point-card {
    background: rgba(255, 255, 255, 0.15);
    padding: 16px;
    border-radius: 12px;
    backdrop-filter: blur(5px);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.user-point-card .label {
    font-size: 13px;
    font-weight: 600;
}

.user-point-card .value {
    font-size: 18px;
    font-weight: 800;
}

/* My Page Order List - Premium Sample UI */
.order-date-group {
    margin-bottom: 40px;
}

.order-date-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding: 0 4px;
}

.order-date-header h3 {
    font-size: 22px;
    font-weight: 850;
    color: #111;
    letter-spacing: -0.5px;
}

.order-detail-link {
    font-size: 14px;
    font-weight: 700;
    color: var(--brand-text-muted);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: var(--transition);
}

.order-detail-link:hover {
    color: var(--brand-primary);
}

.order-card {
    background: #fff;
    border: 1px solid var(--brand-border);
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 20px;
    display: flex;
    gap: 24px;
    position: relative;
    transition: var(--transition);
}

.order-card:hover {
    border-color: var(--brand-border-dark);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.04);
}

.order-item-img-box {
    width: 140px;
    height: 140px;
    background: #f8f9fa;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
}

.order-item-img-box img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.order-item-content {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.order-status-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.status-text {
    font-size: 16px;
    font-weight: 850;
    color: #007aff;
    /* Blue for active status */
}

.status-subtext {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin-left: 8px;
}

.delivery-track-link {
    font-size: 14px;
    font-weight: 700;
    color: var(--brand-text-muted);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 4px;
}

.delivery-track-link:hover {
    text-decoration: underline;
}

.status-progress-bar {
    height: 4px;
    background: #f1f3f5;
    border-radius: 2px;
    margin-bottom: 20px;
    position: relative;
    overflow: hidden;
    width: 200px;
}

.status-progress-bar .fill {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    background: #007aff;
    width: 30%;
    /* Dynamic fill based on status */
}

.order-item-name {
    font-size: 17px;
    font-weight: 600;
    margin-bottom: 8px;
    color: #111;
    line-height: 1.4;
}

.order-item-option {
    font-size: 14px;
    color: var(--brand-text-muted);
    margin-bottom: 16px;
    font-weight: 500;
}

.order-item-price-info {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 16px;
    margin-top: auto;
}

.price-bold {
    font-size: 20px;
    font-weight: 700;
    color: #111;
}

.qty-text {
    color: var(--brand-text-muted);
    font-weight: 400;
}

.order-no-text {
    font-size: 13px;
    color: var(--brand-text-muted);
    margin-left: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 500;
}

.copy-btn {
    cursor: pointer;
    opacity: 0.5;
    transition: opacity 0.2s;
}

.copy-btn:hover {
    opacity: 1;
}

.order-card-actions {
    position: absolute;
    bottom: 24px;
    right: 24px;
    display: flex;
    gap: 12px;
    align-items: center;
}

.cart-icon-btn {
    width: 44px;
    height: 44px;
    border: 1px solid var(--brand-border-dark);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    cursor: pointer;
    transition: var(--transition);
    color: #111;
}

.cart-icon-btn:hover {
    background: #f8f9fa;
    transform: scale(1.05);
}

.confirm-purchase-btn {
    background: #111;
    color: #fff;
    border: none;
    padding: 12px 24px;
    border-radius: 10px;
    font-weight: 800;
    font-size: 15px;
    cursor: pointer;
    transition: var(--transition);
}

.confirm-purchase-btn:hover {
    background: #333;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Old status class fallback or refinement */
.order-status {
    display: none;
    /* Replaced by new status row */
}

/* 주문 필터링 섹션 스타일 */
.order-filter-container {
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid var(--brand-border);
    border-radius: 20px;
    padding: 24px;
    margin-bottom: 30px;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

.filter-presets {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.view-detail {
    cursor: pointer;
    /* 손가락 모양 커서 추가 */
    color: var(--brand-text-muted);
    font-size: 18px;
    padding: 0 5px;
    transition: all 0.3s ease;
    display: inline-block;
}

.view-detail:hover {
    color: var(--brand-primary);
    /* 마우스 오버 시 강조 */
}

.view-detail.active {
    transform: rotate(90deg);
    color: var(--brand-primary);
}

.filter-btn {
    padding: 8px 18px;
    border-radius: 25px;
    border: 1px solid var(--brand-border);
    background: #fff;
    color: var(--brand-text-muted);
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
}

.filter-btn:hover {
    border-color: var(--brand-primary);
    color: var(--brand-primary);
}

.filter-btn.active {
    background: var(--brand-primary);
    border-color: var(--brand-primary);
    color: white;
    box-shadow: 0 4px 12px rgba(28, 61, 110, 0.2);
}

.filter-custom {
    display: flex;
    align-items: center;
    gap: 10px;
}

.filter-custom input[type="date"] {
    padding: 10px 14px;
    border: 1px solid var(--brand-border);
    border-radius: 12px;
    font-size: 14px;
    font-weight: 700;
    outline: none;
    color: var(--brand-text);
    transition: var(--transition);
}

.filter-custom input[type="date"]:focus {
    border-color: var(--brand-primary);
}

.filter-custom span {
    color: var(--brand-text-muted);
    font-weight: 800;
}

@media (max-width: 768px) {
    .order-filter-container {
        flex-direction: column;
        align-items: stretch;
        width: 100% !important;
        max-width: 100% !important;
        padding: 16px;
        box-sizing: border-box;
    }

    .filter-presets {
        display: flex;
        flex-wrap: wrap; /* 버튼들이 넘치면 다음 줄로 넘어가게 설정 */
        justify-content: center;
        gap: 8px;
        width: 100%;
    }

    .filter-custom {
        justify-content: center;
        flex-wrap: wrap;
        gap: 8px;
        width: 100%;
        margin-top: 10px;
    }

    .filter-custom input[type="date"] {
        flex: 1; /* 날짜 입력창이 가변적으로 크기 조절 */
        min-width: 120px;
        padding: 8px;
    }
}

/* 11. Modals & UI Components */
.swal2-container {
    z-index: 10000 !important;
}

.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 0;
    pointer-events: none;
    visibility: hidden;
    transition: all 0.3s ease;
}

@media (max-width: 768px) {
    .modal {
        /* BA 팝업 외의 일반 모달(로그인 등)은 중앙 정렬 유지 */
        display: flex;
        align-items: center;
        justify-content: center;
        overflow-y: auto;
        padding: 20px;
    }
}

.modal:not(.hidden) {
    background: rgba(0, 0, 0, 0.6);
    opacity: 1;
    pointer-events: auto;
    visibility: visible;
}

.login-card {
    background: #fff;
    padding: 70px 60px;
    border-radius: 40px;
    width: 90%;
    max-width: 480px;
    text-align: center;
    box-shadow: 0 40px 80px rgba(0, 0, 0, 0.15);
    position: relative;
    z-index: 2001;
}

@media (max-width: 480px) {
    .login-card {
        padding: 50px 30px;
        border-radius: 30px;
    }
}

.login-card h2 {
    font-size: 28px;
    font-weight: 850;
    margin-bottom: 40px;
    color: var(--brand-primary);
    letter-spacing: -0.5px;
}

.btn-primary {
    background: var(--brand-primary);
    color: white;
    border: none;
    padding: 14px 28px;
    border-radius: 14px;
    font-weight: 800;
    font-size: 17px;
    cursor: pointer;
    transition: var(--transition);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(28, 61, 110, 0.3);
}

/* Password Strength Meter */
.strength-meter-wrap {
    margin-top: 10px;
}

.strength-meter-bg {
    height: 6px;
    background: #f0f2f5;
    border-radius: 3px;
    overflow: hidden;
}

.strength-bar {
    height: 100%;
    width: 0%;
    transition: all 0.4s cubic-bezier(0.18, 0.89, 0.32, 1.28);
}

.strength-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 6px;
}

.strength-label {
    font-size: 11px;
    color: var(--brand-text-muted);
}

.strength-text {
    font-size: 11px;
    font-weight: 800;
}

/* Inline Validation Messages */
.form-group .error-msg {
    color: #ef4444;
    font-size: 13px;
    margin-top: 6px;
    padding-left: 4px;
    display: none;
    font-weight: 500;
}

.form-group.has-error .error-msg {
    display: block;
    animation: shake 0.3s ease-in-out;
}

.form-group.has-error .input-field {
    border-color: #ef4444;
    background-color: #fef2f2;
}

@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-4px);
    }

    75% {
        transform: translateX(4px);
    }
}

.pw-success-msg {
    margin-top: 24px;
    padding: 16px 20px;
    background-color: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 12px;
    color: #166534;
    font-size: 14px;
    line-height: 1.6;
    display: none;
}

.pw-success-msg.visible {
    display: block;
}

.security-form-container {
    max-width: 500px;
    margin-top: 20px;
}

/* Glass Modal Styles */
.modal-content.glass {
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 32px;
    padding: 40px;
    box-shadow: 0 40px 100px rgba(0, 0, 0, 0.2);
    width: 90%;
    position: relative;
    animation: modalSlideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-content.glass.compact {
    max-width: 480px;
}

.modal-content.glass.wide {
    max-width: 600px;
}

@keyframes modalSlideUp {
    from {
        opacity: 0;
        transform: translateY(40px) scale(0.95);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.modal-header h2 {
    font-size: 24px;
    font-weight: 800;
}

.close-modal {
    background: none;
    border: none;
    font-size: 32px;
    cursor: pointer;
    color: var(--brand-text-muted);
}

.modal-footer {
    margin-top: 30px;
    display: flex;
    gap: 12px;
}

/* Address List Styling in My Page Tab */
.address-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-top: 20px;
}

.address-item-card {
    background: #fff;
    border: 1px solid var(--brand-border);
    border-radius: 20px;
    padding: 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: var(--transition);
    position: relative;
}

.address-item-card:hover {
    border-color: var(--brand-primary);
    transform: translateY(-4px);
    box-shadow: var(--shadow-premium);
}

.address-item-card.default {
    border: 2px solid var(--brand-primary);
    background: rgba(28, 61, 110, 0.02);
}

.addr-info {
    flex: 1;
}

.addr-name {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.addr-name .nickname {
    font-size: 18px;
    font-weight: 800;
    color: var(--brand-primary);
    background: rgba(28, 61, 110, 0.1);
    padding: 4px 12px;
    border-radius: 8px;
}

.addr-name .receiver {
    font-size: 16px;
    font-weight: 700;
    color: var(--brand-text);
}

.badge-default {
    background: var(--brand-primary);
    color: #fff;
    font-size: 11px;
    padding: 4px 10px;
    border-radius: 6px;
    font-weight: 800;
    letter-spacing: -0.5px;
}

.addr-text {
    font-size: 15px;
    color: var(--brand-text-muted);
    line-height: 1.6;
    font-weight: 500;
}

.addr-actions {
    display: flex;
    gap: 12px;
    margin-left: 30px;
}

.addr-actions button {
    padding: 10px 20px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
}

.addr-actions .btn-edit {
    background: var(--brand-bg-sub);
    color: var(--brand-text);
    border: 1px solid var(--brand-border);
}

.addr-actions .btn-edit:hover {
    background: var(--brand-primary);
    color: #fff;
    border-color: var(--brand-primary);
}

.addr-actions .btn-delete {
    background: transparent;
    color: #ff4d4f;
    border: 1px solid #ff4d4f;
}

.addr-actions .btn-delete:hover {
    background: #ff4d4f;
    color: #fff;
}

/* Address Form Styling */
.address-form-box {
    margin-bottom: 30px;
    padding: 30px;
    border-radius: 24px;
    border: 1px solid var(--brand-primary);
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    animation: slideDown 0.4s ease-out;
}

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

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

.btn-cancel {
    background: var(--brand-bg-sub);
    color: var(--brand-text-muted);
    border: 1px solid var(--brand-border);
    padding: 14px;
    border-radius: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
}

.btn-cancel:hover {
    background: #e9ecef;
    color: var(--brand-text);
}

.point-summary-box {
    background: rgba(28, 61, 110, 0.04);
    border: 1px solid var(--brand-border);
    border-radius: 20px;
    padding: 24px;
    margin: 24px 0;
}

.point-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px dashed rgba(0, 0, 0, 0.05);
    font-size: 15px;
    font-weight: 600;
}

.point-row span:first-child {
    color: var(--brand-text-muted);
}

.point-row span:last-child {
    text-align: right;
    display: flex;
    align-items: center;
    gap: 4px;
    font-weight: 700;
}

.point-row:last-child {
    border-bottom: none;
}

.point-row.final {
    margin-top: 10px;
    padding-top: 15px;
    border-top: 1px solid var(--brand-border);
    font-size: 18px;
    font-weight: 800;
    color: var(--brand-primary);
}

.point-row.final span:first-child {
    color: var(--brand-text);
}

.text-danger {
    color: #ff4d4f !important;
}

.text-success {
    color: #1890ff !important;
}

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

/* Inline Address Form Box Buttons */
.btn-zipcode {
    background: var(--brand-primary);
    color: #fff;
    border: none;
    padding: 0 15px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    height: 50px;
    /* 입력창 높이와 일치 */
    white-space: nowrap;
}

.btn-zipcode:hover {
    background: #152e55;
    box-shadow: var(--shadow-soft);
}

.btn-save {
    background: var(--brand-primary);
    color: #fff;
    border: none;
    padding: 12px 30px;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 800;
    cursor: pointer;
    transition: var(--transition);
}

.btn-save:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(28, 61, 110, 0.2);
}

.btn-cancel {
    background: #f1f3f5;
    color: var(--brand-text-muted);
    border: 1px solid var(--brand-border);
    padding: 12px 30px;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
}

.btn-cancel:hover {
    background: #e9ecef;
    color: var(--brand-text);
}

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

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.form-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 16px;
}

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

.form-group.checkbox-group {
    margin-top: 20px;
    border-top: 1px dashed var(--brand-border);
    padding-top: 20px;
}

/* 포인트 내역 섹션 요약 박스 (중복 제거 및 스타일 통합) */
.point-summary-box.horizontal {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 30px;
}

.point-summary-box .label {
    font-size: 16px;
    font-weight: 700;
    color: var(--brand-text-muted);
}

.point-summary-box .value {
    font-size: 28px;
    font-weight: 800;
    color: var(--brand-primary);
}

.point-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    table-layout: fixed;
    min-width: 700px;
}

.point-table th,
.point-table td {
    padding: 20px;
    text-align: center;
    border-bottom: 1px solid var(--brand-border);
    font-size: 14px;
    word-break: break-word;
}

.point-table th {
    background: var(--brand-bg-sub);
    font-weight: 700;
    color: var(--brand-text);
    padding: 10px 20px;
}

.point-table tr:last-child td {
    border-bottom: none;
}

.point-table .text-primary {
    color: #004ecc !important;
    font-weight: 800;
}

.col-amt.plus {
    color: #28a745;
    font-weight: 700;
}

.col-amt.minus {
    color: #004ecc;
    font-weight: 700;
}

/* 모바일 포인트 내역 카드형 전환 */
@media (max-width: 768px) {
    .table-scroll-container {
        overflow-x: visible; /* 가로 스크롤 해제 */
    }

    .point-table, .point-table thead, .point-table tbody, .point-table th, .point-table td, .point-table tr {
        display: block; /* 테이블 구조를 블록 구조로 변환 */
    }

    .point-table thead {
        display: none; /* 헤더 숨김 */
    }

    /* 모바일 전용 포인트 카드 프리미엄 스타일 */
    .mobile-point-container {
        display: flex;
        flex-direction: column;
        gap: 20px;
        margin-top: 20px;
    }

    .mobile-point-card {
        background: #fff;
        border: 1px solid var(--brand-border);
        border-radius: 20px;
        padding: 24px;
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
        transition: transform 0.2s ease;
    }

    .mobile-point-card:active {
        transform: scale(0.98);
    }

    .mobile-point-card .card-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 15px;
        font-size: 13px;
        color: var(--brand-text-muted);
        font-weight: 500;
    }

    .mobile-point-card .card-body .description {
        font-size: 17px;
        font-weight: 800;
        color: var(--brand-text);
        margin-bottom: 15px;
        line-height: 1.4;
    }

    .mobile-point-card .point-order-summary {
        background: #f8f9fa;
        border-radius: 12px;
        padding: 15px;
        margin-bottom: 15px;
        border: 1px solid rgba(0, 0, 0, 0.03);
    }

    .mobile-point-card .card-footer {
        border-top: 1px dashed var(--brand-border);
        padding-top: 15px;
        display: flex;
        flex-direction: column;
        gap: 10px;
    }

    .mobile-point-card .amount-row,
    .mobile-point-card .balance-row {
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

    .mobile-point-card .amount-row .label,
    .mobile-point-card .balance-row .label {
        font-size: 13px;
        font-weight: 600;
        color: var(--brand-text-muted);
    }

    .mobile-point-card .amount-row .value {
        font-size: 20px;
        font-weight: 850;
    }

    .mobile-point-card .amount-row .value.plus { color: #28a745; }
    .mobile-point-card .amount-row .value.minus { color: var(--brand-primary); }

    .mobile-point-card .balance-row .value {
        font-size: 15px;
        font-weight: 700;
        color: var(--brand-text);
    }

    /* 배송지 관리 모바일 최적화 */
    .address-item-card {
        flex-direction: column !important;
        align-items: stretch !important;
        padding: 20px !important;
        gap: 15px !important;
    }

    .addr-info {
        width: 100% !important;
    }

    .addr-name {
        flex-wrap: wrap !important;
        gap: 8px !important;
    }

    .addr-actions {
        margin-left: 0 !important;
        margin-top: 10px !important;
        justify-content: flex-end !important;
    }

    .addr-actions button {
        flex: 1 !important;
        text-align: center !important;
    }

    /* 배송지 추가/수정 폼 모바일 최적화 */
    .address-form-box {
        padding: 20px !important;
    }

    .form-row {
        grid-template-columns: 1fr !important;
    }
}

/* 12. Responsive Adjustments */
@media (max-width: 992px) {
    .product-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 20px;
    }

    .product-card, .product-image-container {
        width: 100%;
    }

    .cart-layout,
    .product-detail-container {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    .checkout-summary-card {
        position: static !important;
        width: 100%;
    }
}

@media (max-width: 768px) {
    .product-grid {
        grid-template-columns: repeat(2, 1fr); /* 모바일 2열 배열 */
        gap: 16px 12px;
    }

    .product-card {
        width: 100%; /* 고정 너비 해제 */
    }

    .product-image-container {
        width: 100%;
        height: auto;
        aspect-ratio: 1 / 1;
    }

    /* [복구] 상품 상세 모바일 전용 최적화 */
    .product-detail-container {
        display: flex !important;
        flex-direction: column !important;
        gap: 20px !important;
        padding: 0 15px !important;
        max-width: 100% !important;
        margin-bottom: 40px !important;
    }

    .detail-gallery {
        position: static !important;
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
    }

    .image-slider-wrapper {
        border-radius: 12px !important;
        width: 100% !important;
        aspect-ratio: 1/1 !important;
        box-shadow: none !important;
    }

    .product-detail-info {
        position: static !important;
        padding: 0 !important;
    }

    .detail-name {
        font-size: 20px; /* 모바일 맞춤 폰트 크기 축소 */
        margin-bottom: 12px;
    }

    .detail-price {
        font-size: 22px;
    }

    .detail-actions-3tier {
        flex-direction: row; /* 하단 버튼은 가로 유지 (또는 필요시 변경) */
        gap: 10px;
    }
}

/* MyPage Mobile Overrides */
@media (max-width: 768px) {
    .mypage-layout {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .mobile-mypage-toggle {
        display: flex;
        position: fixed;
        left: 20px;
        bottom: 30px;
        width: 54px;
        height: 54px;
        background: var(--brand-primary);
        color: #fff;
        border: none;
        border-radius: 50%;
        font-size: 20px;
        cursor: pointer;
        align-items: center;
        justify-content: center;
        z-index: 1000;
        box-shadow: 0 6px 16px rgba(28, 61, 110, 0.3);
    }

    .sidebar {
        position: fixed;
        top: 0;
        left: -300px;
        width: 280px;
        height: 100vh;
        z-index: 2000;
        margin: 0;
        border-radius: 0 24px 24px 0;
        box-shadow: 10px 0 30px rgba(0, 0, 0, 0.15);
        transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        visibility: hidden;
        overflow-y: auto;
    }

    .sidebar.active {
        transform: translateX(300px);
        visibility: visible;
    }

    .sidebar-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.4);
        backdrop-filter: blur(2px);
        z-index: 1999;
        display: none;
        opacity: 0;
        transition: opacity 0.3s;
    }

    .sidebar-overlay.active {
        display: block;
        opacity: 1;
    }

    .header-top {
        flex-direction: row !important;
        justify-content: space-between !important;
        height: 60px;
        padding: 0 10px;
        gap: 5px;
        display: flex !important;
    }

    .header-user-point {
        margin-left: 5px;
        padding: 4px 8px;
        font-size: 11px;
        flex: 1;
        justify-content: center;
        min-width: 0;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        display: flex !important;
        align-items: center;
    }

    .header-right {
        gap: 8px;
        display: flex !important;
        align-items: center;
    }

    .nav-icons {
        gap: 8px !important;
        display: flex !important;
    }

    #logoImg {
        width: 28px;
        height: 28px;
        object-fit: cover;
        object-position: left;
        border-radius: 6px;
    }

    .header-bottom {
        height: 40px;
        display: flex !important;
        overflow-x: auto;
    }

    .header-bottom span {
        margin-right: 15px;
        font-size: 12px;
        padding: 10px 0;
        white-space: nowrap;
    }

    .footer-nav {
        gap: 12px;
        justify-content: space-around;
        flex-wrap: wrap;
        display: flex !important;
    }

    .header-user-suffix {
        top: 0;
        margin-right: 2px;
    }

    /* 주문 내역 카드 모바일 최적화 (중첩 방지 및 수직 구조) */
    .order-card {
        flex-direction: column !important;
        gap: 20px !important;
        padding: 20px !important;
        align-items: stretch !important;
    }

    .order-item-img-box {
        width: 100% !important;
        height: auto !important;
        aspect-ratio: 1/1;
        margin: 0 auto !important;
    }

    .order-item-content {
        width: 100% !important;
        padding: 0 !important;
    }

    .order-status-row {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 12px !important;
        margin-bottom: 15px !important;
    }

    .status-progress-bar {
        width: 100% !important;
        margin-bottom: 15px !important;
    }

    .order-item-price-info {
        flex-direction: row !important;
        justify-content: space-between !important;
        align-items: center !important;
        margin-top: 15px !important;
        padding-top: 15px !important;
        border-top: 1px dashed var(--brand-border);
    }

    .order-card-actions {
        position: static !important; /* 고정 위치 해제 */
        width: 100% !important;
        margin-top: 20px !important;
        display: flex !important;
        gap: 10px !important;
        justify-content: flex-end !important;
    }

    .confirm-purchase-btn {
        flex: 1 !important;
        text-align: center !important;
        padding: 14px !important;
    }

    .cart-icon-btn {
        width: 50px !important;
        height: 50px !important;
    }
}

.cart-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 15px;
    padding: 20px 0;
}

.cart-item-image {
    width: 100%;
    height: auto;
    aspect-ratio: 1/1;
}

.cart-item-price {
    text-align: left;
    width: 100%;
    font-size: 20px;
}

.checkout-summary-card {
    padding: 24px;
    border-radius: 16px;
}

/* UI Components & Overlays */
.loader-dots-overlay {
    display: none !important;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
}

/* Category Filter */
.category-container {
    display: none !important; /* 당분간 숨김 처리 */
    margin-bottom: 30px;
    background: #fff;
    padding: 20px;
    border-radius: 16px;
    border: 1px solid var(--brand-border);
}

/* Cart Shipping Section */
.cart-shipping-section {
    padding: 24px;
    margin-bottom: 24px;
    background: #fff;
    border-radius: 16px;
    border: 1px solid var(--brand-border);
}

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

.section-title {
    font-size: 18px;
    font-weight: 800;
    margin: 0;
}

.btn-text-only {
    background: #fff;
    border: 1px solid var(--brand-border);
    padding: 6px 14px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    color: var(--brand-text-muted);
    cursor: pointer;
    transition: var(--transition);
}

.btn-text-only:hover {
    border-color: var(--brand-primary);
    color: var(--brand-primary);
    background: rgba(28, 61, 110, 0.02);
}

.shipping-display-box {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.shipping-info-row {
    font-size: 15px;
    /* 폰트 사이즈 복구 */
    line-height: 1.6;
    display: flex;
    align-items: flex-start;
}

.info-label {
    min-width: 70px;
    color: var(--brand-text-muted);
    font-weight: 600;
    margin-right: 10px;
}

.info-value {
    color: var(--brand-text);
    font-weight: 500;
}

.cart-agreement-section {
    margin: 24px 0;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 16px;
    border: 1px solid var(--brand-border);
}

.agree-all-label {
    display: flex;
    align-items: center;
    gap: 10px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--brand-border);
    margin-bottom: 15px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 700;
}

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

.agree-item-wrapper {
    display: flex;
    flex-direction: column;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    padding-bottom: 8px;
}

.agree-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.agree-item label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 13px;
    color: var(--brand-text);
    white-space: nowrap;
}

.agreement-detail {
    max-height: 0;
    overflow: hidden;
    transition: all 0.4s ease;
    background: #fff;
    border-radius: 8px;
    opacity: 0;
    font-size: 12px;
    color: var(--brand-text-muted);
    line-height: 1.6;
}

.agreement-detail.active {
    max-height: 200px;
    overflow-y: auto;
    margin-top: 10px;
    padding: 15px;
    border: 1px solid var(--brand-border);
    opacity: 1;
}

/* 스크롤바 디자인 커스텀 */
.agreement-detail::-webkit-scrollbar {
    width: 6px;
}

.agreement-detail::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.agreement-detail::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 10px;
}

.agreement-detail::-webkit-scrollbar-thumb:hover {
    background: #bbb;
}

.agreement-detail ul {
    margin: 0;
    padding-left: 20px;
    font-size: 12px;
    /* 폰트 사이즈를 12px로 축소 */
    color: var(--brand-text-muted);
    line-height: 1.6;
}

.agreement-detail li {
    margin-bottom: 6px;
}

/* Footer Styling */
footer {
    margin-top: auto;
    border-top: 1px solid var(--brand-border);
    background-color: var(--brand-secondary);
}

.footer-top {
    padding: 25px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.footer-nav {
    display: flex;
    justify-content: center;
    gap: 40px;
}

@media (max-width: 768px) {
    .footer-nav {
        gap: 12px;
        justify-content: space-around;
    }

    .footer-nav span {
        font-size: 11px;
    }
}

.footer-nav span {
    font-size: 13px;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
}

.footer-bottom {
    padding: 25px 0;
    color: rgba(255, 255, 255, 0.4);
    font-size: 12px;
    text-align: center;
}

/* Address Selection Modal & Items */
.address-list-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.address-selection-card {
    padding: 20px;
    border: 1px solid var(--brand-border);
    border-radius: 12px;
    background: #fff;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.address-selection-card:hover {
    border-color: var(--brand-primary);
    background: rgba(28, 61, 110, 0.02);
    transform: translateY(-2px);
}

.addr-card-info {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.addr-card-user {
    font-weight: 800;
    font-size: 16px;
    color: var(--brand-text);
    display: flex;
    align-items: center;
    gap: 8px;
}

.addr-card-text {
    font-size: 13px;
    color: var(--brand-text-muted);
    line-height: 1.5;
}

.btn-select-addr {
    background: var(--brand-primary);
    color: #fff;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    flex-shrink: 0;
}

.btn-select-addr:hover {
    background: #152e55;
    box-shadow: var(--shadow-soft);
}

.btn-outline {
    background: #fff;
    border: 1px solid var(--brand-primary);
    color: var(--brand-primary);
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
}

.btn-outline:hover {
    background: var(--brand-primary);
    color: #fff;
}

/* Shipping Request Input Fields */
.input-field.mini {
    padding: 8px 12px;
    font-size: 12.5px;
    /* 폰트 사이즈 축소 */
    min-height: 36px;
    border: 1px solid var(--brand-border);
    border-radius: 8px;
    background: #fff;
    color: var(--brand-text);
    transition: var(--transition);
}

select.input-field.mini {
    width: auto;
    /* 폭을 내용에 맞게 조정 */
    min-width: 220px;
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23666' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    padding-right: 30px;
    appearance: none;
}

textarea.input-field.mini {
    width: 100%;
    line-height: 1.5;
    padding-top: 10px;
    resize: none;
}

.input-field.mini:focus {
    border-color: var(--brand-primary);
    outline: none;
    box-shadow: 0 0 0 3px rgba(28, 61, 110, 0.05);
}

/* Helpers & Global States */
.text-nowrap {
    white-space: nowrap !important;
}

.btn-primary:disabled,
.btn-primary[disabled] {
    background-color: #e0e0e0 !important;
    border-color: #e0e0e0 !important;
    color: #a0a0a0 !important;
    cursor: not-allowed !important;
    transform: none !important;
    box-shadow: none !important;
}

/* Cart Price Change Alert Styles */
.price-changed-item {
    position: relative;
    background-color: #fcfcfc !important;
}

.price-changed-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.02);
    pointer-events: none;
    border-radius: 16px;
    z-index: 1;
}

.price-change-warning {
    color: #ff4d4f;
    font-size: 12px;
    font-weight: 600;
    margin-top: 8px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.price-change-warning::before {
    content: '⚠️';
    font-size: 14px;
}

.hidden {
    display: none !important;
}

/* 약관 팝업 내 전체보기 버튼 숨김 */
#agreementModalBody .modal-open-btn-wrapper {
    display: none !important;
}

/* BA Popup Modal Styles */
#baPopupModal .modal-content {
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(20px);
    border: none;
    color: white;
    max-width: none;
    width: 100%;
    height: 100vh;
    border-radius: 0;
    padding: 20px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start; /* 상단부터 정렬 */
    overflow-y: auto;
    position: relative;
}

@media (max-width: 768px) {
    #baPopupModal {
        display: block; /* BA 팝업만 예외적으로 상단부터 배치 */
    }
    
    #baPopupModal .modal-content {
        height: auto;
        min-height: 100vh;
        animation: none; /* 모바일 성능 및 레이아웃 안정성 위해 애니메이션 제거 */
        transform: none !important;
        margin: 0;
    }
}

.ba-header-logo {
    width: 100%;
    text-align: center;
    margin-bottom: 20px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 10020;
    padding: 0 60px;
    flex-shrink: 0;
}

.ba-header-logo img {
    height: 100%;
    max-height: 40px; /* 로고 크기 조정 */
    object-fit: contain;
    filter: brightness(1.2); /* 흰색 배경 로고가 어두운 배경에서 잘 보이도록 보정 */
}

#baPopupModal .modal-body {
    flex: 1;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 0;
    padding: 10px 0;
}

#baPopupModal .ba-close-btn {
    position: absolute;
    top: 20px;
    right: 30px;
    background: none;
    border: none;
    color: white;
    font-size: 40px;
    cursor: pointer;
    z-index: 10030; /* 로고보다 높은 최상위 우선순위 */
    line-height: 1;
    width: 44px; /* 클릭 영역 명시 */
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ba-popup-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
    width: 100%;
}

.ba-popup-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: repeat(4, 1fr);
    gap: 12px;
    width: 100%; /* 고정 너비 제거 */
    max-width: 800px;
    height: auto;
    max-height: 75vh;
    aspect-ratio: 1 / 1;
    margin: auto;
}

.ba-product-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    cursor: pointer;
    min-height: 0;
    position: relative;
}

.ba-product-card:hover {
    transform: scale(1.05);
}

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

/* Hover Info Overlay */
.ba-product-info {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 15px;
    opacity: 0;
    transition: opacity 0.3s ease;
    text-align: left;
    color: white;
}

.ba-product-card:hover .ba-product-info {
    opacity: 1;
}

.ba-info-brand {
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 5px;
    opacity: 0.9;
}

.ba-info-name {
    font-size: 1rem;
    font-weight: 800;
    line-height: 1.3;
    margin-bottom: 15px;
    word-break: keep-all;
}

.ba-info-price {
    font-size: 1.1rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 5px;
}

.ba-info-price span {
    font-size: 0.9rem;
    font-weight: 400;
}

.ba-banner-area {
    grid-column: 2 / span 2;
    grid-row: 2 / span 2;
    background: #fff;
    border-radius: 20px;
    overflow: hidden;
    position: relative;
    box-shadow: 0 20px 50px rgba(0,0,0,0.5);
}

/* Banner Nav Buttons */
.ba-banner-ctrl {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.8);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: #333;
    transition: all 0.3s ease;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

.ba-banner-ctrl:hover {
    background: #fff;
    transform: translateY(-50%) scale(1.1);
}

.ba-banner-ctrl.prev { left: 15px; }
.ba-banner-ctrl.next { right: 15px; }

.ba-banner-slider {
    width: 100%;
    height: 100%;
    display: flex;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.ba-banner-item {
    min-width: 100%;
    height: 100%;
    position: relative;
}

.ba-banner-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ba-banner-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    padding: 30px;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    background: linear-gradient(to bottom, rgba(0,0,0,0.2) 0%, transparent 40%);
}

.ba-banner-title {
    font-size: 1.8rem;
    font-weight: 800;
    margin-bottom: 8px;
    color: #333;
    line-height: 1.2;
    letter-spacing: -1px;
}

.ba-banner-subtitle {
    font-size: 1rem;
    color: #666;
    font-weight: 500;
}

.ba-banner-nav {
    position: absolute;
    bottom: 20px;
    left: 0;
    width: 100%;
    display: flex;
    justify-content: center;
    gap: 6px;
    z-index: 10;
}

.ba-nav-dot {
    width: 6px;
    height: 6px;
    border-radius: 3px;
    background: rgba(0,0,0,0.2);
    cursor: pointer;
    transition: all 0.3s ease;
}

.ba-nav-dot.active {
    width: 18px;
    background: #000;
}

.ba-banner-btn {
    position: absolute;
    bottom: 30px;
    right: 30px;
    background: #111;
    color: white;
    padding: 10px 20px;
    border-radius: 10px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.ba-banner-btn:hover {
    background: #333;
    color: white;
    transform: translateY(-2px);
}

.ba-footer-logo {
    width: 100%;
    text-align: center;
    padding: 10px 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    height: 60px;
}

.ba-footer-logo img {
    height: 24px;
    opacity: 0.9;
}

.ba-copyright {
    font-size: 11px;
    color: rgba(255,255,255,0.6);
    font-weight: 500;
    letter-spacing: 0.3px;
}

@media (max-width: 768px) {
    #baPopupModal .modal-content {
        padding: 20px 15px; /* 상단 고정 패딩 제거하고 일반 흐름으로 */
        overflow-y: auto;
        overflow-x: hidden;
        justify-content: flex-start;
        width: 100% !important;
        height: 100vh;
        max-width: 100vw;
        display: block; /* 내부 요소를 수직으로 쌓기 위함 */
    }

    .ba-header-logo {
        position: relative; /* 고정 위치 해제하여 중첩 방지 */
        top: 0;
        margin-bottom: 20px;
        display: flex;
        padding: 0 50px; /* 로고가 닫기 버튼과 물리적으로 겹치지 않도록 차단 */
    }

    #baPopupModal .ba-close-btn {
        top: 12px;
        right: 12px;
        font-size: 22px; /* 콤팩트한 사이즈 조절 */
        width: 32px;
        height: 32px;
        background: rgba(255, 255, 255, 0.15); /* 반투명 원형 버튼 디자인으로 독립된 버튼임 선언 */
        border-radius: 50%;
        color: rgba(255, 255, 255, 0.8);
    }

    .ba-popup-container {
        min-height: auto;
        padding: 0;
        width: 100%;
        display: block; /* flex 해제 */
    }

    .ba-popup-grid {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        grid-template-rows: auto; /* 고정 행 제거하여 모든 상품 노출 */
        gap: 12px;
        width: 100%;
        max-width: 100%;
        height: auto;
        max-height: none;
        aspect-ratio: auto;
        padding: 0 0 40px 0; /* 하단 푸터와의 여백 */
    }

    .ba-banner-area {
        grid-column: 1 / span 2;
        width: 100%;
        aspect-ratio: 1 / 1; /* 배너를 정사각형으로 변경하여 이미지 온전 노출 */
        order: -2;
        border-radius: 16px;
        margin-bottom: 5px; /* 그리드 갭과 합쳐져 적절한 간격 형성 */
        display: block !important;
        position: relative; /* 중첩 방지 위해 명시적 위치 지정 */
    }

    .ba-product-card {
        width: 100%;
        aspect-ratio: 1 / 1;
        border-radius: 12px;
        overflow: hidden;
        position: relative;
    }

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

    .ba-product-info {
        position: absolute;
        bottom: 0;
        left: 0;
        width: 100%;
        background: linear-gradient(to top, rgba(0,0,0,0.85), transparent);
        color: white;
        padding: 10px 8px;
        opacity: 1;
        display: flex;
        flex-direction: column;
    }

    .ba-info-name {
        font-size: 11.5px;
        font-weight: 600;
        margin-bottom: 4px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .ba-info-price {
        font-size: 14px;
        font-weight: 800;
        color: var(--brand-accent);
    }
    
    .ba-banner-title { font-size: 1.3rem; }
    .ba-banner-subtitle { font-size: 0.9rem; }
    .ba-banner-ctrl { display: none; }
    
    .ba-footer-logo {
        grid-column: 1 / span 2;
        margin-top: 40px;
        padding: 30px 0;
        width: 100%;
    }
}
