/* Custom style overrides - 로그인 버튼 크기 수정 */

/* 로고 크기 유지 - 원본 크기 복원 (198 × 68 px) */
.navbar-brand img,
.u-header__navbar-brand img,
a.navbar-brand.u-header__navbar-brand img,
.u-header__navbar-brand-center img,
img[src*="lineprintingLogoT"] {
    width: 198px !important;
    height: 68px !important;
    max-height: none !important;
    max-width: none !important;
}

/* 헤더와 메인 콘텐츠 사이 간격 조정 */
header#header {
    margin-bottom: 0 !important;
}

/* u-header__section 높이 줄이기 */
.u-header__section {
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    min-height: auto !important;
    height: auto !important;
}

/* topbar (마이페이지 등) padding 완전 제거 */
.u-header__hide-content {
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    margin-bottom: 0 !important;
}

.u-header__hide-content .container {
    padding-top: 0 !important;
    padding-bottom: 0 !important;
}

/* topbar와 navbar 사이 간격 제거 */
#logoAndNav {
    margin-top: 0 !important;
    padding-top: 0 !important;
}

#logoAndNav.container {
    padding-top: 0 !important;
    padding-bottom: 0 !important;
}

/* 네비게이션 바 padding 완전 제거 */
.u-header__navbar {
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
}

main {
    padding-top: 0 !important;
}

/* 배너 섹션 상단 여백 조정 - 헤더 높이에 맞춰서 */
main#content > div:first-child {
    margin-top: 130px !important;  /* 헤더 높이가 줄어들어서 조정 */
}

/* Product 페이지만 간격 줄이기 */
body[class*="product"] main#content > div:first-child,
body[data-controller="product"] main#content > div:first-child {
    margin-top: 20px !important;
}

/* 드롭다운 메뉴 간격 제거 - 제품안내 메뉴 호버 문제 해결 */
/* 1단계 드롭다운 (명함, 스티커, 봉투) - 제품안내, 샘플안내 등 일반 서브메뉴 */
.nav-item.hs-has-sub-menu.u-header__nav-item > ul.hs-sub-menu.u-header__sub-menu {
    top: 100% !important;
    left: -20px !important;  /* 왼쪽으로 이동 */
    margin-top: 0px !important;  /* 위로 올리기 */
    padding-top: 0 !important;
    box-shadow: 0 3px 6px 0 rgba(140, 152, 164, 0.25) !important;  /* 헤더와 같은 box-shadow */
}

/* 주문바로가기 mega-menu - 컨테이너 전체 너비 */
div#logoAndNav.container {
    position: relative !important;
}

nav#navBar.navbar-collapse.u-header__navbar-collapse {
    position: static !important;
}

nav.navbar.navbar-expand-md.u-header__navbar.u-header__navbar--no-space {
    position: static !important;
}

li.nav-item.hs-has-mega-menu.u-header__nav-item[data-event="hover"] {
    position: static !important;
    padding-bottom: 15px !important;
    margin-bottom: -15px !important;
}

li.nav-item.hs-has-mega-menu.u-header__nav-item[data-event="hover"] div.hs-mega-menu.w-100.u-header__sub-menu[aria-labelledby="homeMegaMenu"] {
    position: absolute !important;
    top: 100% !important;
    left: 0 !important;
    right: 0 !important;
    transform: none !important;
    width: 100% !important;
    margin: 0 !important;
    margin-top: -15px !important;
    padding: 0 15px 0 15px !important;
    padding-top: 15px !important;
    background-color: transparent !important;
    box-shadow: none !important;
    border: none !important;
    box-sizing: border-box !important;
}

/* 메가메뉴 실제 콘텐츠 wrapper */
li.nav-item.hs-has-mega-menu.u-header__nav-item[data-event="hover"] div.hs-mega-menu.w-100.u-header__sub-menu[aria-labelledby="homeMegaMenu"] .d-none.d-md-block {
    background-color: #fff !important;
    box-shadow: 0 10px 40px rgba(55, 125, 255, 0.12) !important;
    border-top: 3px solid #377dff !important;
    animation: slideDown 0.3s ease-out !important;
}

/* 메가메뉴 애니메이션 */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 메가메뉴 내부 wrapper도 전체 너비로 */
div.hs-mega-menu .d-none.d-md-block {
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* direct-order-menu-container 세련된 스타일 */
div.hs-mega-menu .direct-order-menu-container {
    display: flex !important;
    flex-wrap: nowrap !important;
    justify-content: space-between !important;
    padding: 40px 30px !important;
    gap: 20px !important;
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%) !important;
    width: 100% !important;
    max-width: 1140px !important;
    margin: 0 auto !important;
    box-sizing: border-box !important;
    box-shadow: none !important;
    border-radius: 0 !important;
}

/* 더 큰 화면에서 container와 맞춤 */
@media (min-width: 1400px) {
    div.hs-mega-menu .direct-order-menu-container {
        max-width: 1320px !important;
    }
}

/* 컬럼 스타일 - 카드 형태 */
div.hs-mega-menu .direct-order-column {
    flex: 1 1 auto !important;
    min-width: 160px !important;
    max-width: 220px !important;
    padding: 20px 15px !important;
    background: #ffffff !important;
    border-radius: 12px !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05) !important;
    transition: all 0.3s ease !important;
    border: 1px solid #e9ecef !important;
}

div.hs-mega-menu .direct-order-column:hover {
    transform: translateY(-4px) !important;
    box-shadow: 0 8px 20px rgba(55, 125, 255, 0.15) !important;
    border-color: #377dff !important;
}

/* 메뉴 타이틀 - 강조 스타일 */
div.hs-mega-menu .direct-order-column .title {
    margin-bottom: 20px !important;
    padding-bottom: 15px !important;
    border-bottom: 2px solid #e9ecef !important;
    position: relative !important;
}

div.hs-mega-menu .direct-order-column .title a {
    font-size: 16px !important;
    font-weight: 700 !important;
    color: #1e2022 !important;
    text-decoration: none !important;
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    transition: color 0.3s ease !important;
}

div.hs-mega-menu .direct-order-column .title a:hover {
    color: #377dff !important;
}

/* 타이틀 하단 강조선 */
div.hs-mega-menu .direct-order-column .title::after {
    content: '' !important;
    position: absolute !important;
    bottom: -2px !important;
    left: 0 !important;
    width: 40px !important;
    height: 2px !important;
    background: linear-gradient(90deg, #377dff 0%, #5a8fff 100%) !important;
    transition: width 0.3s ease !important;
}

div.hs-mega-menu .direct-order-column:hover .title::after {
    width: 100% !important;
}

/* 메뉴 리스트 */
div.hs-mega-menu .direct-order-column ul {
    list-style: none !important;
    padding: 0 !important;
    margin: 0 !important;
}

/* 메뉴 항목 */
div.hs-mega-menu .direct-order-column li {
    margin-bottom: 1px !important;
    transition: all 0.2s ease !important;
}

div.hs-mega-menu .direct-order-column li:not(.line) {
    padding: 4px 8px !important;
    border-radius: 6px !important;
}

div.hs-mega-menu .direct-order-column li:not(.line):hover {
    background: #f0f8ff !important;
    transform: translateX(4px) !important;
}

/* 메뉴 링크 */
div.hs-mega-menu .direct-order-column li a {
    padding: 0 !important;
    line-height: 1.3 !important;
    font-size: 14px !important;
    color: #495057 !important;
    text-decoration: none !important;
    display: inline-flex !important;
    align-items: center !important;
    transition: all 0.3s ease !important;
    font-weight: 400 !important;
}

div.hs-mega-menu .direct-order-column li a:hover {
    color: #377dff !important;
    font-weight: 500 !important;
}

/* New 뱃지 스타일 */
div.hs-mega-menu .direct-order-column li a .badge {
    font-size: 10px !important;
    padding: 3px 6px !important;
    border-radius: 4px !important;
    vertical-align: middle !important;
}

/* 구분선 스타일 */
div.hs-mega-menu .direct-order-column li.line {
    height: 1px !important;
    background: linear-gradient(90deg, transparent 0%, #dee2e6 50%, transparent 100%) !important;
    margin: 12px 0 !important;
    padding: 0 !important;
}

/* 2단계 드롭다운 (수입지명함, 프리미엄명함 등) - 1단계 메뉴 오른쪽에 위치 */
.hs-sub-menu .hs-has-sub-menu > .hs-sub-menu {
    top: 0px !important;
    left: 100% !important;
    margin-left: 0 !important;
    margin-top: 0 !important;
    box-shadow: 0 3px 6px 0 rgba(140, 152, 164, 0.25) !important;  /* 헤더와 같은 box-shadow */
}

.u-header__sub-menu li {
    margin: 0 !important;
    padding: 0 !important;
}

.u-header__sub-menu-nav-link {
    padding: 0.5rem 1rem !important;
}

/* topbar 링크 스타일 복원 - 원본과 동일하게 */
.u-header__hide-content .u-header__navbar-link,
.u-header__hide-content .list-inline-item a.u-header__navbar-link,
a.u-header__navbar-link {
    color: #77838f !important;
    font-size: 0.8125rem !important;  /* 13px - 더 작게 */
    font-weight: 300 !important;      /* 얇은 폰트 */
    padding-left: 0.375rem !important; /* 6px - 더 좁게 */
    padding-right: 0.375rem !important; /* 6px - 더 좁게 */
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    line-height: 1.2 !important;
    display: inline-block !important;
    text-decoration: none !important;
    letter-spacing: -0.01em !important; /* 자간 좁게 */
}

/* list-inline-item 간격 제거 */
.u-header__hide-content .list-inline-item {
    margin-right: 0 !important;
    margin-left: 0 !important;
    padding: 0 !important;
}

.u-header__hide-content .list-inline {
    margin-bottom: 0 !important;
}

/* mr-0 클래스 강제 적용 */
.u-header__hide-content .mr-0 {
    margin-right: 0 !important;
}

/* 파란색 로그인 버튼 크기 복원 */
.btn.btn-sm,
.btn-sm.btn-primary,
button.btn.btn-sm,
button[type="submit"].btn.btn-primary {
    padding: 0.625rem 1.125rem !important;
    font-size: 0.875rem !important;
    line-height: 1.5 !important;
}

/* 모든 btn-sm 버튼 */
.btn-sm {
    padding: 0.625rem 1.125rem !important;
}

/* 버튼 기본 스타일 - transition 추가 */
.btn-primary,
button.btn-primary,
button[type="submit"].btn-primary,
.btn.btn-primary {
    background-color: #377dff !important;
    background-image: none !important;
    border-color: #377dff !important;
    color: #fff !important;
    transition: all 0.2s ease-in-out !important;
}

/* 로그인 버튼 호버 효과 복원 - 그림자 추가 */
.btn-primary:hover,
.btn-primary:focus,
.btn-primary:active,
button.btn-primary:hover,
button.btn-primary:focus,
button.btn-primary:active,
button[type="submit"].btn-primary:hover,
button[type="submit"].btn-primary:focus {
    color: #fff !important;
    background-color: #1164ff !important;
    border-color: #045cff !important;
    box-shadow: 0 4px 11px rgba(55, 125, 255, 0.35) !important;
}

/* 3D 호버 효과 */
.transition-3d-hover {
    transition: all 0.2s ease-in-out !important;
}

.transition-3d-hover:hover,
.transition-3d-hover:focus {
    transform: translateY(-3px) !important;
}

/* form-control 스타일 복원 */
input.form-control,
textarea.form-control,
select.form-control,
.form-control {
    display: block !important;
    width: 100% !important;
    height: auto !important;
    min-height: 2.5rem !important;
    padding: 0.625rem 0.875rem !important;
    font-size: 0.875rem !important;
    font-weight: 400 !important;
    line-height: 1.5 !important;
    color: #1e2022 !important;
    background-color: #fff !important;
    background-clip: padding-box !important;
    border: 1px solid #e7eaf3 !important;
    border-radius: 0.3125rem !important;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out !important;
    box-sizing: border-box !important;
}

input.form-control:focus,
textarea.form-control:focus,
select.form-control:focus,
.form-control:focus {
    color: #1e2022 !important;
    background-color: #fff !important;
    border-color: #377dff !important;
    outline: 0 !important;
    box-shadow: 0 0 0 0.2rem rgba(55, 125, 255, 0.25) !important;
}

/* Input 박스 width 고정 - Bootstrap의 width: 100% 완전 제거 */
input.form-control[style*="width"],
input[type="text"].form-control[style*="width"],
select.custom-select[style*="width"] {
    width: inherit !important;
    max-width: none !important;
    min-width: 0 !important;
    flex: 0 0 auto !important;
}

/* display: inline이 있는 경우 강제 적용 */
input.form-control[style*="display: inline"],
input.form-control[style*="display:inline"] {
    display: inline-block !important;
    width: inherit !important;
}

/* form-control-custom 클래스 - form-control과 동일한 스타일 + width 고정 가능 */
input.form-control-custom,
select.form-control-custom {
    display: inline-block !important;
    height: 40px !important;
    padding: 0.625rem 0.875rem !important;
    font-size: 0.875rem !important;
    font-weight: 400 !important;
    line-height: 1.5 !important;
    color: #1e2022 !important;
    background-color: #fff !important;
    background-clip: padding-box !important;
    border: 1px solid #e7eaf3 !important;
    border-radius: 0.3125rem !important;
    box-sizing: border-box !important;
    text-align: center !important;
    vertical-align: middle !important;
    max-width: none !important;
    min-width: 0 !important;
    flex: 0 0 auto !important;
}

input.form-control-custom:focus,
select.form-control-custom:focus {
    color: #1e2022 !important;
    background-color: #fff !important;
    border-color: #377dff !important;
    outline: 0 !important;
    box-shadow: 0 0 0 0.2rem rgba(55, 125, 255, 0.25) !important;
}

input.form-control-custom:disabled,
input.form-control-custom[disabled],
select.form-control-custom:disabled,
select.form-control-custom[disabled] {
    background-color: #f8fafd !important;
    opacity: 1 !important;
}

/* 사이드바 로그인 폼 input-group 아이콘 정렬 수정 */
.u-sidebar .input-group {
    display: flex !important;
    align-items: center !important;
    flex-wrap: nowrap !important;
}

.u-sidebar .input-group-prepend {
    display: flex !important;
    align-items: center !important;
    margin-right: 0 !important;
}

.u-sidebar .input-group-text {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    height: 100% !important;
    min-height: 2.5rem !important;
    padding: 0.625rem 0.875rem !important;
    margin-bottom: 0 !important;
    font-size: 0.875rem !important;
    font-weight: 400 !important;
    line-height: 1.5 !important;
    color: #77838f !important;
    text-align: center !important;
    white-space: nowrap !important;
    background-color: #f8fafd !important;
    border: 1px solid #e7eaf3 !important;
    border-right: 0 !important;
    border-radius: 0.3125rem 0 0 0.3125rem !important;
}

.u-sidebar .input-group-prepend + .form-control {
    border-left: 0 !important;
    border-radius: 0 0.3125rem 0.3125rem 0 !important;
}

/* CartConfirm 페이지 테이블 스타일 - 원본과 동일하게 */
.table-responsive-sm {
    border: 0 !important;
    border-top: 0 !important;
}

.table.table-borderless {
    border: 0 !important;
    border-collapse: collapse !important;
}

.table thead {
    border-top: 0 !important;
    border: 0 !important;
}

.table thead th {
    background-color: #fff !important;
    color: #1e2022 !important;
    font-weight: 500 !important;
    font-size: 0.875rem !important;
    padding: 0.75rem !important;
    vertical-align: bottom !important;
}

.table.table-borderless thead,
.table.table-borderless thead th,
.table.table-borderless tbody td,
.table.table-borderless tbody tr,
.table.table-borderless thead tr,
.table.table-borderless th,
.table.table-borderless td,
.table.table-borderless tr {
    background-color: #fff !important;
    border: 0 !important;
    border-top: 0 !important;
    border-bottom: 0 !important;
    border-left: 0 !important;
    border-right: 0 !important;
}

.table tbody tr td {
    padding: 1rem 0.75rem !important;
    vertical-align: middle !important;
}

.table.bg-white {
    background-color: #fff !important;
}

/* 후가공 버튼 스타일 */
.addwork-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    margin-right: 10px;
    margin-bottom: 10px;
    border: 2px solid #e4dfdf;
    border-radius: 8px;
    background-color: #ffffff;
    color: #333;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    user-select: none;
}

.addwork-btn:hover {
    border-color: #377dff;
    background-color: #f8f9fa;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(55, 125, 255, 0.15);
}

.addwork-btn-active {
    border-color: #377dff;
    background: linear-gradient(135deg, #377dff 0%, #5a8aff 100%);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(55, 125, 255, 0.3);
}

.addwork-btn-active:hover {
    background: linear-gradient(135deg, #2868dd 0%, #4879ee 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(55, 125, 255, 0.4);
}

.addwork-btn-disabled {
    opacity: 0.5;
    cursor: not-allowed;
    border-color: #e4dfdf;
    background-color: #f5f5f5;
}

.addwork-btn-disabled:hover {
    border-color: #e4dfdf;
    background-color: #f5f5f5;
    transform: none;
    box-shadow: none;
}

/* 후가공 카드 스타일 */
.addwork-card {
    background: #ffffff;
    border: 1px solid #e4e7ec;
    border-radius: 12px;
    margin-bottom: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    transition: all 0.3s ease;
}

.addwork-card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.addwork-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: linear-gradient(135deg, #f8f9fb 0%, #fafbfc 100%);
    border-bottom: 1px solid #e4e7ec;
    border-radius: 12px 12px 0 0;
}

.addwork-card-title {
    font-size: 16px;
    font-weight: 600;
    color: #1d2939;
}

.addwork-card-price {
    font-size: 16px;
    font-weight: 700;
    color: #377dff;
}

.addwork-card-body {
    padding: 20px;
}

.addwork-option-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
}

.addwork-option-row:last-child {
    margin-bottom: 0;
}

.addwork-option-label {
    display: inline-block;
    min-width: 80px;
    font-size: 14px;
    font-weight: 500;
    color: #4b5563;
}

.addwork-select {
    display: inline-block;
    width: auto;
    min-width: 120px;
    padding: 8px 12px;
    font-size: 14px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.addwork-select:focus {
    border-color: #377dff;
    box-shadow: 0 0 0 3px rgba(55, 125, 255, 0.1);
    outline: none;
}

.addwork-checkbox-group {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 12px;
}

.addwork-checkbox-label {
    display: inline-flex;
    align-items: center;
    cursor: pointer;
    margin: 0;
}

.addwork-checkbox-label input[type="checkbox"] {
    margin-right: 6px;
    cursor: pointer;
}

.addwork-checkbox-label span {
    font-size: 14px;
    color: #4b5563;
}

.addwork-input {
    display: inline-block;
    width: auto;
    padding: 8px 12px;
    font-size: 14px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.addwork-input:focus {
    border-color: #377dff;
    box-shadow: 0 0 0 3px rgba(55, 125, 255, 0.1);
    outline: none;
}

/* Pagination styles */
.pagination .pager-item {
    display: inline-block;
    padding: 0.5rem 0.75rem;
    margin: 0 0.25rem;
    color: #377dff;
    text-decoration: none;
    border: 1px solid #dee2e6;
    border-radius: 0.25rem;
    background-color: #fff;
    transition: all 0.2s ease;
}

.pagination .pager-item:hover {
    color: #fff;
    background-color: #377dff;
    border-color: #377dff;
}

.pagination .pager-item.current-page {
    color: #fff;
    background-color: #377dff;
    border-color: #377dff;
    font-weight: 600;
}

.pagination .pager-item.disabled {
    color: #6c757d;
    background-color: #fff;
    border-color: #dee2e6;
    cursor: not-allowed;
    opacity: 0.6;
}

/* 주문바로가기 메뉴 링크 스타일 개선 */
#homeMegaMenu.nav-link.u-header__nav-link {
    font-weight: 600 !important;
    color: #1e2022 !important;
    font-size: 14px !important;
    padding: 8px 16px !important;
    border-radius: 8px !important;
    transition: background 0.3s ease, color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease !important;
    position: relative !important;
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%) !important;
    border: 1px solid #e9ecef !important;
    margin-bottom: 0 !important;
}

#homeMegaMenu.nav-link.u-header__nav-link:hover {
    background: linear-gradient(135deg, #377dff 0%, #5a8fff 100%) !important;
    color: #ffffff !important;
    border-color: #377dff !important;
    box-shadow: 0 4px 12px rgba(55, 125, 255, 0.3) !important;
}

/* 메뉴가 열려있을 때 스타일 */
#homeMegaMenu.nav-link.u-header__nav-link[aria-expanded="true"] {
    background: linear-gradient(135deg, #377dff 0%, #5a8fff 100%) !important;
    color: #ffffff !important;
    border-color: #377dff !important;
    box-shadow: 0 4px 12px rgba(55, 125, 255, 0.3) !important;
    margin-bottom: 0 !important;
}

/* 아이콘 추가를 위한 ::before */
#homeMegaMenu.nav-link.u-header__nav-link::before {
    content: '🛒' !important;
    margin-right: 6px !important;
    font-size: 14px !important;
}

/* ========================================
   CLS (Cumulative Layout Shift) 개선
   이미지 로딩 전 공간 확보를 위한 aspect-ratio
   ======================================== */

/* 메인 페이지 제품 이미지 */
.product-image {
    aspect-ratio: 500 / 280;
    width: 100%;
    height: auto;
    object-fit: cover;
}

/* 명함 이미지 */
.namecard-image {
    aspect-ratio: 1 / 1;
    width: 100%;
    height: auto;
    object-fit: cover;
}

/* 스티커 이미지 */
.sticker-image {
    aspect-ratio: 500 / 280;
    width: 100%;
    height: auto;
    object-fit: cover;
}

/* 봉투 이미지 */
.envelope-image {
    aspect-ratio: 500 / 550;
    width: 100%;
    height: auto;
    object-fit: cover;
}

/* 가이드 캐릭터 */
.guide-character {
    width: 36px;
    height: 36px;
    flex-shrink: 0;
}

/* 일반 카드 이미지 (380x360) */
.info-card img {
    aspect-ratio: 380 / 360;
    width: 60px;
    height: auto;
    object-fit: cover;
    flex-shrink: 0;
}

