/* ============================================
   TLGA Theme - Tài Liệu Giáo Án
   Main CSS for header, footer, homepage, WooCommerce
   ============================================ */

/* ============================================
   HEADER
   ============================================ */
.header {
  position: relative;
  z-index: 100;
}

/* Top Bar */
.top-bar {
  background: var(--rootcolor3);
  color: #fff;
  font-size: 13px;
  .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 20px;
  }
  .top-bar-left {
    .top-slogan {
      font-weight: 500;
      i { margin-right: 6px; color: var(--rootcolor2); }
    }
  }
  .top-bar-right {
    display: flex;
    align-items: center;
    gap: 16px;
    a {
      color: #ccc;
      text-decoration: none;
      transition: color 0.2s;
      i { margin-right: 4px; }
      &:hover { color: var(--rootcolor2); text-decoration: none; }
    }
    .top-social {
      display: flex;
      gap: 10px;
      margin-left: 8px;
      a { font-size: 13px; }
    }
  }
  @media (max-width: 768px) {
    .top-bar-left { display: none; }
    .container { justify-content: flex-end; padding: 4px 15px; }
  }
}

/* Main Header */
.main-header {
  background: #fff;
  box-shadow: 0 2px 6px rgba(0,0,0,0.08);
  position: relative;
  z-index: 999;
  transition: all 0.3s ease;
  .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 20px;
    gap: 20px;
  }
  .logo img {
    height: 42px;
    width: auto;
  }
  .site-name {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--rootcolor1);
  }
}

/* Header Search */
.header-search {
  flex: 1;
  max-width: 600px;
  .wc-search-form {
    .search-fields {
      display: flex;
      align-items: center;
      border: 2px solid var(--rootcolor1);
      border-radius: 6px;
      overflow: hidden;
      background: #fff;
    }
    .search-cat-select {
      padding: 10px 12px;
      border: none;
      border-right: 1px solid #ddd;
      background: #f8f8f8;
      font-size: 14px;
      color: #333;
      min-width: 120px;
      outline: none;
      cursor: pointer;
    }
    input[type="search"] {
      flex: 1;
      padding: 10px 14px;
      border: none;
      font-size: 14px;
      outline: none;
      min-width: 100px;
    }
    button {
      background: var(--rootcolor1);
      color: #fff;
      border: none;
      padding: 10px 18px;
      cursor: pointer;
      font-size: 16px;
      transition: background 0.3s;
      &:hover { background: var(--rootcolor3); }
    }
  }
}

/* Header Right */
.header-right {
  display: flex;
  align-items: center;
  gap: 12px;
  .header-icon {
    color: #333;
    font-size: 20px;
    transition: color 0.3s;
    position: relative;
    text-decoration: none;
    &:hover { color: var(--rootcolor1); text-decoration: none; }
  }
  .cart-icon {
    position: relative;
  }
  .cart-count {
    position: absolute;
    top: -8px;
    right: -10px;
    background: var(--rootcolor-danger);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
  }
  .micon {
    display: none;
    background: none;
    border: none;
    color: #333;
    font-size: 22px;
    cursor: pointer;
  }
}

/* Navigation Bar */
.nav-bar {
  background: var(--rootcolor1);
  position: relative;
  z-index: 99;
  transition: all 0.3s ease;
  &.is-sticky {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    animation: slideDown 0.3s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
  }
  .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
  }
  .nav-right {
    display: flex;
    gap: 20px;
    align-items: center;
    .nav-contact {
      color: rgba(255,255,255,0.85);
      font-size: 13px;
      white-space: nowrap;
      i { margin-right: 5px; color: var(--rootcolor2); }
    }
  }
}
@keyframes slideDown {
  from { transform: translateY(-100%); }
  to { transform: translateY(0); }
}

/* Main Nav Menu */
.main-nav {
  .menu {
    display: flex;
    align-items: center;
    list-style: none;
    margin: 0;
    padding: 0;
    .menu-item {
      position: relative;
      a {
        display: block;
        padding: 12px 18px;
        color: #fff;
        font-weight: 600;
        text-decoration: none;
        font-size: 14px;
        text-transform: uppercase;
        transition: background 0.2s;
        &:hover {
          background: rgba(255,255,255,0.15);
          text-decoration: none;
        }
        .arrow {
          font-size: 10px;
          margin-left: 6px;
        }
      }
      &.current-menu-item > a,
      &.current_page_item > a {
        background: var(--rootcolor2);
        color: #fff;
      }
      .sub-menu {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        background: #fff;
        min-width: 220px;
        border-radius: 0 0 6px 6px;
        box-shadow: 0 6px 12px rgba(0,0,0,0.15);
        padding: 0;
        list-style: none;
        z-index: 99;
        li a {
          color: #333;
          padding: 10px 20px;
          text-transform: none;
          font-size: 13px;
          &:hover {
            background: var(--rootcolor1);
            color: #fff;
          }
        }
      }
      &:hover > .sub-menu { display: block; }
    }
  }
}

/* Header Search Overlay */
.search_overlay {
  position: fixed;
  background: rgba(0,0,0,0.6);
  height: 100vh;
  width: 100%;
  display: none;
  z-index: 2000;
  align-items: center;
  justify-content: center;
  padding-bottom: 10%;
  &.active { display: flex; }
  .search_box {
    width: 90%;
    max-width: 600px;
    animation: fadeInUp 0.3s ease;
    form {
      display: flex;
      background: #fff;
      border-radius: 8px;
      overflow: hidden;
      box-shadow: 0 4px 20px rgba(0,0,0,0.2);
      input { flex: 1; padding: 14px 18px; border: none; font-size: 16px; outline: none; }
      button { background: var(--rootcolor1); color: #fff; border: none; padding: 14px 18px; cursor: pointer; font-size: 18px; }
    }
  }
}

/* Mobile Header */
@media (max-width: 992px) {
  .header-search { display: none; }
  .nav-right { display: none !important; }
  .header-right .micon { display: block; }
  .nav-bar {
    .main-nav {
      display: none;
      position: absolute;
      top: 100%;
      left: 0;
      width: 100%;
      background: var(--rootcolor1);
      .menu { display: block; }
      .menu-item a { padding: 12px 20px; }
      .sub-menu {
        position: static !important;
        box-shadow: none !important;
        background: rgba(0,0,0,0.1) !important;
        li a { color: #fff !important; }
      }
    }
    &.is-open .main-nav { display: block; }
  }
}

/* ============================================
   HEADER - FEATURED PRODUCTS BANNER
   ============================================ */
.header-featured {
  background: #b0b0b0;
  padding: 28px 0;
}
.hf-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}
.hf-card {
  background: #fff;
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(0,0,0,0.1);
  display: flex;
  flex-direction: column;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  &:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.18);
    .hf-card-thumb img { transform: scale(1.05); }
  }
}
.hf-card-link {
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  flex: 1;
  &:hover { text-decoration: none; }
}
.hf-card-thumb {
  height: 180px;
  overflow: hidden;
  background: #9a9a9a;
  img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
  }
}
.hf-card-body {
  padding: 16px;
  flex: 1;
  display: flex;
  flex-direction: column;
  text-align: center;
}
.hf-card-cat {
  display: block;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  color: #456;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}
.hf-card-title {
  font-size: 14px;
  font-weight: 600;
  color: #333;
  margin: 0 0 8px;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.hf-card-price {
  font-size: 14px;
  color: #333;
  margin: auto 0 0;
  padding-top: 4px;
  strong { color: #111; }
}
.hf-card-action {
  padding: 0 16px 16px;
  text-align: center;
}
.hf-btn-buy {
  display: inline-block;
  padding: 10px 28px;
  background: #3a4f5f;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  text-decoration: none;
  border-radius: 4px;
  letter-spacing: 0.5px;
  transition: all 0.3s ease;
  i { margin-right: 5px; }
  &:hover {
    background: var(--rootcolor1);
    color: #fff;
    text-decoration: none;
    transform: translateY(-1px);
  }
}
@media (max-width: 992px) {
  .hf-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 576px) {
  .header-featured { padding: 16px 10px; }
  .hf-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .hf-card-thumb { height: 140px; }
  .hf-card-body { padding: 12px; }
  .hf-card-title { font-size: 13px; }
  .hf-btn-buy { padding: 8px 20px; font-size: 12px; }
}

/* ============================================
   TOP SLIDE / BANNER
   ============================================ */
.top_slide {
  width: 100%;
  margin: 0 auto;
  .swiper-slide img {
    width: 100%;
    height: auto;
    display: block;
  }
  .swiper-button-prev,
  .swiper-button-next {
    width: 44px;
    height: 44px;
    background: rgba(0,0,0,0.35);
    border-radius: 50%;
    color: #fff;
    &:after { font-size: 16px; }
  }
}
.home.blog .site-wrapper { padding: 0; }

/* ============================================
   HOMEPAGE SECTIONS
   ============================================ */
.section-heading {
  text-align: center;
  font-size: 26px;
  font-weight: 700;
  color: var(--rootcolor3);
  margin-bottom: 30px;
  position: relative;
  i { color: var(--rootcolor2); margin-right: 8px; }
  &:after {
    content: '';
    display: block;
    width: 60px;
    height: 3px;
    background: var(--rootcolor2);
    margin: 10px auto 0;
    border-radius: 2px;
  }
}

/* Category Grid */
.home-categories {
  padding: 50px 20px;
  background: #fff;
}
.cat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  @media (max-width: 992px) { grid-template-columns: repeat(3, 1fr); }
  @media (max-width: 576px) { grid-template-columns: repeat(2, 1fr); gap: 12px; }
}
.cat-card {
  display: flex;
  flex-direction: column;
  background: #fff;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(0,0,0,0.06);
  transition: all 0.3s ease;
  text-decoration: none;
  border: 1px solid #f0f0f0;
  &:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.12);
    text-decoration: none;
    .cat-card-img img { transform: scale(1.05); }
  }
  .cat-card-img {
    overflow: hidden;
    height: 140px;
    img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s; }
  }
  .cat-card-info {
    padding: 12px 14px;
    h3 { font-size: 14px; font-weight: 600; color: #333; margin: 0 0 4px; }
    .cat-count { font-size: 12px; color: #888; }
  }
  /* Icon fallback */
  &.cat-card--icon {
    flex-direction: row;
    align-items: center;
    padding: 16px;
    .cat-card-icon {
      width: 48px;
      height: 48px;
      border-radius: 10px;
      background: var(--rootcolor-light);
      display: flex;
      align-items: center;
      justify-content: center;
      margin-right: 14px;
      flex-shrink: 0;
      i { font-size: 22px; color: var(--rootcolor1); }
    }
    .cat-card-info { padding: 0; }
  }
}

/* Products Section */
.home-products {
  padding: 50px 20px;
  &--new { background: #f7f9fc; }
  &--sale { background: #fff; }
}

/* Product Grid Fallback */
.product-grid-fallback {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  @media (max-width: 992px) { grid-template-columns: repeat(3, 1fr); }
  @media (max-width: 576px) { grid-template-columns: repeat(2, 1fr); gap: 12px; }
}
.product-card-fallback {
  background: #fff;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(0,0,0,0.06);
  border: 1px solid #f0f0f0;
  transition: all 0.3s;
  a { text-decoration: none; color: #333; }
  img { width: 100%; height: 160px; object-fit: cover; display: block; }
  .no-thumb {
    height: 160px; background: #f5f5f5; display: flex; align-items: center; justify-content: center;
    i { font-size: 40px; color: #ccc; }
  }
  .pf-info { padding: 12px; h3 { font-size: 14px; font-weight: 600; margin: 0; } }
  &:hover { transform: translateY(-4px); box-shadow: 0 8px 20px rgba(0,0,0,0.12); }
}

/* Bookset cards */
.home-booksets {
  padding: 50px 20px;
  background: #f7f9fc;
}
.bookset-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  @media (max-width: 768px) { grid-template-columns: 1fr; }
}
.bookset-card {
  background: #fff;
  border-radius: 12px;
  padding: 30px 24px;
  text-align: center;
  box-shadow: 0 2px 10px rgba(0,0,0,0.06);
  transition: all 0.3s;
  text-decoration: none;
  border: 1px solid #f0f0f0;
  &:hover { transform: translateY(-4px); box-shadow: 0 8px 20px rgba(0,0,0,0.12); text-decoration: none; }
  .bookset-icon {
    width: 64px;
    height: 64px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    i { font-size: 28px; color: #fff; }
  }
  h3 { font-size: 18px; font-weight: 700; color: #333; margin: 0 0 8px; }
  p { font-size: 14px; color: #666; margin: 0; line-height: 1.5; }
}

/* Why Choose Us */
.home-why {
  padding: 50px 20px;
  background: linear-gradient(135deg, var(--rootcolor3) 0%, var(--rootcolor1) 100%);
}
.home-why .section-heading { color: #fff; }
.home-why .section-heading:after { background: var(--rootcolor2); }
.why-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  @media (max-width: 768px) { grid-template-columns: repeat(2, 1fr); }
  @media (max-width: 480px) { grid-template-columns: 1fr; }
}
.why-item {
  text-align: center;
  padding: 24px 16px;
  .why-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: rgba(255,255,255,0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 14px;
    i { font-size: 26px; color: var(--rootcolor2); }
  }
  h3 { font-size: 16px; font-weight: 700; color: #fff; margin: 0 0 8px; }
  p { font-size: 14px; color: rgba(255,255,255,0.8); margin: 0; line-height: 1.5; }
}

/* ============================================
   WOOCOMMERCE PRODUCT LIST (horizontal rows)
   ============================================ */

/* Products container: vertical list, no grid */
.woocommerce ul.products,
ul.products {
  display: flex !important;
  flex-direction: column !important;
  list-style: none !important;
  padding: 0 !important;
  margin: 0 !important;
  gap: 0 !important;
}
.woocommerce ul.products li.product,
ul.products li.product {
  margin: 0 !important;
  padding: 0 !important;
  width: 100% !important;
  float: none !important;
}

/* Product Row Card */
.wc-product-row {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 16px 0;
  border-bottom: 1px solid #e5e5e5;
  &:first-child { padding-top: 0; }
  &:last-child { border-bottom: none; }
}

/* Thumbnail */
.wc-row-thumb {
  flex-shrink: 0;
  width: 90px;
  height: 90px;
  display: block;
  img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 4px;
  }
}

/* Info area */
.wc-row-info {
  flex: 1;
  min-width: 0;
}

/* Category badge */
.wc-row-cat {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  color: #fff;
  background: var(--rootcolor1);
  padding: 2px 8px;
  border-radius: 3px;
  margin-bottom: 4px;
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Title */
.wc-row-title {
  font-size: 15px;
  font-weight: 600;
  margin: 0 0 4px;
  line-height: 1.4;
  a {
    color: #333;
    text-decoration: none;
    &:hover { color: var(--rootcolor1); }
  }
}

/* Price */
.wc-row-price {
  margin-bottom: 8px;
  .wc-price-old {
    text-decoration: line-through;
    color: #999;
    font-size: 13px;
    margin-right: 6px;
  }
  .wc-price-current {
    font-weight: 700;
    color: var(--rootcolor-danger);
    font-size: 15px;
  }
}

/* Action buttons - outline style */
.wc-row-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}
.wc-rbtn {
  display: inline-block;
  padding: 5px 14px;
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
  border: 1px solid #555;
  color: #555;
  border-radius: 3px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  transition: all 0.2s;
  white-space: nowrap;
  &:hover {
    text-decoration: none;
  }
  &.wc-rbtn--view {
    &:hover { background: var(--rootcolor1); border-color: var(--rootcolor1); color: #fff; }
  }
  &.wc-rbtn--zalo {
    &:hover { background: #0068ff; border-color: #0068ff; color: #fff; }
  }
  &.wc-rbtn--buy {
    border-color: var(--rootcolor2);
    color: var(--rootcolor2);
    &:hover { background: var(--rootcolor2); color: #fff; }
  }
}

/* Responsive */
@media (max-width: 480px) {
  .wc-product-row { gap: 10px; }
  .wc-row-thumb { width: 70px; height: 70px; }
  .wc-row-title { font-size: 13px; }
  .wc-row-actions { flex-wrap: wrap; }
  .wc-rbtn { padding: 4px 10px; font-size: 11px; }
}
ul.products li.product {
  margin: 0 !important;
  padding: 0 !important;
  width: auto !important;
  float: none !important;
}
@media (max-width: 992px) { ul.products { grid-template-columns: repeat(2, 1fr) !important; } }
@media (max-width: 480px) { ul.products { grid-template-columns: repeat(2, 1fr) !important; gap: 10px; } }

/* Shop topbar */
.shop-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  margin-bottom: 16px;
  border-bottom: 1px solid #eee;
}
.shop-topbar .woocommerce-result-count {
  margin: 0;
  font-size: 13px;
  color: #666;
}

/* Product thumb placeholder */
.wc-product-thumb-placeholder {
  height: 200px;
  background: linear-gradient(135deg, #f0f0f0, #e8e8e8);
  display: flex;
  align-items: center;
  justify-content: center;
  i { font-size: 48px; color: #ccc; }
}

/* WooCommerce Pagination */
.woocommerce-pagination {
  margin: 30px 0;
  text-align: center;
  ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    justify-content: center;
    gap: 6px;
    flex-wrap: wrap;
  }
  li a, li span {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s;
    border: 1px solid #ddd;
    color: #333;
  }
  li .current,
  li a:hover {
    background: var(--rootcolor1);
    color: #fff;
    border-color: var(--rootcolor1);
    text-decoration: none;
  }
  li .dots {
    border: none;
    width: auto;
  }
}

/* On-sale section (bottom) */
.home-onsale {
  margin-top: 40px;
  padding-top: 30px;
  border-top: 2px solid #eee;
}
.onsale-heading {
  font-size: 18px;
  font-weight: 700;
  color: var(--rootcolor3);
  margin: 0 0 20px;
  i { color: var(--rootcolor2); margin-right: 8px; }
}
.onsale-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
@media (max-width: 768px) { .onsale-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) { .onsale-grid { grid-template-columns: 1fr; } }
.onsale-item {
  padding: 12px;
  border: 1px solid #f0f0f0;
  border-radius: 8px;
  a { text-decoration: none; color: inherit; }
  a:hover { text-decoration: none; }
  h4 { font-size: 13px; font-weight: 600; color: #333; margin: 0 0 6px; line-height: 1.4; }
  .onsale-price {
    font-size: 13px;
    .old-price { text-decoration: line-through; color: #999; margin-right: 6px; }
    .sale-price { font-weight: 700; color: var(--rootcolor-danger); }
  }
}

/* ============================================
   SHOP SIDEBAR
   ============================================ */
.shop-sidebar {
  .widget-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--rootcolor3);
    padding-bottom: 8px;
    border-bottom: 2px solid var(--rootcolor2);
    margin-bottom: 12px;
    i { margin-right: 6px; color: var(--rootcolor1); }
  }
}
.product-categories {
  list-style: none;
  padding: 0;
  margin: 0;
  li {
    a {
      display: flex;
      justify-content: space-between;
      align-items: center;
      padding: 8px 10px;
      color: #333;
      font-size: 13px;
      border-radius: 5px;
      transition: all 0.2s;
      text-decoration: none;
      &:hover {
        background: var(--rootcolor-light);
        color: var(--rootcolor1);
        text-decoration: none;
      }
      .count { font-size: 11px; color: #999; }
    }
    &.active > a {
      background: var(--rootcolor1);
      color: #fff;
      font-weight: 600;
      .count { color: rgba(255,255,255,0.7); }
    }
    /* Nested */
    ul {
      list-style: none;
      padding-left: 16px;
      margin: 0;
      li a { font-size: 12px; padding: 6px 10px; }
    }
  }
}

/* ============================================
   HOMEPAGE SIDEBAR
   ============================================ */
.home-sidebar {
  padding: 0 !important;
  border: none !important;
  background: transparent !important;
}

.sidebar-widget {
  background: #fff;
  border: 1px solid #e8e8e8;
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 16px;
}

.sidebar-widget-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--rootcolor3);
  text-transform: uppercase;
  margin: 0 0 12px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--rootcolor2);
  i { margin-right: 6px; color: var(--rootcolor1); font-size: 13px; }
}

/* Support widget */
.sidebar-support {
  .support-info {
    p { margin: 0 0 6px; font-size: 13px; color: #444;
      i { margin-right: 6px; color: var(--rootcolor1); width: 14px; text-align: center; }
      strong { color: var(--rootcolor1); }
    }
  }
  .support-actions {
    display: flex;
    gap: 8px;
    margin-top: 10px;
  }
  .support-btn {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 7px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s;
    &--zalo {
      background: #0068ff;
      color: #fff;
      img { filter: brightness(10); }
      &:hover { background: #0055cc; color: #fff; text-decoration: none; }
    }
    &--phone {
      background: var(--rootcolor-danger);
      color: #fff;
      &:hover { background: #c0313e; color: #fff; text-decoration: none; }
    }
  }
}

/* Search widget */
.sidebar-search-form {
  .sidebar-search-input {
    display: flex;
    border: 1px solid #ddd;
    border-radius: 6px;
    overflow: hidden;
    input {
      flex: 1;
      padding: 9px 12px;
      border: none;
      font-size: 13px;
      outline: none;
      min-width: 0;
    }
    button {
      background: var(--rootcolor1);
      color: #fff;
      border: none;
      padding: 9px 14px;
      cursor: pointer;
      &:hover { background: var(--rootcolor3); }
    }
  }
}

/* Category filter */
.filter-categories {
  list-style: none;
  padding: 0;
  margin: 0;
}
.filter-cat-item {
  position: relative;
  border-bottom: 1px solid #f0f0f0;
}
.filter-cat-item:last-child { border-bottom: none; }
.filter-cat-item > a {
  display: block;
  padding: 8px 30px 8px 4px;
  color: #333;
  font-size: 13px;
  text-decoration: none;
  transition: color 0.2s;
}
.filter-cat-item > a:hover { color: var(--rootcolor1); text-decoration: none; }
.filter-cat-item .cat-toggle {
  position: absolute;
  right: 0;
  top: 4px;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #888;
  font-size: 12px;
  border-radius: 4px;
  transition: all 0.2s;
}
.filter-cat-item .cat-toggle:hover { background: #f0f0f0; color: var(--rootcolor1); }
.filter-cat-item .filter-sub-categories {
  display: none;
  list-style: none;
  padding: 0 0 6px 16px;
  margin: 0;
}
.filter-cat-item .filter-sub-categories li a {
  display: block;
  padding: 5px 4px;
  font-size: 12px;
  color: #555;
  text-decoration: none;
}
.filter-cat-item .filter-sub-categories li a:hover { color: var(--rootcolor1); text-decoration: none; }
.filter-cat-item.is-open > .filter-sub-categories { display: block; }

/* Filter list (loại tài liệu, bộ sách, tiếng anh) */
.filter-list {
  list-style: none;
  padding: 0;
  margin: 0;
  li {
    border-bottom: 1px solid #f0f0f0;
    &:last-child { border-bottom: none; }
    a {
      display: block;
      padding: 7px 4px;
      font-size: 13px;
      color: #444;
      text-decoration: none;
      transition: color 0.2s;
      &:hover { color: var(--rootcolor1); text-decoration: none; }
    }
  }
}

/* Homepage grid tweak — reduce product columns with sidebar */

/* Sidebar Product List (Top Rated + On-Sale) */
.sb-product-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.sb-product-item {
  border-bottom: 1px solid #f0f0f0;
  &:last-child { border-bottom: none; }
}
.sb-product-link {
  display: flex;
  gap: 10px;
  padding: 10px 0;
  text-decoration: none;
  color: inherit;
  align-items: flex-start;
  &:hover {
    text-decoration: none;
    .sb-product-title { color: var(--rootcolor1); }
  }
}
.sb-product-thumb {
  width: 60px;
  height: 60px;
  flex-shrink: 0;
  border-radius: 4px;
  overflow: hidden;
  border: 1px solid #eee;
  img {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }
}
.sb-product-info {
  flex: 1;
  min-width: 0;
}
.sb-product-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  color: #fff;
  background: #2573b5;
  padding: 1px 6px;
  border-radius: 3px;
  margin-bottom: 3px;
}
.sb-product-title {
  font-size: 12px;
  font-weight: 600;
  color: #333;
  margin: 0 0 4px;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  transition: color 0.2s;
}
.sb-product-price {
  font-size: 12px;
  color: #666;
  del {
    color: #999;
    font-size: 11px;
    margin-right: 4px;
  }
  strong {
    color: var(--rootcolor-danger);
  }
}

/* Sidebar Tag Cloud */
.sb-tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.sb-tag {
  display: inline-block;
  padding: 4px 10px;
  font-size: 11px;
  color: #555;
  background: #f5f5f5;
  border: 1px solid #e0e0e0;
  border-radius: 20px;
  text-decoration: none;
  transition: all 0.2s;
  &:hover {
    background: var(--rootcolor1);
    color: #fff;
    border-color: var(--rootcolor1);
    text-decoration: none;
  }
}

/* Shop sidebar search */
.shop-sidebar .wc-search-form {
  .search-fields {
    display: flex;
    align-items: center;
    border: 1px solid #ddd;
    border-radius: 6px;
    overflow: hidden;
  }
  .search-cat-select {
    padding: 8px;
    border: none;
    border-right: 1px solid #ddd;
    background: #f8f8f8;
    font-size: 12px;
    min-width: 70px;
    outline: none;
  }
  input[type="search"] {
    flex: 1;
    padding: 8px 10px;
    border: none;
    font-size: 12px;
    outline: none;
    min-width: 0;
  }
  button {
    background: var(--rootcolor1);
    color: #fff;
    border: none;
    padding: 8px 12px;
    cursor: pointer;
    font-size: 14px;
    &:hover { background: var(--rootcolor3); }
  }
}


body.home.layout-two-left {
  .site-grid {
    grid-template-columns: var(--left) 1fr;
  }
  .woocommerce ul.products {
    grid-template-columns: repeat(3, 1fr);
  }
  .cat-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  .why-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .bookset-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* ============================================
   FOOTER
   ============================================ */
.footer {
  margin-top: 0;
}
.footer-main {
  background: var(--rootcolor3);
  color: #ccc;
  padding: 50px 20px;
  .container {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 30px;
    @media (max-width: 992px) { grid-template-columns: repeat(2, 1fr); }
    @media (max-width: 576px) { grid-template-columns: 1fr; }
  }
  h3 {
    color: #fff;
    font-size: 16px;
    font-weight: 700;
    margin: 0 0 16px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--rootcolor2);
  }
  p { font-size: 13px; line-height: 1.6; margin: 0 0 8px; }
  a { color: #aaa; text-decoration: none; &:hover { color: var(--rootcolor2); text-decoration: none; } }
  i { margin-right: 6px; color: var(--rootcolor2); }
}
.footer-social {
  margin-top: 16px;
  display: flex;
  gap: 10px;
  a {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255,255,255,0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    transition: all 0.3s;
    &:hover { background: var(--rootcolor2); }
  }
}
.footer-posts {
  list-style: none;
  padding: 0;
  margin: 0;
  li {
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    a { color: #ccc; font-size: 13px; line-height: 1.5; display: block; i { color: var(--rootcolor2); } &:hover { color: var(--rootcolor2); } }
    .footer-post-date { font-size: 11px; color: #888; margin-top: 3px; display: block; }
    &:last-child { border-bottom: none; margin-bottom: 0; }
  }
}
.footer-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  .tag-link {
    background: rgba(255,255,255,0.08);
    color: #ccc;
    padding: 5px 12px;
    border-radius: 4px;
    font-size: 12px;
    transition: all 0.2s;
    &:hover { background: var(--rootcolor2); color: #fff; text-decoration: none; }
  }
}
.footer-newsletter {
  display: flex;
  margin-top: 12px;
  input {
    flex: 1;
    padding: 10px 12px;
    border: none;
    border-radius: 4px 0 0 4px;
    font-size: 13px;
    outline: none;
  }
  button {
    background: var(--rootcolor2);
    color: #fff;
    border: none;
    padding: 10px 16px;
    border-radius: 0 4px 4px 0;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: background 0.3s;
    &:hover { background: #e09520; }
  }
}
.footer-copyright {
  background: #0f2b1e;
  text-align: center;
  padding: 14px 20px;
  p { color: #888; font-size: 12px; margin: 0; }
}

/* Zalo Float Button */
.zalo-float {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 999;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
  transition: transform 0.3s;
  background: #fff;
  &:hover { transform: scale(1.1); }
  img { border-radius: 50%; }
}

/* ============================================
   WC SHOP PAGE OVERRIDES
   ============================================ */
.woocommerce-result-count {
  font-size: 13px;
  color: #666;
}
.woocommerce-ordering select {
  padding: 8px 12px;
  border: 1px solid #ddd;
  border-radius: 5px;
  font-size: 13px;
}
.woocommerce-pagination {
  margin-top: 30px;
  text-align: center;
  ul {
    display: inline-flex;
    gap: 5px;
    list-style: none;
    padding: 0;
    li {
      a, span {
        display: flex;
        align-items: center;
        justify-content: center;
        min-width: 36px;
        height: 36px;
        padding: 0 10px;
        border-radius: 5px;
        font-size: 14px;
        text-decoration: none;
        border: 1px solid #ddd;
        color: #333;
        transition: all 0.2s;
      }
      a:hover { background: var(--rootcolor-light); border-color: var(--rootcolor1); color: var(--rootcolor1); }
      span.current { background: var(--rootcolor1); color: #fff; border-color: var(--rootcolor1); }
    }
  }
}

/* ============================================
   SINGLE PRODUCT PAGE
   ============================================ */

/* Product Gallery - consistent sizing */
.woocommerce div.product div.images {
  img {
    width: 100%;
    height: auto;
    object-fit: contain;
    background: #f5f5f5;
    border-radius: 8px;
  }
}

/* Single product summary */
.woocommerce div.product .summary {
  .price {
    font-size: 22px;
    color: var(--rootcolor-danger);
    font-weight: 700;
    margin-bottom: 16px;
    del {
      color: #999;
      font-size: 16px;
    }
  }
  .product_meta {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #eee;
    font-size: 13px;
    color: #666;
    a { color: var(--rootcolor1); text-decoration: none; }
    a:hover { text-decoration: underline; }
  }
}

/* Single product action buttons row */
.woocommerce div.product form.cart {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  .quantity { margin-right: 4px; }
  .single_add_to_cart_button {
    padding: 10px 24px;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 13px;
  }
}
.btn-preview-link {
  display: inline-flex !important;
  align-items: center;
  gap: 6px;
  padding: 10px 20px !important;
  background: #fff !important;
  color: var(--rootcolor1) !important;
  border: 2px solid var(--rootcolor1) !important;
  border-radius: 4px !important;
  font-weight: 700 !important;
  font-size: 13px !important;
  text-transform: uppercase;
  text-decoration: none !important;
  transition: all 0.2s;
  &:hover {
    background: var(--rootcolor1) !important;
    color: #fff !important;
  }
}
.btn-zalo-link {
  display: inline-flex !important;
  align-items: center;
  gap: 6px;
  padding: 10px 20px !important;
  background: #0068ff !important;
  color: #fff !important;
  border: 2px solid #0068ff !important;
  border-radius: 4px !important;
  font-weight: 700 !important;
  font-size: 13px !important;
  text-transform: uppercase;
  text-decoration: none !important;
  transition: all 0.2s;
  &:hover {
    background: #0055cc !important;
    border-color: #0055cc !important;
    color: #fff !important;
  }
}

/* Related Products */
.woocommerce .related.products,
.woocommerce .upsells.products {
  clear: both;
  margin-top: 40px;
  > h2 {
    font-size: 18px;
    font-weight: 700;
    color: #fff;
    background: var(--rootcolor3);
    padding: 10px 16px;
    border-radius: 6px;
    margin-bottom: 10px;
  }
  ul.products {
    &::before, &::after { display: none !important; }
  }
  .onsale { display: none; }
}

/* ============================================
   BLOG PAGE
   ============================================ */
.blog-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 30px;
  max-width: var(--max);
  margin: 0 auto;
  padding: 30px 20px;
}

/* Blog Post Card */
.blog-card {
  margin-bottom: 40px;
  padding-bottom: 20px;
  border-bottom: 1px solid #eee;
}
.blog-card__cat {
  text-align: center;
  margin-bottom: 10px;
  a {
    display: inline-block;
    font-size: 13px;
    font-weight: 700;
    color: var(--rootcolor1);
    text-transform: uppercase;
    letter-spacing: 1px;
    text-decoration: none;
    &:hover { text-decoration: underline; }
  }
}
.blog-card__title {
  text-align: center;
  font-size: 26px;
  font-weight: 700;
  line-height: 1.3;
  margin: 0 0 12px;
  a {
    color: #222;
    text-decoration: none;
    &:hover { color: var(--rootcolor1); }
  }
}
.blog-card__meta {
  text-align: center;
  font-size: 13px;
  color: #888;
  margin-bottom: 16px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  time { color: var(--rootcolor1); }
  .blog-card__author { color: var(--rootcolor1); text-transform: uppercase; }
}
.blog-card__image {
  position: relative;
  margin-bottom: 20px;
  border-radius: 4px;
  overflow: hidden;
  a { display: block; }
  img {
    width: 100%;
    height: auto;
    display: block;
  }
}
.blog-card__date-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  background: var(--rootcolor3);
  color: #fff;
  width: 50px;
  padding: 6px 0;
  text-align: center;
  border-radius: 4px;
  line-height: 1.2;
  .day {
    display: block;
    font-size: 20px;
    font-weight: 700;
  }
  .month {
    display: block;
    font-size: 11px;
    text-transform: uppercase;
  }
}
.blog-card__excerpt {
  font-size: 15px;
  line-height: 1.7;
  color: #555;
  margin-bottom: 20px;
  p { margin: 0; }
}
.blog-card__readmore {
  text-align: center;
  margin-bottom: 20px;
  a {
    display: inline-block;
    padding: 8px 24px;
    border: 1px solid #333;
    color: #333;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.2s;
    &:hover {
      background: var(--rootcolor1);
      border-color: var(--rootcolor1);
      color: #fff;
    }
  }
}
.blog-card__footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 12px;
  border-top: 1px solid #eee;
  font-size: 13px;
  color: #888;
  a {
    color: var(--rootcolor1);
    text-decoration: none;
    &:hover { text-decoration: underline; }
  }
}

/* Blog Sidebar */
.blog-sidebar {
  .sidebar-widget {
    background: #fff;
    border: 1px solid #eee;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
  }
  .sidebar-widget-title {
    font-size: 16px;
    font-weight: 700;
    color: #333;
    margin: 0 0 16px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--rootcolor1);
  }
}

/* Support Widget */
.support-info {
  text-align: center;
  .support-name { font-size: 16px; margin: 0 0 4px; }
  .support-phone {
    font-size: 14px;
    color: #555;
    margin: 0 0 12px;
    a { color: var(--rootcolor1); text-decoration: none; font-weight: 600; }
  }
}
.support-buttons {
  display: flex;
  gap: 10px;
  justify-content: center;
  a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: opacity 0.2s;
    &:hover { opacity: 0.85; }
  }
  .btn-zalo {
    background: #0068ff;
    color: #fff;
    img { width: 20px; height: 20px; }
  }
  .btn-call {
    background: var(--rootcolor1);
    color: #fff;
  }
}

/* Latest Posts Widget */
.blog-latest-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.blog-latest-item {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 10px 0;
  border-bottom: 1px solid #f0f0f0;
  &:last-child { border-bottom: none; }
}
.latest-date-badge {
  flex-shrink: 0;
  background: var(--rootcolor3);
  color: #fff;
  width: 42px;
  padding: 4px 0;
  text-align: center;
  border-radius: 4px;
  line-height: 1.2;
  .day { display: block; font-size: 16px; font-weight: 700; }
  .month { display: block; font-size: 10px; }
}
.latest-title {
  font-size: 13px;
  font-weight: 600;
  color: #333;
  text-decoration: none;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  &:hover { color: var(--rootcolor1); }
}

/* Blog Pagination */
.blog-pagination {
  text-align: center;
  padding: 20px 0;
  a, span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 10px;
    margin: 0 3px;
    border-radius: 5px;
    font-size: 14px;
    text-decoration: none;
    border: 1px solid #ddd;
    color: #333;
    transition: all 0.2s;
  }
  a:hover {
    background: var(--rootcolor-light);
    border-color: var(--rootcolor1);
    color: var(--rootcolor1);
  }
  span.current {
    background: var(--rootcolor1);
    color: #fff;
    border-color: var(--rootcolor1);
  }
}

/* Blog responsive */
@media (max-width: 768px) {
  .blog-layout {
    grid-template-columns: 1fr;
  }
  .blog-card__title { font-size: 20px; }
}

/* ============================================
   ON-SALE PRODUCTS (footer section)
   ============================================ */
.onsale-section {
  background: #e8edf2;
  padding: 30px 0;
  border-top: 3px solid #c5d0dc;
}
.onsale-heading {
  font-size: 16px;
  font-weight: 800;
  color: #333;
  text-transform: uppercase;
  margin: 0 0 6px;
}
.onsale-line {
  width: 40px;
  height: 3px;
  background: var(--rootcolor2);
  margin-bottom: 16px;
}
.onsale-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px 24px;
}
.onsale-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 0;
  text-decoration: none;
  color: inherit;
  border-bottom: 1px solid rgba(0,0,0,0.06);
  &:hover { .onsale-title { color: var(--rootcolor1); } }
}
.onsale-thumb {
  width: 50px;
  height: 50px;
  object-fit: contain;
  flex-shrink: 0;
  border-radius: 3px;
}
.onsale-info {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.onsale-title {
  font-size: 13px;
  font-weight: 600;
  color: #333;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  transition: color 0.2s;
}
.onsale-price {
  font-size: 13px;
  color: var(--rootcolor-danger);
  font-weight: 700;
  del {
    color: #999;
    font-size: 12px;
    margin-right: 4px;
    font-weight: 400;
  }
}

@media (max-width: 768px) {
  .onsale-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 480px) {
  .onsale-grid { grid-template-columns: 1fr; }
}
