/* Shared category/test-page CSS extracted from index2.php, google-accounts2.php and apple-accounts2.php.
   Keep this file scoped to benchmark/test category pages until production rollout is approved. */

/* Accordion Styles */
.product-row {
  cursor: pointer;
  transition: background-color 0.2s ease;
  position: relative;
}

.ta-skip-link {
  position: absolute;
  left: -9999px;
  top: 8px;
  z-index: 10000;
  padding: 10px 14px;
  background: #ffffff;
  color: #17222a;
  border: 2px solid #f28c28;
  border-radius: 8px;
  font-weight: 700;
  text-decoration: none;
}

.ta-skip-link:focus {
  left: 8px;
}

.product-row:hover {
  background-color: #f5f5f5 !important;
}

.accordion-row {
  transition: opacity 0.3s ease, visibility 0.3s ease;
  border-top: none !important;
}

.accordion-content {
  padding: 0 !important;
  background-color: #f9f9f9 !important;
  border-top: 1px solid #ddd !important;
}

.accordion-details {
  padding: 15px;
  display: flex;
  gap: 20px;
  align-items: flex-start;
}

.accordion-logo {
  flex-shrink: 0;
}

.accordion-logo img {
  max-width: 60px;
  max-height: 60px;
  border-radius: 4px;
  border: 1px solid #ddd;
}

.accordion-info {
  flex-grow: 1;
}

.accordion-title {
  margin: 0 0 10px 0;
  color: #333;
  font-size: 16px;
  font-weight: bold;
}

.accordion-description {
  margin-bottom: 10px;
  color: #333;
  line-height: 1.4;
  font-size: 13px;
}

.accordion-format-label {
  margin-bottom: 5px;
  font-weight: bold;
  color: #555;
  font-size: 12px;
}

.accordion-format {
  margin-bottom: 15px;
  font-family: monospace;
  background: #fff;
  padding: 8px;
  border-radius: 4px;
  border: 1px solid #ddd;
  font-size: 11px;
  white-space: pre-wrap;
}

.accordion-purchase {
  flex-shrink: 0;
  min-width: 200px;
}

.accordion-form {
  background: #fff;
  padding: 15px;
  border-radius: 6px;
  border: 1px solid #ddd;
}

.accordion-form h4 {
  margin: 0 0 10px 0;
  color: #333;
  font-size: 14px;
}

.form-row {
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.form-row label {
  font-weight: bold;
  min-width: 60px;
  font-size: 12px;
}

.form-row input[type="number"] {
  width: 80px;
  padding: 4px;
  border: 1px solid #ddd;
  border-radius: 3px;
}

.form-row select {
  flex-grow: 1;
  padding: 4px;
  border: 1px solid #ddd;
  border-radius: 3px;
  font-size: 11px;
}

.accordion-buy-btn {
  background: #28a745;
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
  width: 100%;
  margin-top: 5px;
}

.accordion-buy-btn:hover {
  background: #218838;
}

.accordion-error {
  text-align: center;
  padding: 20px;
  color: #999;
  font-style: italic;
}

.format-loader {
  font-size: 11px;
  color: #999;
  font-style: italic;
}

.style6 {color: #993300}

/* Стили для кнопки "вверх" */
.scroll-top {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 40px;
  height: 40px;
  background: rgba(0, 0, 0, 0.5);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease, background-color 0.3s ease, transform 0.3s ease;
  z-index: 1000;
}

.scroll-top.show {
  opacity: 1;
  visibility: visible;
}

.scroll-top:hover {
  background: rgba(0, 0, 0, 0.8);
  transform: translateY(-2px);
}

.style1 {
	color: #996600;
	font-weight: bold;
}

/* Добавленные стили для сортировки */
.sortable-header {
    cursor: pointer;
    color: #996600;
    font-weight: bold;
    padding: 5px 10px;
    border-radius: 4px;
    transition: background-color 0.2s ease, color 0.2s ease;
    display: inline-block;
}

.sortable-header:hover {
    background-color: #f0f0f0;
    color: #663300;
}

.sort-arrow {
    font-size: 12px;
    margin-left: 5px;
    opacity: 0.6;
    transition: opacity 0.2s ease;
}

.sortable-header:hover .sort-arrow {
    opacity: 1;
}

/* Стили для зебры в таблице товаров */
.product-table .even-row {
    background-color: #ffffff !important;
}

.product-table .odd-row {
    background-color: #f9f9f9 !important;
}

/* Эффект при наведении мыши */
.product-table tr:hover.even-row,
.product-table tr:hover.odd-row {
    background-color: #e8f4f8 !important;
}

/* Убираем возможные конфликты со старыми стилями */
.product-table tr.even-row td {
    background-color: inherit !important;
}

.product-table tr.odd-row td {
    background-color: inherit !important;
}

/* Fallback для JavaScript: страница должна быть видна даже без JS */
.loading {
    visibility: visible;
}
.loaded {
    visibility: visible;
}
.no-js .product-search-container {
    display: none !important;
}


/* Index2 category catalog prototype styles */
.catalog-category {
  margin: 0 0 18px;
}

.category-title {
  font-size: 16px;
  color: #333;
  margin: 0 0 7px;
  padding: 4px 0 5px;
  border-bottom: 2px solid #dcdcdc;
}

.category-table {
  margin-bottom: 0;
}

.category-table th,
.category-table td {
  vertical-align: middle;
}

.category-table th:nth-child(2),
.category-table th:nth-child(3),
.category-table th:nth-child(4) {
  width: 125px;
}

.catalog-stock,
.catalog-price,
.catalog-actions {
  white-space: nowrap;
}

.catalog-price {
  font-weight: bold;
}

.catalog-actions {
  text-align: right;
}

.row-buy-btn,
.row-info-btn,
.show-more-btn {
  font-family: Arial, Helvetica, sans-serif;
  font-size: 12px;
  cursor: pointer;
}

.row-buy-btn {
  background: #28a745;
  color: #fff;
  border: 0;
  padding: 5px 9px;
  border-radius: 4px;
}

.row-buy-btn:hover {
  background: #218838;
}

.row-buy-btn:disabled {
  background: #a8b0a9;
  cursor: not-allowed;
}

.row-info-btn {
  display: inline-block;
  min-width: 23px;
  height: 23px;
  border: 1px solid #b8c6d8;
  background: #f7f9fb;
  color: #315f8f;
  border-radius: 50%;
  font-weight: bold;
}

.show-more-wrap {
  margin: 7px 0 0;
  text-align: right;
}

.show-more-btn {
  background: #f6f6f6;
  border: 1px solid #cfcfcf;
  color: #333;
  padding: 5px 11px;
  border-radius: 4px;
}

.legacy-forms-table {
  margin-top: 14px;
}

@media (max-width: 767px) {
  .category-table,
  .category-table thead,
  .category-table tbody,
  .category-table th,
  .category-table td,
  .category-table tr {
    display: block;
  }

  .category-table thead {
    display: none;
  }

  .category-table .product-row {
    border-bottom: 1px solid #ddd;
    padding: 8px;
  }

  .category-table .product-row td {
    border: 0;
    padding: 4px 0;
  }

  .catalog-actions {
    text-align: left;
  }

  .accordion-details {
    display: block;
  }

  .accordion-purchase {
    min-width: 0;
    margin-top: 12px;
  }
}

/* Shared initial visibility/search override */
.product-search-container { display: none !important; }
body { visibility: visible !important; }

/* Shared category menu styles, including approved calm active state */
.category-menu {
          display: flex;
          flex-wrap: wrap;
          justify-content: center;
          gap: 5px;
          padding: 10px 0;
        }
        
        .category-menu a {
          padding: 8px 12px;
          border: 1px solid #ddd;
          border-radius: 5px;
          text-decoration: none;
          color: #333;
          font-weight: bold;
          background-color: #f8f8f8;
          transition: background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
        }
        
        .category-menu a:hover {
          background-color: #e9e9e9;
          border-color: #ccc;
          box-shadow: 0 2px 4px rgba(0,0,0,0.1);
        }

        .ta-category-menu-shell .category-menu a.current,
        .ta-category-menu-shell .category-menu a.current:visited,
        .ta-category-menu-shell .category-menu a.current:hover,
        .ta-category-menu-shell .category-menu a[aria-current="page"],
        .ta-category-menu-shell .category-menu a[aria-current="page"]:visited,
        .ta-category-menu-shell .category-menu a[aria-current="page"]:hover {
          border-color: #b7c9e8 !important;
          background: #eef4ff !important;
          color: #1f5f9f !important;
          box-shadow: none !important;
          text-decoration: none !important;
          transform: none;
        }
        
        /* Мобильная версия стилей для категорий */
        @media only screen and (max-width: 767px) {
          .category-menu {
            gap: 3px;
            padding: 5px 0;
          }
          
          .category-menu a {
            padding: 6px 10px;
            font-size: 12px;
            margin: 2px;
            white-space: nowrap;
          }
        }
