@import url("https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600&display=swap");

:root {
  --bs-white: #fff;
  --bs-gray-100: #f8f9fa;
  --bs-gray-200: #e9ecef;
  --bs-gray-500: #7a7a7a;
  --bs-gray-800: #3f3f3f;
  --bs-dark: hsl(0, 0%, 15%);
}

/* RESET BÁSICO (compatível Bootstrap) */
* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  font-family: "Poppins", sans-serif;
  font-size: 1rem; /* Bootstrap padrão */
}

/* =========================
   LAYOUT GERAL
   ========================= */

section {
  width: 100%;
  height: 100%;
  position: relative;
  overflow: hidden;
}

#pano-config-api,
.pano-config {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

/* =========================
   CONTAINER UI
   ========================= */

.ui-container {
  position: absolute;
  top: 0;
  right: 0;
  width: clamp(300px, 40vw, 400px);
  height: 100vh;
  padding: 1rem;
  background-color: var(--bs-white);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* =========================
   MENU PRINCIPAL
   ========================= */

#menu-elements {
  padding: 1.5rem 2rem 0;
}

.menu-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  margin-bottom: 0.75rem;
  border: 1px solid var(--bs-gray-200);
  border-radius: 0.375rem; /* padrão Bootstrap */
  background-color: var(--bs-white);
  cursor: pointer;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

.menu-item:hover {
  background-color: var(--bs-gray-100);
  border-color: var(--bs-gray-800);
}

.menu-item-thumbnail {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: 0.25rem;
  flex-shrink: 0;
}

.menu-item-text {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.menu-item-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--bs-dark);
}

.menu-item-subtitle {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--bs-gray-500);
}

.menu-item-arrow {
  font-size: 1.25rem;
  color: var(--bs-gray-500);
}

/* =========================
   SUBMENU
   ========================= */

.submenu-panel {
  position: absolute;
  inset: 0;
  background-color: var(--bs-white);
  transform: translateX(100%);
  transition: transform 0.3s ease;
  z-index: 10;
}

.submenu-panel.active {
  transform: translateX(0);
}

.submenu-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem;
  border-bottom: 1px solid var(--bs-gray-200);
}

.submenu-back {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
}

.submenu-title {
  font-size: 1.25rem;
  font-weight: 600;
}

.submenu-body {
  padding: 1rem;
  height: calc(100% - 64px);
  overflow-y: auto;
}

.submenu-main-preview {
  text-align: center;
}

.submenu-main-preview img {
  width: 180px;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 0.5rem;
}

.submenu-main-label {
  margin: 0.5rem 0 1.25rem;
  font-size: 0.875rem;
}

/* =========================
   TILES
   ========================= */

.tile-list {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
  padding: 1rem 0;
}

.tile {
  width: 35%;
  padding: 0.375rem;
  cursor: pointer;
  text-align: center;
}

.tile img {
  padding: 0.25rem;
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 0.65rem;
  border: 1px solid transparent;
  transition: border-color 0.2s ease;
}

.tile img:hover {
  border-color: var(--bs-gray-800);
}

.tile.active img {
  border-color: var(--bs-dark);
}

.tile-label {
  font-size: 0.875rem;
  color: var(--bs-gray-800);
}

/* =========================
   BOTÃO
   ========================= */

#save-design {
  margin: 0.75rem;
  padding: 0.75rem 2.5rem;
  border: none;
  border-radius: 0.375rem;
  background-color: rgb(12, 12, 12);
  color: var(--bs-white);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  text-transform: uppercase;
  font-family: Poppins, sans-serif;
}

#save-design:hover {
  background-color: var(--bs-dark);
}

.client-logo {
  position: absolute;
  bottom: 1rem;
  left: 1rem;
  pointer-events: none; /* evita interferência */
}

.client-logo p {
  margin: 0; /* remove margem padrão do <p> */
  font-size: 1.25rem;
  line-height: 1;
}

/* =========================
   RESPONSIVO (Bootstrap)
   ========================= */

@media (max-width: 1200px) {
  .tile {
    width: 30%;
  }
}

@media (max-width: 992px) {
  .tile {
    width: 25%;
  }
}

@media (max-width: 768px) {
  .ui-container {
    width: 100vw;
    height: 30vh;
    bottom: 0;
    top: auto;
  }

  .submenu-main-preview {
    display: none;
  }

  #menu-elements {
    display: flex;
    flex-direction: row;
    justify-content: center;
    gap: 2rem;
    padding: 0.75rem;
    overflow-x: auto;
  }

  .menu-item {
    width: 100px;
    flex-direction: column;
    border: none;
    margin: 0;
    padding: 0.5rem;
  }

  .menu-item-subtitle,
  .menu-item-arrow {
    display: none;
  }

  .menu-item-title {
    font-size: 0.875rem;
    font-weight: 400;
  }

  .tile-list {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1.75rem;
    padding: 1rem 0;
  }

  .tile {
    width: 75px;
    height: 75px;
    padding: 0.25rem;
  }

  .tile img {
    width: 100%;
    height: 100%;
  }

  .tile-label {
    font-size: 0.75rem;
  }
}

@media (max-width: 576px) {
  #menu-elements {
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
  }

  .tile {
    gap: 0.5rem;
  }

  .tile-list {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-evenly;
    gap: 1.75rem;
    padding: 1rem 0;
    padding: 0.375rem;
    border: 1px black;
  }

  .tile-label {
    font-size: 0.75rem;
  }
}
