:root {
    --pcolor: #2a79c9;
    --p2color: #e8f2fa;
    --ccolor: #ff9900;
    --c2color: #E5384E;
    --ncolor: #6c757d;
    --n2color: #444444;
}

body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
    line-height: 1.6rem;
    font-size: 18px;
}

h1 {
    line-height: 2.5rem;
    font-size: 2rem;
    margin: 0;
}

main {
    max-width: 1150px;
    margin: 0 auto;
    padding: 20px;
}

.container {
    max-width: 1150px;
    box-sizing: border-box;
    width: 100%;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Navbar */
.navbar {
    background-color: var(--pcolor);
    color: #fff;
    padding: 20px 0px;
}

.navbar .logo a {
    color: #fff;
    text-decoration: none;
    font-size: 1.2em;
}

.navbar .menu {
    list-style: none;
    display: flex;
    gap: 15px;
    margin: 0;
    padding: 0;
}

.navbar .menu li a {
    color: #fff;
    text-decoration: none;
}

.logo-img {
    height: 40px;
    width: auto;
}

.footer {
    background-color: #f1f1f1;
    padding: 20px;
    font-size: 1rem;
}

.footer p {
    margin: 0px;
    line-height: 1.8rem;
}

.footer a {
    color: var(--ncolor);
}

.footer h4 {
    margin: 0px;
    font-weight: bold;
}

.footer-container {
    max-width: 1150px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 25% 50% 25%;
    gap: 20px;
    align-items: start;
    padding: 0 20px;
}

.footer-left,
.footer-middle,
.footer-right {
    color: var(--ncolor);
}

.footer-left .logo a {
    display: block;
    margin-bottom: 10px;
}

.footer-left p {
    margin: 0;
}

.footer-right ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-right ul li {
    line-height: 1.8rem;
}

.footer-right ul li a {
    text-decoration: none;
}

@media (max-width: 867px) {
    .footer-container {
        grid-template-columns: 1fr;
        text-align: center;
    }
}

.meta-row {
    display: flex;
    align-items: center;
    gap: 5px;
    border-top 1px solid #d1d5db;
    border-bottom 1px solid #d1d5db;
    border-radius: 6px;
    padding: 8px 0px;
    font-size: 0.8em;
    color: #6c757d;
    flex-wrap: wrap;
}

.meta-row svg {
    flex-shrink: 0;
}

.disclaimer-box {
    background-color: #f8f9fa;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 0.8em;
    color: #6c757d;
    display: inline-block;
    margin-bottom: 20px;
}

.product-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}

.product-link {
  display: block;
  text-decoration: none;
  color: inherit;
  width: 100%;
}

.product-item {
    border: 1px solid #eee;
    border-radius: 6px;
    margin-bottom: 15px;
    position: relative;
    display: flex;
    max-height: 205px;
    padding: 10px;
}

.product-ribbon {
    position: absolute;
    top: -15px;
    left: -1px;
    background-color: var(--pcolor);
    color: #fff;
    font-size: 0.75em;
    font-weight: bold;
    padding: 2px 10px;
    border-radius: 3px 3px 3px 0px;
    z-index: 3;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.product-ribbon i {
    margin-right: 5px;
}

.product-ribbon.cheapest {
  background-color: var(--ccolor);
}

.product-ribbon.highest-discount {
  background-color: var(--c2color);
}

.product-rank {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 2;
    background-color: #fff;
    border: 2px solid var(--pcolor);
    border-radius: 50%;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9em;
    font-weight: bold;
    color: var(--pcolor);
}

.product-image {
    flex: 0 0 25%;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 5px;
}

.product-image img {
    max-height: 200px;
    height: auto;
    width: auto;
}

.product-info {
    flex: 0 0 35%;
}

.product-title {
    color: var(--n2color);
    font-weight: 600;
}

.product-brand {
    color: var(--ncolor);
    text-transform: uppercase;
    margin-top: 5px;
}

.product-rating {
    flex: 0 0 15%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--p2color);
    border-radius: 6px;
}

.rating-number {
    font-size: 2.5rem;
    font-weight: bold;
    color: var(--pcolor);
    margin-top: 5px;
    margin-bottom: 10px;
}

.rating-label {
    color: var(--n2color);
    font-weight: 600;
    font-size: 0.9rem;
}

.rating-stars i {
  color: #f5c518;
  font-size: 1.1rem;
  margin: -2px;
}

.product-cta {
    flex: 0 0 25%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.amazon-logo {
    width: 100px;
    margin-bottom: 10px;
}

.cta-button {
    background-color: var(--ccolor);
    color: #fff;
    text-decoration: none;
    padding: 10px 20px;
    border-radius: 6px;
    font-weight: bold;
}

.label {
    display: inline-block;
    border: 1px solid;
    line-height: 1rem;
    font-size: 0.8em;
    border-radius: 5px;
    padding: 3px 7px;
    margin-top: 5px;
}

.discount {
    background-color: var(--c2color);
    color: white;
    border-color: var(--c2color);
}

.prime {
    color: var(--pcolor);
    border-color: var(--pcolor);
    margin-left: 5px;
}

.product-description-container {
    margin-top: 10px;
    width: 100%;
}

.toggle-description {
    background: none;
    border: none;
    color: var(--pcolor);
    cursor: pointer;
    font-size: 0.9em;
    display: flex;
    align-items: center;
    gap: 5px;
    margin-top: 5px;
    padding: 0;
}

.toggle-description .arrow {
    transition: transform 0.3s ease;
}

.toggle-description.open .arrow {
    transform: rotate(180deg);
}

.product-description {
    overflow: hidden;
    transition: max-height 0.3s ease;
    font-size: 0.85em;
    color: var(--ncolor);
}

@media (max-width: 867px) {
  .product-item {
    flex-direction: row;
    flex-wrap: wrap;
    max-height: none;
  }

  .product-rank{
    top: 125px;
  }

  .product-image {
    flex: 0 0 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 10px 0;
  }

  .product-info {
    flex: 0 0 100%;
    padding: 10px 0;
  }

  .product-rating {
    position: absolute;
    right: 0px;
    top: 0px;
    border-top-left-radius: 0px;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 10px;
    margin: 0px;
  }

  .rating-number {
    font-size: 2rem;
  }

  .product-cta {
    flex: 0 0 100%;
    border-top: 1px solid #eee;
    margin-top: 20px;
    padding: 20px 0 0 0;
  }

  .product-image img {
    max-height: 200px;
    height: auto;
    width: auto;
  }
}