/* 반응형 레이아웃 */

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

  .now_card {
    position: relative;
    top: auto;
  }

  .next_list {
    padding-top: 0;
  }

  .next_card:nth-child(2),.next_card:nth-child(4) {
    margin-left: 0;
  }

  .editorial_story {
    gap: 56px;
    margin-bottom: 120px;
  }

  .editorial_heading {
    margin-bottom: 80px;
  }

  .editorial_copy h3 {
    font-size: clamp(38px,4.5vw,48px);
  }

  .category_card {
    width: 84px;
  }

  .category_card .category_image {
    width: 72px;
    height: 72px;
  }

  /* 카테고리가 한 줄을 유지하도록 좌우 스크롤만 허용합니다 */

  .category_grid {
    flex-wrap: nowrap;
    justify-content: flex-start;
    gap: 8px;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }

  .category_grid::-webkit-scrollbar {
    display: none;
  }

  .category_card:not(.is_open) .category_menu {
    opacity: 0;
    visibility: hidden;
  }

  .category_menu.is_mobile_open {
    position: fixed;
    display: flex;
    width: 172px;
    margin: 0;
    opacity: 1;
    visibility: visible;
    transform: none;
    z-index: 5000;
  }

  .category_menu .category_all_link {
    margin-top: 4px;
    border-top: 1px solid #eee;
    color: var(--ink);
    font-weight: 600;
  }

  .category_card:nth-child(3n+2),.category_card:nth-child(4n) {
    transform: none;
  }

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

  .brand_grid article:nth-child(2) {
    border-right: 0;
  }

  /* 상품 상세 화면 */

  .product_hero {
    grid-template-columns: 1fr;
    gap: 36px;
  }

  .product_gallery,.purchase_box {
    position: static;
  }

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

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

}

@media(max-width:900px) {
  .top_promo_slide {
    padding: 0 8px;
    font-size: 11px;
  }

  .top_promo_button {
    padding: 5px 8px;
    font-size: 10px;
  }

  .top_promo_button.is_outline {
    margin-left: 2px;
  }

  /* 모바일 헤더에서는 일반 메뉴만 숨기고 카테고리 진입점은 유지합니다. */

  .main_menu {
    display: flex;
    margin-left: auto;
    margin-right: 20px;
    flex: 0 1 auto;
  }

  .main_menu > a {
    display: none;
  }

  .menu_category {
    display: block;
  }

  .menu_category_link {
    display: block;
    padding: 8px 0;
    font-size: 13px;
    color: var(--ink)!important;
    font-weight: 600;
  }

  .header_category_menu {
    left: 50%;
    width: min(560px,calc(100vw - 32px));
    max-height: min(68vh,560px);
    padding: 22px;
    grid-template-columns: repeat(2,minmax(0,1fr));
    gap: 20px 22px;
    overflow-y: auto;
    overscroll-behavior: contain;
  }

  .header_category_menu .header_category_title {
    font-size: 14px;
  }

  .header_subcategory {
    font-size: 11.5px;
  }

  .menu_category.is_open .header_category_menu {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translate(-50%,0);
  }

  .header_actions {
    gap: 10px;
  }

  .hero_slide_inner {
    grid-template-columns: 1fr;
    align-items: start;
    gap: 0;
    padding: 36px 24px 76px;
    min-height: auto;
  }

  .hero_media {
    order: -1;
  }

  .hero_copy {
    height: auto;
    margin: 0;
    padding: 34px 30px;
    max-width: none;
    border-radius: 0 0 var(--radius) var(--radius);
  }

  .hero_media {
    height: auto;
    border-radius: var(--radius) var(--radius) 0 0;
  }

  .hero_media img {
    height: auto;
    min-height: 0;
    aspect-ratio: 16/11;
  }

  .coffee_gift_card {
    right: 16px;
    bottom: 16px;
    width: min(28%,168px);
    padding: 6px;
    border-radius: 10px;
    background-size: 12px 12px;
  }

  .coffee_gift_card span {
    top: 5px;
    left: 5px;
    padding: 3px 5px;
    font-size: 7px;
  }

  .hero_media .coffee_gift_card img {
    aspect-ratio: auto;
  }

  .story_banner {
    height: 46vh;
    min-height: 340px;
    margin-bottom: 112px;
  }

  .story_banner_copy {
    padding: 36px 28px;
    max-width: 100%;
  }

  .benefits_inner {
    grid-template-columns: repeat(2,1fr);
    gap: 24px 0;
  }

  .benefits article {
    border-left: 0;
    padding: 0 0 0 4px;
  }

  .benefits {
    margin-bottom: 120px;
  }

  .category_card {
    width: 76px;
  }

  .category_card .category_image {
    width: 64px;
    height: 64px;
  }

  .category_name {
    font-size: 12px;
  }

  .category {
    margin-top: 0;
    margin-bottom: 96px;
  }

  .brand_grid {
    grid-template-columns: 1fr;
  }

  .brand_grid article {
    border-right: 0;
    border-bottom: 1px solid rgba(255,255,255,.14);
  }

  .brand {
    padding: 80px 24px;
    margin-top: 0;
    margin-bottom: 48px;
  }

  .brand_stats {
    flex-wrap: wrap;
    gap: 32px;
  }

  .schedule {
    margin-top: 88px;
    margin-bottom: 64px;
  }

  .editorial_stories {
    margin-top: 0;
    margin-bottom: 104px;
    padding: 0 24px;
  }

  .editorial_story,.editorial_story:nth-child(even) {
    grid-template-columns: 1fr;
    gap: 36px;
    margin-bottom: 104px;
  }

  .editorial_story:nth-child(even) .editorial_copy,.editorial_story:nth-child(even) .editorial_image {
    order: initial;
  }

  .editorial_copy {
    order: 1!important;
    max-width: 640px;
  }

  .editorial_image {
    order: 2!important;
  }

  .today_pick {
    margin-top: 0;
    margin-bottom: 108px;
  }

  .today_pick:not(.related) .product_grid {
    gap: 20px;
  }

  .today_pick:not(.related) .product_card {
    flex-basis: calc((100% - 20px)/2);
  }

  /* 상품 상세 화면 */

  .review_summary {
    flex-direction: column;
    gap: 24px;
  }

  .spec_table th {
    width: 110px;
    font-size: 12.5px;
  }

  .sticky_buy {
    display: flex;
  }

  /* 하단 고정 구매 바가 있는 상품 상세 화면에서는 푸터가 가려지지 않도록 여백을 더 줍니다 */
  body:has(#sticky_buy) .site_footer {
    padding-bottom: 100px;
  }

}

@media(max-width:560px) {
  .site_footer {
    padding-inline: 20px;
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }

  .site_footer .nn_copyright {
    max-width: none;
    text-align: left;
  }

  .sticky_buy {
    padding: 12px 16px;
    gap: 10px;
  }

  .sticky_buy_price {
    display: none;
  }

  .sticky_quantity {
    flex: 0 0 auto;
  }

}

@media(max-width:480px) {
  .coupon_popup {
    padding: 16px;
  }

  .coupon_popup_card {
    padding: 36px 22px 23px;
    border-radius: 20px;
  }

  .coupon_popup_card h2 {
    font-size: 29px;
  }

  .coupon_popup_description {
    font-size: 13px;
  }

  .coupon_ticket {
    margin-top: 23px;
    padding-left: 20px;
  }

  .header_content {
    padding: 16px 20px;
    gap: 4px;
  }

  .main_menu {
    margin: 0 4px 0 auto;
  }

  .header_actions {
    gap: 2px;
  }

  .icon_button {
    width: 30px;
    height: 30px;
  }

  .next_card {
    grid-template-columns: 82px minmax(0,1fr);
    grid-template-rows: auto auto;
    gap: 6px 10px;
    height: auto;
    min-height: 168px;
    padding: 8px;
  }

  .next_card img {
    width: 82px;
    height: 72px;
    grid-row: 1 / span 2;
    align-self: start;
  }

  .next_card.event {
    grid-template-columns: 82px minmax(0,1fr);
  }

  .next_card.event img {
    width: 82px;
    height: 72px;
  }

  .next_card > div:not(.schedule_menu) {
    min-width: 0;
  }

  .next_card h4 {
    overflow-wrap: anywhere;
  }

  .next_price {
    flex-wrap: wrap;
  }

  .next_card .next_card_actions {
    grid-column: 2;
    grid-row: 2;
    width: 100%;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
  }

  .next_card_actions .schedule_toggle {
    justify-content: flex-start;
  }

  .next_card_actions .notify_button {
    flex: 0 0 auto;
  }

  .next_card .schedule_menu {
    grid-column: 1 / -1;
    grid-row: 3;
    box-sizing: border-box;
    height: 0;
    max-height: 0;
    padding-top: 0;
    padding-bottom: 0;
    border-width: 0;
    overflow-y: auto;
  }

  .next_card.is_expanded .schedule_menu {
    height: 96px;
    max-height: 96px;
    padding-top: 10px;
    padding-bottom: 10px;
    border-width: 1px;
  }

  .header_category_menu {
    position: fixed;
    top: 100px;
    left: 16px;
    right: 16px;
    width: auto;
    max-height: calc(100vh - 116px);
    padding: 20px 18px;
    gap: 18px 16px;
    transform: translateY(-8px);
  }

  .menu_category.is_open .header_category_menu {
    transform: translateY(0);
  }

  .hero_tags {
    gap: 8px;
  }

  .hero_buttons {
    flex-direction: column;
  }

  .hero_copy {
    margin: 0;
    padding: 28px 22px;
  }

  .editorial_stories {
    padding: 0 20px;
  }

  .editorial_story {
    gap: 28px;
    margin-bottom: 88px;
  }

  .editorial_heading {
    margin-bottom: 64px;
  }

  .editorial_copy h3 {
    font-size: 36px;
    line-height: 1.2;
  }

  .editorial_description {
    margin: 0;
    font-size: 16px;
  }

  .editorial_action_row {
    margin-top: 20px;
  }

  .editorial_image,.editorial_story:nth-child(even) .editorial_image {
    height: auto;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto auto;
    gap: 10px;
  }

  .editorial_image_main,.editorial_story:nth-child(even) .editorial_image_main {
    grid-column: 1/3;
    grid-row: 1;
    aspect-ratio: 4/3;
  }

  .editorial_image_small,.editorial_story:nth-child(even) .editorial_image_small {
    grid-column: auto;
    grid-row: 2;
    aspect-ratio: 1/1;
  }

  .category_card:nth-child(3n+2),.category_card:nth-child(4n) {
    transform: none;
  }

  .today_pick {
    padding-left: 20px;
    padding-right: 20px;
  }

  .today_pick:not(.related) .product_grid {
    gap: 14px;
  }

  .today_pick:not(.related) .product_card {
    flex-basis: 82%;
  }

  .benefits {
    padding: 36px 20px;
  }

  .benefits_inner {
    grid-template-columns: 1fr 1fr;
    gap: 20px;
  }

  /* 상품 상세 화면 */

  .breadcrumb_nav {
    padding: 18px 20px 0;
    font-size: 11.5px;
  }

  .product_hero {
    padding: 20px 20px 0;
    width: 100%;
    min-width: 0;
  }

  .gallery_thumbs {
    gap: 8px;
    grid-template-columns: repeat(4,minmax(0,1fr));
  }

  .product_tabs {
    padding: 0 20px;
  }

  .tabs_nav {
    gap: 22px;
  }

  .detail_benefits {
    grid-template-columns: 1fr 1fr;
  }

  .related_grid {
    grid-template-columns: 1fr 1fr;
    gap: 14px;
  }

  .wishlist_floating_button {
    right: 14px;
    bottom: 72px;
    width: 48px !important;
    height: 48px !important;
  }

}
