@import url("https://fonts.googleapis.com/css?family=Open+Sans:400,700");

:root {
  --color-primary: #00695c;
  --color-secondary: #00564d;
}

* {
  box-sizing: border-box;
}

body {
  padding: 0;
  margin: 0;
  font-family: "Open Sans", sans-serif;
}

main {
  padding: 1rem;
  margin: auto;
}

form {
  display: inline;
}

.centered {
  text-align: center;
}

.image {
  height: 20rem;
}

.image img {
  height: 100%;
}

.main-header {
  width: 100%;
  height: 3.5rem;
  background-color: var(--color-primary);
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
}

.main-header__nav {
  height: 100%;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.main-header__item-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
}

.main-header__item {
  margin: 0 1rem;
  padding: 0;
}

.main-header__item a,
.main-header__item button {
  font: inherit;
  background: transparent;
  border: none;
  text-decoration: none;
  color: white;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.main-header__item a:hover,
.main-header__item a:active,
.main-header__item a.active,
.main-header__item button:hover,
.main-header__item button:active {
  color: #ffeb3b;
}

.nav-icon {
  width: 1rem;
  height: 1rem;
}

.mobile-nav {
  width: 30rem;
  height: 100vh;
  max-width: 90%;
  position: fixed;
  left: 0;
  top: 0;
  background: white;
  z-index: 10;
  padding: 2rem 1rem 1rem 2rem;
  transform: translateX(-100%);
  transition: transform 0.3s ease-out;
}

.mobile-nav.open {
  transform: translateX(0);
}

.mobile-nav__item-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  margin: 0;
  padding: 0;
}

.mobile-nav__item {
  margin: 1rem;
  padding: 0;
}

.mobile-nav__item a {
  text-decoration: none;
  color: black;
  font-size: 1.5rem;
  padding: 0.5rem 2rem;
}

.mobile-nav__item a:active,
.mobile-nav__item a:hover,
.mobile-nav__item a.active {
  background: var(--color-primary);
  color: white;
  border-radius: 3px;
}

#side-menu-toggle {
  border: 1px solid white;
  font: inherit;
  padding: 0.5rem;
  display: block;
  background: transparent;
  color: white;
  cursor: pointer;
}

#side-menu-toggle:focus {
  outline: none;
}

#side-menu-toggle:active,
#side-menu-toggle:hover {
  color: #ffeb3b;
  border-color: #ffeb3b;
}

.backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  background: rgba(0, 0, 0, 0.5);
  z-index: 5;
  display: none;
}

.grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-around;
  align-items: stretch;
}

.card {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.26);
}

.card__header,
.card__content {
  padding: 1rem;
}

.card__header h1,
.card__content h1,
.card__content h2,
.card__content p {
  margin: 0;
}

.card__image {
  width: 100%;
}

.card__image img {
  width: 100%;
}

.card__actions {
  padding: 1rem;
  text-align: center;
}

.card__actions button,
.card__actions a {
  margin: 0 0.25rem;
}

.btn {
  display: inline-block;
  padding: 0.25rem 1rem;
  text-decoration: none;
  font: inherit;
  border: 1px solid var(--color-primary);
  color: var(--color-primary);
  background: white;
  border-radius: 3px;
  cursor: pointer;
}

.btn:hover,
.btn:active {
  background-color: var(--color-primary);
  color: white;
}

.btn.danger {
  color: red;
  border-color: red;
}

.btn.danger:hover,
.btn.danger:active {
  background: red;
  color: white;
}

.user-message {
  margin: auto;
  width: 90%;
  border: 1px solid #4771fa;
  padding: 0.5rem;
  border-radius: 3px;
  background: #b9c9ff;
  text-align: center;
}

.user-message--error {
  border-color: red;
  background: rgb(240, 161, 161);
  color: red;
}

.user-message--success {
  border-color: green;
  background: rgb(165, 233, 152);
  color: green;
}

@media (min-width: 768px) {
  .main-header__nav {
    display: flex;
  }

  #side-menu-toggle {
    display: none;
  }

  .user-message {
    width: 30rem;
  }
}

.products-table {
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

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

.products-table thead th {
  background: #f5f7fb;
  color: #2c3e50;
  font-weight: 600;
  border-bottom: 1px solid #e5e7eb;
}

.products-table tbody tr {
  border-top: 1px solid #eef2f7;
}

.products-table tbody tr:hover {
  background-color: #f9fbff;
}

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

.btn.small {
  padding: 0.125rem 0.5rem;
  font-size: 0.875rem;
}

.btn-theme {
  background-color: var(--color-primary);
  border: 1px solid var(--color-primary);
  color: #fff;
  border-radius: 8px;
  transition: background-color 0.2s ease, box-shadow 0.2s ease,
    border-color 0.2s ease;
}

.btn-theme:hover,
.btn-theme:focus,
.btn-theme:active {
  background-color: var(--color-primary) !important;
  border-color: var(--color-primary) !important;
  color: #fff !important;
  box-shadow: none !important;
}

.btn-theme:not(:disabled) {
  background-color: var(--color-secondary);
  border-color: var(--color-secondary);
  color: #fff;
  box-shadow: none;
}

.btn-theme:disabled {
  background-color: #f1f5f9;
  border-color: #d3dce6;
  color: #9aa4b2;
  box-shadow: none;
}

.btn-outline-theme {
  background-color: transparent !important;
  border: 1px solid var(--color-primary) !important;
  color: var(--color-primary) !important;
  border-radius: 8px !important;
  transition: background-color 0.2s ease, box-shadow 0.2s ease,
    border-color 0.2s ease, color 0.2s ease;
}

.btn-outline-theme:hover,
.btn-outline-theme:focus {
  background-color: #f5f7fb !important;
  border-color: var(--color-secondary) !important;
  color: var(--color-secondary) !important;
  box-shadow: none !important;
}

.page-title {
  font-weight: 700;
  color: var(--color-primary);
  letter-spacing: 0.02rem;
}

.products-table thead th {
  text-transform: uppercase;
  font-size: 0.8rem;
  letter-spacing: 0.03em;
}

.products-table .table td {
  font-size: 0.95rem;
  color: #2f3b4a;
}

.products-table .btn.btn-primary {
  background-color: var(--color-primary);
  border-color: var(--color-primary);
}

.products-table .btn.btn-primary:hover,
.products-table .btn.btn-primary:focus {
  background-color: var(--color-secondary);
  border-color: var(--color-secondary);
  box-shadow: none;
}

.login-card .form-control:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 0.2rem rgba(0, 105, 92, 0.15);
}

.login-card .form-select:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 0.2rem rgba(0, 105, 92, 0.15);
}

.login-card form {
  display: block;
}

.error-code {
  font-weight: 800;
  color: var(--color-primary);
  line-height: 1;
  font-size: clamp(4rem, 9vw, 6rem);
}

.link-theme {
  color: var(--color-primary);
  text-decoration: none;
}

.link-theme:hover,
.link-theme:focus {
  color: var(--color-secondary);
  text-decoration: underline;
}

.close-btn {
  background: none;
  border: none;
  font-size: 1rem;
  cursor: pointer;
  margin-left: 0.75rem;
  color: inherit;
}

.pagination {
  gap: 0.25rem;
}

.pagination .page-link {
  color: var(--color-primary);
  border: 1px solid #e5e7eb;
  border-radius: 8px;
}

.pagination .page-link:hover {
  background-color: #f5f7fb;
}

.pagination .page-item.disabled .page-link {
  color: #9aa4b2;
  background-color: #f1f5f9;
}

.pagination .page-item.active .page-link {
  background-color: var(--color-primary);
  border-color: var(--color-primary);
  color: #fff;
}
