/* Global Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: Arial, sans-serif;
}

body {
    background-color: #f9f9f9;
    overflow-y: scroll;
}

h2 {
    font-size: 1.2rem;
    margin-bottom: 1rem;
    color: #9f5913;
}

p {
    font-size: 0.9rem;
    color: #777;
}

/* 공통 너비 스타일 */
.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 20px;
    box-sizing: border-box;
}

/* Navbar (상단 네비게이션) */
.navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 0.5rem; /* 높이를 키움 */
    background-color: #fff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
    /*width: 90%;*/
}

.navbar .home {
    font-size: 1.2rem; /* 글자 크기 키움 */
    cursor: pointer;
    color: #333;
    font-weight: bold;
    margin-left: 10px;
}

.navbar .search-container {
    display: flex;
    align-items: center;
    gap: 12px; /* 검색창과 버튼 사이 간격 */
    flex-grow: 1;
    margin: 0 1rem;
    justify-content: center;
}

.navbar .search-container input {
    width: 70%;
    max-width: 400px;
    padding: 0.8rem; /* 높이 키움 */
    border: 1px solid #ddd;
    border-radius: 5px;
    outline: none;
    font-size: 1rem; /* 글자 크기 키움 */
}

.navbar .search-container button {
    display: inline-flex; /* 가로로 정렬 */
    justify-content: center;
    align-items: center;
    padding: 0.5rem 1rem; /* 높이와 너비 조정 */
    border: none;
    background-color: #9f5913;
    color: white;
    font-size: 13px; /* 글자 크기 */
    font-weight: bold;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.navbar .search-container button:hover {
    background-color: #9b5e20;
}

/* Category Section */
.category-section {
    padding: 0.5rem;
    background-color: #fff;
    /*margin-top: 1rem;*/
    border-radius: 10px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    justify-content: center; /* 가로로 가운데 정렬 */
    align-items: center;     /* 세로로 가운데 정렬 */
    text-align: center;      /* 텍스트 가운데 정렬 */
}

.category-container {
    display: flex;
    flex-wrap: wrap; /* 줄바꿈 허용 */
    gap: 10px; /* 버튼 간 간격 */
    overflow-y: auto; /* 가로 스크롤 허용 */
    max-height: calc(2 * 40px + 20px); /* 두 줄 높이 제한 (버튼 높이와 간격에 따라 설정) */
    padding: 10px 0;
    white-space: normal; /* 텍스트 줄바꿈 허용 */
    scroll-behavior: smooth; /* 부드러운 스크롤 */
    box-sizing: border-box;
}

.category-container::-webkit-scrollbar {
    height: 8px; /* 스크롤바 높이 */
}

.category-container::-webkit-scrollbar-thumb {
    background-color: #ccc; /* 스크롤바 색상 */
    border-radius: 4px;
}

.category-container::-webkit-scrollbar-track {
    background-color: #f0f0f0; /* 스크롤바 트랙 색상 */
}

.category-button {
    padding: 10px 15px;
    background-color: #f0f4f8;
    border-radius: 20px;
    font-size: 0.9rem;
    color: #333;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.2s;
}

.category-button:hover {
    background-color: #d9e6f2;
    transform: scale(1.05);
}

/* Product Section */
.product-section {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    padding: 0.5rem;
    justify-content: center;
}

.product-card {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 10px;
    padding: 1rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    text-align: center;
    width: calc(20% - 1rem); /* 기본: 한 줄에 5개 */
    transition: 0.3s;
}

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

.product-image {
    width: 150px;
    height: 150px;
    border-radius: 10px;
    margin-bottom: 1rem;
}

.product-shipping {
    font-size: 0.8rem;
    color: #28A745;
}

.product-name {
    font-size: 0.8rem;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .product-card {
        width: calc(25% - 1rem);
    }
}

@media (max-width: 992px) {
    .product-card {
        width: calc(33.33% - 1rem);
    }
}

@media (max-width: 768px) {
    .product-card {
        width: calc(48.3% - 0rem);
    }
    .product-image {
        width: 160px;
        height: 160px;
    }
}

@media (max-width: 480px) {
    .product-card {
        width: calc(47% - 0rem);
    }
    .product-image {
        width: 130px;
        height: 130px;
    }
}

/* 하단 네비게이션 */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    background-color: #fff;
    box-shadow: 0 -2px 4px rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: space-around; /* 수평 가운데 정렬 */
    align-items: center;
    padding: 1rem 0;
    gap: 2rem; /* 아이템 간 간격 추가 */
    text-align: center; /* 텍스트 중앙 정렬 */
    right: 0;
    margin: 0 auto;
    border-radius: 10px;
}

.bottom-nav .nav-item {
    font-size: 1rem; /* 글자 크기 키움 */
    text-align: center;
    cursor: pointer;
    color: #333;
    transition: color 0.3s;
}

.bottom-nav .nav-item:hover {
    color: #9b5e20;
}

.nav-item a {
    font-size: 0.9rem; /* 글자 크기 */
    text-align: center;
    color: #333;
    text-decoration: none; /* 링크 밑줄 제거 */
    transition: color 0.3s;
}

.nav-item a:hover {
    color: #9b5e20; /* 링크 호버 색상 */
}

@media (max-width: 768px) {
    .category-menu {
        flex-direction: row;
        overflow-x: auto;
        white-space: nowrap;
        padding: 10px 0;
    }

    .category-menu a {
        flex: none;
    }

    .product-info h3 {
        font-size: 0.9rem;
    }
}


/* 상품 상세페이지 컨테이너 */
.product-detail-section {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    padding: 2rem 0;
    background-color: #fff;
    border-radius: 10px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* 상품 정보 및 이미지 */
.product-detail-container {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.product-image-container {
    /*flex: 1 1 40%;*/
    text-align: center;
}

.product-detail-image {
    width: 100%;
    max-width: 350px;
    border-radius: 10px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.product-info-container {
    flex: 1 1 50%;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-right: 10px;
}

/* 반응형 테이블 컨테이너: 컨테이너 너비에 맞춰 자동 스크롤 */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch; /* 터치 스크롤 부드럽게 */
}

/* 상품 정보 테이블 기본 스타일 */
.product-info-table {
  width: 100%;
  max-width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
  table-layout: auto; /* 내용에 맞게 열 너비 자동 조정 */
}

/* 표 제목 (caption) 스타일 */
.product-info-table caption {
  font-weight: bold;
  padding-bottom: 0.5rem;
  text-align: left;
}

/* th, td 기본 스타일 */
.product-info-table th,
.product-info-table td {
  padding: 12px 15px;
  text-align: left;
  border: 1px solid #ddd;
}

/* 작은 화면 대응 */
@media (max-width: 768px) {
  .product-info-table th,
  .product-info-table td {
    padding: 8px 10px;
    font-size: 14px;
  }
}

.product-title {
    font-size: 1rem;
    font-weight: bold;
    color: #333;
    margin-bottom: 0.5rem;
}

.product-keyword {
    font-size: 1rem;
    color: #9f5913;
}

.product-description {
    font-size: 1rem;
    color: #777;
    line-height: 1.5;
}

.product-price-container {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.product-price {
    font-size: 1.3rem;
    font-weight: bold;
    color: #9f5913;
}

/* 버튼 스타일 */
.buy-now-button, .buy-now-button2,
.add-to-cart-button {
    padding: 1rem;
    border: none;
    border-radius: 5px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.3s;
    background-color: #9f5913;
}

.buy-now-button {
    background-color: #9f5913;
    color: #fff;
    margin-top: 20px;
    margin-bottom: 30px;
    width: 100%;
    display: block;
}

.buy-now-button2 {
    background-color: #9f5913;
    color: #fff;
    width: 100%;
}

.buy-now-button:hover, .buy-now-button2:hover {
    background-color: #9b5e20;
}

/* 관련 상품 섹션 */
.related-products-section {
    padding: 1rem 0;
    background-color: #f9f9f9;
    border-radius: 10px;
}

.related-products-container {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.related-products-container .product-card {
    flex: 1 1 30%;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 10px;
    padding: 1rem;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s;
}

.related-products-container .product-card:hover {
    transform: translateY(-5px);
}

.related-products-container .product-image {
    width: 100%;
    max-width: 150px;
    margin-bottom: 0.5rem;
    border-radius: 10px;
}
