/* 하단 고정 CTA 바 (_fixed_bottom_cta.php) - 추모용품 상세 등.
   바는 화면 폭 전체, 안쪽(.fixed-bottom-cta__inner)은 본문 .p_contatiner 의 콘텐츠 열과 맞춘다.
   layout.css 의 .p_contatiner 폭이 바뀌면 아래 좌우 padding 도 같이 바꾼다. */

:where(:root:has(.fixed-bottom-cta)) {
    --fixed-bottom-cta-h: calc(12px + 48px + max(12px, env(safe-area-inset-bottom, 0px)));
}
@media (min-width: 961px) {
    :where(:root:has(.fixed-bottom-cta)) {
        --fixed-bottom-cta-h: calc(80px + env(safe-area-inset-bottom, 0px));
    }
}

/* 마지막 본문이 바 뒤에 가리지 않게 */
body:has(.fixed-bottom-cta) {
    padding-bottom: var(--fixed-bottom-cta-h);
}

.fixed-bottom-cta {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 99;                       /* .modal_slide(201) · 오버레이 아래 */
    box-sizing: border-box;
    /* ~960: .p_contatiner 최대 520 패널 안쪽 16 */
    padding: 12px max(16px, calc((100% - 488px) / 2)) max(12px, env(safe-area-inset-bottom, 0px));
    background: #fff;
    box-shadow: inset 0 1px 0 #ededed, 0 -4px 16px rgba(0, 0, 0, 0.06);
}

.fixed-bottom-cta__inner {
    display: flex;
    align-items: center;
    gap: 24px;
}

.fixed-bottom-cta__summary {
    display: none;
    flex: 1 1 auto;
    min-width: 0;
}
.fixed-bottom-cta__name {
    overflow: hidden;
    color: #666;
    font-size: 14px;
    line-height: 20px;
    white-space: nowrap;
    text-overflow: ellipsis;
}
.fixed-bottom-cta__price {
    margin-top: 2px;
    color: #222;
    font-size: 15px;
    line-height: 28px;
}
.fixed-bottom-cta__price strong {
    font-size: 20px;
    font-weight: 700;
}
.fixed-bottom-cta__rate {
    margin-right: 4px;
    color: #f57a77;
    font-size: 20px;
    font-weight: 700;
}

.fixed-bottom-cta__actions {
    display: flex;
    flex: 1 1 auto;
    gap: 8px;
    min-width: 0;
}

.fixed-bottom-cta__btn {
    display: inline-flex;
    flex: 1 1 0;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    height: 48px;
    padding: 0 16px;
    border: 1px solid #f57a77;
    border-radius: 8px;
    font-family: inherit;
    font-size: 16px;
    font-weight: 600;
    line-height: 1;
    white-space: nowrap;
    text-decoration: none;
    cursor: pointer;
    transition: background-color 0.15s ease, border-color 0.15s ease;
}
/* <a> 버튼도 있어 :hover 를 같이 적는다 - base.css 의 a:hover 가 색을 덮는다. */
.fixed-bottom-cta__btn--primary,
.fixed-bottom-cta__btn--primary:hover {
    background: #f57a77;
    color: #fff;
}
.fixed-bottom-cta__btn--secondary,
.fixed-bottom-cta__btn--secondary:hover {
    background: #fff;
    color: #f57a77;
}
@media (hover: hover) {
    .fixed-bottom-cta__btn--primary:hover {
        border-color: #ef6663;
        background: #ef6663;
    }
    .fixed-bottom-cta__btn--secondary:hover {
        background: #fff6f6;
    }
}
/* base.css 가 모든 요소의 윤곽선을 지운다 - 키보드 포커스에서만 되살린다. */
.fixed-bottom-cta__btn:focus-visible {
    outline: 2px solid #222;
    outline-offset: 2px;
}

@media (min-width: 961px) {
    .fixed-bottom-cta {
        display: flex;
        align-items: center;
        height: var(--fixed-bottom-cta-h, 80px); /* :has() 를 모르는 브라우저 */
        padding: 0 max(50px, calc((100% - 900px) / 2)) env(safe-area-inset-bottom, 0px);
    }
    .fixed-bottom-cta__inner {
        flex: 1 1 auto;
    }
    .fixed-bottom-cta__summary {
        display: block;
    }
    .fixed-bottom-cta__actions {
        flex: none;
    }
    .fixed-bottom-cta__btn {
        flex: none;
        min-width: 160px;
        height: 52px;
    }
    .fixed-bottom-cta__btn--primary {
        min-width: 220px;
    }
}
@media (min-width: 1201px) {
    .fixed-bottom-cta {
        padding-right: max(250px, calc((100% - 900px) / 2));
        padding-left: max(250px, calc((100% - 900px) / 2));
    }
}
@media (min-width: 1601px) {
    .fixed-bottom-cta {
        padding-right: max(400px, calc((100% - 860px) / 2));
        padding-left: max(400px, calc((100% - 860px) / 2));
    }
}
