/* Viewertech Webshop modern presentation layer.
   Scoped to Frappe Webshop routes/components; business logic stays in ERPNext. */

:root {
  --vt-shop-ink: #071b3a;
  --vt-shop-muted: #64748b;
  --vt-shop-border: #dbe7f3;
  --vt-shop-soft: #f4f9fd;
  --vt-shop-panel: #ffffff;
  --vt-shop-blue: #2498d8;
  --vt-shop-blue-dark: #08366f;
  --vt-shop-teal: #117f75;
  --vt-shop-gold: #b87905;
  --vt-shop-shadow: 0 18px 48px rgba(7, 27, 58, 0.12);
}

body.product-page,
body[data-path="cart"],
body[data-path^="products/"],
body[data-path="all-products"] {
  background: #f7fafc;
  color: var(--vt-shop-ink);
}

body.product-page .page_content,
body.product-page .page-content,
body[data-path="cart"] .page_content,
body[data-path="cart"] .page-content,
body[data-path^="products/"] .page_content,
body[data-path^="products/"] .page-content {
  max-width: 1180px;
  margin: 0 auto;
}

body.product-page .page-header,
body[data-path="all-products"] .page-header {
  border: 0;
  margin: 0 auto 1.5rem;
  max-width: 1180px;
}

body.product-page .page-header h1,
body.product-page .page-header .h1,
body.product-page .page-header .mb-6 {
  color: var(--vt-shop-ink);
  font-size: 3rem;
  font-weight: 800;
  letter-spacing: 0;
  line-height: 1.05;
  margin-bottom: 0.75rem !important;
}

body.product-page .page-header::after {
  content: "Browse Viewertech software, managed services and hosting packages.";
  color: var(--vt-shop-muted);
  display: block;
  font-size: 1rem;
  max-width: 680px;
}

#product-listing.item-card-group-section {
  padding: 0;
}

#product-listing .list-row {
  align-items: stretch;
  background: var(--vt-shop-panel);
  border: 1px solid var(--vt-shop-border);
  border-radius: 8px;
  box-shadow: 0 12px 32px rgba(7, 27, 58, 0.08);
  margin-bottom: 1rem !important;
  padding: 1rem;
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

#product-listing .list-row:hover {
  border-color: rgba(36, 152, 216, 0.45);
  box-shadow: var(--vt-shop-shadow);
  transform: translateY(-2px);
}

#product-listing .list-image {
  align-items: center;
  background: linear-gradient(135deg, #eef8ff, #ffffff);
  border: 1px solid var(--vt-shop-border) !important;
  border-radius: 8px !important;
  display: flex;
  justify-content: center;
  min-height: 112px;
  overflow: hidden;
}

#product-listing .no-image-list,
.item-card .no-image,
.no-image-item {
  align-items: center;
  background: linear-gradient(135deg, var(--vt-shop-blue-dark), var(--vt-shop-teal));
  border-radius: 8px;
  color: #ffffff;
  display: flex;
  font-size: 1.5rem;
  font-weight: 800;
  height: 100%;
  justify-content: center;
  min-height: 112px;
  text-transform: uppercase;
}

#product-listing a[href^="/products/"] {
  color: var(--vt-shop-ink) !important;
  font-size: 1.05rem;
  font-weight: 800 !important;
  letter-spacing: 0;
  text-decoration: none !important;
}

#product-listing a[href^="/products/"]:hover {
  color: var(--vt-shop-blue-dark) !important;
}

#product-listing .product-code {
  color: var(--vt-shop-muted);
  font-size: 0.78rem;
  margin: 0.35rem 0 0;
}

.product-price {
  color: var(--vt-shop-blue-dark);
  font-size: 1.05rem;
  font-weight: 800;
  margin-top: 0.75rem;
}

.btn.btn-primary,
.btn-add-to-cart-list,
.btn-add-to-cart,
.go-to-cart {
  background: var(--vt-shop-blue-dark) !important;
  border-color: var(--vt-shop-blue-dark) !important;
  border-radius: 8px !important;
  box-shadow: 0 10px 24px rgba(8, 54, 111, 0.2);
  color: #ffffff !important;
  font-weight: 800 !important;
  min-height: 40px;
}

.btn.btn-primary:hover,
.btn-add-to-cart-list:hover,
.btn-add-to-cart:hover,
.go-to-cart:hover {
  background: var(--vt-shop-teal) !important;
  border-color: var(--vt-shop-teal) !important;
}

.filters-section {
  background: #ffffff;
  border: 1px solid var(--vt-shop-border);
  border-radius: 8px;
  box-shadow: 0 10px 28px rgba(7, 27, 58, 0.08);
  padding: 1.25rem;
  position: sticky;
  top: 6rem;
}

/* WordPress purchase-page inspired catalogue grid. */
body[data-path="all-products"] .page-content-wrapper {
  padding-top: 1rem;
}

body[data-path="all-products"] .page_content,
body[data-path="all-products"] .page-content {
  max-width: 1240px;
  margin: 0 auto;
}

body[data-path="all-products"] #toggle-view {
  display: none;
}

body[data-path="all-products"] .toolbar {
  align-items: center;
  margin-bottom: 1.5rem;
}

body[data-path="all-products"] .toolbar .input-group {
  flex: 1 1 auto;
  max-width: 680px;
}

body[data-path="all-products"] #search-box {
  border: 1px solid var(--vt-shop-border);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(7, 27, 58, 0.06);
  min-height: 46px;
}

body[data-path="all-products"] #products-list-area {
  display: none !important;
}

body[data-path="all-products"] #products-grid-area {
  display: grid !important;
  gap: 1.4rem;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 0 !important;
  padding: 0;
}

body[data-path="all-products"] #products-grid-area .item-card {
  display: block;
  max-width: none;
  min-width: 0;
  padding: 0;
  width: auto;
}

body[data-path="all-products"] #products-grid-area .card {
  align-items: stretch;
  background: #ffffff;
  border: 1px solid var(--vt-shop-border);
  border-radius: 8px;
  box-shadow: 0 10px 28px rgba(7, 27, 58, 0.08);
  height: 100% !important;
  justify-content: flex-start;
  overflow: hidden;
  transition: border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

body[data-path="all-products"] #products-grid-area .card:hover,
body[data-path="all-products"] #products-grid-area .card:focus-within {
  border-color: rgba(36, 152, 216, 0.5);
  box-shadow: 0 18px 42px rgba(7, 27, 58, 0.14);
  transform: translateY(-3px);
}

body[data-path="all-products"] #products-grid-area .card-img-container {
  align-items: center;
  background: #ffffff;
  border-bottom: 1px solid var(--vt-shop-border);
  display: flex;
  height: 220px;
  justify-content: center;
  margin: 0;
  overflow: hidden;
  width: 100%;
}

body[data-path="all-products"] #products-grid-area .card-img-container a {
  align-items: center;
  display: flex;
  height: 100%;
  justify-content: center;
  width: 100%;
}

body[data-path="all-products"] #products-grid-area .card-img {
  height: 100%;
  margin: 0;
  max-height: none;
  object-fit: contain;
  padding: 1rem;
  width: 100%;
}

body[data-path="all-products"] #products-grid-area .no-image {
  border-radius: 0;
  height: 100%;
  margin: 0;
  min-height: 220px;
}

body[data-path="all-products"] #products-grid-area .card-body {
  align-items: stretch;
  display: flex;
  min-height: 220px;
  padding: 1.15rem 1.2rem 1.25rem;
}

body[data-path="all-products"] #products-grid-area .product-title {
  color: var(--vt-shop-ink);
  display: -webkit-box;
  font-size: 1.05rem;
  font-weight: 800;
  line-height: 1.35;
  min-height: 2.85rem;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

body[data-path="all-products"] #products-grid-area .product-category {
  color: var(--vt-shop-teal);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0;
  margin: 0.55rem 0 0.35rem;
  text-transform: uppercase;
}

body[data-path="all-products"] #products-grid-area .product-price {
  align-items: baseline;
  color: var(--vt-shop-blue-dark);
  display: flex;
  flex-wrap: wrap;
  font-size: 1.1rem;
  gap: 0.35rem;
  margin: 0.45rem 0 0.75rem;
}

body[data-path="all-products"] #products-grid-area .striked-price {
  color: #7c8797;
  font-size: 0.83rem;
  order: -1;
}

body[data-path="all-products"] #products-grid-area .product-info-green {
  background: #e8f7f1;
  border-radius: 4px;
  color: #087957;
  font-size: 0.72rem;
  padding: 0.2rem 0.4rem;
}

body[data-path="all-products"] #products-grid-area .btn-add-to-cart-list,
body[data-path="all-products"] #products-grid-area .btn-explore-variants {
  margin-top: auto !important;
  max-height: none;
  min-height: 42px;
  visibility: visible;
}

body[data-path="all-products"] .filters-section {
  box-shadow: 0 10px 28px rgba(7, 27, 58, 0.07);
  padding: 1.15rem;
  top: 5rem;
}

body[data-path="all-products"] .filters-section .title-section {
  border-bottom: 1px solid var(--vt-shop-border);
  margin-bottom: 1rem !important;
}

body[data-path="all-products"] .filters-title {
  color: var(--vt-shop-ink);
  font-size: 0.95rem;
}

body[data-path="all-products"] .filter-label {
  color: var(--vt-shop-ink);
  font-size: 0.72rem;
  font-weight: 800;
}

body[data-path="all-products"] .filter-options label {
  align-items: center;
  color: #46566b;
  display: flex;
  gap: 0.45rem;
  margin-bottom: 0.55rem;
}

body[data-path="all-products"] .product-paging-area {
  margin-top: 2rem !important;
}

.filters-title,
.filter-label {
  color: var(--vt-shop-ink);
  font-weight: 800;
}

.clear-filters {
  color: var(--vt-shop-teal);
  font-weight: 700;
}

.item-card .card,
.featured-item.card {
  border: 1px solid var(--vt-shop-border);
  border-radius: 8px;
  box-shadow: 0 12px 32px rgba(7, 27, 58, 0.08);
  overflow: hidden;
}

.item-card .product-title {
  color: var(--vt-shop-ink);
  font-size: 1rem;
  font-weight: 800;
}

body[data-path^="products/"] .product-image,
body[data-path^="products/"] .sidebar-image-wrapper,
body[data-path^="products/"] .card,
body[data-path="cart"] .cart-container,
body[data-path="cart"] .cart-items,
body[data-path="cart"] .cart-summary {
  border-color: var(--vt-shop-border) !important;
  border-radius: 8px !important;
  box-shadow: 0 12px 32px rgba(7, 27, 58, 0.08);
}

body[data-path="cart"] table,
body[data-path="cart"] .cart-item {
  background: #ffffff;
  border-radius: 8px;
}

body[data-path="cart"] .page-header h1,
body[data-path="cart"] .page-header .h1 {
  color: var(--vt-shop-ink);
  font-weight: 800;
}

.web-footer {
  border-top: 1px solid var(--vt-shop-border);
}

/* Shared Viewertech footer on native Frappe and Webshop routes. */
.vt-site-footer {
  background: #ffffff;
  border-top: 1px solid #e7edf2;
  color: #7b8794;
  margin-top: 3rem;
  padding: 3.5rem 0 1.25rem;
}

.vt-site-footer .vt-container {
  margin-inline: auto;
  width: min(calc(100% - 32px), 1476px);
}

.vt-site-footer a {
  color: #087fca;
  text-decoration: none;
}

.vt-site-footer a:hover {
  color: #065d96;
  text-decoration: underline;
}

.vt-footer-grid {
  display: grid;
  gap: 2rem;
  grid-template-columns: minmax(240px, 1.45fr) repeat(4, minmax(135px, 1fr));
}

.vt-site-footer h2 {
  color: #112955;
  font-size: 1rem;
  font-weight: 800;
  margin: 0 0 0.85rem;
}

.vt-site-footer ul {
  display: grid;
  gap: 0.65rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.vt-footer-brand p {
  color: #7b8794;
  max-width: 360px;
}

.vt-brand-footer {
  display: inline-flex;
  margin-bottom: 1.25rem;
}

.vt-brand-footer img {
  height: auto;
  max-width: 190px;
  width: 100%;
}

.vt-footer-bottom {
  border-top: 1px solid #e7edf2;
  display: flex;
  font-size: 0.9rem;
  gap: 1rem;
  justify-content: space-between;
  margin-top: 2.5rem;
  padding-top: 1.25rem;
}

@media (max-width: 767px) {
  .vt-footer-grid {
    grid-template-columns: 1fr;
  }

  .vt-footer-bottom {
    align-items: flex-start;
    flex-direction: column;
  }

  body.product-page .page-header h1,
  body.product-page .page-header .h1,
  body.product-page .page-header .mb-6 {
    font-size: 2rem;
  }

  #product-listing .list-row {
    padding: 0.85rem;
  }

  #product-listing .list-image {
    margin-bottom: 0.85rem;
    max-width: 100%;
    min-height: 96px;
  }

  .filters-section {
    margin-bottom: 1rem;
    position: static;
  }

  body[data-path="all-products"] #products-grid-area {
    grid-template-columns: 1fr;
  }

  body[data-path="all-products"] #products-grid-area .card-img-container {
    height: 240px;
  }

  body[data-path="all-products"] .toolbar .input-group {
    max-width: none;
    width: 100%;
  }
}

@media (min-width: 768px) and (max-width: 1099px) {
  .vt-footer-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 768px) and (max-width: 1099px) {
  body[data-path="all-products"] #products-grid-area {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Marketplace catalogue facets. */
body[data-path="all-products"] .toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
}

body[data-path="all-products"] .vt-catalogue-tools {
  align-items: center;
  display: flex;
  gap: 0.65rem;
  margin-left: auto;
}

body[data-path="all-products"] .vt-results-count {
  color: var(--vt-shop-muted);
  font-size: 0.82rem;
  white-space: nowrap;
}

body[data-path="all-products"] .vt-catalogue-tools label {
  color: var(--vt-shop-muted);
  font-size: 0.78rem;
  font-weight: 700;
  margin: 0;
  white-space: nowrap;
}

body[data-path="all-products"] #vt-product-sort {
  background: #ffffff;
  border: 1px solid var(--vt-shop-border);
  border-radius: 6px;
  color: var(--vt-shop-ink);
  min-height: 38px;
  padding: 0 2rem 0 0.7rem;
}

body[data-path="all-products"] .vt-cart-link,
body[data-path="all-products"] .vt-filter-toggle {
  align-items: center;
  background: #ffffff;
  border: 1px solid var(--vt-shop-border);
  border-radius: 6px;
  color: var(--vt-shop-blue-dark);
  display: inline-flex;
  font-size: 0.82rem;
  font-weight: 800;
  justify-content: center;
  min-height: 38px;
  padding: 0 0.8rem;
  text-decoration: none;
}

body[data-path="all-products"] .vt-filter-toggle {
  display: none;
}

body[data-path="all-products"] .vt-facet-block {
  border-bottom: 1px solid var(--vt-shop-border);
  padding: 0 0 1rem;
  margin: 0 0 1rem;
}

body[data-path="all-products"] .vt-facet-block h2 {
  color: var(--vt-shop-ink);
  font-size: 0.78rem;
  font-weight: 800;
  margin: 0 0 0.7rem;
  text-transform: uppercase;
}

body[data-path="all-products"] .vt-facet-search {
  border: 1px solid var(--vt-shop-border);
  border-radius: 6px;
  font-size: 0.8rem;
  margin-bottom: 0.7rem;
  min-height: 36px;
  padding: 0 0.7rem;
  width: 100%;
}

body[data-path="all-products"] .vt-facet-options {
  display: grid;
  gap: 0.25rem;
}

body[data-path="all-products"] .vt-facet-option {
  align-items: center;
  color: #334155;
  cursor: pointer;
  display: grid;
  font-size: 0.82rem;
  gap: 0.45rem;
  grid-template-columns: 16px minmax(0, 1fr) auto;
  margin: 0;
  min-height: 29px;
}

body[data-path="all-products"] .vt-facet-option input {
  height: 15px;
  margin: 0;
  width: 15px;
}

body[data-path="all-products"] .vt-facet-option small {
  color: #8793a4;
  font-size: 0.72rem;
}

body[data-path="all-products"] .vt-facet-extra {
  display: none;
}

body[data-path="all-products"] .vt-facet-extra.is-visible {
  display: grid;
}

body[data-path="all-products"] .vt-facet-more,
body[data-path="all-products"] .vt-reset-filters {
  background: transparent;
  border: 0;
  color: var(--vt-shop-blue-dark);
  font-size: 0.78rem;
  font-weight: 800;
  margin-top: 0.55rem;
  padding: 0;
}

body[data-path="all-products"] #vt-price-range {
  accent-color: var(--vt-shop-blue-dark);
  width: 100%;
}

body[data-path="all-products"] .vt-price-label {
  color: var(--vt-shop-muted);
  display: flex;
  font-size: 0.74rem;
  justify-content: space-between;
  margin-top: 0.25rem;
}

body[data-path="all-products"] .vt-price-label strong {
  color: var(--vt-shop-ink);
}

body[data-path="all-products"] .item-card[hidden] {
  display: none !important;
}

@media (max-width: 767px) {
  body[data-path="all-products"] {
    max-width: 100%;
    overflow-x: hidden;
  }

  body[data-path="all-products"] .page-content-wrapper,
  body[data-path="all-products"] .page_content,
  body[data-path="all-products"] .page-content,
  body[data-path="all-products"] #product-listing,
  body[data-path="all-products"] #products-grid-area,
  body[data-path="all-products"] #products-grid-area .item-card,
  body[data-path="all-products"] #products-grid-area .card,
  body[data-path="all-products"] #products-grid-area .card-body {
    max-width: 100%;
    min-width: 0;
  }

  body[data-path="all-products"] .toolbar {
    align-items: stretch;
    max-width: 100%;
  }

  body[data-path="all-products"] .vt-catalogue-tools {
    display: grid;
    gap: 0.55rem;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    margin-left: 0;
    width: 100%;
  }

  body[data-path="all-products"] .vt-results-count {
    align-self: center;
  }

  body[data-path="all-products"] .vt-catalogue-tools label {
    display: none;
  }

  body[data-path="all-products"] .vt-filter-toggle {
    display: inline-flex;
    width: 100%;
  }

  body[data-path="all-products"] .vt-cart-link {
    display: none;
  }

  body[data-path="all-products"] #vt-product-sort {
    grid-column: 1 / -1;
    max-width: 100%;
    width: 100%;
  }

  body[data-path="all-products"] #product-filters {
    display: none;
    max-height: 70vh;
    overflow-y: auto;
  }

  body[data-path="all-products"] #product-filters.is-mobile-open {
    display: block;
  }
}
