/* CSS Custom Properties for Breakpoints */
:root {
  --bp-maggie: 15em;
  --bp-lisa: 30em;
  --bp-bart: 48em;
  --bp-marge: 62em;
  --bp-homer: 75em;
  --font-stack-system: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* Base Styles */
html {
  box-sizing: border-box;
  /* Improve text rendering on mobile */
  -webkit-text-size-adjust: 100%;
  -ms-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

*,
*:before,
*:after {
  box-sizing: inherit;
}

body {
  font-family: var(--font-stack-system);
  color: rgba(0,0,0,.87);
  line-height: 1.5;
  /* Better mobile font size */
  font-size: 16px;
}

@media (min-width: 48em) {
  body {
    font-size: 14px;
  }
}

a {
  color: rgba(38,137,13,1);
  /* Better touch targets on mobile */
  min-height: 44px;
  display: inline-block;
  text-decoration: none;
}

a:hover,
a:focus {
  color: rgba(4,106,56,1);
  text-decoration: underline;
}

.container {
  margin: 3% 2%;
}

@media (min-width: 48em) {
  .container {
    margin: 2%;
  }
}

@media (min-width: 75em) {
  .container {
    margin: 2em auto;
    max-width: 75em;
  }
}

/* Mobile-first navigation paragraph */
p {
  margin: 1em 0;
  line-height: 1.6;
}

@media (max-width: 48em) {
  p {
    font-size: 1.1em;
    margin: 1.5em 0;
  }
}

/* Responsive Table Styles */
.responsive-table {
  width: 100%;
  margin-bottom: 1.5em;
  border-spacing: 0;
  /* Mobile-first font sizing */
  font-size: 1em;
}

@media (min-width: 48em) {
  .responsive-table {
    font-size: .9em;
  }
}

@media (min-width: 62em) {
  .responsive-table {
    font-size: 1em;
  }
}

.responsive-table thead {
  /* Accessibly hide <thead> on narrow viewports */
  position: absolute;
  clip: rect(1px 1px 1px 1px); /* IE6, IE7 */
  padding: 0;
  border: 0;
  height: 1px;
  width: 1px;
  overflow: hidden;
}

@media (min-width: 48em) {
  .responsive-table thead {
    /* Unhide <thead> on wide viewports */
    position: relative;
    clip: auto;
    height: auto;
    width: auto;
    overflow: auto;
  }
}

.responsive-table thead th {
  background-color: rgba(38,137,13,1);
  border: 1px solid rgba(134,188,37,1);
  font-weight: normal;
  text-align: center;
  color: white;
  padding: 0.8em 0.6em;
}

.responsive-table thead th:first-of-type {
  text-align: left;
}

/* Set these items to display: block for narrow viewports */
.responsive-table tbody,
.responsive-table tr,
.responsive-table th,
.responsive-table td {
  display: block;
  padding: 0;
  text-align: left;
  white-space: normal;
}

@media (min-width: 48em) {
  .responsive-table tr {
    /* Undo display: block */
    display: table-row;
  }
}

.responsive-table th,
.responsive-table td {
  padding: .75em;
  vertical-align: middle;
}

@media (min-width: 30em) {
  .responsive-table th,
  .responsive-table td {
    padding: .8em .6em;
  }
}

@media (min-width: 48em) {
  .responsive-table th,
  .responsive-table td {
    /* Undo display: block */
    display: table-cell;
    padding: .5em;
  }
}

@media (min-width: 62em) {
  .responsive-table th,
  .responsive-table td {
    padding: .75em .5em;
  }
}

@media (min-width: 75em) {
  .responsive-table th,
  .responsive-table td {
    padding: .75em;
  }
}

.responsive-table caption {
  margin-bottom: 1em;
  font-size: 1.2em;
  font-weight: bold;
  text-align: center;
  line-height: 1.4;
}

@media (max-width: 48em) {
  .responsive-table caption {
    margin-bottom: 1.5em;
    padding: 0 0.5em;
  }
}

@media (min-width: 48em) {
  .responsive-table caption {
    font-size: 1.5em;
  }
}

.responsive-table tfoot {
  font-size: .9em;
  font-style: italic;
}

@media (min-width: 62em) {
  .responsive-table tfoot {
    font-size: .9em;
  }
}

@media (max-width: 48em) {
  .responsive-table tfoot {
    margin-top: 1em;
    padding: 1em;
    background-color: rgba(0,0,0,.05);
    border-radius: 4px;
  }
}

@media (min-width: 48em) {
  .responsive-table tbody {
    /* Undo display: block */
    display: table-row-group;
  }
}

.responsive-table tbody tr {
  margin-bottom: 1.5em;
}

@media (max-width: 48em) {
  .responsive-table tbody tr {
    background-color: rgba(0,0,0,.03);
    border-radius: 8px;
    padding: 1em;
    border: 1px solid rgba(0,0,0,.1);
    box-shadow: 0 2px 4px rgba(0,0,0,.1);
  }
}

@media (min-width: 48em) {
  .responsive-table tbody tr {
    /* Undo display: block */
    display: table-row;
    border-width: 1px;
    margin-bottom: 0;
  }
}

.responsive-table tbody tr:last-of-type {
  margin-bottom: 0;
}

@media (min-width: 48em) {
  .responsive-table tbody tr:nth-of-type(even) {
    background-color: rgba(0,0,0,.12);
  }
}

.responsive-table tbody th[scope="row"] {
  background-color: rgba(38,137,13,1);
  color: white;
  font-weight: bold;
  font-size: 1.1em;
}

@media (max-width: 48em) {
  .responsive-table tbody th[scope="row"] {
    margin-bottom: 0.5em;
    padding: 0.8em 1em;
    border-radius: 4px;
    text-align: center;
  }
}

@media (min-width: 30em) {
  .responsive-table tbody th[scope="row"] {
    border-left: 1px solid rgba(134,188,37,1);
    border-bottom: 1px solid rgba(134,188,37,1);
  }
}

@media (min-width: 48em) {
  .responsive-table tbody th[scope="row"] {
    background-color: transparent;
    color: rgba(0,0,0,.87);
    text-align: left;
    font-size: 1em;
    font-weight: normal;
  }
}

.responsive-table tbody td {
  text-align: right;
}

@media (max-width: 48em) {
  .responsive-table tbody td {
    margin-bottom: 0.8em;
    padding: 0.5em 0;
    border-bottom: 1px solid rgba(0,0,0,.1);
  }

  .responsive-table tbody td:last-of-type {
    border-bottom: none;
    margin-bottom: 0;
  }

  .responsive-table tbody td[data-title*="цена"] {
    line-height: 1.4;
  }
}

@media (min-width: 48em) {
  .responsive-table tbody td {
    border-left: 1px solid rgba(134,188,37,1);
    border-bottom: 1px solid rgba(134,188,37,1);
    text-align: center;
  }
}

@media (min-width: 48em) {
  .responsive-table tbody td:last-of-type {
    border-right: 1px solid rgba(134,188,37,1);
  }
}

.responsive-table tbody td[data-type=currency] {
  text-align: right;
}

.responsive-table tbody td[data-title]:before {
  /* Remove column header repetition in mobile view */
  content: none;
}

@media (max-width: 48em) {
  .responsive-table tbody small {
    font-size: 0.9em;
    display: block;
    margin-top: 0.3em;
    color: rgba(0,0,0,.65);
  }
}

/* Additional mobile-specific enhancements */
@media (max-width: 48em) {
  .responsive-table {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  a {
    margin: 0.3em 0.5em 0.3em 0;
    padding: 0.5em 0.8em;
    border-radius: 4px;
    background-color: rgba(38,137,13,0.1);
  }

  a:hover,
  a:focus {
    background-color: rgba(38,137,13,0.2);
  }

  .container {
    padding: 0 1em;
  }
}

/* Ensure good contrast for color-coded values */
.responsive-table tbody td[style*="color: green"] {
  color: rgba(34,139,34,1) !important;
}

.responsive-table tbody td[style*="color: red"] {
  color: rgba(178,34,34,1) !important;
}

/* Navigation menu styles */
.main-nav {
  background-color: transparent;
  padding: 0.8em 0;
  margin-bottom: 1.5em;
  border-bottom: 1px solid rgba(0,0,0,0.1);
}

@media (max-width: 48em) {
  .main-nav {
    margin-bottom: 1em;
    padding: 0.6em 0;
  }
}

.main-nav .nav-container {
  max-width: 75em;
  margin: 0 auto;
  padding: 0 2%;
}

@media (min-width: 75em) {
  .main-nav .nav-container {
    padding: 0;
  }
}

.main-nav .nav-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0;
}

@media (min-width: 48em) {
  .main-nav .nav-list {
    justify-content: flex-start;
  }
}

.main-nav .nav-item {
  margin: 0;
  border-right: 1px solid rgba(0,0,0,0.2);
}

.main-nav .nav-item:last-child {
  border-right: none;
}

@media (max-width: 48em) {
  .main-nav .nav-item {
    border-right: none;
    border-bottom: 1px solid rgba(0,0,0,0.1);
  }

  .main-nav .nav-item:last-child {
    border-bottom: none;
  }
}

.main-nav .nav-link {
  display: block;
  color: rgba(0,0,0,0.8);
  text-decoration: none;
  padding: 0.8em 1.2em;
  font-weight: normal;
  transition: background-color 0.2s ease, color 0.2s ease;
  min-height: auto;
  text-align: center;
}

@media (min-width: 48em) {
  .main-nav .nav-link {
    text-align: left;
  }
}

.main-nav .nav-link:hover,
.main-nav .nav-link:focus {
  background-color: rgba(0,0,0,0.05);
  color: rgba(0,0,0,0.9);
  text-decoration: none;
}

.main-nav .nav-current {
  display: block;
  color: white;
  padding: 0.8em 1.2em;
  font-weight: bold;
  background-color: rgba(38,137,13,1);
  text-align: center;
  cursor: default;
}

@media (min-width: 48em) {
  .main-nav .nav-current {
    text-align: left;
  }
}

/* Dropdown menu styles */
.main-nav .nav-item {
  position: relative;
}

.main-nav .dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background-color: white;
  border: 1px solid rgba(0,0,0,0.2);
  box-shadow: 0 4px 6px rgba(0,0,0,0.1);
  list-style: none;
  margin: 0;
  padding: 0;
  min-width: 200px;
  z-index: 1000;
}

.main-nav .nav-item:hover .dropdown-menu,
.main-nav .nav-item:focus-within .dropdown-menu {
  display: block;
}

.main-nav .dropdown-menu .nav-link {
  padding: 0.8em 1.2em;
  border-bottom: 1px solid rgba(0,0,0,0.1);
  white-space: nowrap;
}

.main-nav .dropdown-menu .nav-link:last-child {
  border-bottom: none;
}

.main-nav .dropdown-menu .nav-current {
  padding: 0.8em 1.2em;
  border-bottom: 1px solid rgba(0,0,0,0.1);
  white-space: nowrap;
}

.main-nav .dropdown-menu .nav-current:last-child {
  border-bottom: none;
}

.main-nav .has-dropdown > .nav-link::after,
.main-nav .has-dropdown > .nav-current::after {
  content: " ▾";
  font-size: 0.8em;
}

@media (max-width: 48em) {
  .main-nav .dropdown-menu {
    position: static;
    box-shadow: none;
    border: none;
    border-left: 3px solid rgba(38,137,13,0.3);
    margin-left: 1em;
    min-width: 0;
  }

  .main-nav .nav-item:hover .dropdown-menu,
  .main-nav .nav-item:focus-within .dropdown-menu {
    display: block;
  }

  .main-nav .dropdown-menu .nav-link {
    padding: 0.6em 1em;
    font-size: 0.95em;
  }

  .main-nav .dropdown-menu .nav-current {
    padding: 0.6em 1em;
    font-size: 0.95em;
  }
}

/* Page heading styles */
h1 {
  text-align: center;
  margin: 1.5em 0 1em 0;
  font-size: 2em;
  font-weight: bold;
  color: rgba(0,0,0,0.87);
}

@media (max-width: 48em) {
  h1 {
    font-size: 1.8em;
    margin: 1em 0 0.8em 0;
  }
}
