body {
  padding-top: 80px;
  padding-bottom: 20px;
}

@media print {
    @page {
        size: landscape;
        margin: 10mm;
    }

    .main {
        width: 100% !important;
        margin-left: 0 !important;
    }

    .no-print, .no-print * {
        display: none !important;
    }
}

/* ---- Product photos (component detail page) ---- */

.photo-drop-zone {
  border: 2px dashed #ccc;
  border-radius: 4px;
  padding: 12px;
  text-align: center;
  color: #777;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.photo-drop-zone-active {
  border-color: #337ab7;
  background-color: #f0f7fc;
}

.photo-drop-hint {
  margin-bottom: 8px;
}

.photo-drop-formats {
  margin: 8px 0 0;
  font-size: 12px;
}

/* Hidden but still reachable: the visible control is the <label>. */
.photo-file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.photo-errors {
  list-style: none;
  padding: 0;
  margin: 8px 0 0;
}

.photo-error {
  color: #a94442;
  font-size: 12px;
  margin-bottom: 4px;
}

.photo-gallery {
  list-style: none;
  padding: 0;
  margin: 12px 0 0;
  display: flex;
  flex-wrap: wrap;
}

.photo-tile {
  position: relative;
  margin: 0 8px 8px 0;
}

.photo-tile img {
  max-width: 100px;
  max-height: 100px;
  border: 1px solid #ddd;
  border-radius: 3px;
}

.photo-tile-pending {
  width: 100px;
  height: 100px;
  border: 1px dashed #ccc;
  border-radius: 3px;
  font-size: 11px;
  color: #999;
  padding: 4px;
  overflow: hidden;
  word-break: break-all;
}

.photo-delete {
  position: absolute;
  top: 0;
  right: 0;
  padding: 2px 5px;
  color: #a94442;
  background: rgba(255, 255, 255, 0.85);
  border-bottom-left-radius: 3px;
}


/* ---- Photo thumbnails popover (component list) ---- */

.photo-popover {
  position: absolute;
  z-index: 1040;
  /* Explicit width rather than shrink-to-fit: an absolutely positioned box
     near the right edge of the viewport otherwise collapses to one column. */
  width: 252px;
  box-sizing: border-box;
  padding: 8px;
  background: #fff;
  border: 1px solid #ccc;
  border-radius: 4px;
  box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2);
}

.photo-popover-message {
  margin: 0;
  font-size: 12px;
  color: #777;
}

.photo-popover-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
}

.photo-popover-list li {
  margin: 0 4px 4px 0;
}

.photo-popover-thumb {
  padding: 0;
  border: 1px solid #ddd;
  border-radius: 3px;
  background: none;
  cursor: pointer;
}

.photo-popover-thumb:hover {
  border-color: #337ab7;
}

.photo-popover-thumb img {
  display: block;
  width: 72px;
  height: 72px;
  object-fit: contain;
}

/* ---- Full screen photo viewer ---- */

body.photo-viewer-open {
  overflow: hidden;
}

.photo-viewer {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1060;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.85);
}

.photo-viewer-figure {
  margin: 0;
  max-width: 90vw;
  max-height: 90vh;
  text-align: center;
}

.photo-viewer-image {
  max-width: 90vw;
  max-height: 82vh;
  object-fit: contain;
}

.photo-viewer-figure figcaption {
  margin-top: 8px;
  color: #eee;
  font-size: 13px;
}

.photo-viewer-counter {
  margin-left: 8px;
  color: #aaa;
}

.photo-viewer button {
  position: absolute;
  background: none;
  border: none;
  color: #fff;
  opacity: 0.7;
  line-height: 1;
}

.photo-viewer button:hover {
  opacity: 1;
}

.photo-viewer-close {
  top: 12px;
  right: 20px;
  font-size: 40px;
}

.photo-viewer-prev,
.photo-viewer-next {
  top: 50%;
  transform: translateY(-50%);
  font-size: 64px;
  padding: 0 20px;
}

.photo-viewer-prev {
  left: 8px;
}

.photo-viewer-next {
  right: 8px;
}
