/* 공통 레이아웃 */

html, body { font-family: 'Pretendard','Noto Sans KR', Arial, sans-serif; }

body {
    margin: 0;
    padding: 0;
    background: #f4f6f9;
    color: #333;
}

h2, h3 {
    margin-bottom: 20px;
    font-weight: bold;
    color: #222;
}

/* 버튼 스타일 */
.btn {
    display: inline-block;
    padding: 8px 14px;
    text-decoration: none;
    color: white;
    border-radius: 4px;
    margin: 5px;
    font-size: 14px;
}

.btn-primary { background-color: #28a745; }
.btn-primary:hover { background-color: #218838; }

.btn-secondary { background-color: #007bff; }
.btn-secondary:hover { background-color: #0056b3; }

.btn-edit { background-color: #ffc107; color: black; }
.btn-edit:hover { background-color: #e0a800; }

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

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


/* 테이블 스타일 */
.table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    background: white;
}

.table th, .table td {
    border: 1px solid #ddd;
    padding: 10px;
    text-align: center;
    font-size: 14px;
}

.table th {
    background-color: #f8f9fa;
    font-weight: bold;
}

.no-image {
    font-size: 12px;
    color: #888;
}

/* 폼 스타일 */
.form-container {
    max-width: 600px;
    margin: 20px auto;
    background: #fff;
    padding: 20px;
    border: 1px solid #ddd;
    border-radius: 6px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.form-group {
    margin-bottom: 15px;
}

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

.form-group input[type="text"],
.form-group input[type="number"],
.form-group input[type="file"],
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
}

.form-group textarea {
    min-height: 80px;
}

/* 페이지 타이틀 */
.page-title {
    font-size: 24px;
    margin-bottom: 20px;
    text-align: center;
}


.farmer-grid, .product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
    margin: 20px 0;
}

.farmer-card, .product-card {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 15px;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.farmer-card img, .product-card img {
    width: 100%;
    height: 150px;
    object-fit: cover;
    border-radius: 6px;
}

.product-card h4, .farmer-card h3 {
    margin: 10px 0;
    font-size: 16px;
}

.product-card p, .farmer-card p {
    margin: 5px 0;
    font-size: 14px;
    color: #555;
}


/*상품안내페이지*/
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin: 20px 0;
}

.product-card {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 6px rgba(0,0,0,0.05);
    transition: transform 0.2s ease;
}

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

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

.product-info {
    padding: 15px;
}

.product-info h3 {
    font-size: 18px;
    margin: 5px 0;
    font-weight: bold;
}

.base-product {
    font-size: 14px;
    color: #777;
}

.farmer-name {
    font-size: 14px;
    color: #333;
    margin-bottom: 10px;
}

.product-options {
    border-top: 1px solid #eee;
    margin-top: 10px;
    padding-top: 10px;
}

.option-row {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    margin-bottom: 4px;
}

.option-name {
    font-weight: bold;
    color: #333;
}

.price {
    color: #28a745;
    font-weight: 500;
}

.stock {
    font-size: 12px;
    padding: 2px 6px;
    border-radius: 4px;
}

.stock.out-of-stock {
    background: #dc3545;
    color: white;
}

.stock:not(.out-of-stock) {
    background: #28a745;
    color: white;
}
/* ========== 카드 썸네일 정사각형(1:1) 공통 적용 ========== */
/* 기존 height 고정(150px/180px)을 없애고, 1:1 비율 + 커버 크롭 */
.farmer-card img,
.product-card img,
.product-image {
  width: 100%;
  height: auto;            /* 고정 높이 제거 */
  aspect-ratio: 1 / 1;     /* 정사각형 비율 */
  object-fit: cover;       /* 가운데 크롭 */
  display: block;
  border-radius: 6px;
  background: #f3f4f6;     /* 이미지 없을 때 배경 */
}

/* 상품 카드의 하단 경계선 유지하고 싶다면 */
.product-image {
  border-bottom: 1px solid #eee;
}
