/* RESET & BASE */
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body {
    width: 100vw; height: 100vh;
    min-height: 100vh; min-width: 100vw;
    overflow: hidden;
    position: relative;
    font-family: 'Segoe UI', Arial, sans-serif;
    background: #000;
    color: #222;
}

/* === [VIDEO FULL VERTICAL (전체세로화면) 적용 추가] === */
.live-container,
.video-section {
    width: 100vw;
    height: 100vh;
    min-height: 100vh;
}

/* 세로 전체화면용 래퍼와 iframe */
.video-fullscreen-wrapper {
    position: relative;
    width: 100vw;
    height: 100vh;
    background: #000;
}
#video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    min-width: 100vw;
    min-height: 100vh;
    border: none;
    background: #000;
}

/************** VIDEO BACKGROUND *************/
.video-section {
    position: fixed;
    inset: 0;
    width: 100vw; height: 100vh;
    z-index: 1;
    background: #000;
}
.video-section video {
    width: 100vw; height: 100vh;
    object-fit: cover;
    object-position: center;
    display: block;
    background: #191919;
}

/************** OVERLAY UI CONTAINERS *************/
/* 모든 주요 UI, 항상 영상 위에 표시 */
.overlay {
    position: fixed;
    width: 100vw; /* 디폴트 */
    pointer-events: none;
    z-index: 10;
}

/************** NOTICE BANNER *************/
.notice-banner.active { animation: noticeDown 0.5s; }
@keyframes noticeDown {
    from { opacity: 0; transform: translateY(-30px);}
    to   { opacity: 1; transform: translateY(0); }
}
.notice-content {
    background: rgba(30, 30, 30, 0.32);   /* 살짝 어두운 투명 배경 (or 필요없음) */
    color: #ffe066;                       /* 밝은 노란색 텍스트 */
    border-radius: 0;
    border: none;
    box-shadow: none;
    padding: 18px 0 14px 0;               /* 위아래 패딩, 양옆은 없음 */
    font-weight: 700;
    min-width: 0;
    width: 100vw;                         /* 가로 전체 */
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0;
    pointer-events: auto;
    font-size: 1.14rem;
    text-align: center;
}
.notice-banner {
    /* 기존 스타일 유지(가로 전체/상단위치), 필요 시 아래만 추가 */
    width: 100vw;
    position: absolute;     /* 상단 고정 */
    top: 0;
    left: 0;
    right: 0;
}
.notice-icon { font-size: 22px; }

/************** PRODUCT OVERLAY *************/
.product-overlay {
    z-index: 20;
    pointer-events: auto;
    position: fixed;
    left: 0; right: 0; bottom: 0;
    margin: 0 auto 0 auto;
    max-width: 500px;
    width: 97vw;
    background: rgba(255,255,255,0.96);
    backdrop-filter: blur(8px);
    padding: 15px 18px;
    border-radius: 22px 22px 0 0;
    box-shadow: 0 -3px 22px 0 rgba(0,0,0,0.12);
    display: flex; align-items: center; gap: 16px;
}
.product-overlay img {
    width: 56px; height: 56px; object-fit: cover; border-radius: 12px;
    background: #ececec; flex-shrink: 0;
}
.product-info {
    flex: 1 1 0;
    display: flex; flex-direction: column; min-width: 0;
    gap: 8px;
}
.product-info h4 {
    font-weight: 700;
    font-size: 15px;
    color: #2d2d38;
    margin-bottom: 2px;
    margin-top: 0;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.product-info .price {
    color: #e85329;
    font-weight: bold;
    font-size: 15px;
}
.view-cart-btn {
    background: linear-gradient(135deg, #4caf50 0%, #45a049 100%);
    color: #fff;
    padding: 9px 17px;
    border: none;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 2px 10px #7fc09980;
    transition: all 0.18s;
    flex-shrink: 0;
}
.view-cart-btn:active { filter: brightness(0.94); }

/************** CART OVERLAY *************/
.cart-overlay {
    z-index: 100;
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 11, 31, 0.78);
    justify-content: center;
    align-items: center;
    pointer-events: auto;
}
.cart-overlay.active { display: flex; }
.cart-popup {
    background: #fff;
    border-radius: 18px;
    padding: 30px 25px 15px 25px;
    max-width: 430px;
    width: 97vw;
    max-height: 85vh; overflow-y: auto;
    box-shadow: 0 10px 32px rgba(0,0,0,0.19);
    position: relative;
}
.cart-popup h5 {
    font-size: 19px; color: #236; font-weight: bold;
    margin-bottom: 17px; display: flex; align-items: center; gap: 7px;
    border-bottom: 2px solid #f1f1f1; padding-bottom: 13px;
}
.cart-popup-close {
    position: absolute;
    top: 20px; right: 18px;
    background: #eee;
    border: none;
    width: 30px; height: 30px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 19px;
    color: #444;
    display: flex; align-items: center; justify-content: center;
    font-weight: bold;
}
#cart-list { list-style: none; margin: 0 0 17px 0; padding: 0;}
.cart-item {
    padding: 12px 0;
    border-bottom: 1px solid #f3f3f3;
    display: flex; gap: 12px; align-items: flex-start;
}
.cart-item:last-child { border-bottom: none; }
.cart-item-image {
    width: 64px; height: 64px;
    object-fit: cover; border-radius: 9px; background: #ededed; flex-shrink: 0;
}
.cart-item-info { flex: 1; display: flex; flex-direction: column; gap: 7px; }
.cart-item-name { font-weight: 700; font-size: 15px; color: #222; }
.cart-item-price { color: #e85329; font-weight: 600; font-size: 15px; }
.cart-item-controls {
    display: flex; align-items: center; gap: 7px; margin-top: 4px;
}
.cart-qty-btn {
    width: 26px; height: 26px;
    border: 1px solid #ddd;
    border-radius: 6px;
    background: #fff;
    cursor: pointer;
    font-size: 15px; font-weight: 700; color: #294;
    display: flex; align-items: center; justify-content: center;
    transition: background 0.13s;
}
.cart-qty-btn:disabled { color: #bbb;}
.cart-qty-display {
    min-width: 32px; text-align: center; font-weight: 600; font-size: 15px;
}
.cart-item-remove {
    background: #f44;
    color: #fff;
    border: none;
    padding: 6px 13px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 700;
}
.cart-total {
    padding: 14px 7px;
    background: #f2f8fc;
    border-radius: 11px;
    display: flex; justify-content: space-between; align-items: center;
    font-size: 16px; font-weight: 700; color: #222;
    margin-top: 6px; margin-bottom: 14px;
}
.cart-total-label { color: #555;}
.cart-total-price { color: #e85329; font-size: 18px;}
.cart-checkout-btn {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #ff7a00 0%, #ff5500 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 17px; font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 15px #ffbe8649;
    margin-top: 3px;
}
.cart-checkout-btn:disabled { background: #ccc; cursor: not-allowed; box-shadow: none; }
.cart-empty {
    text-align: center; padding: 55px 15px 30px 15px; color: #888; font-size: 14px;
}

.cart-summary-compact .cart-summary-value { 
    display:inline-block; min-width:110px; 
    text-align:right; 
}

.cart-summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 6px;
}

.cart-summary-row .cart-summary-label {
    font-weight: 600;
    color: #444;
}

.cart-summary-row .cart-summary-value {
    flex: 0 0 auto;
    font-weight: 700;
    color: #222;
    text-align: right;
    min-width: 130px;
}

.cart-summary-row.total .cart-summary-value {
    font-size: 1.25rem;
    color: #e85329;
}
.cart-summary-row.total .cart-summary-label {
    font-size: 1.05rem;
    color: #222;
}

.cart-summary-sep {
    margin: 6px 0 10px 0;
    border: none;
    border-top: 1px dashed #d9d9d9;
}

/************** CHAT OVERLAY (하단 중앙) *************/
.chat-overlay {
    z-index: 25;
    pointer-events: auto;
    position: fixed;
    left: 0; right: 0; bottom: 85px;
    margin: 0 auto; max-width: 500px;
    width: 98vw;
    display: flex; flex-direction: column; gap: 0;
}

/* 입력창과 전송 버튼이 한줄로 붙으면서, 버튼이 잘리지 않게 수정 */
.chat-input-wrapper {
    display: flex;
    align-items: center;
    width: 100%;
    gap: 7px;
}
#chat-input {
    flex: 1 1 0%;
    min-width: 0;
}
#chat-send {
    flex-shrink: 0;
    margin-left: 4px;
    min-width: 56px;
    max-width: 80px;
    height: 40px;
    box-sizing: border-box;
    overflow: hidden;
}

/* 필요시 모바일에서도 버튼 영역이 유지되도록 */
@media (max-width:650px) {
    #chat-send {
        min-width: 44px;
        max-width: 65px;
        height: 38px;
        font-size: 14px;
        padding-left: 0; padding-right: 0;
    }
}

.chat-messages {
    flex: 1; overflow-y: auto;
    display: flex; flex-direction: column; gap: 6px;
    padding: 10px 17px;
    min-height: 70px; max-height: 32vh;
    background: transparent;
    border-radius: 12px 12px 0 0;
    font-size: 15px;
    box-shadow: 0 1px 10px rgba(0,0,0,0.08);
}
.chat-message .nickname {
    font-weight: 700; color: #ffc107;
    margin-right: 9px; font-size: 14px;
}
.chat-message .text {
    color: #fff; font-size: 14px;
}
.chat-input-area {
    display: flex; gap: 10px; align-items: center;
    background: transparent;
    border-radius: 0 0 12px 12px;
    padding: 12px 14px;
}
.chat-input-area input {
    flex: 1 1 0px; min-width: 0;
    border-radius: 24px;
    padding: 11px 16px;
    border: 1px solid rgba(255,255,255,0.28);
    outline: none;
    background: rgba(255,255,255,0.13);
    font-size: 15px; color: #fff;
}
.chat-input-area input::placeholder { color: #fff9; }
.emoji-toggle-btn {
    width: 40px; height: 40px;
    border-radius: 50%; border: none;
    background: rgba(0,0,0,0.18);
    color: #ffc107;
    font-size: 21px;
    cursor: pointer;
}
.chat-send-btn {
    padding: 11px 12px;
    min-width: 52px; font-size: 15px;
    background: linear-gradient(135deg, #ff7a00 0%, #ff5500 100%);
    color: white;
    border: none; border-radius: 25px;
    font-weight: 700;
    box-shadow: 0 2px 10px #ffb8864d;
    cursor: pointer;
    flex-shrink: 0;
}
.chat-send-btn:active { opacity: 0.7; }

.emoji-picker {
    display: none; position: absolute; bottom: 56px; left: 0;
    background: rgba(23,28,38,0.98);
    border-radius: 15px;
    padding: 14px; gap: 8px;
    flex-wrap: wrap; max-height: 180px;
    overflow-y: auto;
    border: 1px solid #3c4a5e2e;
    z-index: 300;
}
.emoji-picker.active { display: flex; }
.emoji-btn {
    width: 43px; height: 43px;
    border-radius: 8px;
    border: none;
    background: rgba(255,255,255,0.09);
    font-size: 23px;
    cursor: pointer;
}

/************** VIDEO WAITING OVERLAY (대기/로딩 등) *************/
.video-waiting-overlay {
    position: absolute; inset: 0;
    display: flex; align-items: center; justify-content: center;
    background: rgba(10,20,40,0.88);
    z-index: 17; text-align: center;
    animation: fadeIn 1s;
    box-shadow: 0 0 40px 10px #141c4818 inset;
}
@keyframes fadeIn { from { opacity:0; } to { opacity:1; } }
.waiting-content { display: flex; flex-direction: column; align-items: center; }
.waiting-icon {
    font-size: 56px; margin-bottom: 20px;
    animation: bounce 1.6s infinite both;
}
@keyframes bounce {
    0%   { transform: translateY(0);}
    40%  { transform: translateY(-20px);}
    60%  { transform: translateY(-12px);}
    80%  { transform: translateY(-6px);}
    100% { transform: translateY(0);}
}
.waiting-text .main {
    font-size: 2.1rem; color: #ffe066; font-weight: bold;
    margin-bottom: 10px; letter-spacing: 0.02em;
    text-shadow: 0 4px 16px #0003, 0 1px 1px #000;
}
.waiting-text .sub {
    font-size: 1.12rem; color: #fff;
    opacity: 0.86; margin-top: 8px;
    text-shadow: 0 1px 8px #0002;
}
.waiting-spinner {
    margin-top: 27px;
    width: 40px; height: 40px;
    border: 5px solid #ffe06622;
    border-top: 5px solid #ffe066;
    border-radius: 50%;
    animation: spin 1.2s linear infinite;
}
@keyframes spin { 0% { transform: rotate(0);} 100% { transform: rotate(360deg);} }

/********** SCROLLBAR FOR CHAT/EMOJI ***********/
.chat-messages::-webkit-scrollbar,
.emoji-picker::-webkit-scrollbar { width: 4px; }
.chat-messages::-webkit-scrollbar-thumb,
.emoji-picker::-webkit-scrollbar-thumb { background: #fff3; border-radius: 2px; }
.chat-messages::-webkit-scrollbar-track,
.emoji-picker::-webkit-scrollbar-track { background: transparent; }

/************** RESPONSIVE FOR MOBILE *************/
@media (max-width:650px) {
    .notice-content { padding: 10px 7vw 10px 13px; font-size: 14px;}
    .product-overlay, .chat-overlay, .cart-popup { max-width:98vw;}
    .cart-popup { padding: 13vw 3vw 4vw 3vw; font-size: 15px;}
    .chat-messages { padding: 7px 4vw; font-size:14px;}
    .chat-input-area { padding: 10px 4vw; }
}
