/*
Theme Name: Tung Elementor Theme
Theme URI: https://github.com/tungpham42/tung-wordpress-theme
Author: Tung Pham
Author URI: https://tungpham42.github.io
Description: Tung's theme with Elementor and single product page
Version: 1.2
License: GNU General Public License v2 or later
Text Domain: tung-wordpress-theme
*/

:root {
  --primary-color: #1e40af;
  --accent-color: #60a5fa;
  --price-color: #ef4444;
  --text-color: #1f2937;
  --bg-color: #f1f5f9;
  --highlight-color: #facc15;
  --card-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}

body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
  margin: 0;
  padding: 0;
  font-size: 16px;
  line-height: 1.7;
  color: var(--text-color);
  background-color: var(--bg-color);
  transition: background-color 0.3s ease;
}

body.home header.entry-header {
  display: none;
}

body.home main > article {
  padding: 0 !important;
}

body.home main > article:hover {
  transform: none !important;
}

body.home .e-con-inner {
  padding-block-start: 0 !important;
}

header:not(.entry-header) {
  background: linear-gradient(
    135deg,
    var(--primary-color),
    var(--accent-color)
  );
  color: #fff;
  padding: 1.5rem 2rem;
  box-shadow: var(--card-shadow);
  position: sticky;
  top: 0;
  z-index: 1000;
  animation: slideIn 0.5s ease-out;
}

@keyframes slideIn {
  from {
    transform: translateY(-100%);
  }
  to {
    transform: translateY(0);
  }
}

a.site-logo {
  text-decoration: none !important;
}

.nav-container {
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.site-branding {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.site-title {
  margin: 0;
  font-size: 1.8rem;
  font-weight: 800;
  color: #fff;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.site-logo img {
  max-height: 60px;
  width: auto;
  transition: transform 0.3s ease;
}

.site-logo img:hover {
  transform: scale(1.1);
}

.primary-nav ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  gap: 2rem;
}

.primary-nav ul li a {
  color: #fff;
  text-decoration: none;
  font-weight: 600;
  padding: 0.75rem 1.5rem;
  border-radius: 50px;
  transition: all 0.3s ease;
  background: rgba(255, 255, 255, 0.1);
}

.primary-nav ul li a:hover,
.primary-nav ul li a:focus {
  background: var(--highlight-color);
  color: var(--primary-color);
  transform: scale(1.05);
  outline: none;
}

.hamburger {
  display: none;
  font-size: 1.8rem;
  background: none;
  border: none;
  color: #fff;
  cursor: pointer;
  transition: transform 0.3s ease;
}

.hamburger::before {
  content: "☰";
}

.hamburger:hover {
  transform: rotate(90deg);
}

.hamburger:hover::before {
  content: "✕";
}

.top-header-banner a.elementor-button,
.bottom-cta-banner a.elementor-button {
  display: unset !important;
}

footer {
  background: linear-gradient(180deg, #111827, #1f2937);
  color: #e5e7eb;
  padding: 3rem 2rem;
  position: relative;
}

.footer-container {
  max-width: 1280px;
  margin: 0 auto;
}

.footer-widgets {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 2rem;
  margin-bottom: 2.5rem;
}

.footer-widgets article {
  background: unset !important;
  padding: 0 !important;
}

.footer-widgets header,
.footer-widgets footer,
.footer-widgets ol,
.footer-widgets ul {
  padding: 0 !important;
}

.footer-bottom {
  text-align: center;
  border-top: 1px solid #4b5563;
  padding-top: 1.5rem;
  font-size: 0.9rem;
}

.posts-grid {
  max-width: 1280px;
  margin: 3rem auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 2rem;
}

article {
  background: #fff;
  border-radius: 16px;
  box-shadow: var(--card-shadow);
  padding: 2rem;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

article:hover {
  transform: translateY(-8px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.15);
}

.footer-widget article {
  transform: none !important;
}

.footer-widget article footer {
  background-image: none !important;
}

.footer-widget a {
  color: #fff !important;
}

.entry-header {
  margin-bottom: 1.5rem;
}

.entry-title {
  font-size: 1.8rem;
  color: var(--primary-color);
  margin: 0;
  font-weight: 700;
}

.entry-title a {
  color: var(--primary-color);
  text-decoration: none;
}

.entry-title a:hover {
  color: var(--highlight-color);
}

.entry-content {
  font-size: 1.1rem;
  color: var(--text-color);
}

img {
  max-width: 100%;
  height: auto;
  border-radius: 12px;
  transition: transform 0.3s ease;
}

img:hover {
  transform: scale(1.05);
}

.product-summary {
  padding: 2rem;
  background: #fff;
  border-radius: 16px;
  box-shadow: var(--card-shadow);
  margin: 1.5rem;
  transition: transform 0.3s ease;
}

.product-summary:hover {
  transform: translateY(-5px);
}

.single-product-container {
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
  max-width: 1280px;
  margin: 0 auto;
  padding: 2rem;
}

.product-details {
  display: flex;
  justify-content: center;
  gap: 2rem;
  width: 100%;
}

.product-gallery {
  flex: 1 1 450px;
  background: #fff;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--card-shadow);
  transition: transform 0.3s ease;
}

.product-gallery:hover {
  transform: translateY(-5px);
}

.product-thumbnails img {
  width: 100px;
  height: 100px;
  object-fit: cover;
  margin: 0.75rem;
  cursor: pointer;
  border: 3px solid transparent;
  border-radius: 8px;
  transition: all 0.3s ease;
}

.product-thumbnails img:hover {
  border-color: var(--highlight-color);
  transform: scale(1.1);
}

.product-info {
  flex: 1 1 450px;
  padding: 2rem;
  background: #fff;
  border-radius: 16px;
  box-shadow: var(--card-shadow);
}

/* Single Product Styles */
.product-info h1 {
  font-size: 2.5rem;
  font-weight: 600;
  color: #1e40af;
  margin: 0 0 1rem;
  text-shadow: none;
}

.product-info .price {
  font-size: 1.8rem;
  font-weight: bold;
  color: #ef4444;
  margin: 0;
  text-shadow: none;
}

.product-info .category {
  display: block;
  font-size: 1rem;
  color: #1f2937;
  margin: 0 0 1rem;
  text-shadow: none;
}

.product-info .category:hover {
  color: #facc15;
}

.btn-add-cart {
  padding: 0.75rem 2rem;
  background-color: #60a5fa;
  color: #ffffff;
  border-radius: 50px;
  border-style: none;
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  transition: background 0.3s ease, color 0.3s ease, transform 0.3s ease,
    box-shadow 0.3s ease;
  text-shadow: none;
}

.btn-add-cart:hover {
  background-color: #facc15;
  color: #1e40af;
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  text-shadow: none;
}

/* Price and Discount Styles */
.price-container {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
}

.original-price {
  font-size: 1.2rem;
  color: #6b7280; /* Neutral gray for original price */
  text-decoration: line-through;
}

.discount-badge {
  font-size: 14px;
  font-weight: 600;
  color: #16a34a;
  background-color: #dcfce7;
  padding: 4px 8px;
  border-radius: 12px;
  flex-grow: 0;
  transition: transform 0.3s ease;
}

/* Related Items Styles */
.related-item h3 {
  font-size: 1.4rem;
  color: var(--primary-color, #1e40af);
  padding: 1rem;
  margin: 0;
  font-weight: 600;
}

.related-item h3:hover {
  color: var(--highlight-color, #facc15);
}

.related-item .price {
  font-size: 1.2rem;
  color: var(--price-color, #ef4444);
  padding: 0 1rem 1rem;
}

.related-item .btn-view,
.btn-view {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  background-color: var(--accent-color, #60a5fa);
  color: var(--button-text-color, #ffffff);
  text-decoration: none;
  border-radius: 50px;
  margin: 1rem;
  border-style: none;
  border-width: 1px;
  border-color: var(--primary-color, #1e40af);
  transition: background 0.3s ease, color 0.3s ease, transform 0.3s ease;
}

.related-item .btn-view:hover,
.btn-view:hover {
  background-color: var(--highlight-color, #facc15);
  color: var(--primary-color, #1e40af);
  border-color: var(--primary-color, #1e40af);
  transform: scale(1.05);
}

.related-item .category {
  font-size: 1rem;
  color: var(--text-color, #1f2937);
  padding: 0 1rem;
  margin-bottom: 1rem;
  display: block;
}

.related-item .category:hover {
  color: var(--highlight-color, #facc15);
}

.related-products {
  padding: 3rem;
  background: linear-gradient(180deg, #f3f4f6, #e5e7eb);
  border-radius: 16px;
}

.related-products h2 {
  font-size: 2rem;
  color: var(--primary-color);
  text-align: center;
  margin-bottom: 1.5rem;
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 2rem;
  max-width: 1280px;
  margin: 0 auto;
}

.pg-item .btn-view,
.related-products .pg-item .btn-view {
  background-color: #60a5fa;
  color: #ffffff;
  border-style: none;
  border-width: 1px;
  border-color: #1e40af;
  border-radius: 50px;
}

.pg-item .btn-view:hover,
.related-products .pg-item .btn-view:hover {
  background-color: #facc15;
  color: #1e40af;
  border-color: #1e40af;
}

/* Ensure 3 columns for 6 related products on desktops */
@media (min-width: 1024px) {
  .related-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Adjust to 2 columns for tablets */
@media (min-width: 768px) and (max-width: 1023px) {
  .related-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.related-item {
  background: #fff;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--card-shadow);
  text-align: center;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.related-item:hover {
  transform: translateY(-8px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.15);
}

.related-item img {
  width: 100%;
  height: 220px;
  object-fit: cover;
  border-radius: 12px 12px 0 0;
}

.tungtheme-product-gallery {
  max-width: 1280px;
  padding: 2rem;
  background: #fff;
  border-radius: 16px;
  box-shadow: var(--card-shadow);
}

.pg-filter {
  display: flex;
  gap: 1rem;
  margin-bottom: 2rem;
  justify-content: center;
}

.pg-select {
  padding: 0.75rem;
  border-radius: 8px;
  border: 1px solid var(--text-color);
  background: var(--bg-color);
  color: var(--text-color);
  font-size: 1rem;
  cursor: pointer;
  transition: border-color 0.3s ease, background 0.3s ease;
}

.pg-select:hover {
  border-color: var(--highlight-color);
  background: #fff;
}

.pg-loading {
  text-align: center;
  padding: 2rem;
  font-size: 1.2rem;
  color: var(--text-color);
}

.pg-loading .loading-spinner {
  display: inline-block;
  width: 24px;
  height: 24px;
  border: 3px solid var(--accent-color);
  border-top: 3px solid var(--highlight-color);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-right: 10px;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

.pg-grid {
  display: grid;
  gap: 2rem;
}

.pg-grid .pg-item {
  background: #fff;
  border-radius: 16px;
  box-shadow: var(--card-shadow);
  text-align: center;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.pg-grid .pg-item:hover {
  transform: translateY(-8px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.15);
}

.pg-item img {
  width: 100%;
  height: 220px;
  object-fit: cover;
  border-radius: 12px 12px 0 0;
}

.pg-item h3 {
  font-size: 1.4rem;
  color: var(--primary-color);
  padding: 1rem;
  margin: 0;
  font-weight: 600;
}

.pg-item h3:hover {
  color: var(--highlight-color);
}

.pg-item .price {
  font-size: 1.2rem;
  color: var(--price-color);
  padding: 0 1rem;
  margin-bottom: 1rem;
}

.pg-item .category {
  display: block;
  font-size: 1rem;
  color: var(--text-color);
  padding: 0 1rem;
  margin-bottom: 1rem;
}

.pg-item .category:hover {
  color: var(--highlight-color);
}

.pg-item .btn-view {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  text-decoration: none;
  border-radius: 50px;
  margin: 1rem;
  font-weight: 600;
  transition: background 0.3s ease, color 0.3s ease, transform 0.3s ease;
}

/* Dynamic grid columns based on items per row */
.tungtheme-product-gallery[data-items="1"] .pg-grid {
  grid-template-columns: 1fr;
}

.tungtheme-product-gallery[data-items="2"] .pg-grid {
  grid-template-columns: repeat(2, 1fr);
}

.tungtheme-product-gallery[data-items="3"] .pg-grid {
  grid-template-columns: repeat(3, 1fr);
}

.tungtheme-product-gallery[data-items="4"] .pg-grid {
  grid-template-columns: repeat(4, 1fr);
}

.tungtheme-product-gallery[data-items="5"] .pg-grid {
  grid-template-columns: repeat(5, 1fr);
}

.tungtheme-product-gallery[data-items="6"] .pg-grid {
  grid-template-columns: repeat(6, 1fr);
}

/* Search Form Styles */
.search-form {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.5rem;
  background: #fff;
  border-radius: 50px;
  padding: 0.5rem 1rem;
  box-shadow: var(--card-shadow);
  transition: box-shadow 0.3s ease, transform 0.3s ease;
  width: 100%;
}

.search-form:hover {
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.15);
  transform: translateY(-2px);
}

.search-form label.search-label {
  width: 100%;
}

.search-form input[type="search"] {
  flex: 1;
  border: none;
  padding: 0.75rem;
  font-size: 1rem;
  color: var(--text-color);
  background: transparent;
  outline: none;
  font-family: "Inter", sans-serif;
  width: 100%;
}

.search-form input[type="search"]::placeholder {
  color: #6b7280;
}

.search-form button[type="submit"] {
  padding: 0.75rem 1.5rem;
  background-color: var(--accent-color);
  color: #fff;
  border: none;
  border-radius: 50px;
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  transition: background 0.3s ease, color 0.3s ease, transform 0.3s ease;
}

.search-form button[type="submit"]:hover {
  background-color: var(--highlight-color);
  color: var(--primary-color);
  transform: scale(1.05);
}

/* Back to Top Button Styles */
.back-to-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background-color: var(--accent-color);
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: var(--card-shadow);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease;
  z-index: 1000;
}

.back-to-top.visible {
  opacity: 1;
  visibility: visible;
}

.back-to-top:hover {
  background-color: var(--highlight-color);
  color: var(--primary-color);
  transform: scale(1.1);
}

.back-to-top svg {
  width: 24px;
  height: 24px;
}

/* Tablets (≥768px) */
@media (min-width: 768px) {
  .primary-nav ul {
    justify-content: flex-end;
  }

  .product-summary {
    display: flex;
    gap: 2.5rem;
  }
}

/* Desktops (≥1024px) */
@media (min-width: 1024px) {
  header,
  footer {
    padding: 2rem 6rem;
  }

  .product-gallery,
  .product-info {
    flex: 1 1 550px;
  }
}

/* Mobile (≤768px) */
@media (max-width: 768px) {
  .primary-nav ul {
    display: none;
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--primary-color);
    padding: 1.5rem;
    border-radius: 0 0 16px 16px;
  }

  .primary-nav ul.active {
    display: flex;
  }

  .hamburger {
    display: block;
  }

  .related-grid {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  }

  .posts-grid {
    grid-template-columns: 1fr;
  }

  .product-content {
    grid-template-columns: 1fr;
  }

  .tungtheme-product-gallery[data-items="4"] .pg-grid,
  .tungtheme-product-gallery[data-items="5"] .pg-grid,
  .tungtheme-product-gallery[data-items="6"] .pg-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .search-form {
    flex-direction: column;
    gap: 1rem;
    padding: 1rem;
  }

  .search-form input[type="search"] {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--text-color);
    border-radius: 8px;
  }

  .search-form button[type="submit"] {
    width: 100%;
    padding: 0.75rem;
  }

  .back-to-top {
    bottom: 1.5rem;
    right: 1.5rem;
    width: 40px;
    height: 40px;
  }
}

/* Small Mobile (≤480px) */
@media (max-width: 480px) {
  .related-grid {
    grid-template-columns: 1fr;
  }

  .product-gallery,
  .product-info {
    flex: 1 1 100%;
  }

  .site-title {
    font-size: 1.4rem;
  }

  .tungtheme-product-gallery[data-items="2"] .pg-grid,
  .tungtheme-product-gallery[data-items="3"] .pg-grid,
  .tungtheme-product-gallery[data-items="4"] .pg-grid,
  .tungtheme-product-gallery[data-items="5"] .pg-grid,
  .tungtheme-product-gallery[data-items="6"] .pg-grid {
    grid-template-columns: 1fr;
  }

  .search-form input[type="search"] {
    font-size: 0.9rem;
  }

  .search-form button[type="submit"] {
    font-size: 0.9rem;
  }

  .back-to-top {
    bottom: 1rem;
    right: 1rem;
    width: 36px;
    height: 36px;
  }

  .back-to-top svg {
    width: 20px;
    height: 20px;
  }
}

ol.wp-block-latest-comments {
  padding-left: 0 !important;
}

.e-con.e-flex > .e-con-inner {
  flex-wrap: nowrap !important;
}
