/* 월간 유레카 공통 스타일 */

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

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

a {
    text-decoration: none;
    color: inherit;
}

ul, ol {
    list-style: none;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
}

/* 컨테이너 */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px 20px;
}

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

/* 헤더 */
.header {
    background-color: #fff;
    box-shadow: 0 2px 4px rgba(30,97,55,0.2);
    position: sticky;
    top: 0;
    z-index: 1000;
    will-change: transform;
    transform: translateZ(0);
}

/* 헤더 상단 영역 */
.header-top {
    border-bottom: 1px solid #fde68a;
}

.header-top-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 15px 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
}

.logo h1 {
    font-size: 28px;
    color: #007bff;
    font-weight: 700;
    white-space: nowrap;
}

/* 헤더 하단 영역 (네비게이션) */
.header-bottom {
    background-color: #fffefb;
}

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

.main-btn {
    padding: 5px 12px;
    color: #fef3c7;
    /* background: linear-gradient(170deg, #24a788 0%, #18381d 100%); */
    background: linear-gradient(170deg, #24a7a7 0%, #184647 100%);
    border : 1px solid #065e45;
    border-radius: 911px !important;
    font-size: 16px;
}
.main-btn:hover { color:white !important; }

.main-btn-outline {
    padding: 5px 7px;
    border : 1px solid #065e45;
    border-radius: 11px;
}

.main-btn2 {
    padding: 1px 5px;
    border : 1px solid #6ad4c3;
    border-radius: 11px;
}

.gradation1 {
    background: linear-gradient(170deg, #24a7a7 0%, #184647 100%) !important;
}

.gradation2 {
    background: linear-gradient(170deg, #184647 0%, #24a7a7 100%) !important;
}

.small-btn {
    padding: 5px 12px;
    color: #fff;
    /* background: linear-gradient(170deg, #24a788 0%, #18381d 100%); */
    background: linear-gradient(170deg, #24a7a7 0%, #277475 100%);
    border : 1px solid #065e5e;
    border-radius: 911px !important;
}

.secondary-color {
    background: linear-gradient(170deg, #24a7a7 0%, #163a3a 100%);
}

.nav-desktop {
    display: flex;
    justify-content: center;
}

.nav-menu {
    display: flex;
    gap: 40px;
}

.nav-menu > li {
    position: relative;
}

.nav-menu a {
    display: block;
    padding: 15px 0;
    font-weight: 600;
    font-size: 20px;
    transition: color 0.3s;
    /* color:#065f46; */
    color:#1d7c70;
}

.nav-menu a:hover {
    color: #007bff;
}

/* 드롭다운 메뉴 */
.dropdown {
    position: relative;
}

.dropdown-toggle {
    cursor: pointer;
    display: block;
    padding: 10px 0;
}

.dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background-color: #fff;
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
    border-radius: 4px;
    min-width: 150px;
    padding: 10px 0;
    margin-top: 0;
    z-index: 1000;
}

.dropdown:hover .dropdown-menu {
    display: block;
}

/* 드롭다운과 메뉴 사이의 간격을 메우기 위한 가상 요소 */
.dropdown::before {
    content: '';
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    height: 10px;
    background: transparent;
}

.dropdown-menu li {
    padding: 0;
}

.dropdown-menu a {
    display: block;
    padding: 10px 20px;
    color: #333;
    transition: background-color 0.3s;
    white-space: nowrap;
}

.dropdown-menu a:hover {
    background-color: #f8f9fa;
    color: #007bff;
}

.search-bar {
    flex: 1;
    max-width: 400px;
}

.search-form {
    display: flex;
    gap: 10px;
    overflow: hidden;
}

.search-input {
    flex: 1;
    padding: 8px 12px;
    border: none;
    outline: none;
}

.search-btn {
    padding: 8px 16px;
    background-color: #007bff;
    color: #fff;
    border: none;
    cursor: pointer;
    transition: background-color 0.3s;
}

.search-btn:hover {
    background-color: #0056b3;
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-nickname {
    font-weight: 500;
}

.menu-link {
    font-size: 14px;
    transition: color 0.3s;
}

.menu-link:hover {
    color: #007bff;
}

.cart-link {
    position: relative;
    font-size: 20px;
}

.cart-count {
    position: absolute;
    top: -8px;
    right: -8px;
    background-color: #dc3545;
    color: #fff;
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 30px;
    min-width: 18px;
    text-align: center;
}

.hamburger-btn {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    width: 40px;
    height: 40px;
    position: relative;
}

.hamburger-btn span {
    width: 25px;
    height: 3px;
    background-color: #333;
    transition: all 0.3s ease;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}

.hamburger-btn span:nth-child(1) {
    top: 10px;
}

.hamburger-btn span:nth-child(2) {
    top: 18px;
}

.hamburger-btn span:nth-child(3) {
    top: 26px;
}

.hamburger-btn.active span:nth-child(1) {
    top: 18px;
    transform: translateX(-50%) rotate(45deg);
}

.hamburger-btn.active span:nth-child(2) {
    opacity: 0;
}

.hamburger-btn.active span:nth-child(3) {
    top: 18px;
    transform: translateX(-50%) rotate(-45deg);
}

.mobile-menu {
    display: none;
    background-color: #fff;
    border-top: 1px solid #ddd;
    width: 100%;
    position: absolute;
    top: 50%;
    left: 0;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-in-out;
    z-index: 999;
}

.mobile-menu.active {
    max-height: 500px !important;
    overflow-y: auto;
}

.mobile-nav-list {
    padding: 20px;
}

.mobile-nav-list li {
    padding: 10px 0;
    border-bottom: 1px solid #f0f0f0;
}

.mobile-nav-list a {
    display: block;
    font-weight: 500;
}

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

/* 버튼 */
.btn {
    display: inline-block;
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    text-align: center;
}

.btn-primary {
    background-color: #007bff;
    color: #fff;
}

.btn-primary:hover {
    background-color: #0056b3;
}

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

.btn-secondary:hover {
    background-color: #545b62;
}

.btn-success {
    background-color: #28a745;
    color: #fff;
}

.btn-success:hover {
    background-color: #218838;
}

.btn-danger {
    background-color: #dc3545;
    color: #fff;
}

.btn-danger:hover {
    background-color: #c82333;
}

.btn-block {
    display: block;
    width: 100%;
}

.btn-cart {
    padding: 6px 12px;
    background-color: #28a7a7;
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.btn-cart:hover {
    background-color: #218888;
}

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

.form-label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
}

.form-control {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
    outline: none;
    transition: border-color 0.3s;
}

.form-control:focus {
    border-color: #007bff;
}

.form-text {
    display: block;
    margin-top: 5px;
    font-size: 14px;
    color: #6c757d;
}

.form-error {
    color: #dc3545;
    font-size: 14px;
    margin-top: 5px;
}

/* 카드 */
.card {
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.card-img {
    width: 100%;
    height: 250px;
    object-fit: cover;
}

.card-body {
    padding: 15px;
}

.card-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 10px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.card-text {
    font-size: 14px;
    color: #6c757d;
    margin-bottom: 10px;
}

.card-price {
    font-size: 20px;
    font-weight: 700;
    color: #007bff;
}

/* 그리드 */
.grid {
    display: grid;
    gap: 20px;
}

.grid-2 {
    grid-template-columns: repeat(2, 1fr);
}

.grid-3 {
    grid-template-columns: repeat(3, 1fr);
}

.grid-4 {
    grid-template-columns: repeat(4, 1fr);
}

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

.pagination a,
.pagination span {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    transition: all 0.3s;
}

.pagination a:hover {
    background-color: #007bff;
    color: #fff;
    border-color: #007bff;
}

.pagination .active {
    background-color: #007bff;
    color: #fff;
    border-color: #007bff;
}

/* 푸터 */
.footer {
    background-color: #343a40;
    color: #fff;
    padding: 40px 0 20px;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0;
}

.footer-section h3,
.footer-section h4 {
    margin-bottom: 15px;
}

.footer-section ul li {
    margin-bottom: 8px;
}

.footer-section a {
    color: #adb5bd;
    transition: color 0.3s;
}

.footer-section a:hover {
    color: #fff;
}

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    margin-top: 20px;
    border-top: 1px solid #495057;
    color: #adb5bd;
}

/* 알림 메시지 */
.alert {
    padding: 15px 20px;
    border-radius: 4px;
    margin-bottom: 20px;
}

.alert-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert-info {
    background-color: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* 로딩 스피너 */
.spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #007bff;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 반응형 디자인 - 태블릿 */
@media (max-width: 1024px) {
    .header-top-container {
        gap: 15px;
    }
    
    .logo h1 {
        font-size: 24px;
    }
    
    .search-bar {
        max-width: 300px;
    }
    
    .nav-menu {
        gap: 25px;
    }
    
    .nav-menu a {
        font-size: 14px;
    }
}

/* 반응형 디자인 - 모바일 */
@media (max-width: 768px) {
    /* 헤더 */
    .header {
        position: fixed;
        width: 100%;
        top: 0;
        left: 0;
    }
    
    /* 헤더 상단 */
    .header-top {
        border-bottom: none;
    }
    
    .header-top-container {
        padding: 12px 15px;
        justify-content: space-between;
    }
    
    .logo h1 {
        font-size: 20px;
    }
    #logoImage { height: 40px !important; }
    
    /* 검색바 숨김 (모바일에서는 별도 검색 페이지로) */
    .search-bar {
        display: none;
    }
    
    /* 사용자 메뉴 간소화 */
    .user-menu {
        gap: 10px;
    }
    
    .user-nickname {
        display: none;
    }
    
    .menu-link {
        display: none;
    }
    
    .cart-link {
        display: block;
    }
    
    /* 햄버거 메뉴 표시 */
    .hamburger-btn {
        display: flex;
    }
    
    /* 네비게이션 메뉴 숨김 */
    .header-bottom {
        display: none;
    }
    
    .nav-desktop {
        display: none;
    }
    
    /* 모바일 메뉴 표시 */
    .mobile-menu {
        display: block;
        top: 100% !important;
    }

    .mobile-nav-list { padding-top: 0 !important; }
    
    /* 메인 콘텐츠에 상단 여백 추가 (헤더 높이만큼) */
    .main-content {
        padding-top: 70px;
    }
}

@media (max-width: 480px) {
    .logo h1 {
        font-size: 18px;
    }
    
    .cart-link {
        font-size: 18px;
    }
}


/* 알림 모달 스타일 */
.alert-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.alert-modal-overlay.show {
    opacity: 1;
}

.alert-modal {
    background-color: #fff;
    border-radius: 12px;
    padding: 30px;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    text-align: center;
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.alert-modal-overlay.show .alert-modal {
    transform: scale(1);
}

.alert-modal-icon {
    font-size: 48px;
    margin-bottom: 15px;
    font-weight: bold;
}

.alert-modal-success .alert-modal-icon {
    color: #28a745;
}

.alert-modal-error .alert-modal-icon {
    color: #dc3545;
}

.alert-modal-warning .alert-modal-icon {
    color: #ffc107;
}

.alert-modal-info .alert-modal-icon {
    color: #17a2b8;
}

.alert-modal-message {
    font-size: 16px;
    line-height: 1.6;
    color: #333;
    margin-bottom: 20px;
    word-break: keep-all;
}

.alert-modal-close {
    padding: 10px 30px;
    background-color: #06553f;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s;
}

.alert-modal-close:hover {
    background-color: #044030;
}

/* 기존 alert 스타일 (하위 호환성) */
.alert {
    padding: 15px 20px;
    margin-bottom: 20px;
    border-radius: 4px;
    font-size: 14px;
}

.alert-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert-warning {
    background-color: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

.alert-info {
    background-color: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}


/* 로고 이미지 */
.logo-image {
    height: 60px;
}

/* 숨김 클래스 */
.hidden {
    display: none !important;
}
