@charset "UTF-8";

/* 1. 레이아웃 라인 일치화 */
.header-container, 
.product-grid-container, 
.pagination-wrapper {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
    width: 100%;
}

.product-grid-container { 
    margin-left: 0;
    margin-right: 0;
} 

/* --- 상단 헤더 정렬 --- */
@media (min-width: 769px) {
    .header-container {
        display: grid;
        grid-template-columns: 1fr auto 1fr;
        align-items: center;
    }
    .header-container > div:last-child {
        display: flex;
        justify-content: flex-end;
        padding-right: 0.75rem !important; 
    }
}

/* --- 홈으로 버튼 --- */
.btn-home-wrapper {
    display: flex;
    justify-content: flex-end;
    padding-right: 0.75rem;
}

.btn-home-wrapper .btn {
    font-size: 1rem !important;      
    font-weight: 500;                
    padding: 0.38rem 0.85rem !important; 
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

/* --- [수정] 상품 카드 레이아웃 --- */
.product-card {
    height: 100%;
    display: flex;
    flex-direction: column;
    border: 1px solid #eee;
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
}

.product-card .card-img-top {
    width: 100%;
    aspect-ratio: 1 / 1; /* 이미지 비율 고정 */
    object-fit: cover;
}

.product-card .card-body {
    display: flex;
    flex-direction: column;
    /* 수직, 수평 정중앙 핵심 설정 */
    justify-content: center; 
    align-items: center;     
    text-align: center;      
    
    padding: 1.5rem 1.25rem !important;
    flex-grow: 1;            /* 이미지 아래 남은 흰색 영역을 꽉 채움 */
    background-color: #ffffff;
}

.product-card .card-title {
    width: 100%;
    font-size: 1.2rem; 
    font-weight: 600;
    margin-bottom: 0.75rem;  /* 가격과의 간격 */
    color: #212529;
    
    /* 한 줄 말줄임표 */
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-break: break-all;
}

.product-card .product-price {
    width: 100%;
    font-size: 1.25rem;
    font-weight: 700;
    color: #dc3545;
    margin-bottom: 0;        /* 하단 여백 제거로 수직 중앙 보정 */
}

/* --- 페이지네이션 --- */
#paginationContainer .page-link {
    font-size: 1rem;
    padding: 0.5rem 0.85rem;
    min-width: 38px;
    text-align: center;
    color: #333;
    border-color: #dee2e6;
    transition: background-color 0.2s;
}

#paginationContainer .page-item.active .page-link {
    background-color: #198754; 
    border-color: #198754;
    color: #fff;
}

/* --- TOP 버튼 기본 스타일 --- */
#back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 9999 !important;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 54px;
    height: 54px;
    border-radius: 50%;
    background-color: #ffffff;
    border: 1px solid #e0e0e0;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94), 
                opacity 0.4s, background-color 0.3s, border-color 0.3s;
}

#back-to-top.show { opacity: 1; visibility: visible; transform: translateY(0); }

#back-to-top .up-arrow {
    width: 10px; height: 10px;
    border-top: 2px solid #333; border-left: 2px solid #333;
    transform: rotate(45deg); margin-bottom: -2px; margin-top: 4px;
}

#back-to-top .top-text { font-size: 11px; font-weight: bold; color: #333; }


/* ============================================================
   2. [접근성 강화 세션]
   ============================================================ */

.visually-hidden {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

.form-select:focus {
    outline: 2px solid #198754 !important;
    outline-offset: 1px;
    box-shadow: 0 0 0 0.25rem rgba(25, 135, 84, 0.25) !important;
}

/* 상품 카드 전체 포커스 감지 */
.product-card:focus-within {
    box-shadow: 0 0 0 3px rgba(25, 135, 84, 0.5) !important;
    outline: none;
}

#paginationContainer .page-link:focus-visible {
    z-index: 3;
    outline: 3px solid #198754;
    outline-offset: -1px;
}

.btn-home-wrapper .btn:focus-visible,
#back-to-top:focus-visible {
    outline: 3px solid #198754;
    outline-offset: 3px;
    opacity: 1;
    visibility: visible;
}

#back-to-top:hover, #back-to-top:focus-visible { 
    background-color: #f8f9fa; 
    border-color: #198754; 
}
#back-to-top:hover .up-arrow, #back-to-top:focus-visible .up-arrow,
#back-to-top:hover .top-text, #back-to-top:focus-visible .top-text { 
    border-color: #198754; 
    color: #198754; 
}
    
	/* 배너 */
	#mainHero {
      margin-left: 0 !important;
	  margin-right: 0 !important;
	  padding-left: 0.75rem;
	  padding-right: 0.75rem;
	  
	  background-image: url("/resources/images/banner.png");
	  background-size: cover;        /* 꽉 채움 */
	  background-position: right center; /* 오른쪽 기준 정렬 */
	  background-repeat: no-repeat;
	  
	  height: 260px;
      min-height: unset;          /* 배너 높이 확보 */
	  display: flex;
	  align-items: center;
	  
	  position: relative;
	  overflow: hidden;
	}
 	
	#mainHero::before {
	  content: "";
	  position: absolute;
	  inset: 0;
	  background: linear-gradient(
	    to right,
	    rgba(255,255,255,0.95) 0%,
	    rgba(255,255,255,0.85) 45%,
	    rgba(255,255,255,0.4) 70%,
	    rgba(255,255,255,0.0) 100%
	  );
	}
	
	#mainHero .btn-success {
	  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
	}

	.hero-banner .container-fluid {
	  position: relative;
	  z-index: 2;
	}
	
	.hero-banner h1 {
	  color: #1f6f45; /* 조금 더 진한 초록 */
	  text-shadow: 0 2px 4px rgba(0,0,0,0.15);
	  font-size: 2.8rem;
  	  letter-spacing: -0.5px;
	}

	.hero-banner p {
	  color: #222;
	  font-weight: 500;
	  font-size: 1.2rem;
	}
    
	@media (max-width: 768px) {
	
	h4#season-title {
        font-size: 17px !important;
    }
	
	#mainHero .container-fluid {
        padding-left: 0 !important;
        padding-right: 0 !important;
        max-width: 100% !important;
    }
    
    /* 내부 패딩만 조금 줄이기 */
    #mainHero .container-fluid {
        padding-top: 0.8rem !important;
        padding-bottom: 0.8rem !important;
    }

    /* 제목 더 작게 */
    #mainHero h1 {
        font-size: 1.3rem;
        margin-bottom: 0.4rem;
    }

    /* 본문 텍스트 더 작게 */
    #mainHero p {
        font-size: 0.9rem !important;
        line-height: 1.2;
        margin-bottom: 0.6rem;
    }

    /* 버튼 더 작게 */
    #mainHero .btn {
        font-size: 0.75rem;
        padding: 0.4rem 0.8rem;
    }
    
    /* 최근 주문일 줄바꿈 */
    .order-summary {
        display: flex;
        flex-direction: column;
        white-space: normal;
    }

}

@media (max-width: 992px) {
    .pagination-wrapper { flex-direction: column !important; gap: 1.5rem; align-items: center !important; }
    .btn-home-wrapper { justify-content: center !important; padding-right: 0 !important; }
    .header-container { display: flex; flex-direction: column; gap: 1rem; }
    #back-to-top { width: 48px !important; height: 48px !important; bottom: 20px !important; right: 20px !important; }
    
    .product-card .card-body {
        padding: 1.25rem 1rem !important;
    }
}