@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+KR:wght@400;700&display=swap');

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

:root {
    --main-color: #1E8B74;
    --sub-color: #FFD8E2;
    --accent-color: #FBE8A6;
    --background-color: #FFFDF8;
    --lavender-color: #C6B7F7;
    --text-color: #222222;
    --subtext-color: #707070;
    --shadow-color: rgba(0, 0, 0, 0.08);
    --font-family: 'Noto Sans KR', 'Pretendard', sans-serif;

    /* Fluid Font Sizes */
    --font-size-sm: clamp(0.8rem, 1.2vw, 0.9rem);
    --font-size-base: clamp(1rem, 1.5vw, 1.1rem);
    --font-size-md: clamp(1.2rem, 2vw, 1.5rem);
    --font-size-lg: clamp(1.5rem, 3vw, 2rem);
    --font-size-xl: clamp(2rem, 5vw, 3rem);
}

body {
    font-family: 'Noto Sans KR', sans-serif;
    background-color: var(--background-color);
    color: var(--text-color);
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    font-size: var(--font-size-base);
}

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

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

main {
    flex-grow: 1;
}

section {
    padding: 60px 0;
}

/* Header */
header {
    padding: 10px 0; /* 헤더 상하 패딩 조절 */
    background-color: var(--background-color);
    border-bottom: 1px solid #eee;
}

header .container {
    display: flex;
    align-items: center;
}

.header-right {
    display: flex;
    align-items: center;
}

.user-actions {
    display: flex;
    gap: 10px; /* 로그인, 회원가입 버튼 사이 간격 */
}

.user-actions .btn {
    padding: 8px 16px; /* 버튼 내부 여백 축소 */
    font-size: var(--font-size-sm);   /* 버튼 글자 크기 축소 */
    white-space: nowrap; /* 버튼 텍스트가 줄바꿈되지 않도록 설정 */
}

.user-menu-container {
    position: relative;
    display: inline-block;
    vertical-align: middle; /* 다른 버튼과 수직 정렬 */
}

.user-profile-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    background-color: white;
    border-radius: 10px;
    box-shadow: 0 4px 15px var(--shadow-color);
    padding: 15px;
    margin-top: 10px;
    width: 220px;
    z-index: 100;
    align-items: center;
    gap: 15px;
}
.user-profile-dropdown img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}
.user-profile-dropdown .user-info strong {
    display: block;
    font-weight: 700;
}
.user-profile-dropdown .user-info span {
    font-size: 13px;
    color: var(--subtext-color);
}

header .logo a {
    position: relative;
    top: 4px; /* 로고를 아래로 4px 이동 */
    display: inline-block; /* position 속성 적용을 위해 display 변경 */
}

header .logo svg {
    height: 55px; /* SVG 로고 높이 조절 */
}


header nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 30px;
}
header nav {
    flex-grow: 1; /* nav가 남은 공간을 모두 차지하도록 설정 */
}
header nav ul {
    justify-content: center; /* ul의 아이템들을 가운데 정렬 */
}

header nav ul li a {
    font-size: var(--font-size-base);
    font-weight: 700;
    color: var(--text-color);
    transition: color 0.3s;
}

header nav ul li a:hover {
    color: var(--main-color);
}

/* Footer */
footer {
    text-align: center;
    padding: 30px 0;
    background-color: #f8f8f8;
    color: var(--subtext-color);
    font-size: var(--font-size-sm);
}

footer p {
    margin-bottom: 0; /* Remove default bottom margin */
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 12px 28px;
    border-radius: 50px;
    background-color: var(--main-color);
    color: white;
    font-weight: 700;
    text-align: center;
    border: none;
    cursor: pointer;
    transition: background-color 0.3s;
}

.btn:hover {
    background-color: #28a78d;
}

.btn-accent {
    background-color: var(--accent-color);
    color: var(--text-color);
}

.btn-accent:hover {
    background-color: #fce28a;
}


/* Cards */
.card {
    background-color: white;
    border-radius: 20px;
    box-shadow: 0 4px 15px var(--shadow-color);
    padding: 25px;
    text-align: left; /* Changed from center to left */
    transition: transform 0.3s, box-shadow 0.3s;
}

.card:hover {
    transform: translateY(-10px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12);
}

.info-cards-section {
    padding-top: 100px; /* 카드 섹션 상단 패딩 추가 */
}

.info-cards-section .card {
    width: 180px; /* 6개 카드를 위해 너비 조정 */
    height: 180px; /* 세로값 180px으로 지정 */
    display: flex; /* Flexbox 활성화 */
    flex-direction: column; /* 자식 요소들을 세로로 정렬 */
    justify-content: center; /* 세로 가운데 정렬 */
    align-items: center; /* 가로 가운데 정렬 */
    text-align: center; /* 텍스트 가운데 정렬 */
}
.info-cards-section .card h3 {
    margin: 0 0 5px 0; /* 제목의 하단 마진 조정 */
    font-size: var(--font-size-sm); /* 메인 텍스트 크기 조정 */
}
.info-cards-section .card p {
    margin: 0; /* 단락의 기본 마진 제거 */
    font-size: var(--font-size-sm);
}
.info-cards-section .card .icon {
    margin-bottom: 10px; /* 아이콘과 제목 사이 간격 추가 */
}
.card-row {
  display: flex;
  justify-content: center;
  gap: 30px;
  margin-bottom: 20px; /* 인덱스 페이지 카드 섹션 하단 패딩을 줄임 */
}
.card .icon {
    font-size: 48px;
}

/* Hero Section */
.hero {
    padding: 60px 20px;
    background: linear-gradient(90deg, #FBE8A6, #FFD8E2);
    text-align: center;
}

.mobile-only-text {
    display: none; /* Hidden by default on desktop */
}

.hero .container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 40px;
    text-align: left; /* Reset text-align for the container contents */
}

.hero-text {
    width: 50%; /* 텍스트 영역 왼쪽 정렬 */
    text-align: left;
}

.hero-text h1 {
    font-size: var(--font-size-xl);
    font-weight: 700;
    margin-bottom: 20px;
    line-height: 1.3; /* flex 관련 정렬 속성 제거 */
}

.hero-text p {
    font-size: var(--font-size-md);
    color: var(--subtext-color);
    margin-bottom: 30px;
}

.hero-image img {
    max-width: 500px;
    border-radius: 20px;
}

.hero-visual img {
    max-width: 650px;
    border-radius: 20px;
}

.hero-image-icon {
    width: 80px; /* 이미지 크기를 80px로 확대 */
    height: auto;
    vertical-align: bottom;
    margin-right: 10px;
}

.hero h1 {
    font-size: var(--font-size-lg);
    font-weight: 700;
}

.hero-subtitle {
    font-size: var(--font-size-base); /* Smaller font size */
    color: var(--subtext-color);
    margin-top: -15px; /* Adjust spacing with h1 */
    margin-bottom: 30px;
}




/* Community / Tabs */
.community-section {
    padding-top: 30px; /* community-section 상단 패딩을 줄임 */
}

.tab-nav {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap; /* 공간 부족 시 다음 줄로 넘어가도록 설정 */
    align-items: center; /* 버튼들을 세로 가운데 정렬 */
    margin-bottom: 40px;
}

.tab-btn {
    padding: 8px 20px;
    font-size: var(--font-size-base);
    font-weight: 700;
    border-radius: 50px;
    background: transparent;
    border: 1px solid #ddd;    color: var(--subtext-color);
    cursor: pointer;
    transition: all 0.3s;
}

.tab-btn.active {
    background-color: var(--main-color);
    color: white;
    border-color: var(--main-color);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Q&A Section */
.qna-section {
    text-align: center;
    background-color: #F7FDFB;
    padding: 80px 20px;
    border-radius: 20px;
}

.qna-section h2 {
    font-size: var(--font-size-lg);
    margin-bottom: 20px;
}

.qna-input-group {
    display: flex;
    justify-content: center;
    max-width: 700px;
    margin: 0 auto 20px;
}

.qna-input-group input {
    flex-grow: 1;
    padding: 15px 25px;
    border-radius: 50px 0 0 50px;
    border: 1px solid #ddd;
    font-size: var(--font-size-base);
    outline: none;
}

.qna-input-group .btn {
    border-radius: 0 50px 50px 0;
}

#qna-result {
    max-width: 700px;
    margin: 30px auto 0;
    padding: 20px;
    background: white;
    border-radius: 15px;
    text-align: left;
    color: var(--subtext-color);
    min-height: 50px;
    border: 1px solid #eee;
}

/* Funeral Page Specific */
body.funeral-theme {
    --main-color: var(--lavender-color);
    --accent-color: #E6E0FF;
}

body.funeral-theme header .logo a,
body.funeral-theme header nav ul li a:hover {
    color: var(--lavender-color);
}

body.funeral-theme .btn {
    background-color: var(--lavender-color);
}
body.funeral-theme .btn:hover {
    background-color: #d4c7fa;
}
body.funeral-theme .tab-btn.active {
    background-color: var(--lavender-color);
    border-color: var(--lavender-color);
}
/* 배경 */
.pet-modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(3px);
  display: none; /* Changed from flex to none */
  justify-content: center;
  align-items: center;
  z-index: 999;
}

.pet-modal.show {
  display: flex;
}

/* 팝업 카드 */
.pet-modal-content {
  background: #fff;
  border-radius: 20px;
  width: 90%;
  max-width: 520px;
  height: 80vh;
  box-shadow: 0 10px 25px rgba(0,0,0,0.2);
  overflow: hidden;
  position: relative;
  animation: fadeIn 0.35s ease;
  display: flex;
  flex-direction: column;
}

/* 닫기 버튼 */
.close-btn {
  position: absolute;
  top: 14px;
  right: 16px;
  background: #f9f9f9;
  border: none;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  font-size: 20px;
  color: #777;
  cursor: pointer;
  transition: all 0.25s ease;
}
.close-btn:hover {
  background: #F25061;
  color: #fff;
}

/* 이미지 */
.pet-image {
  width: 100%;
  height: 200px;
  object-fit: cover;
  border-top-left-radius: 20px;
  border-top-right-radius: 20px;
}

/* 제목 */
.pet-title {
  text-align: center;
  color: #1E8B74;
  font-size: 1.6rem;
  margin: 12px 0 2px 0;
  font-weight: 700;
}
.pet-sub {
  text-align: center;
  color: #777;
  font-size: 0.95rem;
  margin-bottom: 8px;
}

/* 스크롤 영역 */
.scroll-area {
  flex: 1;
  overflow-y: auto;
  padding-bottom: 20px;
}

/* 스크롤바 스타일 */
.scroll-area::-webkit-scrollbar {
  width: 10px;
}
.scroll-area::-webkit-scrollbar-thumb {
  background-color: #FDE2BD;
  border-radius: 6px;
}
.scroll-area::-webkit-scrollbar-track {
  background-color: #fff5e6;
}

/* 별점 */
.rating-box {
  background: #FAFAFA;
  border: 1px solid #EEE;
  border-radius: 12px;
  padding: 14px 18px;
  margin: 0 20px 20px;
}
.rating-box div {
  display: flex;
  justify-content: space-between;
  font-size: 0.95rem;
  color: #444;
  margin: 6px 0;
}

/* 내용 섹션 */
.info-section {
  padding: 0 20px;
}
.info-section h3 {
  color: #1E8B74;
  font-size: 1rem;
  margin-top: 16px;
  margin-bottom: 4px;
  border-left: 4px solid #FFD8E2;
  padding-left: 8px;
}
.info-section p {
  color: #333;
  font-size: 0.92rem;
  line-height: 1.55;
}

/* 애니메이션 */
 @keyframes fadeIn {
  from { opacity: 0; transform: translateY(25px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Rescue Page Specific */
.rescue-section .section-title {
    text-align: center;
    margin-bottom: 40px;
}

.rescue-section .section-title h2 {
    font-size: 32px;
    margin-bottom: 10px;
}

.rescue-section .section-title p {
    font-size: 18px;
    color: var(--subtext-color);
}

.filter-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin-bottom: 40px;
}

.filter-btn {
    padding: 10px 25px;
    font-size: 16px;
    font-weight: 700;
    border-radius: 50px;
    background: transparent;
    border: 1px solid #ddd;
    color: var(--subtext-color);
    cursor: pointer;
    transition: all 0.3s;
}

.filter-btn.active {
    background-color: var(--main-color);
    color: white;
    border-color: var(--main-color);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Shelter Table */
.shelter-table {
    width: 100%;
    border-collapse: collapse;
    box-shadow: 0 4px 15px var(--shadow-color);
    border-radius: 10px;
    overflow: hidden;
    table-layout: fixed;
    word-wrap: break-word;
}

.shelter-table th:nth-child(1) { width: 20%; }
.shelter-table th:nth-child(2) { width: 70%; }
.shelter-table th:nth-child(3) { width: 20%; }

.shelter-table th, .shelter-table td {
    padding: 15px 20px;
    border-bottom: 1px solid #eee;
    text-align: left;
}

.shelter-table th {
    background-color: var(--main-color);
    color: white;
    font-weight: 700;
}

.shelter-table tbody tr:hover {
    background-color: #f5f5f5;
}

/* Pagination */
.pagination-container {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 30px;
    gap: 8px;
}

.shelter-table-section {
    padding: 60px 0;
    width: 100%;
}

.page-link {
    display: inline-block;
    padding: 8px 12px;
    border-radius: 5px;
    background-color: transparent;
    color: var(--text-color);
    font-weight: 700;
    text-align: center;
    border: none;
    cursor: pointer;
    transition: all 0.3s;
}

.page-link:hover {
    background-color: #f0f0f0;
    color: var(--main-color);
}

.page-link.active {
    background-color: var(--main-color);
    color: white;
    cursor: default;
}

.page-link.arrow {
    font-size: 18px;
}

/* Shelter Detail Modal Specific Styles (rescue.html) */
.shelter-modal-name {
    text-align: center;
    font-size: var(--font-size-lg);
    font-weight: 700;
    color: var(--main-color);
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--sub-color);
    /* This style is now applied to h3 inside .shelter-detail-modal-header */
    /* It will be overridden or removed */
}

.info-group {
    background-color: #f9f9f9;
    border-radius: 12px;
    padding: 15px 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);}

.info-group h4 {
    font-size: var(--font-size-md);
    font-weight: 700;
    color: var(--main-color);
    margin-top: 0;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
}

.info-group h4 i {
    margin-right: 10px;
    color: var(--accent-color); /* 아이콘에 강조 색상 적용 */
}

.info-item {
    display: flex;
    align-items: center; /* 아이콘과 텍스트를 중앙 정렬 */
    font-size: var(--font-size-base);
    color: var(--text-color);
    margin-bottom: 8px;
    line-height: 1.4;
}

.info-item i {
    margin-right: 10px;
    color: var(--subtext-color);
    font-size: 16px;
    flex-shrink: 0; /* 아이콘이 줄어들지 않도록 방지 */
}

.info-item strong {
    font-weight: 700;
    margin-right: 5px;
}

.info-group .note {
    font-size: 13px;
    color: var(--subtext-color);
    margin-top: 15px;
    padding-top: 10px;
    border-top: 1px dashed #eee;
    text-align: left;
}

.modal-actions {
    text-align: center;
    margin-top: 30px;
}

.btn-call {
    background-color: var(--main-color);
    color: white;
    padding: 12px 25px;
    border-radius: 50px;
    font-size: 16px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: background-color 0.3s;
}

.btn-call:hover {
    background-color: #28a78d;
}

.shelter-detail-modal-map-container {
    padding: 0 25px; /* Match body padding */
    margin-top: 25px;
}

#shelter-modal-map {
    width: 100%;
    height: 220px;
    border-radius: 12px;
    background-color: #f9f9f9;
    border: 1px solid #eee;
    display: flex;
    justify-content: center;
    align-items: center;
}

.map-loading-text {
    font-size: 15px;
    color: var(--subtext-color);
    font-weight: 700;
}

/* --- Shelter Detail Modal Styles (for rescue.html) --- */
.shelter-detail-modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.55);
    backdrop-filter: blur(3px);
    display: none; /* Hidden by default */
    justify-content: center;
    align-items: center; /* Center vertically */
    z-index: 9999; /* Ensure it's on top of everything */
}

.shelter-detail-modal.show {
    display: flex;
}

.shelter-detail-modal-content {
    background: #fff;
    border-radius: 20px;
    max-width: 550px; /* Slightly smaller for a more focused look */
    width: 90%;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
    position: relative;
    animation: fadeIn 0.35s ease;
    display: flex;
    flex-direction: column;
    overflow: hidden; /* Ensures rounded corners apply to children */
    height: auto; /* Adjust height based on content */
    max-height: 90vh; /* Prevent modal from exceeding viewport height */
}

.shelter-detail-modal-header {
    background-color: var(--main-color); /* Header background */
    color: white;
    padding: 20px 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
}

.shelter-detail-modal-header .shelter-modal-name {
    /* This is the h3 inside the header */
    margin: 0;
    font-size: 26px; /* Larger title */
    font-weight: 700;
    color: white; /* White text for header */
    text-align: left; /* Align title to left */
    border-bottom: none; /* Remove border from here */
    padding-bottom: 0;
    margin-left: 0; /* Reset negative margins */
    margin-right: 0;
    padding-left: 0;
    padding-right: 0;
}

.close-shelter-detail-btn {
    background: transparent;
    border: none;
    font-size: 32px; /* Larger close button */
    color: rgba(255, 255, 255, 0.8); /* White with transparency */
    cursor: pointer;
    transition: color 0.25s ease;
    padding: 0;
    line-height: 1;
}

.close-shelter-detail-btn:hover {
    color: white; /* Solid white on hover */
}

.shelter-detail-modal-body {
    padding: 25px; /* Padding for the body content */
    overflow-y: auto; /* Enable scrolling for content */
    flex-grow: 1; /* Allow body to take available space */
}

/* Re-apply info-group styles within the new modal body structure */
.shelter-detail-modal-body .info-group {
    background-color: #f9f9f9;
    border-radius: 12px;
    padding: 15px 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.shelter-detail-modal-body .info-group h4 {
    font-size: 18px;
    font-weight: 700;
    color: var(--main-color);
    margin-top: 0;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
}

.shelter-detail-modal-body .info-group h4 i {
    margin-right: 10px;
    color: var(--accent-color);
}

.shelter-detail-modal-body .info-item {
    display: flex;
    align-items: flex-start; /* Align icon and text to top */
    font-size: 15px;
    color: var(--text-color);
    margin-bottom: 8px;
    line-height: 1.4;
}

.shelter-detail-modal-body .info-item i {
    margin-right: 10px;
    color: var(--subtext-color);
    font-size: 16px;
    flex-shrink: 0;
    padding-top: 2px; /* Adjust icon vertical alignment */
}

.shelter-detail-modal-body .info-item strong {
    font-weight: 700;
    margin-right: 5px;
}

.shelter-detail-modal-body .info-group .note {
    font-size: 13px;
    color: var(--subtext-color);
    margin-top: 15px;
    padding-top: 10px;
    border-top: 1px dashed #eee;
    text-align: left;
}

.shelter-detail-modal-body .modal-actions {
    text-align: center;
    margin-top: 30px;
}

/* Animal Cards Section */
.animal-cards-section {
    padding-top: 60px; /* Reduced from 40px */
    padding-bottom: 80px;
    text-align: center;
}

.animal-cards-section h2 {
    font-size: var(--font-size-lg);
    margin-bottom: 10px;
    color: var(--main-color);
}

.section-subtitle {
    font-size: var(--font-size-base);
    color: var(--subtext-color);
    margin-top: 0;
    margin-bottom: 40px;
}

/* 데스크톱/모바일 서브타이틀 표시 제어 */
.desktop-subtitle {
    display: block;
}

.mobile-subtitle {
    display: none;
}

.animal-cards-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr); /* 5 cards per row */
    gap: 20px; /* Gap between cards */
    margin-bottom: 30px;
}

.animal-card {
    background-color: white;
    border-radius: 15px;
    box-shadow: 0 4px 15px var(--shadow-color);
    padding: 15px;
    text-align: center;
    transition: transform 0.3s, box-shadow 0.3s;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 240px; /* Set a fixed height */
    width: 100%; /* Ensure card fills its grid cell */
    box-sizing: border-box; /* Include padding in width calculation */
    min-width: 0; /* Prevent content from expanding the card width */
}

.animal-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}

.animal-card img {
    width: 100%;
    height: 160px; /* Fixed height for images */
    object-fit: cover; /* Cover the area, crop if necessary */
    border-radius: 10px;
    margin-bottom: 10px;
}

.animal-card h3 {
    font-size: 16px;
    color: var(--text-color);
    margin: 5px 0 0 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.animal-card p {
    font-size: 13px;
    color: var(--subtext-color);
    margin: 0;
    max-width: 100%;
    line-height: 1.4;
    height: calc(1.4em * 2); /* 2 lines based on font size */
    /* Allow up to 2 lines of text before truncating */
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    line-clamp: 2; /* 표준 속성 */
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

/* Pagination for Animal Cards (reusing existing .pagination-container styles but ensuring it's distinct if needed) */
#animal-cards-pagination {
    justify-content: center; /* Center the pagination for animal cards */
    margin-top: 20px;
}

/* Responsive adjustments */
@media (max-width: 1200px) {
    .animal-cards-grid {
        grid-template-columns: repeat(4, 1fr); /* 4 cards per row on smaller screens */
    }
}

@media (max-width: 992px) {
    .animal-cards-grid {
        grid-template-columns: repeat(3, 1fr); /* 3 cards per row */
    }
}

@media (max-width: 768px) {
    .animal-cards-grid {
        display: block; /* 그리드 대신 블록 레이아웃 */
        gap: 0;
        margin-bottom: 20px;
        overflow: hidden;
        position: relative;
    }
    .animal-cards-section {
        padding-top: 30px;
        padding-bottom: 40px;
    }
    .animal-cards-section h2 {
        font-size: 24px;
        margin-bottom: 8px;
    }
    .section-subtitle {
        font-size: 14px;
        margin-bottom: 25px;
        padding: 0 10px;
    }
    .desktop-subtitle {
        display: none;
    }
    .mobile-subtitle {
        display: block;
    }
    .animal-card {
        width: 100%;
        max-width: 100%;
        margin: 0 auto 20px;
        padding: 0;
        height: auto;
        min-height: auto;
        border-radius: 20px;
        overflow: hidden;
        box-shadow: none;
        cursor: grab;
        user-select: none;
        touch-action: pan-y;
    }
    .animal-card:active {
        cursor: grabbing;
    }
    .animal-card-image {
        width: 100%;
        aspect-ratio: 1 / 1; /* 1:1 비율 */
        overflow: hidden;
        position: relative;
        display: flex;
        align-items: center;
        justify-content: center;
        background-color: #f0f0f0;
    }
    .animal-card-image img {
        width: 100%;
        height: 100%;
        min-width: 100%;
        min-height: 100%;
        object-fit: cover;
        object-position: center;
        display: block;
        flex-shrink: 0;
    }
    .animal-card-content {
        padding: 20px;
        background: white;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
    .animal-card-title {
        font-size: 22px;
        font-weight: 700;
        color: var(--main-color);
        margin: 0 0 20px 0;
        text-align: center;
    }
    .animal-info-grid {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
        margin-bottom: 15px;
    }
    .animal-info-item {
        display: flex;
        flex-direction: column;
        padding: 8px 6px;
        background: #f8f9fa;
        border-radius: 6px;
        text-align: center;
    }
    .animal-info-item .info-label {
        font-size: 10px;
        color: var(--subtext-color);
        margin-bottom: 4px;
        font-weight: 600;
    }
    .animal-info-item .info-value {
        font-size: 13px;
        color: var(--text-color);
        font-weight: 500;
        word-break: keep-all;
    }
    .animal-info-full {
        display: flex;
        flex-direction: column;
        padding: 12px;
        background: #f8f9fa;
        border-radius: 8px;
        margin-bottom: 12px;
    }
    .animal-info-full .info-label {
        font-size: 12px;
        color: var(--subtext-color);
        margin-bottom: 6px;
        font-weight: 600;
    }
    .animal-info-full .info-value {
        font-size: 14px;
        color: var(--text-color);
        line-height: 1.5;
    }
    .animal-shelter-info {
        margin-top: 20px;
        padding-top: 20px;
        border-top: 2px solid #e9ecef;
    }
    .animal-shelter-info h4 {
        font-size: 18px;
        font-weight: 700;
        color: var(--main-color);
        margin: 0 0 15px 0;
    }
    .animal-card img {
        height: auto;
        margin-bottom: 0;
    }
    .animal-card h3 {
        font-size: 14px;
    }
    .animal-card p {
        font-size: 12px;
    }
    /* 모바일에서 페이지네이션 숨김 */
    #animal-cards-pagination {
        display: none !important;
    }
}

@media (max-width: 576px) {
    .animal-cards-grid {
        margin-bottom: 15px;
    }
    .animal-cards-section {
        padding-top: 25px;
        padding-bottom: 35px;
    }
    .animal-cards-section h2 {
        font-size: 20px;
        margin-bottom: 6px;
    }
    .section-subtitle {
        font-size: 13px;
        margin-bottom: 20px;
        padding: 0 15px;
        line-height: 1.5;
    }
    .animal-card {
        margin-bottom: 15px;
        border-radius: 15px;
    }
    .animal-card-image {
        aspect-ratio: 1 / 1; /* 1:1 비율 */
    }
    .animal-card-content {
        padding: 15px;
    }
    .animal-card-title {
        font-size: 20px;
        margin-bottom: 15px;
    }
    .animal-info-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
        margin-bottom: 12px;
    }
    .animal-info-item {
        padding: 8px 6px;
    }
    .animal-info-item .info-label {
        font-size: 10px;
    }
    .animal-info-item .info-value {
        font-size: 12px;
    }
    .animal-info-full {
        padding: 10px;
        margin-bottom: 10px;
    }
    .animal-info-full .info-label {
        font-size: 11px;
    }
    .animal-info-full .info-value {
        font-size: 13px;
    }
    .animal-shelter-info {
        margin-top: 15px;
        padding-top: 15px;
    }
    .animal-shelter-info h4 {
        font-size: 16px;
        margin-bottom: 12px;
    }
    #animal-cards-pagination {
        margin-top: 15px;
    }
}

@media (max-width: 480px) {
    .animal-cards-grid {
        margin-bottom: 12px;
    }
    .animal-cards-section h2 {
        font-size: 18px;
    }
    .section-subtitle {
        font-size: 12px;
        padding: 0 10px;
    }
    .animal-card {
        margin-bottom: 12px;
        border-radius: 12px;
    }
    .animal-card-image {
        aspect-ratio: 1 / 1; /* 1:1 비율 */
    }
    .animal-card-content {
        padding: 12px;
    }
    .animal-card-title {
        font-size: 18px;
        margin-bottom: 12px;
    }
    .animal-info-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 6px;
    }
    .animal-info-item {
        padding: 6px 4px;
    }
    .animal-info-item .info-label {
        font-size: 9px;
    }
    .animal-info-item .info-value {
        font-size: 11px;
    }
    .animal-info-full {
        padding: 10px;
    }
    .animal-info-full .info-label {
        font-size: 11px;
    }
    .animal-info-full .info-value {
        font-size: 12px;
    }
    .animal-shelter-info h4 {
        font-size: 15px;
    }
}

/* --- Animal Detail Modal --- */
.detail-modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(4px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    padding: 20px;
}



.hamburger-menu {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, rgba(30, 139, 116, 0.08) 0%, rgba(251, 232, 166, 0.08) 100%);
    border: none;
    border-radius: 12px;
    cursor: pointer;
    padding: 0;
    position: relative;
    z-index: 100;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 8px rgba(30, 139, 116, 0.1);
}

.hamburger-menu:hover {
    background: linear-gradient(135deg, rgba(30, 139, 116, 0.15) 0%, rgba(251, 232, 166, 0.15) 100%);
    box-shadow: 0 4px 12px rgba(30, 139, 116, 0.2);
    transform: scale(1.05);
}

.hamburger-menu:active {
    transform: scale(0.95);
}

.hamburger-menu span {
    display: block;
    width: 20px;
    height: 2.5px;
    background: linear-gradient(90deg, #1E8B74 0%, #33A18A 100%);
    border-radius: 2px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: absolute;
    left: 12px;
}

.hamburger-menu span:nth-child(1) {
    top: 13px;
}

.hamburger-menu span:nth-child(2) {
    top: 20.5px;
    width: 16px;
    opacity: 1;
}

.hamburger-menu span:nth-child(3) {
    top: 28px;
}

.hamburger-menu:hover span:nth-child(2) {
    width: 20px;
}

.hamburger-menu.active span:nth-child(1) {
    transform: rotate(45deg);
    top: 20.5px;
}

.hamburger-menu.active span:nth-child(2) {
    opacity: 0;
    transform: translateX(10px);
}

.hamburger-menu.active span:nth-child(3) {
    transform: rotate(-45deg);
    top: 20.5px;
}

.mobile-nav {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #FFFDF8 0%, #F8FBF9 100%);
    z-index: 999;
    padding: 80px 20px 30px;
    text-align: center;
    overflow-y: auto;
    box-sizing: border-box;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.mobile-nav.active {
    display: block;
    animation: fadeIn 0.3s ease forwards;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.mobile-nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.mobile-nav nav ul {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    padding: 0;
    list-style: none;
    max-width: 500px;
    margin: 0 auto;
}

.mobile-nav nav ul li {
    margin-bottom: 0;
}

.mobile-nav nav ul li a {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: white;
    border: 2px solid transparent;
    border-radius: 16px;
    padding: 20px 8px;
    min-height: 90px;
    font-size: 13px;
    font-weight: 700;
    color: var(--text-color);
    box-shadow: 0 4px 12px rgba(30, 139, 116, 0.08);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.mobile-nav nav ul li a::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(30, 139, 116, 0.05) 0%, rgba(251, 232, 166, 0.05) 100%);
    opacity: 0;
    transition: opacity 0.4s ease;
}

.mobile-nav nav ul li a:hover::before,
.mobile-nav nav ul li a.active::before {
    opacity: 1;
}

.mobile-nav nav ul li a:active {
    transform: scale(0.95);
}

.mobile-nav nav ul li a:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(30, 139, 116, 0.15);
    border-color: rgba(30, 139, 116, 0.2);
}

.mobile-nav nav ul li a.active {
    background: linear-gradient(135deg, rgba(30, 139, 116, 0.1) 0%, rgba(251, 232, 166, 0.1) 100%);
    border-color: var(--main-color);
    color: var(--main-color);
    box-shadow: 0 6px 16px rgba(30, 139, 116, 0.2);
}

.mobile-nav nav {
    margin-bottom: 30px;
}

/* 사용자 액션 버튼 스타일 개선 */
.mobile-nav .user-actions {
    margin-top: 40px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: stretch;
    max-width: 320px;
    margin-left: auto;
    margin-right: auto;
}

.mobile-nav .user-actions .btn {
    width: 100%;
    padding: 16px 24px;
    border-radius: 14px;
    font-size: 15px;
    font-weight: 700;
    box-shadow: 0 4px 12px rgba(30, 139, 116, 0.15);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 2px solid transparent;
}

.mobile-nav .user-actions .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(30, 139, 116, 0.25);
}

.mobile-nav .user-actions .btn:active {
    transform: translateY(0);
}

.mobile-nav .user-actions .btn-accent {
    background: linear-gradient(135deg, var(--accent-color) 0%, #FFE8B6 100%);
    color: var(--text-color);
    box-shadow: 0 4px 12px rgba(251, 232, 166, 0.3);
}

.mobile-nav .user-actions .btn-accent:hover {
    box-shadow: 0 6px 16px rgba(251, 232, 166, 0.45);
}

/* 로그아웃 및 마이페이지 버튼 */
.mobile-nav .user-actions #logout-button {
    background: linear-gradient(135deg, #f5f5f5 0%, #e8e8e8 100%);
    color: var(--subtext-color);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.mobile-nav .user-actions #logout-button:hover {
    background: linear-gradient(135deg, #e8e8e8 0%, #dcdcdc 100%);
    color: var(--text-color);
}

/* 사용자 메뉴 컨테이너 */
.mobile-nav .user-menu-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
}

.mobile-nav .user-menu-container .btn {
    width: 100%;
}

.mobile-nav .user-profile-dropdown {
    display: flex !important;
    position: relative;
    background: white;
    border-radius: 14px;
    padding: 16px;
    margin-top: 0;
    box-shadow: 0 4px 12px rgba(30, 139, 116, 0.1);
    border: 2px solid rgba(30, 139, 116, 0.1);
}

.mobile-nav .user-profile-dropdown img {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: 2px solid var(--main-color);
}

.mobile-nav .user-profile-dropdown .user-info {
    text-align: left;
    flex: 1;
}

.mobile-nav .user-profile-dropdown .user-info strong {
    font-size: 16px;
    color: var(--text-color);
}

.mobile-nav .user-profile-dropdown .user-info span {
    font-size: 13px;
    color: var(--subtext-color);
}


/* General Responsive Styles */
@media (max-width: 1200px) {
    .container {
        max-width: 960px;
    }
}

@media (max-width: 992px) {
    .container {
        max-width: 720px;
    }

    .header-right {
        display: none; /* Hide nav, user actions */
    }

    .hamburger-menu {
        display: flex; /* Show hamburger menu */
    }

    .hero .container {
        flex-direction: column;
        text-align: center;
        align-items: center; /* Center flex items horizontally */
    }

    .hero-text, .hero-visual {
        width: 100%;
        text-align: center;
    }

    .hero-text {
        text-align: center;
    }

    .card-row {
        flex-wrap: wrap;
    }

    .hero-visual img {
        width: 100%;
        height: auto;
    }
}

@media (min-width: 993px) { /* Apply to desktop screens */
    header nav ul li a {
        font-size: 0.95rem; /* Slightly smaller than 1rem to 1.1rem */
    }
} /* Closing brace for @media (min-width: 993px) */

@media (max-width: 768px) {
    .container {
        max-width: 540px;
        padding-bottom: 0; /* Remove bottom padding */
        height: auto; /* Adjust height to fit content */
        min-height: unset; /* Remove any minimum height constraints */
    }

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

    .qna-input-group {
        flex-direction: column;
    }

    .qna-input-group input {
        border-radius: 50px;
        margin-bottom: 10px;
    }

    .qna-input-group .btn {
        border-radius: 50px;
    }

    #menu_wrap {
        position: static;
        width: 100%;
        margin-bottom: 20px;
    }

    /* 모바일 보호소 테이블 스타일 */
    .shelter-table-section {
        padding: 30px 0;
    }

    .table-header-container {
        display: flex;
        flex-direction: column;
        gap: 15px;
        align-items: stretch;
    }

    .table-header-container .search-container {
        width: 100% !important;
    }

    .table-header-container #search-input {
        font-size: 14px !important;
        padding: 12px 15px !important;
    }

    .map-instruction-text {
        font-size: 13px;
        color: var(--subtext-color);
        text-align: center;
        margin: 0;
    }

    /* 테이블을 카드 형태로 변경 */
    .shelter-table {
        display: block;
        box-shadow: none;
        border-radius: 0;
        overflow: visible;
    }

    .shelter-table thead {
        display: none;
    }

    .shelter-table tbody {
        display: block;
    }

    .shelter-table tbody tr {
        display: block;
        background-color: white;
        border-radius: 12px;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
        margin-bottom: 15px;
        padding: 15px;
        border: 1px solid #eee;
        transition: transform 0.2s, box-shadow 0.2s;
    }

    .shelter-table tbody tr:hover {
        transform: translateY(-2px);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
        background-color: white;
    }

    .shelter-table tbody tr td {
        display: block;
        padding: 8px 0;
        border-bottom: none;
        text-align: left;
        font-size: 14px;
    }

    .shelter-table tbody tr td:first-child {
        font-weight: 700;
        font-size: 16px;
        color: var(--main-color);
        margin-bottom: 8px;
        padding-top: 0;
        cursor: pointer;
    }

    .shelter-table tbody tr td:nth-child(2) {
        color: var(--text-color);
        line-height: 1.5;
        margin-bottom: 6px;
    }

    .shelter-table tbody tr td:nth-child(2)::before {
        content: "📍 ";
        margin-right: 4px;
    }

    .shelter-table tbody tr td:nth-child(3) {
        color: var(--subtext-color);
        font-size: 13px;
    }

    .shelter-table tbody tr td:nth-child(3)::before {
        content: "📞 ";
        margin-right: 4px;
    }

    .pagination-container {
        margin-top: 20px;
        flex-wrap: wrap;
        gap: 6px;
    }

    .page-link {
        padding: 6px 10px;
        font-size: 14px;
    }

    /* 모바일에서 shelter-search 이미지 숨김 */
    .shelter-search-image {
        display: none;
    }

    .shelter-search-title {
        text-align: center;
        line-height: 1.4;
    }

    /* 모바일에서 shelter-search-section 패딩 조정 */
    .shelter-search-section {
        padding: 5px 0 20px 0;
    }

}

@media (max-width: 576px) {
    .card-grid {
        grid-template-columns: 1fr;
    }

    /* 작은 모바일 화면 보호소 테이블 추가 조정 */
    .shelter-table-section {
        padding: 25px 0;
    }

    .shelter-table tbody tr {
        padding: 12px;
        margin-bottom: 12px;
        border-radius: 10px;
    }

    .shelter-table tbody tr td:first-child {
        font-size: 15px;
    }

    .shelter-table tbody tr td {
        font-size: 13px;
    }

    .shelter-table tbody tr td:nth-child(3) {
        font-size: 12px;
    }

    .table-header-container #search-input {
        font-size: 13px !important;
        padding: 10px 12px !important;
    }

    .map-instruction-text {
        font-size: 12px;
    }

    .page-link {
        padding: 5px 8px;
        font-size: 13px;
    }
}


.detail-modal.show {
    display: flex;
}

.detail-modal-content {
    background: white;
    border-radius: 15px;
    width: 100%;
    max-width: 650px;
    max-height: 90vh;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    position: relative;
    animation: fadeIn 0.3s ease;
    display: flex;
    flex-direction: column;
}

.detail-modal .close-btn {
    position: absolute;
    top: 10px;
    right: 15px;
    background: none;
    border: none;
    font-size: 30px;
    color: #999;
    cursor: pointer;
    transition: color 0.2s;
    z-index: 10;
}

.detail-modal .close-btn:hover {
    color: #333;
}

.detail-modal-body {
    padding: 30px;
    overflow-y: auto;
}

.animal-detail-img {
    width: 100%;
    height: 300px;
    object-fit: cover;
    border-radius: 10px;
    margin-bottom: 20px;
    background-color: #f0f0f0;
}

.detail-modal-body h2 {
    font-size: var(--font-size-lg);
    margin: 0 0 15px 0;
    color: var(--main-color);
    line-height: 1.3;
}

.detail-modal-body .info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.detail-modal-body .info-item {
    background: #f9f9f9;
    padding: 12px;
    border-radius: 8px;
    border: 1px solid #eee;
}

.detail-modal-body .info-item strong {
    display: block;
    color: var(--subtext-color);
    font-size: 13px;
    margin-bottom: 4px;
    font-weight: normal;
}

.detail-modal-body .info-item span {
    font-size: 16px;
    font-weight: 700;
}

.detail-modal-body .info-item-full {
    background: #f9f9f9;
    padding: 12px;
    border-radius: 8px;
    border: 1px solid #eee;
    margin-top: 15px;
}

.detail-modal-body .info-item-full strong {
    display: block;
    color: var(--subtext-color);
    font-size: 13px;
    margin-bottom: 4px;
    font-weight: normal;
}

.detail-modal-body .info-item-full span {
    font-size: 16px;
    line-height: 1.5;
}

.detail-modal-body hr {
    border: none;
    border-top: 1px solid #eee;
    margin: 25px 0;
}

.detail-modal-body h4 {
    font-size: 20px;
    color: var(--main-color);
    margin: 0 0 15px 0;
}

.animal-card-text {
    width: 100%;
    text-align: center;
}

/* Hospital Page Specific */
.map_wrap {
    position: relative;
    width: 100%;
    min-height: 500px; /* Adjust as needed */
}

#menu_wrap {
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    width: 300px;
    margin: 0;
    padding: 5px;
    overflow-y: hidden; /* Remove scrollbar */
    background: #fff;
    z-index: 1;
    font-size: 12px;
    border-radius: 10px;
    box-shadow: 0 4px 15px var(--shadow-color);
}

#placesList {
    list-style: none;
    padding: 0;
    margin: 0;
}

#placesList .item {
    padding: 10px;
    border-bottom: 1px solid #eee;
    cursor: pointer;
}

#placesList .item:hover {
    background-color: #f9f9f9;
}

#placesList .item .info {
    padding-left: 40px;
}

#placesList .item h5 {
    font-size: 14px;
    font-weight: 700;
    margin: 0 0 5px 0;
}

#placesList .item span {
    display: block;
    font-size: 12px;
    color: var(--subtext-color);
}

#placesList .item .tel {
    color: var(--main-color);
    font-weight: 700;
}

#pagination {
    margin-top: 10px;
    text-align: center;
}

#pagination a {
    display: inline-block;
    padding: 5px 10px;
    border: 1px solid #ddd;
    margin: 0 2px;
    border-radius: 5px;
    color: var(--text-color);
    text-decoration: none;
}

#pagination a.on {
    background-color: var(--main-color);
    color: white;
    border-color: var(--main-color);
}

/* Pet Health Info Section */
.health-info-section {
    padding: 40px 0;
    background-color: #F7FDFB;
}

.health-info-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
}

.health-card {
    background-color: white;
    border-radius: 15px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s;
    display: flex;
    flex-direction: column;
}

.health-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
}

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

.health-card-content {
    padding: 20px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.health-card-content h3 {
    font-size: var(--font-size-md);
    font-weight: 700;
    margin: 0 0 10px 0;
    color: var(--text-color);
}

.health-card-content p {
    font-size: var(--font-size-base);
    color: var(--subtext-color);
    line-height: 1.6;
    margin: 0;
    flex-grow: 1;
}

.health-card-content .read-more {
    margin-top: 15px;
    font-size: 14px;
    font-weight: 700;
    color: var(--main-color);
    text-decoration: none;
    align-self: flex-end;
}

.health-card-content .read-more:hover {
    text-decoration: underline;
}

@media (max-width: 992px) {
    .health-info-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .health-info-grid {
        grid-template-columns: 1fr;
    }
}


.health-cards-navigation {
    padding: 40px 0;
    background-color: #f8f8f8;
    border-top: 1px solid #eee;
    text-align: center;
}

.health-cards-navigation h2 {
    font-size: 24px;
    color: var(--main-color);
    margin-bottom: 30px;
}

.card-list-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
}

.health-mini-card {
    background-color: white;
    border: 1px solid #ddd;
    border-radius: 10px;
    padding: 15px 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    flex: 0 0 auto; /* Prevent cards from growing/shrinkin */
    width: 200px; /* Fixed width for mini cards */
    text-align: center;
}

.health-mini-card:hover {
    border-color: var(--main-color);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-3px);
}

.health-mini-card.active {
    background-color: var(--main-color);
    color: white;
    border-color: var(--main-color);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
}

.health-mini-card.active h3 {
    color: white;
}

.health-mini-card h3 {
    font-size: var(--font-size-base);
    font-weight: 700;
    margin: 0;
    color: var(--text-color);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* rescue.html shelter search */
.shelter-search-content {
    text-align: center;
}

.shelter-search-title {
    color: var(--main-color);
    font-size: 28px;
}

/* rescue.html shelter search image */
.shelter-search-image {
    width: 20%;
    height: auto;
}

/* Slide-over Panel Styles */
.modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.55);
    backdrop-filter: blur(3px);
    display: block; /* 항상 보이도록 설정, 가시성은 visibility와 transform으로 제어 */
    visibility: hidden;
    opacity: 0;
    transition: visibility 0s 0.3s, opacity 0.3s ease;
    z-index: 999;
}
.modal.show {
    visibility: visible;
    opacity: 1;
    transition: visibility 0s, opacity 0.3s ease;
}
.modal-content {
    position: absolute;
    top: 0;
    right: 0;
    width: 100%;
    max-width: 520px; /* 패널 너비 */
    height: 100%;
    background: #fff;
    box-shadow: -5px 0 25px rgba(0,0,0,0.15);
    transform: translateX(100%);
    transition: transform 0.35s ease;
    display: flex;
    flex-direction: column;
    overflow: hidden; /* 모달 콘텐츠가 넘치지 않도록 */
}
.modal.show .modal-content {
    transform: translateX(0);
}
.modal-header {
    padding: 20px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative; /* For close button positioning */
}
.modal-header h3 {
    margin: 0;
    font-size: 22px; /* 약간 작게 조정 */
}
.modal-body {
    padding: 20px;
    overflow-y: auto;
    flex-grow: 1;
}
#modal-map {
    width: 100%;
    height: 250px;
    border-radius: 10px;
    margin-bottom: 20px;
}

/* 모바일 모달 하단 목록보기 버튼 */
.modal-footer-mobile {
    display: none; /* 기본적으로 숨김 */
    padding: 20px;
    border-top: 1px solid #eee;
    background: #fff;
    margin-top: auto; /* flex container에서 하단으로 밀어냄 */
    flex-shrink: 0; /* 크기 고정 */
}

.btn-list-view {
    width: 100%;
    padding: 14px 20px;
    background-color: transparent;
    color: var(--main-color);
    border: 2px solid #f0f0f0;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.1s, color 0.2s, border-color 0.2s;
}

.btn-list-view:hover {
    background-color: var(--main-color);
    color: white;
    border-color: var(--main-color);
}

.btn-list-view:active {
    transform: scale(0.98);
    background-color: #1a7a65;
    border-color: #1a7a65;
}

/* 모바일에서만 목록보기 버튼 표시 */
@media (max-width: 768px) {
    .modal-footer-mobile {
        display: flex; /* flex로 변경하여 정렬 */
        align-items: center;
        justify-content: center;
    }
    
    .modal-body {
        padding-bottom: 0; /* footer가 있으므로 불필요 */
        overflow-y: auto; /* 스크롤 가능하도록 */
    }
}

/* New About Pettopia Section */
#about-pettopia {
  background: linear-gradient(180deg, #fffdf9 0%, #f9f5f1 100%);
  padding: 80px 0;
  border-top: 1px solid #f0e8e1;
}
.about-container {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 50px;
  align-items: center;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 20px;
}
.about-text h2 {
  font-size: 2rem;
  line-height: 1.4;
  color: #2d2d2d;
  margin-bottom: 20px;
}
.about-text h2 span {
  color: #2fb27a;
  font-weight: 700;
}
.about-text .intro {
  color: #666;
  font-size: 1rem;
  line-height: 1.8;
  margin-bottom: 35px;
}
.about-features {
  display: grid;
  grid-template-columns: 1fr;
  gap: 22px;
  margin-bottom: 35px;
}
.feature {
  display: grid;
  grid-template-columns: 50px 1fr;
  align-items: start;
  background: #fff;
  border-radius: 16px;
  padding: 18px 20px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.05);
  transition: transform .2s ease;
}
.feature:hover {
  transform: translateY(-4px);
}
.feature .icon {
  font-size: 1.8rem;
  margin-top: 2px;
}
.feature h3 {
  margin: 0 0 5px;
  color: #333;
  font-size: 1.05rem;
}
.feature p {
  color: #666;
  font-size: 0.9rem;
  line-height: 1.6;
  margin: 0;
}
.about-text .closing {
  margin-top: 40px;
  color: #4a4a4a;
  font-size: 1rem;
  line-height: 1.8;
  border-top: 1px dashed #e4dad0;
  padding-top: 25px;
  font-style: italic;
}
.about-visual img {
  width: 100%;
  border-radius: 16px;
  box-shadow: 0 8px 25px rgba(0,0,0,0.08);
}
.about-visual .stats {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: 15px;
}
.about-visual .stats div {
  flex: 1;
  background: #fff;
  border-radius: 10px;
  border: 1px solid #eee;
  text-align: center;
  padding: 10px;
  font-size: 0.85rem;
  box-shadow: 0 4px 10px rgba(0,0,0,0.04);
}
.about-visual .stats strong {
  display: block;
  color: #2d2d2d;
  font-weight: 600;
}
.about-visual .stats span {
  color: #777;
  font-size: 0.8rem;
}
 @media (max-width: 960px) {
  .about-container {
    grid-template-columns: 1fr;
    gap: 40px;
  }
}

.footer-links {
    text-align: center;
    padding: 0 0 20px 0; /* Remove top padding, keep bottom padding */
    background-color: #f8f8f8;
}

.footer-links ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-links li {
    display: inline-block;
    margin: 0 15px;
}

.footer-links a {
    color: #6b6b6b;
    font-size: var(--font-size-sm);
    text-decoration: none;
}

.footer-links a:hover {
    text-decoration: underline;
}

/* New About Pettopia Section */
#about-pettopia {
  background: linear-gradient(180deg, #fffdf9 0%, #f9f5f1 100%);
  padding: 80px 0;
  border-top: 1px solid #f0e8e1;
}
.about-container {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 50px;
  align-items: center;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 20px;
}
.about-text h2 {
  font-size: 2rem;
  line-height: 1.4;
  color: #2d2d2d;
  margin-bottom: 20px;
}
.about-text h2 span {
  color: #2fb27a;
  font-weight: 700;
}
.about-text .intro {
  color: #666;
  font-size: 1rem;
  line-height: 1.8;
  margin-bottom: 35px;
}
.about-features {
  display: grid;
  grid-template-columns: 1fr;
  gap: 22px;
  margin-bottom: 35px;
}
.feature {
  display: grid;
  grid-template-columns: 50px 1fr;
  align-items: start;
  background: #fff;
  border-radius: 16px;
  padding: 18px 20px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.05);
  transition: transform .2s ease;
}
.feature:hover {
  transform: translateY(-4px);
}
.feature .icon {
  font-size: 1.8rem;
  margin-top: 2px;
}
.feature h3 {
  margin: 0 0 5px;
  color: #333;
  font-size: 1.05rem;
}
.feature p {
  color: #666;
  font-size: 0.9rem;
  line-height: 1.6;
  margin: 0;
}
.about-text .closing {
  margin-top: 40px;
  color: #4a4a4a;
  font-size: 1rem;
  line-height: 1.8;
  border-top: 1px dashed #e4dad0;
  padding-top: 25px;
  font-style: italic;
}
.about-visual img {
  width: 100%;
  border-radius: 16px;
  box-shadow: 0 8px 25px rgba(0,0,0,0.08);
}
.about-visual .stats {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: 15px;
}
.about-visual .stats div {
  flex: 1;
  background: #fff;
  border-radius: 10px;
  border: 1px solid #eee;
  text-align: center;
  padding: 10px;
  font-size: 0.85rem;
  box-shadow: 0 4px 10px rgba(0,0,0,0.04);
}
.about-visual .stats strong {
  display: block;
  color: #2d2d2d;
  font-weight: 600;
}
.about-visual .stats span {
  color: #777;
  font-size: 0.8rem;
}
 @media (max-width: 960px) {
  .about-container {
    grid-template-columns: 1fr;
    gap: 40px;
  }
}

.footer-links {
    text-align: center;
    padding: 0 0 20px 0; /* Remove top padding, keep bottom padding */
    background-color: #f8f8f8;
}

.footer-links ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-links li {
    display: inline-block;
    margin: 0 15px;
}

.footer-links a {
    color: #6b6b6b;
    font-size: var(--font-size-sm);
    text-decoration: none;
}

.footer-links a:hover {
    text-decoration: underline;
}

/* Terms Page Specific Styles */
.terms-section {
    max-width: 800px;
    margin: 40px auto;
    padding: 30px;
    background-color: white;
    border-radius: 15px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    line-height: 1.7;
    color: var(--text-color);
}

.terms-section h1 {
    font-size: var(--font-size-lg);
    color: var(--main-color);
    text-align: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--sub-color);
}

.terms-section .update-date {
    text-align: right;
    font-size: var(--font-size-sm);
    color: var(--subtext-color);
    margin-bottom: 30px;
}

.terms-section h2 {
    font-size: var(--font-size-md);
    color: var(--main-color);
    margin-top: 40px;
    margin-bottom: 15px;
    border-left: 5px solid var(--accent-color);
    padding-left: 15px;
}

.terms-section h3 {
    font-size: var(--font-size-md);
    color: var(--text-color);
    margin-top: 30px;
    margin-bottom: 10px;
}

.terms-section p {
    margin-bottom: 1em;
}

.terms-section ul {
    list-style: disc;
    margin-left: 20px;
    margin-bottom: 1em;
    padding-left: 0;
}

.terms-section ul li {
    margin-bottom: 0.5em;
}

/* 현재 활성화된 네비게이션 링크 스타일 */
header nav ul li a.active {
    color: var(--main-color);
    font-weight: 700;
}

/* Table styles for terms and privacy pages */
.terms-section table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
}

.terms-section th,
.terms-section td {
    border: 1px solid #ddd;
    padding: 10px;
    text-align: left;
}

/* Default styles for desktop */
.desktop-only-text {
    display: inline;
}
.mobile-only-text {
    display: none;
}
.desktop-only-text-p {
    display: inline;
}
.mobile-only-text-p {
    display: none;
}

@media (max-width: 768px) {
    .hero h1 {
        font-size: 1.8rem !important; /* Adjust as needed for mobile */
    }
    .desktop-only-text {
        display: none !important;
    }
    .mobile-only-text {
        display: inline !important; /* Ensure it's visible on mobile */
        font-weight: bold !important;
    }
    .desktop-only-text-p {
        display: none !important;
    }
    .mobile-only-text-p {
        display: inline !important;
    }

    /* Hide slider arrows on mobile */
    .slider-arrow {
        display: none !important;
    }

    /* Adjust cards-container for grid layout */
    .cards-container {
        display: block !important; /* Ensure it's a block element */
        overflow-x: hidden; /* Disable horizontal scrolling */
        padding: 20px 0; /* Remove left/right padding */
    }

    /* Display two cards per row using CSS Grid */
    .cards {
        display: grid !important; /* Ensure it's a grid container */
        grid-template-columns: repeat(2, 1fr); /* Two columns, equal width */
        gap: 12px; /* Gap between cards, as requested */
        padding: 0; /* Remove padding from .cards */
        /* flex-wrap, justify-content are not needed here as grid handles it */
    }

    .card {
        width: auto; /* Let grid handle width */
        max-width: none; /* Remove max-width constraint */
        margin-bottom: 0; /* Grid gap handles spacing, remove flex margin */
        flex-shrink: 0; /* Ensure no shrinking */
        flex-grow: 0; /* Ensure no growing */
        aspect-ratio: 1 / 1; /* Make the card itself 1:1 */
        display: flex; /* Use flex to center content vertically if needed */
        flex-direction: column; /* Stack content vertically */
        justify-content: flex-start; /* Align content to the start */
        align-items: stretch; /* Allow items to stretch to fill width */
        padding: 10px; /* Adjust padding for smaller cards */
        overflow: hidden; /* Hide any overflowing content within the card */
    }
    .card img {
        width: 100%; /* Image takes full width of the card */
        height: auto; /* Let aspect-ratio handle height */
        aspect-ratio: 1 / 1; /* Make the image 1:1 */
        object-fit: cover; /* Ensure image covers the area */
        border-radius: 10px; /* Slightly smaller border-radius for smaller cards */
    }
    .card h3 {
        overflow: hidden;
        white-space: nowrap;
        text-overflow: ellipsis;
        text-align: center; /* Center the heading text */
        margin: 5px 0; /* Adjust margin */
    }
    .card p {
        display: none; /* Hide the description on mobile */
    }
}

/* Mobile responsiveness for horizontal scrolling */
@media (max-width: 768px) {
    .container {
        max-width: 540px;
        padding-bottom: 0; /* Remove bottom padding */
    }

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

    .qna-input-group {
        flex-direction: column;
    }

    .qna-input-group input {
        border-radius: 50px;
        margin-bottom: 10px;
    }

    .qna-input-group .btn {
        border-radius: 50px;
    }

    #menu_wrap {
        position: static;
        width: 100%;
        margin-bottom: 20px;
    }
    .community-section .container {
        height: 160px; /* Set fixed height for community section container on mobile */
    }
    .hospital-layout {
        flex-direction: column;
    }
    #map-container {
        width: 100%;
        position: static;
        height: 400px;
    }
    #list-container {
        width: 100%;
    }
    .hero-visual {
        display: none; /* Hide hero image on mobile */
    }

    html, body, section, div, main, header, footer {
        max-width: 100%;
        overflow-x: hidden;
    }

    img, video {
        max-width: 100%;
        height: auto; /* Maintain aspect ratio */
    }

    .card-row {
        display: grid;
        grid-template-columns: repeat(3, 1fr); /* 3 cards per row */
        gap: 10px; /* Reduced gap for 3 columns */
    }

    .info-cards-section .card {
        width: 100px; /* Slightly smaller size */
        height: 100px; /* Slightly smaller size */
        padding: 10px; /* Adjust padding for new size */
        box-shadow: none; /* Remove shadow on mobile */
    }
    .info-cards-section .card h3 {
        font-size: 0.7rem; /* Adjusted font size */
    }
    .info-cards-section .card p {
        font-size: 0.6rem; /* Adjusted font size */
    }
    .info-cards-section .card .icon {
        font-size: 18px; /* Adjusted icon size to prevent overflow */
        margin-bottom: 5px;
    }

    .info-cards-section {
        padding-top: 20px; /* Ensure equal top padding */
        padding-bottom: 20px; /* Ensure equal bottom padding */
    }

    .card-row {
        margin-bottom: 10px; /* Reduced bottom margin */
    }

    .community-section {
        border-top: 1px solid #eee; /* Separator line */
        padding-top: 20px; /* Space above separator */
        padding-bottom: 10px; /* Further reduced bottom padding */
    }

    .tab-nav {
        flex-direction: column; /* One button per line */
        gap: 10px; /* Adjusted gap for text links */
        overflow-x: hidden; /* No horizontal scrolling needed for column layout */
        padding: 0; /* Remove all padding */
        justify-content: center; /* Center the column of buttons */
        align-items: flex-start; /* Align items to the start for left alignment */
        flex-wrap: nowrap; /* Prevent wrapping */
        margin-bottom: 0; /* Remove empty space at the bottom */
    }

    .tab-btn {
        padding: 10px 0; /* Add vertical padding */
        font-size: 0.85rem; /* 텍스트 크기 줄임 */
        font-weight: normal; /* 굵기 제거 */
        background: none;
        border: none;
        border-radius: 0;
        box-shadow: none;
        width: 100%; /* Take full width */
        max-width: none; /* Remove max-width */
        text-align: left; /* Left-align text */
        white-space: nowrap; /* Prevent wrapping */
        overflow: hidden; /* Hide overflow */
        text-overflow: ellipsis; /* Add ellipsis for overflow */
    }

    .tab-btn:not(:last-child) {
        border-bottom: 1px solid #eee; /* Add separator lines between items */
    }

    .mobile-only-text {
        display: inline; /* Show on mobile */
        font-weight: normal; /* Make descriptive text normal weight */
    }

    .info-cards-section .icon {
        display: block; /* Restore icons on mobile */
    }
    .desktop-only-icon {
        display: none; /* Keep desktop-only icons hidden on mobile */
    }
}

.terms-section th {
    background-color: #f2f2f2;
    font-weight: bold;
}

/* Contact Page Specific Styles */
.contact-section {
    max-width: 700px;
    margin: 40px auto;
    padding: 30px;
    background-color: white;
    border-radius: 15px;
}

/* Daily Tip Section */
.daily-tip {
background: linear-gradient(180deg, #faf6f2 0%, #f9f5f1 100%);
border-top: 1px solid #f0e8e1;
padding: 80px 0;
}


.daily-tip-container {
max-width: 1100px;
margin: 0 auto;
display: flex;
align-items: center;
justify-content: space-between;
    flex-wrap: wrap;
    gap: 50px;}


.daily-tip-text {
flex: 1 1 550px;
}


.daily-tip-text h2 {
font-size: 28px;
margin-bottom: 20px;
color: #1E8B74;
font-weight: 700;
}


.daily-tip-text .tip-desc {
font-size: 17px;
color: #444;
line-height: 1.8;
margin-bottom: 25px;
}


.tip-btn {
display: inline-block;
background-color: #F25061;
color: #fff;
padding: 10px 24px;
border-radius: 30px;
font-weight: 600;
text-decoration: none;
transition: background 0.3s ease;
}


.tip-btn:hover {
background-color: #d63f51;
}


.daily-tip-image {
flex: 1 1 500px;
text-align: right;
}


.daily-tip-image img {
width: 100%;
max-width: 500px;
border-radius: 18px;
box-shadow: 0 4px 16px rgba(0,0,0,0.1);
}

.contact-section h1 {
    font-size: var(--font-size-lg);
    color: var(--main-color);
    text-align: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--sub-color);
}

.contact-intro {
    text-align: center;
    color: var(--subtext-color);
    margin-bottom: 30px;
    font-size: var(--font-size-base);
}

.contact-form .form-group {
    margin-bottom: 20px;
}

.contact-form label {
    display: block;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--text-color);
}

.contact-form input[type="text"],
.contact-form input[type="email"],
.contact-form textarea {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: var(--font-size-base);
    color: var(--text-color);
    box-sizing: border-box; /* Include padding in width */
    transition: border-color 0.3s, box-shadow 0.3s;
}

.contact-form input[type="text"]:focus,
.contact-form input[type="email"]:focus,
.contact-form textarea:focus {
    border-color: var(--main-color);
    box-shadow: 0 0 0 3px rgba(30, 139, 116, 0.2);
    outline: none;
}

.contact-form textarea {
    resize: vertical; /* Allow vertical resizing */
    min-height: 120px;
}

.contact-form .btn {
    width: 100%;
    padding: 15px;
    font-size: var(--font-size-md);
    border-radius: 8px;
    margin-top: 10px;
}

.form-message {
    text-align: center;
    margin-top: 20px;
    padding: 10px;
    border-radius: 8px;
    font-weight: 700;
}

.form-message.success {
    background-color: #e6ffe6;
    color: #1e8b74;
    border: 1px solid #1e8b74;
}

.form-message.error {
    background-color: #ffe6e6;
    color: #cc0000;
    border: 1px solid #cc0000;
}

/* Responsive adjustments for contact page */
@media (max-width: 768px) {
    .contact-section {
        margin: 20px auto;
        padding: 20px;
    }
}

/* Responsive adjustments for terms page */
@media (max-width: 768px) {
    .terms-section {
        margin: 20px auto;
        padding: 20px;
    }

    .terms-section h1 {
        font-size: var(--font-size-lg);
    }

    .terms-section h2 {
        font-size: var(--font-size-md);
    }

    .terms-section h3 {
        font-size: var(--font-size-base);
    }
}
.hospital-guide {
  background: linear-gradient(120deg, #f9fffb, #fff);
  padding: 80px 0;
  border-top: 1px solid #eee;
}

.guide-container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 20px;
  text-align: center;
}

.hospital-guide h2 {
  font-size: 30px;
  color: #1E8B74;
  font-weight: 700;
  margin-bottom: 20px;
}

.guide-intro {
  font-size: 17px;
  color: #444;
  line-height: 1.8;
  margin-bottom: 50px;
}

.guide-list {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 30px;
}

.guide-card {
  flex: 1 1 320px;
  background-color: #fff;
  border: 1px solid #e8f2ee;
  border-radius: 16px;
  padding: 0 0 30px 0;
  box-shadow: 0 4px 12px rgba(0,0,0,0.05);
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  text-align: left;
}

.guide-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 6px 16px rgba(0,0,0,0.08);
}

.guide-img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  border-bottom: 1px solid #eee;
}

.guide-card h3 {
  font-size: 20px;
  color: #1E8B74;
  margin: 20px 0 15px 25px;
}

.guide-card ul {
  list-style: none;
  padding: 0 25px;
  margin: 0;
}

.guide-card li {
  font-size: 15px;
  color: #555;
  margin-bottom: 10px;
  padding-left: 16px;
  position: relative;
}

.guide-card li::before {
  content: '•';
  color: #F25061;
  font-weight: bold;
  position: absolute;
  left: 0;
}

.guide-footer {
  margin-top: 60px;
  font-size: 16px;
  color: #333;
  line-height: 1.8;
}

.guide-footer .empathy {
  margin-top: 10px;
  color: #1E8B74;
  font-weight: 600;
  font-size: 17px;
}

/* --- Mobile Top Nav --- */
.mobile-top-nav {
    display: none; /* Hidden by default on desktop */
}

@media (max-width: 768px) {
    /* Hide existing header and show mobile nav */
    header {
        display: none;
    }

    .mobile-top-nav {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 50px;
        background-color: #fff;
        border-bottom: 1px solid #eee;
        display: flex;
        align-items: center;
        padding: 0 15px;
        z-index: 1000;
        transition: box-shadow 0.3s;
        box-sizing: border-box;
    }

    .mobile-top-nav.scrolled {
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    }

    .mobile-hamburger-menu {
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        width: 44px;
        height: 44px;
        background: linear-gradient(135deg, rgba(30, 139, 116, 0.08) 0%, rgba(251, 232, 166, 0.08) 100%);
        border: none;
        border-radius: 12px;
        cursor: pointer;
        padding: 0;
        z-index: 1001;
        flex-shrink: 0;
        position: relative;
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: 0 2px 8px rgba(30, 139, 116, 0.1);
    }

    .mobile-hamburger-menu:hover {
        background: linear-gradient(135deg, rgba(30, 139, 116, 0.15) 0%, rgba(251, 232, 166, 0.15) 100%);
        box-shadow: 0 4px 12px rgba(30, 139, 116, 0.2);
        transform: scale(1.05);
    }

    .mobile-hamburger-menu:active {
        transform: scale(0.95);
    }

    .mobile-hamburger-menu span {
        display: block;
        width: 20px;
        height: 2.5px;
        background: linear-gradient(90deg, #1E8B74 0%, #33A18A 100%);
        border-radius: 2px;
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        position: absolute;
        left: 12px;
    }

    .mobile-hamburger-menu span:nth-child(1) {
        top: 13px;
    }

    .mobile-hamburger-menu span:nth-child(2) {
        top: 20.5px;
        width: 16px;
        opacity: 1;
    }

    .mobile-hamburger-menu span:nth-child(3) {
        top: 28px;
    }

    /* 호버 시 중간 라인 애니메이션 */
    .mobile-hamburger-menu:hover span:nth-child(2) {
        width: 20px;
    }

    /* 활성화 상태 애니메이션 (햄버거 → X) */
    .mobile-hamburger-menu.active span:nth-child(1) {
        transform: rotate(45deg);
        top: 20.5px;
    }

    .mobile-hamburger-menu.active span:nth-child(2) {
        opacity: 0;
        transform: translateX(10px);
    }

    .mobile-hamburger-menu.active span:nth-child(3) {
        transform: rotate(-45deg);
        top: 20.5px;
    }

    .mobile-logo-text {
        font-weight: 900;
        font-size: 24px;
        color: var(--main-color);
        margin: 0 15px;
        flex-shrink: 0;
    }

    .mobile-tabs-container {
        display: flex;
        flex-grow: 1;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    .mobile-tabs-container::-webkit-scrollbar {
        display: none;
    }

    .mobile-tab {
        flex: 0 0 auto;
        padding: 15px 12px;
        font-size: 15px;
        font-weight: 700;
        color: var(--subtext-color);
        text-decoration: none;
        white-space: nowrap;
        position: relative;
        transition: color 0.3s;
    }

    .mobile-tab.active {
        color: var(--main-color);
    }

    .mobile-tab.active::after {
        content: '';
        position: absolute;
        bottom: 0;
        left: 50%;
        transform: translateX(-50%);
        width: calc(100% - 24px);
        height: 3px;
        background-color: var(--main-color);
        border-radius: 3px 3px 0 0;
    }

    /* Hide the original hamburger menu that was part of header.html */
    .hamburger-menu {
        display: none;
    }

    /* Add padding to the top of the body to prevent content from being hidden */
    body {
        padding-top: 50px;
    }
}

/* Hide mobile-hamburger-menu on desktop */
@media (min-width: 769px) {
    .mobile-hamburger-menu {
        display: none;
    }
}

.mobile-br {
    display: none; /* Hide by default */
}

/* Mobile-specific styles for about-pettopia section */
@media (max-width: 768px) {
    #about-pettopia .about-text h2 {
        text-align: center;
        font-size: 1.5rem; /* 폰트 크기를 한 단계 줄임 */
    }
    .emoji-mobile-hide {
        display: none;
    }
    #about-pettopia {
        padding-top: 40px; /* about-pettopia 상단 패딩을 줄임 */
    }
    .mobile-br {
        display: inline; /* Make it visible on mobile */
    }
    .mobile-br::before {
        content: '\A'; /* Insert a newline character */
        white-space: pre; /* Preserve whitespace, including newlines */
    }
    .daily-tip-image {
        flex: none; /* Remove flex sizing */
        width: 320px; /* Set fixed width */
        height: 175px; /* Set fixed height */
        margin: 0 auto; /* Center the image container */
        overflow: hidden; /* Explicitly prevent scrolling on the image container */
    }
    .daily-tip-image img {
        width: 100%; /* Make image fill its container */
        height: 100%; /* Make image fill its container */
        object-fit: cover; /* Ensure image covers the area */
    }
    .daily-tip-container {
        overflow: hidden; /* Prevent scrolling on the container */
        gap: 20px; /* 간격 줄임 */
    }
    .daily-tip-text h2 {
        text-align: center; /* 오늘의 반려 팁 가운데 정렬 */
        font-size: 24px; /* 폰트 사이즈 줄임 */
    }
    .daily-tip-text .tip-desc {
        padding-left: 20px;
        padding-right: 20px;
        text-align: justify; /* 양쪽 정렬 */
    }
    .tip-btn {
        padding: 8px 16px; /* 사이즈 줄임 */
        font-size: 0.9rem; /* 폰트 사이즈 줄임 */
        display: block; /* 블록 요소로 변경 */
        width: fit-content; /* 내용에 맞게 너비 조정 */
        margin-left: auto; /* 오른쪽 정렬 */
        margin-right: 20px; /* 오른쪽 패딩 */
    }
    .daily-tip {
        padding-top: 40px; /* 상단 패딩 줄임 */
    }
    #about-pettopia {
        padding-bottom: 40px; /* 하단 패딩 줄임 */
    }
    .info-cards-section .card {
        width: 110px; /* 카드 사이즈 약간 크게 */
        height: 110px; /* 카드 사이즈 약간 크게 */
    }
    .card-row {
        gap: 5px; /* 사이 간격 줄임 */
    }

    /* 작은 모바일 화면용 네비게이션 조정 */
    .mobile-nav nav ul {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .mobile-nav nav ul li a {
        padding: 18px 8px;
        min-height: 85px;
        font-size: 12px;
    }

    .mobile-nav .user-actions {
        max-width: 280px;
    }

    .mobile-nav .user-actions .btn {
        padding: 14px 20px;
        font-size: 14px;
    }
}

/* 아주 작은 화면 (최적화) */
@media (max-width: 360px) {
    .mobile-nav nav ul {
        gap: 8px;
    }

    .mobile-nav nav ul li a {
        padding: 15px 6px;
        min-height: 75px;
        font-size: 11px;
    }

    .mobile-nav .user-actions {
        max-width: 260px;
    }
}

/* 모바일 푸터 스타일 */
@media (max-width: 768px) {
    footer {
        padding: 25px 15px;
        text-align: center;
    }
    
    footer .container {
        padding: 0 15px;
    }
    
    footer p {
        font-size: 12px;
        margin-bottom: 15px;
        line-height: 1.5;
    }
    
    .footer-links {
        padding: 0;
        margin-top: 15px;
    }
    
    .footer-links ul {
        display: grid;
        grid-template-columns: repeat(4, 1fr);
        grid-template-rows: repeat(2, auto);
        gap: 8px 5px;
        padding: 0;
        margin: 0;
        max-width: 100%;
    }
    
    .footer-links li {
        display: block;
        margin: 0;
        text-align: center;
    }
    
    .footer-links a {
        display: block;
        padding: 6px 2px;
        font-size: 11px;
        color: #6b6b6b;
        text-decoration: none;
        word-break: keep-all;
        line-height: 1.4;
    }
    
    .footer-links a:hover {
        color: var(--main-color);
        text-decoration: underline;
    }
}

/* 모바일 카카오맵 공통 스타일 */
@media (max-width: 768px) {
    #map {
        width: 100%;
        min-height: 350px !important;
    }
    
    /* 모바일에서 마켓 링크 숨김 (관리자만 데스크톱에서 볼 수 있음) */
    #market-link,
    .mobile-nav #market-link,
    #mobile-market-link,
    .mobile-top-nav #mobile-market-link,
    .mobile-top-nav a[href="market.html"] {
        display: none !important;
    }
}