/*
Theme Name: SGTECHPC Theme
Author: Hiếu PC
Version: 1.1 (products.css – fixed card layout)
*/

/* ====== BASE CONTAINER 1620 ====== */
:root{
  --container:1620px;
  --gap:20px;
  --card-radius:16px;
  --shadow:0 4px 12px rgba(0,0,0,.08);
  --line:#e5e7eb;
  --brand1:#2196f3;
  --brand2:#003eaa;
  --text:#212a36;
  --muted:#666;
  --price:#e10000;
}

.container{
  width:100%;
  margin:0 auto;
  padding:0 10px;
  box-sizing:border-box;
}
@media (min-width:576px){  .container{max-width:540px;} }
@media (min-width:768px){  .container{max-width:720px;} }
@media (min-width:992px){  .container{max-width:960px;} }
@media (min-width:1200px){ .container{max-width:1140px;} }
@media (min-width:1400px){ .container{max-width:1320px;} }
@media (min-width:1620px){
  .container{max-width:var(--container);min-width:var(--container);}
}

/* ====== PRODUCT LIST WRAPPER ====== */
/* ====== PRODUCT LIST WRAPPER + OWL ====== */
.product-row{
  display:flex;
  flex-wrap:wrap;
  gap:var(--gap);
  justify-content:flex-start;
  overflow:visible !important;
}

/* DÙNG OWL: để Owl tự layout, nhưng ẩn đi trước khi init xong */
.product-row.owl-carousel{
  display:block;              /* bắt buộc cho Owl */
  opacity:0;                  /* ẩn lúc chưa init */
  transition:opacity .15s ease;
}

/* Khi Owl init xong nó tự thêm class .owl-loaded */
.product-row.owl-carousel.owl-loaded{
  opacity:1;                  /* lúc này mới cho hiện */
}

/* Card trong Owl: 1 slide = 1 card full width của slide */
.product-row.owl-carousel .product-card{
  flex:none;
  max-width:none;
  width:100%;
}


/* ====== PRODUCT CARD ====== */
/* 6 cột desktop: (100% - 5*gap)/6 */
.product-card{
  position:relative;
  z-index:1;
  flex:0 0 calc((100% - 5*var(--gap)) / 6);
  max-width:calc((100% - 5*var(--gap)) / 6);

  background:#fff;
  border-radius:var(--card-radius);
  box-shadow:var(--shadow);
  padding:16px;
  box-sizing:border-box;
  text-align:left;
  transition:transform .3s ease;
  overflow:visible;

  /* cố định cấu trúc dọc trong card */
  display:flex;
  flex-direction:column;
}
.product-card:hover{ transform:translateY(-5px); }
.product-link{ display:block; }

/* Responsive số cột */
@media (max-width:1399.98px){
  .product-card{
    flex-basis:calc((100% - 4*var(--gap))/5);
    max-width:calc((100% - 4*var(--gap))/5);
  }
}
@media (max-width:1199.98px){
  .product-card{
    flex-basis:calc((100% - 3*var(--gap))/4);
    max-width:calc((100% - 3*var(--gap))/4);
  }
}
@media (max-width:991.98px){
  .product-card{
    flex-basis:calc((100% - 2*var(--gap))/3);
    max-width:calc((100% - 2*var(--gap))/3);
  }
}
@media (max-width:767.98px){
  .product-card{
    flex-basis:calc((100% - 1*var(--gap))/2);
    max-width:calc((100% - 1*var(--gap))/2);
  }
}
@media (max-width:479.98px){
  .product-card{ flex-basis:100%; max-width:100%; }
}

/* Ảnh trong card */
.product-image{
  width: 100%;
  aspect-ratio: 1 / 1;
  height: auto;
  object-fit: cover;
  display: block;
}

/* Khối info bên dưới ảnh trong card */
.product-info{
  display:flex;
  flex-direction:column;
  flex:1 1 auto;
  text-align:left;
}

/* Tiêu đề trong CARD – override riêng, không ảnh hưởng trang chi tiết */
.product-card .product-title{
  padding-right:0;
  border-right:0;
  margin-right:0;

  color:var(--text);
  font-weight:500;
  font-size:14px;
  line-height:18px;
  margin-top:8px;
  margin-bottom:10px;

  /* chiều cao cố định ~2 dòng để các card đều nhau */
  min-height:36px;
}

/* Khối đáy trong card: giá, trạng thái... luôn dính sát đáy */
.product-info-bottom{
  margin-top:auto;
  width:100%;
}

/* Icon phần mềm (nếu dùng) */
.product-icons{
  display:flex;
  justify-content:center;
  gap:6px;
  margin-bottom:10px;
}
.product-icons img{
  width:24px;
  height:24px;
  object-fit:contain;
  display:block;
}

/* Giá trong card */
.product-price{
  font-size:22px;
  font-weight:700;
  color:var(--price);
}

/* ====== TOOLTIP ====== */
/* tooltip gốc trong card ẩn hẳn */
.product-tooltip{ display:none !important; }

/* tooltip bay gắn body (JS tạo .product-tooltip--floating) */
.product-tooltip--floating{
  position:fixed;
  left:0;
  top:0;
  display:none;
  pointer-events:none;
  z-index:2147483647;
  width:320px;
  max-width:min(90vw,360px);
  background:#fff;
  border:1px solid var(--line);
  border-radius:10px;
  box-shadow:0 10px 30px rgba(0,0,0,.14);
  padding:12px 14px;
  line-height:1.5;
  color:var(--text);
}
.product-tooltip--floating h3{
  display:block;
  margin:-12px -14px 8px;
  padding:10px 14px;
  font-size:16px;
  font-weight:700;
  line-height:1.4;
  color:#fff;
  background:linear-gradient(91.56deg, var(--brand1) 2.74%, var(--brand2) 96.84%);
  border-radius:10px 10px 6px 6px;
}
.product-tooltip--floating .tooltip-section > strong{
  display:inline-block;
  margin:8px 0;
  padding:6px 15px;
  font-size:15px;
  font-weight:600;
  color:#fff;
  background:linear-gradient(91.56deg, var(--brand1) 2.74%, var(--brand2) 96.84%);
  border-radius:6px;
}

/* Không bị cắt trong các wrapper/owl */
/* Cho tooltip không bị cắt trong từng item thôi */
.owl-stage{ 
  overflow: visible !important; 
}
.owl-item{ 
  overflow: visible !important; 
}
/* KHÔNG đụng .owl-stage-outer, để Owl tự dùng overflow:hidden */

#js-collection-holder, .p-container, .product-list, .section-products{ overflow:visible !important; }
.section-products{ position:relative; z-index:1; }

/* ================== PHẦN TRANG CHI TIẾT ================== */
/* ====== TIÊU ĐỀ TRANG CHI TIẾT ====== */
.product-title{
  color:var(--text);
  font-weight:400;
  font-size:14px;
  line-height:21px;
  padding-right:10px;
  border-right:1px solid #e5eaf1;
  margin-right:10px;
}

/* ====== KHỐI GIÁ (CỘT 2 – CHI TIẾT) ====== */
.product-price-box{
  background:#f8fafc;
  border:1px solid #e0e0e0;
  border-radius:8px;
  padding:12px 18px;
  width:91%;
}
.product-price-box .price-sale{
  color:var(--price);
  font-size:28px;
  font-weight:700;
  margin-right:10px;
  display:inline-block;
}
.product-price-box .price-old{
  text-decoration:line-through;
  color:#999;
  font-size:18px;
  margin-right:10px;
}
.product-price-box .price-contact{
  font-size:18px;
  font-weight:700;
  color:var(--text);
}





.product-stock{
  margin-top:12px;
  font-size:16px;
  font-weight:600;
}

.product-stock .instock{
  color:#16a34a;
}

.product-stock .outofstock{
  color:#dc2626;
}


.product-card-link{
  display:flex;
  flex-direction:column;
  height:100%;
  text-decoration:none;
  color:inherit;
}
.product-card-link:hover{
  text-decoration:none;
  color:inherit;
}


.product-title {
  display: -webkit-box;
  -webkit-line-clamp: 2;   /* hiển thị tối đa 2 dòng */
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 40px;         /* đảm bảo các card luôn cao bằng nhau */
}





/* ========= CSS cho phần GIỎ HÀNG ========= */
  /* NỀN + LAYOUT 2 CỘT */
  .sgtpc-cart{
    padding:20px 0 30px;
  }
  .sgtpc-cart-layout{
    display:grid;
    grid-template-columns:minmax(0,2fr) minmax(0,1.1fr);
    gap:24px;
    align-items:flex-start;
  }
  @media(max-width:1024px){
    .sgtpc-cart-layout{
      grid-template-columns:1fr;
    }
  }

  .cart-box{
    background:#fff;
    border-radius:12px;
    padding:16px 18px;
    border:1px solid #e5e7eb;
  }

  /* BẢNG GIỎ HÀNG */
  .cart-table{width:100%;border-collapse:collapse;margin:0;background:#fff;border-radius:10px;overflow:hidden}
  .cart-table th,.cart-table td{padding:12px;border-bottom:1px solid #eee}
  .cart-table thead th{background:#f7f8fa;text-align:left}
  .cart-table td.right{text-align:right}
  .cart-table td.qty{white-space:nowrap}
  .cart-table td.qty input{width:60px;text-align:center;margin:0 6px}
  .cart-table td.qty button{width:28px;height:28px;border:1px solid #ddd;background:#fafafa;border-radius:6px}

  .cart-actions{
    display:flex;
    gap:10px;
    justify-content:flex-end;
    margin-top:12px;
  }

  .btn-primary{background:#1677ff;color:#fff;padding:10px 14px;border-radius:8px;display:inline-block;border:none;cursor:pointer}
  .btn-outline{background:#fff;border:1px solid #ddd;padding:10px 14px;border-radius:8px;display:inline-block}
  .btn-clear{background:#fff;border:1px solid #f3caca;color:#d33;padding:10px 14px;border-radius:8px;cursor:pointer}

  /* FORM KHÁCH HÀNG BÊN PHẢI */
  /* FORM THÔNG TIN NHẬN HÀNG KIỂU HOÀNG HÀ */
.sgtpc-checkout{
  background:#ffffff;
  border-radius:18px;
  padding:18px 20px 20px;
  border:1px solid #d4e5ff;
  box-shadow:0 10px 30px rgba(15,23,42,0.04);
  display:flex;
  flex-direction:column;
}

.checkout-title{
  font-size:18px;
  font-weight:700;
  margin:0 0 6px;
  color:#1677ff;
}

.checkout-desc{
  font-size:13px;
  color:#6b7280;
  margin:0 0 14px;
  line-height:1.5;
}
.checkout-desc a{
  color:#1677ff;
  font-weight:600;
  text-decoration:none;
}
.checkout-desc a:hover{
  text-decoration:underline;
}

.checkout-field{
  margin-bottom:10px;
}

/* ô input/textarea bo tròn, nền xám nhạt */
.checkout-field input,
.checkout-field textarea{
  width:100%;
  border:none;
  outline:none;
  border-radius:14px;
  padding:11px 13px;
  font-size:14px;
  background:#f3f4ff;
  color:#111827;
  box-shadow:0 0 0 1px #e5e7eb inset;
}

.checkout-field input::placeholder,
.checkout-field textarea::placeholder{
  color:#9ca3af;
}

/* dòng gợi ý dưới địa chỉ */
.checkout-hint{
  display:flex;
  align-items:flex-start;
  gap:6px;
  font-size:12px;
  color:#6b7280;
  margin:4px 0 10px;
}
.checkout-hint .hint-icon{
  width:16px;
  height:16px;
  border-radius:999px;
  border:1px solid #93c5fd;
  display:flex;
  align-items:center;
  justify-content:center;
  font-size:11px;
  color:#1d4ed8;
}

/* nút ĐẶT HÀNG full width, gradient */
.btn-primary.btn-block{
  width:100%;
  margin-top:8px;
  border:none;
  border-radius:999px;
  padding:11px 0;
  font-size:15px;
  font-weight:600;
  background:linear-gradient(90deg,#2563eb,#0ea5e9);
  color:#fff;
  cursor:pointer;
}

/* nếu có reCAPTCHA thì để phía trên nút */
.checkout-recaptcha{
  margin:8px 0 10px;
}


  .sgtpc-cart a {
  text-decoration: none !important;
}
/* Nút xóa dạng icon thùng rác */
.cart-table td button.remove {
  width: 34px;
  height: 34px;
  border: none;
  border-radius: 8px;
  background: #f3f4f6;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  font-size: 0; /* ẩn chữ Xóa */
}

/* Icon SVG */
.cart-table td button.remove::before {
  content: "";
  width: 18px;
  height: 18px;
  display: block;
  background: url("data:image/svg+xml,%3Csvg stroke='currentColor' fill='none' stroke-width='2' viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M3 6h18M9 6v12m6-12v12M4 6l1 14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2l1-14M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2'/%3E%3C/svg%3E") center/contain no-repeat;
  color: #dc2626; /* màu đỏ */
}

.cart-table td button.remove:hover {
  background: #fee2e2;
}

/* ========= END CSS cho phần GIỎ HÀNG ========= */