/* -------------------------- */
/*        공통 설정           */
/* -------------------------- */

html, body {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    width: 100%;
    overflow-x: hidden;
    font-family: 'Noto Sans KR', 'Nanum Gothic', sans-serif;
    background-color: #f5f5f5;
    color: #333;
}

*, *::before, *::after {
    box-sizing: inherit;
}

h2 {
    text-align: center;
    margin: 20px 0;
    font-weight: 700;
    color: #333;
}

#platform-products h3 {
    margin-bottom: 20px;
    font-size: 1.2em;
    color: #333;
}

/* -------------------------- */
/*         HEADER 영역        */
/* -------------------------- */

.header {
    background-color: transparent;  /* ✅ 배경 제거 */
    border-bottom: none;            /* ✅ 구분선 제거 */
    font-family: 'Pretendard', sans-serif;
}

.header-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 10px 20px;
    margin-top: 12px;  /* 👈 여백 추가 */
}

/* 상단 즐겨찾기 + 로그인 */
/* 전체 상단 네비게이션 박스 */
.top-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 16px;
    padding: 0 0 12px 0; /* 상단 padding 제거 */
    margin-bottom: 8px;
    border-bottom: 1px solid #ddd;
    height: 48px;
}


/* 좌측 즐겨찾기 */
.left-links {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* 우측 인증 관련 링크 */
.auth-links {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* 기본 링크 스타일 */
.plain-link {
    color: #444;
    text-decoration: none;
    font-weight: 500;
    font-size: 15px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: color 0.3s ease;
}

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

/* 프로필 이미지 */
.profile-img {
    width: 28px !important;
    height: 28px !important;
    border-radius: 50% !important;
    object-fit: cover !important;
    display: inline-block;
}

/* 로그아웃 아이콘 버튼 */
.logout-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background-color: #f0f0f0;
    color: #444;
    font-size: 16px;
    text-decoration: none;
    transition: background-color 0.3s ease;
}

.logout-icon:hover {
    background-color: #ddd;
    color: #000;
}




/* 메인 줄 (로고 + 검색창 + 버튼) */
.main-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
    margin-bottom: 30px; /* 기존 15px → 30px */
}

/* 로고 영역 */
.logo-box {
    flex: 0 0 15%;
    height: 70px;
    background-color: #007bff;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    font-size: 28px;
    font-weight: bold;
    padding: 0 28px;
    margin-right: 16px;
}

/* 검색 영역 */
.search-bar {
    flex: 0 0 60%;
    display: flex;
    justify-content: center;
    margin: 10px 0;
}

.search-bar form {
    width: 100%;
    max-width: 600px;
    position: relative;
}

.search-input {
    width: 100%;
    height: 48px;
    padding: 0 40px 0 15px;
    border: 1px solid #ccc;
    border-radius: 20px;
    font-size: 17px;
    text-align: center;  /* 🔥 이거 추가 */
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
    transition: box-shadow 0.3s, border 0.3s;
}


.search-input:focus {
    border-color: #007bff;
    box-shadow: 0 0 8px rgba(0, 123, 255, 0.4);
    outline: none;
}

.search-bar form button.search-icon {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    font-size: 18px;
    color: #666;
    cursor: pointer;
}

.search-close-button {
    position: absolute;
    top: -10px;
    right: -10px;
    color: rgb(0, 0, 0);
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    font-size: 20px;
    cursor: pointer;
    z-index: 1000; /* 카드 위로 올라오게 */
}


.search-close-button:hover {
    color: #333;
}

/* 하단 메뉴 */
.bottom-nav {
    display: flex;
    justify-content: space-between;
    background: none;
    align-items: center;
    margin-top: 15px;
    flex-wrap: wrap;
}

.menu-button {
    font-size: 24px;
    padding: 8px 12px;
    background: none;
    border: none;
    color: #666;
    cursor: pointer;
}

/* 버튼들 */
.action-buttons {
    flex: 0 0 auto;
    display: flex;
    gap: 12px;
    flex-wrap: nowrap;
    margin-left: 16px;
}


.action-buttons .button {
    padding: 10px 18px;
    border-radius: 22px;
    font-size: 15px;
    font-weight: 600;
    border: 1px solid #007bff;
    background-color: white;
    color: #007bff;
    text-decoration: none;
    white-space: nowrap;
    transition: 0.3s;
}


.action-buttons .button:hover {
    background-color: #007bff;
    color: white;
}

.category-bar {
    display: flex;
    justify-content: center;
    padding: 20px 0;

    border-top: 1px solid #ddd;
    border-bottom: 1px solid #eee;
  }

  .category-menu {
    display: flex;
    align-items: center;
    gap: 32px;
    list-style: none;
    padding: 0;
    margin: 0;
  }
  


.category-menu li a {
    text-decoration: none;
    color: #333;
    font-weight: 500;
    transition: color 0.2s ease;
}

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


/* 드롭다운 스타일 */
.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-toggle {
    background-color: transparent;
    border: none;
    padding: 10px 15px;
    font-size: 16px;
    cursor: pointer;
    border-radius: 5px;
}

.dropdown-menu {
    display: none;
    position: absolute;
    top: 110%;
    left: 0;
    background-color: white;
    min-width: 180px;
    border: 1px solid #ddd;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    z-index: 999;
}

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

.dropdown-menu li a {
    display: block;
    padding: 10px 15px;
    color: #007bff;
    text-decoration: underline;
}

.dropdown-menu li a:hover {
    background-color: #f5f5f5;
}

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


/* -------------------------- */
/*         반응형 헤더        */
/* -------------------------- */
/* 모바일 반응형 - 메인 줄 */
@media (max-width: 768px) {
    .main-row {
        display: flex;
        flex-direction: column; /* 세로로 배치 */
        align-items: center; /* 가운데 정렬 */
        gap: 8px;
    }

    .logo-box {
        flex: 0 0 auto;
        font-size: 16px; /* 글자 크기 조정 */
        height: 50px;
        padding: 0 12px;
    }

    .search-bar {
        flex: 1 1 auto;
        margin: 0;
    }

    .search-bar form {
        width: 100%;
    }

    .action-buttons {
        flex: 0 0 auto;
        display: flex;
        flex-direction: column; /* 기본은 세로로 배치 */
        gap: 8px;
        margin-left: 0;
    }

    .action-buttons .button {
        padding: 6px 10px;
        font-size: 12px; /* 버튼 크기 줄이기 */
    }

    /* 버튼들만 가로로 배치 */
    .action-buttons {
        flex-direction: row; /* 버튼을 가로로 배치 */
        gap: 16px; /* 버튼 간 간격을 늘림 */
    }
}



/* -------------------------- */
/*         카드 섹션         */
/* -------------------------- */

section {
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
}

#platform-products {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
    box-sizing: border-box;
}

.card-container {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 20px;
    width: 100%;
    box-sizing: border-box;
}

.card {
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.08);
    padding: 15px;
    display: flex;
    flex-direction: column;
    justify-content: space-between; /* 콘텐츠 상하 배치 */
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    width: 100%;
    position: relative;
    min-height: 420px;
}

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

.card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 8px;
}

.image-wrapper {
    position: relative;
}

.wishlist-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: none;
    border: none;
    font-size: 22px;
    color: #ccc;
    cursor: pointer;
    z-index: 2;
    padding: 0;
    transition: color 0.3s ease;
}

.wishlist-btn:hover {
    color: #e60023;
}

.card-info {
    display: flex;
    flex-direction: column;
    align-items: center; /* 수평 중앙 정렬 */
    justify-content: center; /* 수직 중앙 정렬 */
    text-align: center; /* 텍스트 중앙 정렬 */
    gap: 8px;
    margin: 0 auto;
    padding: 0 8px;
    width: 100%; /* 너비를 100%로 고정하여 영역을 강제 */
}

.card-info h3 {
    font-size: 1em;
    font-weight: 600;
    line-height: 1.4;
    text-align: center;
    margin: 0; /* 자동 마진 제거 */
    width: 100%; /* 강제 너비 지정 */
    display: inline-block; /* 더 정확한 중앙 배치 */
}

.card-info p.price {
    color: #e60023;
    font-weight: bold;
    font-size: 0.9em;
    margin: 0;
}

.card-info .meta {
    display: flex;
    flex-direction: column; /* 항상 위아래로 정렬 */
    align-items: center;
    gap: 2px;
    margin-top: 4px;
}

/* 사용자 페이지 상품 카드 스타일 */
.main-product-list .card .card-info {
    display: flex;
    flex-direction: column;
    align-items: center; /* 수평 중앙 정렬 */
    justify-content: center; /* 수직 중앙 정렬 */
    text-align: center; /* 텍스트 중앙 정렬 */
    gap: 8px;
    margin: 0 auto;
    padding: 0 8px;
    width: 100%;
    background-color: #fff; /* 필요하다면 추가 */
}

.main-product-list .card .card-info h3 {
    font-size: 1.1em;
    color: #333;
    margin-bottom: 5px;
}

.main-product-list .card .price-info {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    text-align: left;
    flex-wrap: wrap;
}

.main-product-list .card .price-info .price {
    color: #e44d26;
    font-size: 1.2em;
    font-weight: bold;
    margin: 0;
}

.main-product-list .card .price-info .original-price {
    color: #777;
    font-size: 0.9em;
    text-decoration: line-through;
    margin: 0;
}

.main-product-list .card .price-info .discount-rate {
    background-color: #dc3545;
    color: white;
    padding: 3px 6px;
    border-radius: 5px;
    font-size: 0.8em;
    margin: 0;
}

.badge {
    display: inline-block;
    background-color: #f1f3f5;
    color: #555;
    padding: 3px 8px;
    font-size: 0.75em;
    border-radius: 12px;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.card a {
    margin-top: 20px; /* 위에 여백 추가 */
    display: block;
    text-align: center;
    padding: 8px 12px;
    color: white;
    background-color: #007BFF;
    text-decoration: none;
    border-radius: 4px;
    font-size: 0.9em;
    transition: background-color 0.3s ease;
}

.card a:hover {
    background-color: #0056b3;
}

@media (max-width: 600px) {
    .card-container {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); /* 최소 150px로 크기 조정 */
    }
}


/* 찜한 상품 텍스트 왼쪽 정렬 */
#wishlist-section h2 {
    text-align: left; /* 왼쪽 정렬 */
    font-family: 'Noto Sans KR', sans-serif; /* 플랫폼 제품과 동일한 글꼴 */
}
/* -------------------------- */
/*        섹션 타이틀        */
/* -------------------------- */

section h3 {
    font-size: 1.5rem;
    font-weight: 400;
    color: #333;
    margin: 1rem 0 0.5rem;
    padding-left: 20px;
    line-height: 1.3;
    text-align: left;
}

/* -------------------------- */
/*        페이지네이션        */
/* -------------------------- */

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 2rem 0;
    gap: 0.5rem;
    flex-wrap: nowrap; /* 기본은 줄바꿈 안 함 */
}

.pagination a {
    padding: 0.5rem 0.75rem;
    border-radius: 5px;
    background-color: white;
    color: #333;
    border: 1px solid #ccc;
    text-decoration: none;
    transition: 0.2s ease;
}

.pagination a:hover {
    background-color: #f2f2f2;
}

.pagination a.active {
    background-color: #3ED598;
    color: white;
    font-weight: bold;
    border: none;
}

/* ✅ 모바일 대응 */
@media (max-width: 600px) {
  .pagination {
    flex-wrap: wrap;
    gap: 0.3rem;
  }

  .pagination a {
    padding: 0.4rem 0.5rem;
    font-size: 0.85rem;
  }
}

@media (max-width: 400px) {
  .pagination {
    gap: 0.2rem;
  }

  .pagination a {
    padding: 0.3rem 0.4rem;
    font-size: 0.75rem;
  }
}



.login-popup {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
  }
  .login-popup.hidden {
    display: none;
  }
  .login-popup-content {
    background: #fff;
    padding: 30px 24px;
    border-radius: 12px;
    width: 360px;
    text-align: center;
    position: relative;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
  }
  .popup-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
  }
  .popup-logo img {
    width: 48px;
    height: 48px;
    margin-bottom: 16px;
  }
  .popup-title {
    font-size: 20px;
    margin: 0;
    font-weight: bold;
  }
  .popup-subtitle {
    font-size: 14px;
    color: #555;
    margin: 10px 0 20px;
  }
  .social-buttons {
    display: flex;
    flex-direction: column;
    justify-content: center; /* 세로 가운데 정렬 */
    align-items: center;
    height: 280px; /* 전체 높이 고정 (원래 4개 버튼 있을 때 기준) */
    gap: 12px;
  }
  .social-btn {
    display: inline-block;
    width: 280px;
    padding: 12px 0;
    font-size: 16px;
    border-radius: 6px;
    text-align: center;
    color: white;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.3s;
  }
  .social-btn.kakao {
    background-color: #FEE500;
    color: #000;
  }
  .social-btn.facebook {
    background-color: #1877F2;
  }
  .social-btn.naver {
    background-color: #03C75A;
  }
/* 구글 버튼 */
.social-btn.google {
    background-color: #db4437;
  }
  .popup-help {
    font-size: 12px;
    color: #999;
    margin-top: 16px;
  }
  .popup-help a {
    color: #007BFF;
    text-decoration: underline;
  }

/* 숨겨진 버튼이 자리는 차지하지만 안 보이게 */
.hidden-placeholder {
    visibility: hidden;
    pointer-events: none;
  }
/* ✅ 프로필 드롭다운 래퍼 */
.profile-dropdown {
    position: relative;
    display: inline-block;
  }
  
  /* ✅ 프로필 이미지 */
  .profile-img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    border: none;
    padding: 0;
    background: none;
    box-shadow: none;
    outline: none;
  }
  
  /* ✅ 드롭다운 메뉴 */
  .profile-dropdown-menu {
    display: none;
    position: absolute;
    top: 110%;
    right: 0;
    background-color: #fff;
    min-width: 180px;
    border: 1px solid #ddd;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 999;
    padding: 0;
    margin: 0;
    border-radius: 8px;
    list-style: none;
    text-align: center; /* ✅ 메뉴 전체 가운데 정렬 */
  }
  
  /* ✅ 드롭다운 열릴 때 */
  .profile-dropdown.open .profile-dropdown-menu {
    display: block;
  }
  
  /* ✅ 각 항목 구분선 */
  .profile-dropdown-menu li {
    border-bottom: 1px solid #eee;
  }
  
  .profile-dropdown-menu li:last-child {
    border-bottom: none;
  }
  
  /* ✅ 항목 링크 스타일 (가운데 정렬 포함) */
  .profile-dropdown-menu li a {
    display: block;
    width: 100%;
    padding: 12px 0; /* 좌우 여백 제거해서 정중앙 */
    text-decoration: none;
    color: #333;
    font-size: 14px;
    text-align: center; /* ✅ 가운데 정렬 핵심 */
    background: none;
    transition: background-color 0.2s ease;
  }
  
  /* ✅ 호버 효과 */
  .profile-dropdown-menu li a:hover {
    background-color: #f7f7f7;
  }
  

  