/* products.php 모바일 전용 스타일 (수정) */
@media (max-width: 768px) {
  /* 전체 상품 섹션 */
  .products-section {
    padding: 1.2rem 0 0.5rem 0;
  }
  .products-section .container {
    max-width: 100%;
    padding: 0 0.5rem;
  }
  /* 헤더 */
  .products-header {
    text-align: center;
    margin-bottom: 1.2rem;
  }
  .products-header h1 {
    font-size: 1.3rem;
    margin-bottom: 0.3rem;
  }
  .products-header p {
    font-size: 0.85rem;
    color: #666;
  }
  /* 필터 섹션 */
  .filter-section {
    margin-bottom: 1.2rem;
    display: flex;
    justify-content: center;
  }
  .filter-form {
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
    padding: 1.2rem 1rem 1rem 1rem;
    width: 100%;
    max-width: 340px;
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
  }
  
  .filter-row {
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
    margin-left: 0 !important;
    margin-right: 0 !important;
  }
  
  /* 첫 번째 줄: 카테고리와 정렬을 가로로 배치 */
  .filter-row:first-child {
    display: flex;
    flex-direction: row;
    gap: 0.7rem;
  }
  
  .filter-row:first-child .filter-group {
    flex: 1;
  }
  .filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
  }
  .filter-group label {
    font-size: 0.92rem;
    font-weight: 600;
    color: #6b4a2e;
    margin-bottom: 0.1rem;
  }
  .filter-select,
  .search-input,
  .price-input {
    width: 100%;
    padding: 0.7rem 0.8rem;
    border: 1px solid #e0d6c8;
    border-radius: 8px;
    font-size: 0.95rem;
    background: #fff;
    box-sizing: border-box;
  }
  .price-range {
    display: flex;
    align-items: center;
    gap: 0.4rem;
  }
  .price-input {
    flex: 1;
    min-width: 0;
  }
  .price-separator {
    font-size: 0.9rem;
    color: #b8a88e;
  }
  .filter-btn {
    width: 100%;
    padding: 0.9rem 0;
    background: #6b4a2e;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 1.05rem;
    font-weight: 700;
    cursor: pointer;
    margin-top: 0.2rem;
    letter-spacing: 0.02em;
    box-shadow: 0 1px 4px rgba(0,0,0,0.04);
    transition: background 0.2s;
  }
  .filter-btn:active {
    background: #4e331a;
  }
  /* 상품 그리드 */
  .products-container {
    margin-top: 0.5rem;
  }
  .products-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.1rem 0.8rem;
    margin-bottom: 2rem;
  }
  /* 상품 카드 */
  .product-card {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.07);
    display: flex;
    flex-direction: column;
    min-width: 0;
    padding: 0.7rem 0.5rem 0.8rem 0.5rem;
    align-items: center;
    transition: box-shadow 0.2s;
  }
  .product-card:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
  }
  .product-image {
    position: relative;
    width: 100%;
    padding-top: 100%; /* 1:1 비율 */
    overflow: hidden;
    border-radius: 8px;
    background: #faf7f3;
    margin-bottom: 0.5rem;
  }
  .product-image img {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    object-fit: cover;
    border-radius: 8px;
  }
  .product-badges {
    position: absolute;
    top: 0.5rem;
    left: 0.5rem;
    z-index: 2;
  }
  .badge {
    display: inline-block;
    padding: 0.18rem 0.38rem;
    font-size: 0.7rem;
    font-weight: 600;
    border-radius: 4px;
    margin-right: 0.2rem;
  }
  .badge.best { background: #ff6b6b; color: #fff; }
  .badge.new { background: #4ecdc4; color: #fff; }
  .product-image-overlay {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    z-index: 2;
  }
  .hover-btn {
    width: 2rem;
    height: 2rem;
    border: none;
    border-radius: 50%;
    background: rgba(255,255,255,0.9);
    color: #333;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.8rem;
  }
  .hover-btn.wish-btn.wishlisted {
    background: #ff6b6b;
    color: #fff;
  }
  /* 상품 정보 */
  .product-info {
    padding: 0.2rem 0 0 0;
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    width: 100%;
    align-items: center;
  }
  .product-name {
    margin-bottom: 0.2rem;
    min-width: 0;
    width: 100%;
    text-align: center;
  }
  .product-name a {
    font-size: 0.93rem;
    font-weight: 600;
    color: #222;
    text-decoration: none;
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    line-height: 1.2;
    max-width: 100%;
  }
  /* 간단설명 강제 표시 - style.css의 숨김 스타일 덮어쓰기 */
  .products-section .products-grid .product-card .product-info .product-description,
  .products-section .products-grid .product-card .product-info div.product-description,
  .products-section .products-grid .product-card .product-info p.product-description {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    height: auto !important;
    margin: 0 0 0.3rem 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
    position: static !important;
    left: auto !important;
    top: auto !important;
    font-size: 0.78rem !important;
    color: #999 !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
    line-height: 1.2 !important;
    max-width: 100% !important;
    text-align: center !important;
    min-height: 1.2em !important;
  }
  .product-price {
    margin-top: auto;
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    align-items: center;
    width: 100%;
  }
  .current-price,
  .discount-price {
    font-size: 1.05rem;
    font-weight: 700;
    color: #e74c3c;
    letter-spacing: -0.01em;
  }
  .original-price {
    font-size: 0.75rem;
    color: #999;
    text-decoration: line-through;
  }
  .discount-rate {
    font-size: 0.7rem;
    color: #e74c3c;
    font-weight: 600;
  }
  /* 상품이 없을 때 */
  .no-products {
    text-align: center;
    padding: 3rem 1rem;
  }
  .no-products-content i {
    font-size: 3rem;
    color: #ddd;
    margin-bottom: 1rem;
  }
  .no-products-content h3 {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
  }
  .no-products-content p {
    color: #666;
  }
  /* 페이지네이션 */
  .pagination {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 2rem;
  }
  .page-btn {
    padding: 0.5rem 0.8rem;
    border: 1px solid #ddd;
    background: #fff;
    color: #333;
    text-decoration: none;
    border-radius: 4px;
    font-size: 0.9rem;
  }
  .page-btn.active {
    background: #6b4a2e;
    color: #fff;
    border-color: #6b4a2e;
  }
  .filter-group .price-range {
    display: flex !important;
    flex-direction: row !important;
    align-items: center;
    gap: 0.4rem;
  }
}

@media (max-width: 480px) {
  .products-grid {
    gap: 0.7rem 0.5rem;
  }
  .product-info {
    padding: 0.1rem 0 0 0;
  }
  .product-name a {
    font-size: 0.88rem;
  }
  /* 더 작은 화면에서 간단설명 폰트 크기 조정 */
  .products-section .products-grid .product-card .product-info .product-description,
  .products-section .products-grid .product-card .product-info div.product-description,
  .products-section .products-grid .product-card .product-info p.product-description {
    font-size: 0.72rem !important;
  }
  .current-price,
  .discount-price {
    font-size: 0.98rem;
  }
} 