/* ============================================
   Theme Page Styles - Single Product, Cart, Blog
   ============================================ */

/* Single Product Page */
.woocommerce div.product {
  background: #fff;
  border-radius: 10px;
  padding: 24px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.06);
}
.woocommerce div.product div.images {
  border-radius: 8px;
  overflow: hidden;
}
.woocommerce div.product .product_title {
  font-size: 24px;
  font-weight: 700;
  color: #222;
  margin-bottom: 10px;
}
.woocommerce div.product p.price {
  font-size: 22px;
  font-weight: 700;
  color: var(--rootcolor-danger);
  margin-bottom: 16px;
  ins { text-decoration: none; }
  del { color: #999; font-size: 16px; }
}
.woocommerce div.product .woocommerce-product-details__short-description {
  font-size: 14px;
  line-height: 1.7;
  color: #555;
  margin-bottom: 20px;
}
.woocommerce div.product form.cart {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
  .qty {
    width: 60px;
    padding: 10px;
    text-align: center;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 15px;
  }
  .single_add_to_cart_button {
    background: var(--rootcolor2);
    color: #fff;
    border: none;
    padding: 12px 30px;
    border-radius: 6px;
    font-weight: 700;
    font-size: 15px;
    cursor: pointer;
    transition: background 0.3s;
    &:hover { background: #e09520; }
  }
}
.woocommerce div.product .woocommerce-tabs {
  margin-top: 30px;
  ul.tabs {
    list-style: none;
    padding: 0;
    display: flex;
    gap: 0;
    border-bottom: 2px solid #eee;
    margin-bottom: 20px;
    li {
      a {
        display: block;
        padding: 10px 20px;
        font-weight: 600;
        font-size: 14px;
        color: #666;
        text-decoration: none;
        border-bottom: 2px solid transparent;
        margin-bottom: -2px;
        transition: all 0.2s;
        &:hover { color: var(--rootcolor1); }
      }
      &.active a {
        color: var(--rootcolor1);
        border-bottom-color: var(--rootcolor1);
      }
    }
  }
}

/* Category meta */
.woocommerce div.product_meta {
  font-size: 13px;
  color: #888;
  margin-top: 16px;
  a { color: var(--rootcolor1); }
}

/* Cart Page - Title */
.page-title,
.woocommerce-cart .wp-block-post-title,
.woocommerce-cart .entry-title {
  font-size: 28px;
  font-weight: 800;
  color: #1a1a1a;
  text-transform: uppercase;
  margin: 0 0 24px;
  padding: 0;
  letter-spacing: 0.5px;
}

/* ===== WC Blocks Cart ===== */
.wp-block-woocommerce-cart,
.wc-block-cart {
  margin-top: 10px;
}

/* Cart Table Headers (SẢN PHẨM, TỔNG CỘNG) */
.wc-block-cart .wc-block-cart-items .wc-block-cart-items__header {
  border-bottom: 2px solid #ddd;
  padding-bottom: 10px;
  margin-bottom: 0;
}
.wc-block-cart .wc-block-cart-items .wc-block-cart-items__header span {
  font-size: 13px;
  font-weight: 700;
  color: #555;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Cart Item Rows */
.wc-block-cart .wc-block-cart-items .wc-block-cart-items__row {
  border-bottom: 1px solid #eee;
  padding: 16px 0;
}
.wc-block-cart .wc-block-cart-items .wc-block-cart-items__row:last-child {
  border-bottom: none;
}

/* Product thumbnail */
.wc-block-cart .wc-block-cart-item__image img {
  width: 70px !important;
  height: 70px !important;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid #eee;
}

/* Product name */
.wc-block-cart .wc-block-cart-item__product .wc-block-components-product-name {
  font-weight: 600;
  color: #333;
  text-decoration: none;
  font-size: 14px;
  line-height: 1.4;
}
.wc-block-cart .wc-block-cart-item__product .wc-block-components-product-name:hover {
  color: var(--rootcolor1);
}

/* Product price */
.wc-block-cart .wc-block-cart-item__product .wc-block-components-product-price {
  color: #333;
  font-weight: 600;
}
.wc-block-cart .wc-block-cart-item__total .wc-block-components-product-price {
  font-weight: 700;
  color: var(--rootcolor-danger, #e53e3e);
  font-size: 15px;
}

/* Quantity controls */
.wc-block-cart .wc-block-components-quantity-selector {
  border: 1px solid #ddd;
  border-radius: 6px;
  overflow: hidden;
}
.wc-block-cart .wc-block-components-quantity-selector input {
  font-size: 14px;
  font-weight: 600;
  text-align: center;
  border: none !important;
}
.wc-block-cart .wc-block-components-quantity-selector button {
  background: #f8f9fa !important;
  border: none !important;
  color: #555 !important;
  font-size: 16px;
  cursor: pointer;
}
.wc-block-cart .wc-block-components-quantity-selector button:hover {
  background: #eee !important;
}

/* Remove item button */
.wc-block-cart .wc-block-cart-item__remove-link {
  color: #999 !important;
  font-size: 13px;
  text-decoration: none !important;
}
.wc-block-cart .wc-block-cart-item__remove-link:hover {
  color: var(--rootcolor-danger, #e53e3e) !important;
}

/* ===== Cart Totals Sidebar ===== */
.wc-block-cart .wp-block-woocommerce-cart-totals-block,
.wc-block-cart .wc-block-cart__sidebar {
  background: #fff;
  border: 1px solid #eee;
  border-radius: 10px;
  padding: 24px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}
.wc-block-cart .wc-block-cart__sidebar .wc-block-components-totals-wrapper {
  border-color: #eee;
}
.wc-block-cart .wc-block-cart__sidebar .wc-block-components-totals-item__label {
  font-weight: 600;
  color: #555;
}
.wc-block-cart .wc-block-cart__sidebar .wc-block-components-totals-item__value {
  font-weight: 700;
  color: #222;
}
.wc-block-cart .wc-block-cart__sidebar .wc-block-components-totals-footer-item .wc-block-components-totals-item__value {
  font-size: 20px;
  color: var(--rootcolor-danger, #e53e3e);
  font-weight: 800;
}
.wc-block-cart .wc-block-cart__sidebar .wc-block-components-totals-footer-item .wc-block-components-totals-item__label {
  font-weight: 700;
  font-size: 16px;
}

/* Coupon accordion */
.wc-block-cart .wc-block-components-totals-coupon__button {
  background: var(--rootcolor1) !important;
  color: #fff !important;
  border: none !important;
  border-radius: 6px !important;
  padding: 8px 16px !important;
  font-weight: 600 !important;
  cursor: pointer;
}
.wc-block-cart .wc-block-components-totals-coupon__button:hover {
  background: var(--rootcolor3) !important;
}
.wc-block-cart .wc-block-components-totals-coupon input {
  border: 1px solid #ddd !important;
  border-radius: 6px !important;
  padding: 8px 12px !important;
}

/* Checkout button */
.wc-block-cart .wc-block-cart__submit-button,
.wc-block-cart .wp-block-woocommerce-proceed-to-checkout-block a,
.wc-block-cart .wc-block-components-checkout-return-to-cart-button,
.wc-block-cart a.wc-block-cart__submit-button {
  display: block !important;
  width: 100% !important;
  background: var(--rootcolor3) !important;
  color: #fff !important;
  border: none !important;
  border-radius: 8px !important;
  font-weight: 700 !important;
  font-size: 15px !important;
  text-align: center !important;
  padding: 14px 30px !important;
  text-decoration: none !important;
  text-transform: uppercase !important;
  letter-spacing: 0.5px;
  transition: background 0.3s, opacity 0.3s;
  cursor: pointer;
  margin-top: 12px;
}
.wc-block-cart .wc-block-cart__submit-button:hover,
.wc-block-cart .wp-block-woocommerce-proceed-to-checkout-block a:hover,
.wc-block-cart a.wc-block-cart__submit-button:hover {
  background: var(--rootcolor1) !important;
  opacity: 1 !important;
  text-decoration: none !important;
}

/* ===== Empty Cart ===== */
.wc-block-cart--is-loading .wc-block-cart__empty-cart__title,
.wc-block-cart .wc-block-cart__empty-cart__title {
  font-size: 18px;
  font-weight: 600;
  color: #555;
  text-align: center;
}
.wc-block-cart .wp-block-woocommerce-empty-cart-block {
  text-align: center;
  padding: 40px 20px;
}
.wc-block-cart .wp-block-woocommerce-empty-cart-block .wp-block-button__link,
.wc-block-cart .wp-block-woocommerce-empty-cart-block a.wp-block-button__link {
  background: var(--rootcolor3) !important;
  color: #fff !important;
  border-radius: 6px !important;
  font-weight: 700 !important;
  text-transform: uppercase !important;
  padding: 14px 30px !important;
  text-decoration: none !important;
  font-size: 14px !important;
  letter-spacing: 0.5px;
}
.wc-block-cart .wp-block-woocommerce-empty-cart-block a.wp-block-button__link:hover {
  background: var(--rootcolor1) !important;
}

/* ===== Classic WC Cart (shortcode fallback) ===== */
.woocommerce-cart .woocommerce {
  max-width: 100%;
}
.woocommerce-cart .woocommerce > .woocommerce-notices-wrapper + .cart-empty {
  text-align: center;
  padding: 60px 20px;
  font-size: 16px;
  color: #666;
}
.woocommerce-cart .woocommerce > .woocommerce-notices-wrapper + .cart-empty::before {
  content: '\f07a';
  font-family: 'Font Awesome 6 Free';
  font-weight: 900;
  font-size: 60px;
  display: block;
  color: #ddd;
  margin-bottom: 20px;
}
.woocommerce-cart .return-to-shop a {
  display: inline-block;
  padding: 14px 30px;
  background: var(--rootcolor3);
  color: #fff !important;
  border-radius: 6px;
  font-weight: 700;
  font-size: 14px;
  text-transform: uppercase;
  text-decoration: none;
  transition: background 0.3s;
  margin-top: 10px;
}
.woocommerce-cart .return-to-shop a:hover {
  background: var(--rootcolor1);
  text-decoration: none;
}
.woocommerce-cart table.shop_table {
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid #eee;
  border-collapse: separate;
  border-spacing: 0;
  th {
    background: var(--rootcolor3);
    color: #fff;
    font-weight: 600;
    padding: 14px 16px;
    font-size: 14px;
    text-align: left;
  }
  td {
    padding: 14px 16px;
    vertical-align: middle;
    font-size: 14px;
    border-bottom: 1px solid #f0f0f0;
  }
  tr:last-child td {
    border-bottom: none;
  }
  .product-thumbnail img {
    width: 70px;
    height: 70px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid #eee;
  }
  .product-name a {
    color: #333;
    font-weight: 600;
    text-decoration: none;
    &:hover { color: var(--rootcolor1); }
  }
  .product-price,
  .product-subtotal {
    font-weight: 700;
    color: var(--rootcolor-danger);
  }
  .product-quantity .qty {
    width: 60px;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 6px;
    text-align: center;
    font-size: 14px;
  }
  .product-remove a {
    color: #ccc;
    font-size: 20px;
    transition: color 0.2s;
    text-decoration: none;
    &:hover { color: var(--rootcolor-danger); }
  }
}
.woocommerce-cart .actions {
  padding: 16px !important;
  background: #f8f9fa;
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  .coupon {
    display: flex;
    gap: 8px;
    flex: 1;
    input { padding: 10px 14px; border: 1px solid #ddd; border-radius: 6px; font-size: 14px; flex: 1; min-width: 120px; }
    button { background: var(--rootcolor1); color: #fff; border: none; padding: 10px 20px; border-radius: 6px; font-weight: 600; cursor: pointer; white-space: nowrap; }
    button:hover { background: var(--rootcolor3); }
  }
  > button[name="update_cart"] {
    background: #555;
    color: #fff;
    border: none;
    padding: 10px 24px;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    margin-left: auto;
    &:hover { background: #333; }
  }
}
.woocommerce .cart-collaterals .cart_totals {
  background: #fff;
  border-radius: 10px;
  padding: 24px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.08);
  border: 1px solid #eee;
  h2 {
    font-size: 18px;
    font-weight: 700;
    color: #222;
    margin: 0 0 16px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--rootcolor2);
  }
  table {
    width: 100%;
    th { font-weight: 600; padding: 10px 0; color: #555; }
    td { text-align: right; padding: 10px 0; }
    .order-total td { font-weight: 700; font-size: 18px; color: var(--rootcolor-danger); }
  }
}
.woocommerce a.checkout-button {
  display: block;
  background: var(--rootcolor3) !important;
  color: #fff !important;
  border-radius: 8px !important;
  font-weight: 700;
  font-size: 16px;
  text-align: center;
  padding: 14px 30px;
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  transition: background 0.3s;
  &:hover { background: var(--rootcolor1) !important; text-decoration: none; }
}

/* Checkout */
.woocommerce-checkout .woocommerce-billing-fields label,
.woocommerce-checkout .woocommerce-shipping-fields label {
  font-weight: 600;
  font-size: 14px;
  color: #333;
}
.woocommerce-checkout input,
.woocommerce-checkout select,
.woocommerce-checkout textarea {
  border: 1px solid #ddd;
  border-radius: 5px;
  padding: 10px 12px;
  font-size: 14px;
}
.woocommerce #place_order {
  background: var(--rootcolor1);
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 14px 30px;
  font-weight: 700;
  font-size: 16px;
  cursor: pointer;
  &:hover { background: var(--rootcolor3); }
}

/* Blog / Archive styles */
.cat_list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
}
.cat_item {
  display: flex;
  gap: 16px;
  padding: 16px 0;
  border-bottom: 1px solid #eee;
  .cat_thumb {
    flex-shrink: 0;
    width: 200px;
    height: 130px;
    border-radius: 8px;
    overflow: hidden;
    img { width: 100%; height: 100%; object-fit: cover; }
  }
  .cat_content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
  }
  .cat_title {
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 8px;
    a { color: #333; &:hover { color: var(--rootcolor1); text-decoration: none; } }
  }
  .cat_desc {
    font-size: 13px;
    color: #666;
    margin: 0 0 8px;
    line-height: 1.5;
  }
  .cat_meta {
    font-size: 12px;
    color: #999;
    span { margin-right: 12px; }
  }
  @media (max-width: 576px) {
    flex-direction: column;
    .cat_thumb { width: 100%; height: 180px; }
  }
}

/* Archive header */
.archive-header {
  margin-bottom: 20px;
  .entry-title {
    font-size: 22px;
    font-weight: 700;
    color: var(--rootcolor3);
    margin: 0 0 8px;
  }
  .archive-description {
    font-size: 14px;
    color: #666;
  }
}