/* STOCK_PRODUCTS_FLAT_V17 — products.html only; account sidebar intentionally excluded. */
body[data-stock-products-flat-v17="1"] {
  --sp17-paper: #ffffff;
  --sp17-line: #e7ebf1;
  --sp17-ink: #182235;
}
body.dark-mode[data-stock-products-flat-v17="1"],
html[data-theme="dark"] body[data-stock-products-flat-v17="1"] {
  --sp17-paper: #161e29;
  --sp17-line: #344050;
  --sp17-ink: #eef1f7;
}

/* One continuous surface rather than independently floating sections. */
body[data-stock-products-flat-v17="1"] main#mainContent.dashboard-main {
  background: var(--sp17-paper) !important;
  border: 0 !important;
  box-shadow: none !important;
  border-radius: 16px !important;
  padding: clamp(16px, 2vw, 28px) !important;
  min-width: 0 !important;
  color: var(--sp17-ink);
}

/* Flat top-level sections, including the list and featured products. */
body[data-stock-products-flat-v17="1"] main#mainContent > :is(section, article, div).card-surface,
body[data-stock-products-flat-v17="1"] main#mainContent :is(
  .card-surface, .form-card, .list-card, .products-card,
  .products-panel, .products-list-card, .products-section,
  .featured-products-section, .featured-products, .featured-section,
  .product-list-container, .products-table-card,
  .panel-card, .table-card
) {
  background: transparent !important;
  background-image: none !important;
  border-color: transparent !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  outline: none !important;
  transform: none !important;
}
body[data-stock-products-flat-v17="1"] main#mainContent :is(
  .card-surface, .form-card, .list-card, .products-card,
  .products-panel, .products-list-card, .products-section,
  .featured-products-section, .featured-products, .featured-section,
  .product-list-container, .products-table-card,
  .panel-card, .table-card
):hover {
  box-shadow: none !important;
  transform: none !important;
}

/* Remove the feeling of nested rectangles while keeping useful spacing. */
body[data-stock-products-flat-v17="1"] main#mainContent :is(
 .card-surface, .list-card, .products-card, .products-panel,
 .products-list-card, .products-table-card, .featured-products-section
) {
  padding-inline: 0 !important;
}
body[data-stock-products-flat-v17="1"] main#mainContent > :is(section, article, div).card-surface + :is(section, article, div).card-surface,
body[data-stock-products-flat-v17="1"] main#mainContent .featured-products-section,
body[data-stock-products-flat-v17="1"] main#mainContent .featured-products {
  border-top: 1px solid var(--sp17-line) !important;
  margin-top: 22px !important;
  padding-top: 22px !important;
}

/* Table remains a functional table; lines distinguish rows instead of card borders. */
body[data-stock-products-flat-v17="1"] main#mainContent :is(
 .table-responsive, .table-wrap, .products-table-wrap,
 .products-table-container, .table-container
) {
  background: transparent !important;
  box-shadow: none !important;
  border: 0 !important;
  border-radius: 0 !important;
}
body[data-stock-products-flat-v17="1"] main#mainContent table {
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
}
body[data-stock-products-flat-v17="1"] main#mainContent table :is(th, td) {
  border-inline: 0 !important;
  border-top: 0 !important;
  border-bottom: 1px solid var(--sp17-line) !important;
}
body[data-stock-products-flat-v17="1"] main#mainContent table tr {
  box-shadow: none !important;
  background: transparent !important;
}

/* Featured product tiles: photograph still has its own shape; tile is no longer a box. */
body[data-stock-products-flat-v17="1"] main#mainContent :is(
 .product-card, .featured-card, .featured-product-card,
 .products-featured-card, .product-item-card,
 .product-tile, .featured-item
) {
  background: transparent !important;
  background-image: none !important;
  border: 0 !important;
  box-shadow: none !important;
  outline: none !important;
  transform: none !important;
}
body[data-stock-products-flat-v17="1"] main#mainContent :is(
 .product-card, .featured-card, .featured-product-card,
 .products-featured-card, .product-item-card, .product-tile, .featured-item
):hover {
  transform: none !important;
  box-shadow: none !important;
}
body[data-stock-products-flat-v17="1"] main#mainContent :is(
 .product-card, .featured-card, .featured-product-card, .product-tile
) img {
  border-radius: 12px;
}

/* Do not restyle buttons, action links, counters, badges, filters, or account navigation. */
@media (max-width: 740px) {
  body[data-stock-products-flat-v17="1"] main#mainContent.dashboard-main {
    padding: 14px !important;
    border-radius: 10px !important;
  }
  body[data-stock-products-flat-v17="1"] main#mainContent .featured-products-section,
  body[data-stock-products-flat-v17="1"] main#mainContent .featured-products {
    margin-top: 16px !important;
    padding-top: 16px !important;
  }
}
