/* === General Page Styling === */
body {
  font-family: "Segoe UI", Arial, sans-serif;
  background-color: #f9f9f9;
  color: #333;
  margin: 0;
}

/* Product View Container */
.productView {
  padding: 34px 0;
}
.productView .table tr td {
    padding: 0.6rem 1.1rem;
}
/* === Hero Section === */
.productView-images {
  text-align: center;
  margin-bottom: 24px;
}
.productView-img-container img {
  max-width: 100%;
  height: auto;
  border-radius: 10px;
  cursor: pointer;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.productView-img-container img:hover {
  transform: scale(1.03);
 
}

/* === Product Metadata === */
.productView-title {
  font-size: 2rem;
  font-weight: 700;
  color: #222;
  margin-bottom: 20px;
}
.productView-info {
  display: grid;
  grid-template-columns: 120px auto;
  gap: 10px 16px;
  font-size: 1rem;
}
.productView-info-name {
  font-weight: 600;
  color: #555;
}
.productView-info-value {
  color: #111;
}

/* === Tools Bar === */
.tools-bar {
  background-color: #fdfdfd;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  padding: 14px 18px;
  margin: 28px 0;
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}
.tools-bar .btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: 20px;
  padding: 10px 18px;
  font-weight: 500;
  transition: all 0.25s ease;
  min-width: 140px;
}
.tools-bar .btn-half {
    flex: 45%;
}
.tools-bar .btn-third {
    flex: 30%;
}
.tools-bar .btn-primary {
  background-color: #0078d4;
  color: #fff;
  border: none;
}
.tools-bar .btn-primary:hover {
  background-color: #005a9e;
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(0,0,0,0.15);
}
.tools-bar .btn-secondary {
  background-color: #fff;
  border: 1px solid #ccc;
  color: #333;
}
.tools-bar .btn-secondary:hover {
  background-color: #f5f5f5;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.productView-details {
    padding-right: 44px;
}
/* === Specifications Table === */
.productView-details h2 {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 1px;
  color: #222;
  margin-top: 3px;
}
.table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  border-radius: 8px;
  overflow: hidden;
  margin-top: 0;
}
.table-striped tbody tr:nth-child(odd) {
  background-color: #fafafa;
}
.table-hover tbody tr {
  transition: background 0.25s ease, transform 0.25s ease;
}
.table-hover tbody tr:hover {
  background-color: #eef6ff;
  transform: scale(1.01);
  box-shadow: inset 3px 0 0 #0078d4;
  cursor: pointer;
  color: darkblue;
  font-weight: 700;
}
.table td {
  padding: 14px;
  border-bottom: 1px solid #eee;
  font-size: 0.95rem;
}

/* === Short Description === */
.productView-shortDesc {
  font-size: 1rem;
  line-height: 1.6;
  color: #444;
  margin-top: 20px;
}

/* === Sticky Footer Tools Bar === */
#sticky_toolsbar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: #fff;
  border-top: 1px solid #ddd;
  padding: 14px 0;
  z-index: 1000;
  display: none;
  box-shadow: 0 -4px 12px rgba(0,0,0,0.08);
}
#sticky_toolsbar .item-wrap {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
#sticky_toolsbar .product-info img {
  border: 1px solid #ddd;
  border-radius: 6px;
  margin-right: 10px;
}
#sticky_toolsbar .productView-title {
  font-size: 1rem;
  font-weight: 600;
  margin: 0;
}

/* === Side Panel === */
.side-panel {
  position: fixed;
  top: 0;
  right: -660px;
  width: 660px;
  max-width: 94vw;
  height: 100%;
  background: #fff;
  border-left: 2px solid #0078d4;
  box-shadow: -2px 0 12px rgba(0,0,0,0.12);
  transition: right 0.3s ease;
  display: flex;
  flex-direction: column;
  z-index: 9999;
}
.side-panel.open {
  right: 0;
}
.side-panel .panel-header,
.side-panel .panel-footer {
  padding: 16px 20px;
  background: #f5f7fa;
  border-bottom: 1px solid #ddd;
}
.side-panel .panel-footer {
  border-top: 1px solid #ddd;
  border-bottom: none;
}
.side-panel .panel-body {
  flex: 1;
  overflow-y: auto;
  padding: 18px;
  line-height: 1.6;
}
.side-panel #spec-list li {
  padding: 8px 10px;
  border-bottom: 1px solid #e9e9e9;
  transition: background 0.25s ease, border-left 0.25s ease;
}
.side-panel #spec-list li:hover {
  background-color: #f9fbff;
  border-left: 3px solid #0078d4;
  font-weight: 600;
}

/* === Overlay === */
.overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.4);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease;
  z-index: 9998;
}
.overlay.open {
  opacity: 1;
  visibility: visible;
}

.side-panel .product-context img {
  max-width: 44px;
  margin-bottom: 2px;
}
.side-panel {
  position: fixed;
  top: 0;
  right: -400px;
  width: 400px;
  height: 100%;
  background: #fff;
  border-left: 2px solid #0078d4;
  box-shadow: -2px 0 8px rgba(0,0,0,0.1);
  transition: right 0.3s ease;
  display: flex;
  flex-direction: column;
}
.side-panel.open {
  right: 0;
}
.side-panel.open {
  right: 0; /* slide in */
}

.side-panel .panel-header,
.side-panel .panel-footer {
  padding: 10px;
  background: #f5f7fa;
  border-bottom: 1px solid #ddd;
}

.side-panel .panel-footer {
  border-top: 1px solid #ddd;
  border-bottom: none;
}

.side-panel .panel-header h2 {
  margin: 0;
  font-size: 1.2rem;
  color: #0078d4;
  flex: 1;
  width: 220px;
  float: left;
}

.side-panel .panel-header button {
  background: none;
  border: none;
  font-size: 1.2rem;
  cursor: pointer;
  float: right;
  margin: 14px;
}

.side-panel .panel-body {
  flex: 1;
  overflow-y: auto;
  padding: 10px;
}

.side-panel .product-context {
  text-align: center;
  margin-bottom: 15px;
}

.side-panel .product-context img {
  max-width: 44px;
  margin-bottom: 2px;
}

.side-panel .product-context h3 {
  margin: 0;
  font-size: 1rem;
  color: #333;
}

.side-panel .spec-controls {
  margin: 10px 0;
  text-align: center;
}

.side-panel .spec-controls button {
  margin: 0 5px;
  padding: 5px 10px;
  font-size: 0.85rem;
  cursor: pointer;
  background-color: whitesmoke;
}
.side-panel .spec-controls button:hover {
  background-color: lightgray;
  font-weight: 700;
}
.side-panel #spec-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.side-panel #spec-list li {
  margin: 6px 0;
  border-bottom: .1rem solid #e9e9e9;
  font-size: medium;
  padding: 2px;

}
.side-panel #spec-list li:hover {
  background-color: #e9e9e9;
  font-weight: 700;
}
.side-panel #spec-list label {
  cursor: pointer;
  display: flex;
  align-items: center;
}

.side-panel #spec-list input[type="checkbox"] {
  margin-right: 8px;
}

.side-panel .primary {
  background: #0078d4;
  color: #fff;
  border: none;
  padding: 8px 12px;
  cursor: pointer;
  border-radius: 4px;
}

.side-panel .secondary {
  background: #eee;
  color: #333;
  border: none;
  padding: 8px 12px;
  cursor: pointer;
  border-radius: 4px;
  margin-left: 8px;
}
/* Overlay background */
.overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.4); /* semi-transparent dark layer */
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease;
  z-index: 9998;
}

/* Show overlay when active */
.overlay.open {
  opacity: 1;
  visibility: visible;
}

/* Side Panel */


.side-panel.open {
  right: 0; /* slide in */
}

.side-panel .panel-header,
.side-panel .panel-footer {
  padding: 10px;
  background: #f5f7fa;
  border-bottom: 1px solid #ddd;
}

.side-panel .panel-footer {
  border-top: 1px solid #ddd;
  border-bottom: none;
}

.side-panel .panel-body {
  flex: 1;
  overflow-y: auto;
  padding: 10px;
}
.side-panel {
  position: fixed;
  top: 0;
  right: -700px; /* hidden by default */
  width: 660px;
  height: 100%;
  max-width: 94vw;
  background: #fff;
  border-left: 2px solid #0078d4;
  box-shadow: -2px 0 8px rgba(0,0,0,0.1);
  transition: right 0.3s ease;
  display: flex;
  flex-direction: column;
  z-index: 9999; /* above overlay */
}
/* Search panel (initial side panel) */
#similar-panel {
  position: fixed;
  top: 0;
  right: 0;
  width: 650px;
  max-width: 94vw;
  height: 100%;
  background: #f9f9f9;
  box-shadow: -2px 0 8px rgba(0,0,0,0.2);
  transition: transform 0.3s ease-in-out;
  transform: translateX(0); /* visible by default */
  
}

/* Slide search panel off */
#similar-panel.hidden {
  transform: translateX(100%);
}

/* Results panel (full width) */
#results-panel {
  position: fixed;
  top: 0;
  left: 100%; /* start off-screen */
  width: 100%;
  height: 100%;
  background: #fff;
  overflow-y: auto;
  transition: transform 0.3s ease-in-out;
  z-index: 9999;
  padding: 34px;
}

/* === Mobile Responsiveness === */
@media (max-width: 768px) {
  .productView-info {
    grid-template-columns: 90px auto;
  }
  .tools-bar  .btn-primary.btn-half {
    flex: 100%;
  }
  #sticky_toolsbar .item-wrap {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }
  #sticky_toolsbar .item-right {
    justify-content: space-around;
    flex-wrap: wrap;
  }
  .table td {
    padding: 10px;
    font-size: 0.9rem;
  }
}