/* Trang shop.skymax.vn - dung lai cac class "ruot" (the san pham, panel da chon,
   form checkout...) tu cart-website01.css, chi thay phan khung ngoai tu modal
   nen mo sang bo cuc trang binh thuong. */

.shop-page { padding: 140px 0 80px; min-height: 70vh; }
.shop-head { margin-bottom: 20px; }
.shop-head h1 { font-size: 1.8rem; font-weight: 800; color: var(--navy); }

/* Khong dung overflow:hidden o day nua - no tao ra 1 "containing block" rieng
   khien .shop-search-bar (position:sticky) bam nham theo no thay vi bam theo
   cuon trang thuc te, gay loi thanh tim kiem troi giua danh sach. Bo cuon rong
   rieng cua .shop-products, de ca trang cuon tu nhien - sticky se hoat dong
   dung theo cuon trang. Bo tron 2 goc chuyen sang tung cot 2 dau thay vi dua
   vao overflow:hidden cua cha. */
.shop-body {
  display: flex; gap: 0; border: 1px solid var(--gray-light); border-radius: var(--radius);
  background: var(--white); box-shadow: var(--shadow); align-items: stretch;
}
.shop-cats {
  width: 220px; flex-shrink: 0; border-right: 1px solid var(--gray-light);
  padding: 16px; display: flex; flex-direction: column; gap: 4px; background: var(--white);
  border-radius: var(--radius) 0 0 var(--radius);
}

/* ---- cot giua: thanh tim kiem (dinh o tren khi cuon trang) + luoi san pham ---- */
.shop-products-col { flex: 1; min-width: 0; display: flex; flex-direction: column; background: var(--gray-pale); }
.shop-search-bar {
  position: sticky; top: var(--header-h); z-index: 5; flex-shrink: 0;
  display: flex; align-items: center; gap: 10px; padding: 16px 24px;
  background: var(--white); border-bottom: 1px solid var(--gray-light);
}
.shop-search-bar svg { width: 19px; height: 19px; color: var(--gray); flex-shrink: 0; }
.shop-search-bar input {
  flex: 1; border: none; background: none; font-size: .95rem; color: var(--navy);
  padding: 4px 0;
}
.shop-search-bar input:focus { outline: none; }
.shop-search-bar input::placeholder { color: var(--gray); }

.shop-products { padding: 20px 24px; }

.shop-selected {
  width: 290px; flex-shrink: 0; border-left: 1px solid var(--gray-light);
  padding: 18px; background: var(--gray-pale); display: flex; flex-direction: column;
  border-radius: 0 var(--radius) var(--radius) 0;
}
.shop-selected-body { flex: 1; }
/* Dinh (sticky) nut "Dat Hang" theo day man hinh khi cuon, de luon trong tam
   tay du danh sach san pham ben trai dai bao nhieu - khong can ca panel nay
   tach khoi chieu cao hang (giu duoc dang the deu dep nhu cu). */
.shop-selected-foot {
  position: sticky; bottom: 20px; flex-shrink: 0; margin-top: 10px;
  background: var(--gray-pale); padding-top: 14px; border-top: 1px solid var(--gray-light);
}

/* trang thai rong cho panel da chon - them icon cho do trong trai */
.shop-selected-empty-wrap { text-align: center; padding: 36px 12px; color: var(--gray); }
.shop-selected-empty-wrap svg { width: 40px; height: 40px; color: var(--gray-light); margin-bottom: 10px; }
.shop-selected-empty-wrap p { font-size: .82rem; }

.shop-checkout, .shop-success { max-width: 620px; margin: 0 auto; }
.shop-back-link { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; color: var(--navy); margin-bottom: 18px; }
.shop-back-link:hover { color: var(--gold-dark); }

/* mot chut polish cho the san pham dung chung tu cart-website01.css */
.cwcart-card { transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease; }
.cwcart-card:hover { transform: translateY(-2px); }
.cwcart-card-img[data-open-detail], .cwcart-card-name[data-open-detail] { cursor: pointer; }
.cwcart-card-detail-link {
  align-self: flex-start; font-size: .76rem; font-weight: 700; color: var(--gold-dark);
  text-decoration: underline; text-underline-offset: 2px; margin-top: -2px;
}
.cwcart-card-detail-link:hover { color: var(--navy); }

/* Noi bat lai the vua xem chi tiet sau khi bam "Quay lai chon san pham", de
   nguoi dung de tim lai dung cho minh dang xem - tu mo dan roi tat sau ~2.5s. */
@keyframes cwcart-just-viewed-pulse {
  0% { box-shadow: 0 0 0 0 rgba(217,140,15,.45); }
  70% { box-shadow: 0 0 0 10px rgba(217,140,15,0); }
  100% { box-shadow: 0 0 0 0 rgba(217,140,15,0); }
}
.cwcart-card.just-viewed {
  border-color: var(--gold); animation: cwcart-just-viewed-pulse 1.3s ease-out 2;
}

/* ---- man chi tiet san pham ---- */
.shop-detail { max-width: 980px; margin: 0 auto; }
.shop-detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; margin-bottom: 36px; }
.shop-detail-img {
  width: 100%; aspect-ratio: 1/1; border-radius: var(--radius); overflow: hidden;
  background: var(--white); border: 1px solid var(--gray-light);
}
.shop-detail-img img { width: 100%; height: 100%; object-fit: cover; }
.shop-detail-gallery { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; margin-top: 10px; }
.shop-detail-thumb {
  padding: 0; aspect-ratio: 1/1; border-radius: var(--radius-sm); overflow: hidden;
  border: 2px solid var(--gray-light); cursor: pointer; transition: border-color .15s ease;
}
.shop-detail-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.shop-detail-thumb:hover { border-color: var(--gold-light); }
.shop-detail-thumb.active { border-color: var(--gold); }
.shop-detail-info h1 { font-size: 1.5rem; font-weight: 800; color: var(--navy); margin: 12px 0 10px; }
.shop-detail-desc { font-size: .92rem; color: var(--gray); line-height: 1.6; margin-bottom: 20px; }
.shop-detail-buy {
  display: flex; flex-direction: column; gap: 14px; align-items: flex-start;
  padding: 18px; background: var(--gray-pale); border-radius: var(--radius);
}
.shop-detail-buy .cwcart-variant-select { width: 100%; }
.shop-detail-buy .cwcart-card-price { font-size: 1.3rem; }
.shop-detail-sections { border-top: 1px solid var(--gray-light); padding-top: 24px; display: flex; flex-direction: column; gap: 22px; }
.shop-detail-section h3 { font-size: 1.02rem; font-weight: 800; color: var(--navy); margin-bottom: 10px; }
.shop-detail-section-body { font-size: .9rem; color: var(--navy); line-height: 1.7; }
.shop-detail-section-body table { width: 100%; border-collapse: collapse; font-size: .85rem; }
.shop-detail-section-body td, .shop-detail-section-body th { border: 1px solid var(--gray-light); padding: 8px 10px; }

/* Thanh tom tat noi day man hinh tren mobile/tablet - vi luc nay panel "da
   chon" bi day xuong duoi cung trang (xep doc), khong co thanh nay thi phai
   keo het xuong day moi biet minh da chon gi/bao nhieu tien. */
.shop-mobile-bar { display: none; }

@media (max-width: 900px) {
  .shop-page { padding-bottom: 90px; }
  .shop-body { flex-direction: column; }
  .shop-cats {
    width: 100%; flex-direction: row; overflow-x: auto; border-right: none;
    border-bottom: 1px solid var(--gray-light); border-radius: var(--radius) var(--radius) 0 0;
  }
  .shop-selected {
    width: 100%; border-left: none; border-top: 1px solid var(--gray-light);
    border-radius: 0 0 var(--radius) var(--radius);
  }

  .shop-mobile-bar.show {
    display: flex; align-items: center; justify-content: space-between; gap: 14px;
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
    background: var(--navy); color: var(--white); padding: 14px 20px;
    box-shadow: 0 -6px 24px rgba(0,0,0,.18);
  }
  .shop-mobile-bar-info { font-size: .8rem; color: rgba(255,255,255,.75); line-height: 1.4; }
  .shop-mobile-bar-info strong { display: block; font-size: 1.05rem; color: var(--gold-light); font-weight: 800; }
  .shop-mobile-bar .btn { flex-shrink: 0; white-space: nowrap; }

  /* nut back-to-top (dung chung tu style.css) can day len cao hon tren mobile
     de khong bi thanh gio hang noi o day man hinh de len tren. */
  #backToTop { bottom: 96px; right: 16px; width: 42px; height: 42px; font-size: 1.05rem; }
}
@media (max-width: 640px) {
  .shop-page { padding-top: 100px; }
  .shop-head h1 { font-size: 1.4rem; }
  .shop-cats { padding: 10px; }
  .cwcart-cat-btn { font-size: .82rem; padding: 8px 10px; }
  .shop-search-bar { padding: 12px 16px; }
  .shop-products { padding: 14px 16px; }
  .cwcart-card-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .cwcart-card-img { height: 100px; }
  .shop-detail-grid { grid-template-columns: 1fr; gap: 20px; }
  .shop-detail-gallery { grid-template-columns: repeat(4, 1fr); }
  .shop-detail-info h1 { font-size: 1.2rem; }
}
@media (max-width: 400px) {
  .cwcart-card-grid { grid-template-columns: 1fr; }
}
