/* 주문 진입 페이지(index.php) 전용 스타일 - 귤담 레퍼런스 디자인 기준 */
:root {
    --green: #1f4b39;
    --orange: #eb7023;
    --ink: #232d28;
    --muted: #66736c;
    --line: #dce5df;
    --canvas: #f5f8f6;
    --surface: #fff;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    background: var(--canvas);
    color: var(--ink);
    font-family: "Pretendard", "Noto Sans KR", -apple-system, "Apple SD Gothic Neo", "Malgun Gothic", system-ui, sans-serif;
    line-height: 1.55;
}
body.no-scroll { overflow: hidden; }

/* 내용이 짧아도 하단 정보(footer)가 화면 맨 아래에 오도록 */
body { min-height: 100vh; display: flex; flex-direction: column; }
body > main { flex: 1 0 auto; }
body > .site-header, body > .site-footer { flex: none; }

button, input, select, textarea { font: inherit; color: inherit; }

/* ===== 헤더 ===== */
.site-header {
    position: sticky;
    top: 0;
    z-index: 10;
    height: 76px;
    /* 아래 .section(최대 1180px, 좌우 24px 여백)의 내용 영역과 좌우 끝선이 맞도록 */
    padding: 0 max(24px, calc((100% - 1180px) / 2 + 24px));
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #fff;
    border-bottom: 1px solid var(--line);
}
.brand { display: flex; gap: 10px; align-items: center; font-size: 24px; color: inherit; text-decoration: none; }   /* 로고·이름을 누르면 첫 주문 화면으로 (링크) */
.brand-mark {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border-radius: 12px;
    background: var(--orange);
    color: #fff;
    font-size: 17px;
    font-weight: 800;
}
/* 로고 이미지 안쪽의 투명 여백(좌우 각 약 12px)을 걷어내서, 보이는 로고가 화면 왼쪽 여백·글자와 딱 맞게 */
.brand-logo { width: 62px; height: auto; display: block; margin: 0 -12px; }
.header-links { display: flex; gap: 18px; align-items: center; }
.header-links a { display: inline-flex; align-items: center; gap: 6px; color: var(--green); text-decoration: none; font-weight: 700; }
.header-links .ico { flex: none; }
/* 헤더 오른쪽 버튼 (index.php): "주문 조회"는 끝이 둥근 테두리 버튼, 전화는 동그란 아이콘 버튼. 높이를 36px로 맞춤 */
.header-links .hd-btn {
    height: 36px;
    padding: 0 16px;
    border: 1.5px solid var(--green);
    border-radius: 999px;
    font-size: 14px;
    transition: background .15s, color .15s;
}
.header-links .hd-btn:hover { background: var(--green); color: #fff; }
.header-links .hd-icon-btn {
    justify-content: center;
    width: 52px;          /* 가로로 조금 길게 (양 끝은 둥글게) */
    height: 36px;
    border-radius: 999px;
    background: #edf5f0;
    transition: background .15s;
}
.header-links .hd-icon-btn:hover { background: #dcebe2; }
/* 글자가 들어가는 헤더 버튼 (예: 상품 주문으로 돌아가기). 아이콘 버튼과 같은 색·높이·둥근 모양 */
.header-links .hd-pill {
    height: 36px;
    padding: 0 16px;
    border-radius: 999px;
    background: #edf5f0;
    font-size: 14px;
    white-space: nowrap;
    transition: background .15s;
}
.header-links .hd-pill:hover { background: #dcebe2; }

/* ===== 히어로 ===== */
.hero {
    padding: 51px 24px 41px;   /* 상단 사진 영역 높이를 50px 줄임 */
    text-align: center;
    background: #1d2a22;   /* 사진을 불러오기 전/실패했을 때의 바탕색 */
}
.hero h1 { font-size: clamp(32px, 6vw, 56px); line-height: 1.18; margin: 12px 0 18px; }
.hero p { margin: 0; color: #fff; }
.hero-line { display: block; }

/* 상단 안내 영역: 사진 배경(어두운 막을 깔아 흰 글자가 읽히게) + 사진이 천천히 확대·축소 + 주황빛이 진해졌다 옅어짐
   층 순서(아래→위): 사진(::before) → 주황빛(::after) → 글자 */
.hero {
    position: relative;
    overflow: hidden;
}
.hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(rgba(16, 24, 19, .30), rgba(16, 24, 19, .42)),
        url("../images/bg_2025.jpg") center / cover no-repeat;
    animation: heroZoom 24s ease-in-out infinite alternate;
    pointer-events: none;
}
.hero::after {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 72% 30%, rgba(235, 112, 35, .30), transparent 60%);
    animation: heroGlow 7s ease-in-out infinite;
    pointer-events: none;
}
.hero > * { position: relative; z-index: 1; }   /* 사진·빛 위에 글자가 보이도록 */
/* 글자 전체가 아니라 "물결"이 왼쪽에서 오른쪽으로 지나가면서 그 부분의 글자만 흐려졌다 돌아옵니다.
   (글자 색을 가로 그라데이션으로 칠하고, 흐린 띠의 위치를 계속 옮깁니다. 제목 → 설명 줄 순서로 시차를 둡니다) */
.hero h1, .hero-line {
    background-size: 220% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
    filter: drop-shadow(0 2px 6px rgba(0, 0, 0, .35));   /* 사진 위에서 글자 가장자리가 또렷하도록 */
}
/* 흰 글자 위로 지나가는 물결: 지나가는 부분만 귤빛(주황 노랑)으로 물들었다가 돌아옵니다 */
.hero h1 {
    background-image: linear-gradient(90deg, #fff 0%, #fff 38%, #ffb347 50%, #fff 62%, #fff 100%);
    animation: heroIn 1s ease-out both, heroWave 6s linear 1s infinite;
}
.hero-line {
    background-image: linear-gradient(90deg, rgba(255, 255, 255, .92) 0%, rgba(255, 255, 255, .92) 38%, #ffc775 50%, rgba(255, 255, 255, .92) 62%, rgba(255, 255, 255, .92) 100%);
}
.hero-line:nth-child(1) { animation: heroIn 1s ease-out .4s both, heroWave 6s linear 1.3s infinite; }
.hero-line:nth-child(2) { animation: heroIn 1s ease-out .8s both, heroWave 6s linear 1.6s infinite; }

@keyframes heroIn {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}
/* 흐린 띠를 왼쪽 → 오른쪽으로 이동 (글자 위치는 그대로라 떨리지 않습니다) */
@keyframes heroWave {
    from { background-position: 100% 0; }
    to   { background-position: 0% 0; }
}
@keyframes heroZoom {
    from { transform: scale(1); }
    to   { transform: scale(1.1); }
}
@keyframes heroGlow {
    0%, 100% { opacity: .25; }
    50%      { opacity: 1; }
}
/* 기기에서 "동작 줄이기"를 켠 경우에는 움직이지 않습니다 */
@media (prefers-reduced-motion: reduce) {
    .hero::before, .hero::after, .hero h1, .hero .hero-line:nth-child(n) { animation: none; }
    .hero h1, .hero-line { background: none; -webkit-text-fill-color: currentColor; filter: none; }
    .hero h1 { color: #fff; }
    .hero-line { color: #fff; }
}
.eyebrow { margin: 0; color: var(--orange) !important; font-weight: 800; letter-spacing: .08em; }

/* ===== 섹션 공통 ===== */
.section { max-width: 1180px; margin: 54px auto; padding: 0 24px; }

.section-heading { display: flex; gap: 14px; align-items: center; margin-bottom: 24px; }
.section-heading > span {
    display: grid;
    place-items: center;
    min-width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--green);
    color: #fff;
    font-weight: 800;
}
.section-heading h2, .section-heading p { margin: 0; }
.section-heading p { color: var(--muted); font-size: 15px; }
.section-heading .head-action { margin-left: auto; }

/* ===== 1. 상품 선택 ===== */
.product-box {
    padding: 24px;
    background: #fff;
    border: 2px solid transparent;
    border-radius: 18px;
    box-shadow: 0 7px 24px #1f4b3910;
    transition: border-color .18s;
}
.product-box:focus-within { border-color: var(--orange); }
.product-box label { display: block; font-weight: 700; margin-bottom: 8px; }

/* ===== 입력 공통 ===== */
.order-form input,
.order-form select,
.product-box select,
.summary input[type="number"] {
    width: 100%;
    height: 48px;
    padding: 0 14px;
    border: 1px solid #cfdad3;
    border-radius: 10px;
    background: #fff;
    font-weight: 600;   /* 입력한 글자를 조금 두껍게 */
}
.order-form input:focus,
.order-form select:focus,
.product-box select:focus {
    outline: 3px solid #eb702326;
    border-color: var(--orange);
}
.order-form input::placeholder { color: #9aa6a0; font-size: 13px; font-weight: 400; }   /* 안내 문구는 기본 굵기 유지 */
.order-form input[readonly] { color: #53615a; background: #f4f6f5; cursor: pointer; }

input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
input[type="number"] { -moz-appearance: textfield; }

/* ===== 2~3. 주문 레이아웃 ===== */
.order-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 380px;
    gap: 28px;
    align-items: start;
}
.order-form, .summary {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 20px;
    padding: 28px;
}

.order-input-section + .order-input-section {
    margin-top: 34px;
    padding-top: 32px;
    border-top: 1px solid var(--line);
}
.order-input-section .section-heading { margin-bottom: 18px; }

.field { margin-top: 18px; }
.field > label { display: block; font-weight: 700; margin-bottom: 7px; }
.field > label small { margin-left: 5px; color: var(--muted); font-weight: 500; }

.address-row { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.address-row input { max-width: 150px; }
.address-row + input { margin-bottom: 10px; }

/* ===== 버튼 ===== */
.btn-green {
    height: 48px;
    padding: 0 18px;
    border: 0;
    border-radius: 10px;
    background: var(--green);
    color: #fff;
    font-weight: 700;
    white-space: nowrap;
    cursor: pointer;
}
.btn-chip {
    padding: 7px 13px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: #edf5f0;
    color: var(--green);
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
    cursor: pointer;
}
.btn-chip:hover { border-color: var(--green); }

/* ===== 주문 요약 ===== */
.summary { position: sticky; top: 96px; }
.summary h2 { margin: 0 0 16px; }
.summary-product {
    padding: 15px;
    border-radius: 12px;
    background: #edf5f0;
    color: var(--green);
    font-weight: 800;
}
.summary-product.is-empty { color: var(--muted); font-weight: 600; }
.summary > .summary-label { display: block; font-weight: 700; margin: 18px 0 7px; }

.quantity { display: flex; align-items: center; gap: 12px; }
.quantity button {
    width: 38px;
    height: 38px;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: #fff;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
}
.quantity button:hover { border-color: var(--orange); color: var(--orange); }
.summary .quantity input[type="number"] {
    width: 64px;
    height: 38px;
    padding: 0 4px;
    text-align: center;
    font-weight: 800;
    font-size: 17px;
}

.summary dl { margin: 18px 0 0; }
.summary dl > div { display: flex; justify-content: space-between; align-items: baseline; padding: 9px 0; }
.summary dt, .summary dd { margin: 0; }
.summary dd { text-align: right; }
#showcount { margin-right: 8px; color: var(--muted); font-size: 14px; text-decoration: line-through; }
.summary .total {
    border-top: 1px solid var(--line);
    margin-top: 10px;
    padding-top: 18px;
    font-size: 19px;
    font-weight: 800;
}
.summary .total dd { color: var(--orange); }

/* 입금 안내 */
.pay-info {
    margin: 18px 0;
    padding: 16px;
    border: 1px solid #dbe7df;
    border-radius: 14px;
    background: #fbfdfc;
    font-size: 14px;
}
.pay-info p { margin: 0; }
.pay-info .notice { margin-bottom: 10px; color: #9a4b18; font-weight: 700; }
.pay-info .account { font-weight: 800; color: var(--green); font-size: 15px; margin-bottom: 6px; }
.pay-info .holder { font-weight: 800; color: var(--green); font-size: 15px; }
.pay-info .small { margin-top: 10px; color: var(--muted); font-size: 13px; }
.pay-info a { color: var(--green); font-weight: 700; text-decoration: none; }

/* 개인정보 동의 */
.agree-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    font-size: 14px;
    font-weight: 700;
}
#agreeContent { display: none; margin-top: 10px; }
#agreeContent.is-open { display: block; }
/* 교환·환불 안내 접기/펼치기 (제목줄 아래 한 줄 요약은 항상 보임) */
.pay-info .agree-head .notice { margin-bottom: 0; }
#refundContent { display: none; }
#refundContent.is-open { display: block; }
/* 주문 전 확인 사항: 한 줄짜리 항목 (교환·환불 / 배송 / 개인정보) */
.pay-info .check-row { margin-top: 8px; font-size: 13px; font-weight: 600; color: var(--ink); }
.pay-info .check-row .btn-chip { padding: 4px 10px; font-size: 12px; flex-shrink: 0; }
.pay-info .consent { margin: 14px 0 0; }
/* 배송 안내 접기/펼치기 (교환·환불 안내와 같은 방식) */
#deliveryContent { display: none; }
#deliveryContent.is-open { display: block; }
.terms {
    max-height: 200px;
    overflow-y: auto;
    padding: 12px 14px;
    background: var(--canvas);
    border: 1px solid var(--line);
    border-radius: 10px;
    font-size: 12.5px;
    color: var(--muted);
    line-height: 1.6;
}
.terms ol { margin: 0; padding-left: 0; list-style: none; }
.terms > ol > li { margin-bottom: 10px; }
.terms .s_list { margin-top: 4px; padding-left: 14px; list-style: disc; }
.terms .s_list p { margin: 2px 0; }
.terms > p { margin: 10px 0 0; font-weight: 700; color: #9a4b18; }

.consent {
    display: flex;
    align-items: center;
    gap: 9px;
    margin: 14px 0 18px;
    font-size: 14px;
    color: var(--muted);
    cursor: pointer;
}
.consent input { width: 18px; height: 18px; margin: 0; accent-color: var(--orange); flex-shrink: 0; }

.submit {
    width: 100%;
    border: 0;
    border-radius: 12px;
    padding: 15px;
    background: var(--orange);
    color: #fff;
    font-size: 16px;
    font-weight: 800;
    cursor: pointer;
}
.submit:hover { filter: brightness(1.04); }

/* ===== 하단 사업자 정보 (footer.php) ===== */
.site-footer {
    margin-top: 40px;
    padding: 36px 0 44px;
    background: #fff;
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-size: 13px;
    line-height: 1.7;
}
.site-footer-inner { max-width: 1180px; margin: 0 auto; padding: 0 24px; }
.footer-brand { margin: 0 0 10px; color: var(--green); font-size: 17px; font-weight: 800; }
.footer-links { margin: 0 0 14px; display: flex; flex-wrap: wrap; gap: 6px 18px; }
.footer-links a { color: var(--ink); font-weight: 700; text-decoration: none; }
.footer-links a:hover { text-decoration: underline; }
.footer-info { margin: 0; display: flex; flex-wrap: wrap; gap: 2px 18px; }
.footer-info > div { display: flex; gap: 6px; }
.footer-info dt { flex: none; color: #8a968f; }
.footer-info dt::after { content: ' :'; }
.footer-info dd { margin: 0; color: var(--muted); }
.footer-info a { color: inherit; text-decoration: none; }
.footer-copy { margin: 16px 0 0; color: #9aa6a0; font-size: 12px; }

/* ===== 로딩 / 마감 오버레이 ===== */
.loading {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 200;
    background: #17211c59;
    align-items: center;
    justify-content: center;
}
.loading.is-open { display: flex; }
.loading img { width: 56px; height: 56px; }

.sg_overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 300;
    padding: 20px;
    background: #17211c99;
    align-items: center;
    justify-content: center;
}
.sg_overlay.is-open { display: flex; }
.sg_notice {
    width: min(430px, 100%);
    padding: 36px;
    text-align: center;
    background: #fff;
    border-radius: 20px;
}
.sg_notice h2 { margin: 0 0 12px; color: var(--green); }
.sg_notice p { margin: 0 0 12px; color: var(--muted); line-height: 1.7; }
/* 마감 안내의 "내 주문 조회하기" 버튼 */
.sg_notice-link {
    display: inline-block;
    margin-top: 6px;
    padding: 12px 24px;
    border-radius: 12px;
    background: var(--green);
    color: #fff;
    font-weight: 700;
    text-decoration: none;
}

/* ===== 반응형 ===== */
@media (max-width: 850px) {
    .order-layout { grid-template-columns: 1fr; }
    .summary { position: static; }
    .site-header { height: 66px; }
    .site-header .header-links a { font-size: 13px; }   /* 오른쪽 버튼만 작게. (로고·이름 링크 .brand 는 제외) */
    .brand { font-size: 22px; }
    .hero { padding-top: 29px; padding-bottom: 25px; }
    .order-form, .summary { padding: 22px; }
}
@media (max-width: 520px) {
    .section { padding: 0 16px; margin: 40px auto; }
    .site-header { padding: 0 16px; }
    .header-links { gap: 12px; }
    .header-links .tel-text { display: none; }   /* 모바일: 전화 아이콘만 남김 */
    /* 휴대폰: 제목·설명 한 줄이 줄바꿈되지 않도록 화면 폭에 맞춰 글자 크기 조절 */
    .hero { padding-left: 16px; padding-right: 16px; }
    .hero h1 { font-size: clamp(22px, 6.2vw, 32px); }
    .hero-line { font-size: clamp(12px, 3.6vw, 16px); }
    .address-row input { max-width: none; }
    .section-heading { flex-wrap: wrap; }
    /* 주문자 정보·받는 분과 배송지: 제목과 오른쪽 버튼("주문자와 동일", "새로 작성")이 한 줄에 머물도록 줄바꿈을 막고 크기를 줄임 */
    .order-input-section .section-heading { flex-wrap: nowrap; gap: 10px; }
    .order-input-section .section-heading > span { min-width: 32px; height: 32px; font-size: 14px; }
    .order-input-section .section-heading h2 { font-size: 17px; white-space: nowrap; }
    .order-input-section .section-heading .head-action { flex-shrink: 0; white-space: nowrap; padding: 5px 10px; font-size: 12px; }
}
