﻿/* ==========================================================================
   쇼핑

   폭을 다 쓰는 자리에 선다. 그래서 양옆에 제 여백을 둔다 - 그러지 않으면
   글과 사진이 화면 가장자리에 바로 붙는다.
   ========================================================================== */

.shop-wrap {
    padding: 0 24px 40px;
}

/* ---------- 머리 ---------- */

/* 위의 BIZ EVENT 띠에 바로 붙지 않게 띄운다. 붙어 있으면 쇼핑이 그 띠의
   일부처럼 읽힌다. */
.shop-head {
    margin: 28px 0 4px;
}
.shop-head {
    position: relative;
}
.shop-head .shop-head-links {
    position: absolute;
    right: 0;
    bottom: 4px;
}
.shop-head .shop-cart-link {
    display: inline-block;
    margin-left: 8px;
    padding: 8px 16px;
    border: 1px solid #ccc;
    border-radius: 20px;
    color: #333;
    font-size: 14px;
}
.shop-head .shop-cart-link:hover {
    background: #f5f5f5;
    text-decoration: none;
}
.shop-head h1 {
    margin: 0;
    font-size: 26px;
    font-weight: 700;
    line-height: 1.2;
}
.shop-head .shop-count {
    margin-left: 10px;
    font-size: 14px;
    font-weight: 400;
    color: #999;
}

.shop-crumb {
    margin: 24px 0 16px;
    font-size: 13px;
    color: #888;
}
.shop-crumb a {
    color: #888;
}
.shop-crumb .shop-crumb-sep {
    margin: 0 8px;
    color: #ccc;
}

.shop-toolbar {
    margin: 0 0 20px;
    padding: 10px 0;
    border-bottom: 1px solid #e6e6e6;
    overflow: hidden;
}
.shop-toolbar .shop-cats {
    float: left;
}
.shop-toolbar .shop-sort {
    float: right;
}
.shop-toolbar a {
    display: inline-block;
    margin-right: 10px;
    padding: 4px 10px;
    color: #555;
    font-size: 14px;
    border-radius: 2px;
}
.shop-toolbar a:hover {
    background: #f2f2f2;
    text-decoration: none;
}
.shop-toolbar a.is-on {
    background: #333;
    color: #fff;
}

/* ---------- 칸 ----------
   한 줄에 다섯. 좁아지면 넷, 셋, 둘로 준다. 사진이 주인공이므로 칸의
   가로세로를 고정하고 그 안에서 사진을 잘라 넣는다 - 그러지 않으면 세로로
   긴 사진 하나가 줄 전체를 밀어내린다. */
.shop-grid {
    margin: 0 -8px;
    overflow: hidden;
}
.shop-card {
    float: left;
    width: 20%;
    padding: 0 8px 28px;
    box-sizing: border-box;
}
.shop-card a {
    display: block;
    color: inherit;
}
.shop-card a:hover {
    text-decoration: none;
}
.shop-card .shop-thumb {
    position: relative;
    height: 0;
    padding-bottom: 100%;        /* 정사각형 */
    overflow: hidden;
    background: #fff;
    border: 1px solid #e6e6e6;

    /* 누를 수 있는 자리라는 것을 손이 오면 알려 준다. 칸 전체가 링크인데
       아무 반응이 없으면 그림처럼 읽힌다. */
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.shop-card a:hover .shop-thumb {
    border-color: #bbb;
    box-shadow: 0 2px 10px rgba(0,0,0,0.10);
}
.shop-card a:hover .shop-name {
    text-decoration: underline;
}
/* 사진을 자르지 않고 칸 안에 통째로 넣는다.
   세로로 긴 사진은 양옆이, 가로로 넓은 사진은 위아래가 남는다 - 그 자리는
   흰 바탕으로 둔다.

   자르는 편이 칸은 더 꽉 차 보이지만, 파는 물건의 가장자리가 잘려 나간다.
   병 뚜껑이 없어지거나 글자가 반만 보이는 사진으로는 무엇인지 알기 어렵다.

   padding 은 사진이 테두리에 닿지 않게 한다. 닿으면 상자에 눌러 담은 것처럼
   보인다. */
.shop-card .shop-thumb img {
    position: absolute;
    top: 0; left: 0;
    width: 100%;
    height: 100%;
    padding: 10px;
    box-sizing: border-box;
    object-fit: contain;
}
.shop-card .shop-name {
    margin: 10px 0 4px;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.35;

    /* 이름이 길어도 칸의 키가 달라지지 않게 두 줄에서 자른다. */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.shop-card .shop-desc {
    margin: 0 0 6px;
    font-size: 13px;
    color: #888;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.shop-card .shop-price {
    font-size: 18px;
    font-weight: 700;
    color: #111;
}
.shop-was {
    margin-left: 8px;
    font-size: 14px;
    font-weight: 400;
    color: #aaa;
    text-decoration: line-through;
}

/* 재고가 없는 칸. 지우지 않고 덮는다 - 잠시 없는 것이지 팔지 않는 것이
   아니므로, 다시 채웠을 때 같은 자리에 그대로 선다. */
.shop-card .shop-soldout {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(255,255,255,0.72);
    color: #c00;
    font-size: 15px;
    font-weight: 700;
    text-align: center;
}
.shop-card .shop-soldout span {
    position: absolute;
    top: 50%; left: 0;
    width: 100%;
    margin-top: -10px;
}

.shop-empty {
    padding: 40px 0;
    text-align: center;
    color: #888;
}

/* ---------- 상품 화면 ----------
   작은 사진이 왼쪽에 세로로 서고, 큰 사진이 그 옆에, 살 수 있는 것들이
   오른쪽에. 물건 파는 곳들이 오래 다듬어 온 모양이다 - 사진이 많아도 값과
   단추가 첫 화면에서 밀려나지 않는다. */
.shop-detail {
    overflow: hidden;
    margin-bottom: 40px;
}
.shop-detail .shop-gallery {
    float: left;
    width: 58%;
    overflow: hidden;
}
.shop-detail .shop-info {
    float: right;
    width: 38%;
}

.shop-detail .shop-thumbs-v {
    float: left;
    width: 72px;
}
.shop-detail .shop-thumbs-v a {
    display: block;
    margin-bottom: 8px;
    border: 1px solid #e6e6e6;
    box-sizing: border-box;
}
.shop-detail .shop-thumbs-v a.is-on {
    border-color: #333;
}
.shop-detail .shop-thumbs-v img {
    display: block;
    width: 100%;
}

/* 사진이 한 장뿐이면 왼쪽 줄이 없다. 그때는 큰 사진을 안으로 밀지 않는다. */
.shop-detail .shop-gallery.no-thumbs .shop-main-image {
    margin-left: 0;
}
.shop-detail .shop-main-image {
    position: relative;          /* 화살표가 이 안에 자리를 잡는다 */
    margin-left: 88px;
    border: 1px solid #e6e6e6;
    background: #fff;
    text-align: center;
    min-height: 300px;
}
.shop-detail .shop-main-image img {
    max-width: 100%;
    vertical-align: middle;
}

/* 사진 양옆의 화살표.
   사진 위에 얹지 않고 가장자리에 세운다 - 상품 사진 한가운데를 가리면
   보러 온 것을 가리는 셈이 된다. 평소에는 옅게 두었다가 손이 오면 짙어진다. */
.shop-detail .shop-nav {
    position: absolute;
    top: 50%;
    width: 44px;
    height: 60px;
    margin-top: -30px;
    color: #999;
    font-size: 40px;
    line-height: 58px;
    text-align: center;
    text-decoration: none;
    -webkit-user-select: none;
    user-select: none;
    transition: color 0.15s ease;
}
.shop-detail .shop-nav:hover {
    color: #222;
    text-decoration: none;
}
.shop-detail .shop-prev { left: 4px; }
.shop-detail .shop-next { right: 4px; }

.shop-detail h1 {
    margin: 0 0 6px;
    font-size: 26px;
    line-height: 1.3;
}
.shop-detail .shop-sub {
    margin-bottom: 18px;
    font-size: 15px;
    color: #777;
}
.shop-detail .shop-detail-price {
    margin: 18px 0;
    font-size: 28px;
    font-weight: 700;
}
.shop-detail .shop-tax-note {
    margin-left: 10px;
    font-size: 13px;
    font-weight: 400;
    color: #888;
}
.shop-detail .shop-stock {
    margin: 10px 0 22px;
    font-size: 14px;
    color: #555;
}
.shop-detail .shop-stock.is-out {
    color: #c00;
    font-weight: 700;
}

/* ---------- 사는 자리 ---------- */
.shop-buybox {
    padding-top: 20px;
    border-top: 1px solid #eee;
}
.shop-buy-row {
    display: block;
}
.shop-qty {
    height: 46px;
    padding: 0 8px;
    margin-right: 10px;
    font-size: 15px;
    border: 1px solid #ccc;
    vertical-align: top;
}
.shop-buy-button {
    display: inline-block;
    height: 46px;
    min-width: 220px;
    padding: 0 24px;
    background: #c8102e;
    color: #fff;
    font-size: 16px;
    font-weight: 700;
    border: none;
    border-radius: 24px;
    cursor: pointer;
    vertical-align: top;
}
.shop-buy-button:hover {
    background: #a50d26;
}
.shop-buy-button.is-off {
    background: #ddd;
    color: #888;
    line-height: 46px;
    text-align: center;
    cursor: default;
}
.shop-buy-msg {
    margin-top: 12px;
    padding: 10px 12px;
    background: #fdf3f3;
    border: 1px solid #f0d6d6;
    color: #a12;
    font-size: 14px;
}
.shop-buy-msg.is-good {
    background: #f2f8f4;
    border-color: #cfe6d7;
    color: #1c6b3a;
}

.shop-back {
    margin-top: 24px;
    font-size: 14px;
}

/* ---------- 아래 칸들 ----------
   제목 하나에 내용 하나. 줄은 제목 밑에 그어 그 아래가 이 제목에 딸린
   것임을 보인다 - 줄을 칸 위에 그으면 제목이 앞 칸에 붙어 보인다.

   배송 안내나 교환·반품 같은 칸이 붙을 자리라 한 벌로 만들어 둔다. */
.shop-section {
    margin-top: 40px;
}
.shop-section-title {
    margin: 0 0 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid #e6e6e6;
    font-size: 18px;
    font-weight: 700;
    line-height: 1.3;
}

.shop-description {
    line-height: 1.7;
}
.shop-description img {
    max-width: 100%;
    height: auto;
}

/* ---------- 좁은 화면 ----------
   폭이 줄면 칸도 준다. 다섯을 억지로 지키면 사진이 우표만 해진다. */
@media (max-width: 1199px) {
    .shop-card { width: 25%; }
}
@media (max-width: 991px) {
    .shop-card { width: 33.3333%; }
    .shop-detail .shop-gallery,
    .shop-detail .shop-info { float: none; width: 100%; }
    .shop-detail .shop-info { margin-top: 24px; }
}
@media (max-width: 767px) {
    .shop-wrap { padding: 0 12px 30px; }
    .shop-card { width: 50%; }

    /* 좁은 화면에서는 작은 사진을 큰 사진 아래에 가로로 눕힌다 - 옆에 두면
       큰 사진이 남는 폭에 눌려 작아진다. */
    .shop-detail .shop-thumbs-v {
        float: none;
        width: auto;
        margin: 8px -4px 0;
        overflow: hidden;
    }
    .shop-detail .shop-thumbs-v a {
        float: left;
        width: 20%;
        margin: 0 0 8px;
        border: none;
        padding: 0 4px;
    }
    .shop-detail .shop-thumbs-v img {
        border: 1px solid #e6e6e6;
        box-sizing: border-box;
    }
    .shop-detail .shop-thumbs-v a.is-on img {
        border-color: #333;
    }
    .shop-detail .shop-main-image {
        margin-left: 0;
    }
    .shop-buy-button { min-width: 0; width: calc(100% - 90px); }
}
@media (max-width: 479px) {
    .shop-toolbar .shop-cats,
    .shop-toolbar .shop-sort { float: none; }
}

/* ==========================================================================
   장바구니

   한 줄에 한 상품, 위에서 아래로. 표처럼 칸을 나누지 않는다 - 칸이 넷이면
   좁은 화면에서 넷 다 눌려 글자가 겹친다. 사진 · 이름 · 값을 한 줄에 두고
   나머지는 오른쪽 끝에 모은다.
   ========================================================================== */

.shop-cart-page .shop-head {
    margin-bottom: 24px;
}

/* ---------- 담은 것 ---------- */
.cart-list {
    border-top: 1px solid #e6e6e6;
}
.cart-line {
    display: table;
    width: 100%;
    padding: 18px 0;
    border-bottom: 1px solid #eee;
    box-sizing: border-box;
}
.cart-pic,
.cart-body,
.cart-tail {
    display: table-cell;
    vertical-align: middle;
}

.cart-pic {
    width: 88px;
}
.cart-pic img {
    display: block;
    width: 80px;
    height: 80px;
    padding: 6px;
    box-sizing: border-box;
    border: 1px solid #eee;
    object-fit: contain;
}
.cart-pic .cart-nothumb {
    display: block;
    width: 80px;
    height: 80px;
    background: #f7f7f7;
    border: 1px solid #eee;
}

.cart-body {
    padding-right: 20px;
}
.cart-name {
    display: block;
    margin-bottom: 4px;
    color: #111;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.35;
}
.cart-name:hover {
    text-decoration: underline;
}
.cart-unit {
    font-size: 13px;
    color: #888;
}
.cart-note {
    margin-top: 4px;
    font-size: 12px;
}
.cart-note .is-out {
    color: #c00;
    font-weight: 700;
}

/* 값과 손댈 것들을 오른쪽 끝에 모은다. 눈이 값을 따라 세로로 내려오고,
   고칠 것이 있으면 바로 그 아래에 있다. */
.cart-tail {
    width: 160px;
    text-align: right;
    white-space: nowrap;
}
.cart-sum {
    font-size: 17px;
    font-weight: 700;
    color: #111;
}
.cart-actions {
    margin-top: 8px;
}
.cart-qty {
    height: 32px;
    padding: 0 6px;
    border: 1px solid #ccc;
    font-size: 14px;
}
.cart-remove {
    margin-left: 12px;
    color: #999;
    font-size: 13px;
}
.cart-remove:hover {
    color: #c00;
}

/* ---------- 셈 ---------- */
.cart-sumbox {
    width: 300px;
    max-width: 100%;
    margin: 24px 0 0 auto;      /* 오른쪽에 붙인다 - 띄우지 않고 여백으로 */
}
.cart-sum-row {
    display: table;
    width: 100%;
    padding: 7px 0;
    font-size: 15px;
}
.cart-sum-row span {
    display: table-cell;
    color: #777;
}
.cart-sum-row b {
    display: table-cell;
    text-align: right;
    font-weight: 600;
}
.cart-sum-row.is-total {
    margin-top: 8px;
    padding-top: 16px;
    border-top: 1px solid #ddd;
}
.cart-sum-row.is-total span {
    color: #111;
    font-size: 17px;
    font-weight: 700;
}
.cart-sum-row.is-total b {
    font-size: 22px;
    font-weight: 700;
}

/* ---------- 받는 분 ----------
   셈이 오른쪽에 붙어 있으므로 여기서 줄을 새로 시작한다. 예전에는 이 칸이
   셈 옆으로 흘러들어 글자가 겹쳤다. */
.cart-form-block {
    clear: both;
    margin-top: 48px;
}
.cart-form {
    margin: 0 -10px;
    overflow: hidden;
}
.cart-field {
    float: left;
    width: 50%;
    padding: 0 10px 18px;
    box-sizing: border-box;
}
.cart-field.is-wide { width: 100%; }
.cart-field.is-third { width: 33.3333%; }

.cart-field label {
    display: block;
    margin-bottom: 6px;
    font-size: 13px;
    color: #777;
}
.cart-field input[type="text"],
.cart-field textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #d5d5d5;
    border-radius: 3px;
    box-sizing: border-box;
    font-size: 14px;
    font-family: inherit;
}
.cart-field input[type="text"]:focus,
.cart-field textarea:focus {
    border-color: #888;
    outline: none;
}

/* 아직 결제를 받지 않는다는 말. 눈에 띄되 겁주지 않는 색으로. */
.cart-notice {
    clear: both;
    margin: 6px 0 24px;
    padding: 14px 16px;
    background: #fbf8ef;
    border: 1px solid #ecdfb8;
    color: #6b5620;
    font-size: 14px;
    line-height: 1.6;
}
.cart-submit {
    padding-bottom: 30px;
}

/* ---------- 주문이 끝난 뒤 ---------- */
.shop-done {
    max-width: 560px;
    margin: 40px auto;
    padding: 34px;
    border: 1px solid #cfe6d7;
    background: #f7fbf8;
    text-align: center;
    line-height: 1.7;
}
.shop-done-title {
    font-size: 22px;
    font-weight: 700;
    color: #1c6b3a;
}
.shop-done-no {
    margin: 10px 0 16px;
    font-size: 16px;
}
.shop-done-links a {
    display: inline-block;
    margin: 0 10px;
}

@media (max-width: 767px) {
    .cart-pic { width: 72px; }
    .cart-pic img,
    .cart-pic .cart-nothumb { width: 64px; height: 64px; }
    .cart-tail { width: 110px; }
    .cart-remove { display: block; margin: 6px 0 0; }
    .cart-field,
    .cart-field.is-third { width: 100%; }
    .cart-sumbox { width: 100%; }
}

/* ==========================================================================
   주문 내역

   주문 하나가 칸 하나. 머리에 번호와 상태, 가운데에 산 것들, 발에 보낼
   곳과 합계.
   ========================================================================== */

.myorder {
    margin-bottom: 20px;
    border: 1px solid #e6e6e6;
    border-radius: 4px;
}
.myorder-head {
    display: table;
    width: 100%;
    padding: 14px 18px;
    background: #fafafa;
    border-bottom: 1px solid #eee;
    box-sizing: border-box;
}
.myorder-no,
.myorder-status {
    display: table-cell;
    vertical-align: middle;
}
.myorder-no b {
    font-size: 15px;
}
.myorder-date {
    margin-left: 12px;
    color: #999;
    font-size: 13px;
}
.myorder-status {
    text-align: right;
    white-space: nowrap;
}

.myorder-line {
    display: table;
    width: 100%;
    padding: 12px 18px;
    border-bottom: 1px solid #f2f2f2;
    box-sizing: border-box;
}
.myorder-pic,
.myorder-name,
.myorder-qty,
.myorder-sum {
    display: table-cell;
    vertical-align: middle;
}
.myorder-pic {
    width: 60px;
}
.myorder-pic img,
.myorder-nopic {
    display: block;
    width: 48px;
    height: 48px;
    padding: 4px;
    box-sizing: border-box;
    border: 1px solid #eee;
    object-fit: contain;
}
.myorder-nopic {
    background: #f7f7f7;
}
.myorder-name {
    font-size: 15px;
}
.myorder-qty {
    width: 80px;
    text-align: center;
    color: #777;
    font-size: 14px;
}
.myorder-sum {
    width: 110px;
    text-align: right;
    font-weight: 600;
}

.myorder-foot {
    display: table;
    width: 100%;
    padding: 14px 18px;
    box-sizing: border-box;
}
.myorder-ship,
.myorder-total {
    display: table-cell;
    vertical-align: middle;
}
.myorder-ship {
    color: #888;
    font-size: 13px;
    line-height: 1.5;
}
.myorder-total {
    width: 180px;
    text-align: right;
    white-space: nowrap;
    color: #777;
    font-size: 14px;
}
.myorder-total b {
    margin-left: 6px;
    color: #111;
    font-size: 19px;
}

/* ---------- 상태 딱지 ----------
   뒷사무실 목록과 같은 뜻의 같은 색. 손님이 보는 말과 우리가 보는 말이
   다르면 전화로 이야기할 때 서로 다른 것을 가리키게 된다.

   신호등의 뜻을 따른다: 아직 손대지 않은 것이 빨강, 손을 댄 것이 노랑,
   길 위에 있는 것이 파랑, 끝난 것이 초록. 취소만 채운 빨강이다. */
.ord-badge {
    display: inline-block;
    min-width: 62px;
    padding: 3px 12px;
    border-radius: 11px;
    border: 1px solid transparent;
    font-size: 12px;
    font-weight: 700;
    line-height: 16px;
    text-align: center;
    white-space: nowrap;
}
.ord-new    { background: #ffecec; border-color: #f2b8b8; color: #c0261d; }
.ord-ok     { background: #fff6da; border-color: #ecd48a; color: #8a6300; }
.ord-ship   { background: #e9f1fd; border-color: #b8d3f5; color: #1657a8; }
.ord-done   { background: #eaf6ee; border-color: #b3dcc1; color: #1c6b3a; }
.ord-cancel { background: #c8102e; border-color: #c8102e; color: #ffffff; }

@media (max-width: 767px) {
    .myorder-qty { width: 56px; }
    .myorder-sum { width: 90px; }
    .myorder-foot { display: block; }
    .myorder-ship,
    .myorder-total { display: block; width: auto; text-align: left; }
    .myorder-total { margin-top: 8px; }
}
