nav.woocommerce-breadcrumb {
  > a {
    padding-left: 0 !important;
  }

  a {
    font-size: 14px !important;
  }
}

.woocommerce-product-search {
  button[type="submit"] {
    background: #000;
    color: #fff;
    padding: 12px 16px;
    margin: 16px auto;
  }
}

/* -----  Product page ----- */

.product {
  margin-bottom: 32px;
  .woocommerce-breadcrumb {
    a {
      text-transform: uppercase;
      font-size: 11px !important;
    }

    a:first-of-type {
      padding-left: 0 !important;
    }
    text-transform: uppercase;
    font-size: 11px;
  }

  .woocommerce-product-gallery {
    position: relative;
    z-index: 1;
    .woocommerce-product-gallery__trigger {
      position: absolute;
      top: 12px;
      right: 12px;
      z-index: 10;
    }
  }

  .flex-control-nav {
    display: flex;
    gap: 4px;
    margin-top: 4px;
  }

  h4 {
    font-size: clamp(15px, 1.5vw, 17px);
    margin-bottom: 12px;
  }

  .input-text.qty.text {
    width: auto;
    min-width: 150px;
    align-self: flex-start;
  }

  .stock {
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: 0.1rem;
    font-weight: 600;
    margin-bottom: 8px;
    padding: 8px;
    border: 1px solid #555;
    display: inline-block;
    line-height: 1;
  }

  .quantity {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 16px;

    label {
      font-family: var(--font-serif);
      font-size: 11px;
      text-transform: uppercase;
      font-weight: 600;
      color: var(--color-softened-black);
      position: static !important;
      clip: auto !important;
      width: auto !important;
      height: auto !important;
      margin: 0 !important;
      padding: 0 !important;
      border: none !important;
      overflow: visible !important;
      white-space: normal !important;
    }
  }

  /* Star Rating and Review Count */
  .product-rating-summary {
    margin: 12px 0;

    .rating-link {
      display: flex;
      align-items: center;
      gap: 8px;
      text-decoration: none;
      transition: opacity 0.2s ease;

      &:hover {
        opacity: 0.7;
      }
    }

    .star-rating {
      position: relative;
      display: inline-block;
      width: 90px;
      height: 18px;
      font-size: 18px;
      line-height: 1;
      margin-right: 12px;

      &::before {
        content: "\2605\2605\2605\2605\2605";
        color: var(--color-rust-200);
        letter-spacing: 2px;
      }

      span {
        position: absolute;
        top: 0;
        left: 0;
        height: 100%;
        overflow: hidden;
        white-space: nowrap;

        &::before {
          content: "\2605\2605\2605\2605\2605";
          color: var(--color-rust-600);
          letter-spacing: 2px;
        }

        strong {
          position: absolute;
          width: 1px;
          height: 1px;
          margin: -1px;
          padding: 0;
          overflow: hidden;
          clip: rect(0, 0, 0, 0);
          border: 0;
        }
      }
    }

    .review-count {
      font-size: 13px;
      color: var(--color-softened-black);
      text-decoration: underline;
    }
  }

  .button {
    display: inline-block;
    padding: 8px 16px;
    border-radius: 4px;
    margin: 16px 0;
    transition: background-color 0.2s ease;
    cursor: pointer;
    &.single_add_to_cart_button {
      background: var(--color-rust-500);
      color: #fff;
      text-transform: uppercase;
      font-size: 13px;
      letter-spacing: 0.1rem;

      &:hover {
        background: var(--color-rust-700);
      }
    }
  }

  .product_meta {
    margin-top: 16px;
    font-size: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
  }
}

.product-description-section {
  h2 {
    font-size: clamp(12px, 1.5vw, 14px);
    text-transform: uppercase;
    letter-spacing: 0.05rem;
    margin-bottom: 16px;
    color: hsl(from var(--color-softened-black) h s l / 0.5);
  }

  h4 {
    font-size: clamp(15px, 1.5vw, 17px);
    margin-bottom: 12px;
  }
}

.product-reviews-section {
  border-top: 1px solid hsl(from var(--color-softened-black) h s l / 0.1);
}

.woocommerce-Reviews {
  h2 {
    font-size: clamp(14px, 1.75vw, 17px);
    margin-bottom: 16px;
  }
}

/* Star Rating Input for Reviews */
.comment-form-rating {
  margin-bottom: 20px;

  label {
    display: block;
    font-family: var(--font-serif);
    font-size: 11px;
    text-transform: uppercase;
    font-weight: 600;
    color: var(--color-softened-black);
    margin-bottom: 8px;
  }

  /* Hide WooCommerce's default star links */
  p.stars {
    display: none !important;
  }

  .star-rating-input {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
  }

  .star-button {
    background: none;
    border: none;
    font-size: 32px;
    color: var(--color-rust-200);
    cursor: pointer;
    padding: 0;
    line-height: 1;
    transition: all 0.2s ease;

    &:hover {
      transform: scale(1.15);
    }

    &.hover {
      color: var(--color-rust-400);
    }

    &.active {
      color: var(--color-rust-600);
    }
  }

  .rating-text {
    display: block;
    font-size: 13px;
    color: var(--color-rust-600);
    font-weight: 500;
    min-height: 20px;
  }
}

@media (width >= 1024px) {
  .woocommerce div.product {
    grid-template-columns: 1fr 1fr;
  }
  .product {
    .summary {
      padding: 0 36px;
    }
  }
}

@media (width >= 1440px) {
  .woocommerce div.product {
    grid-template-columns: 1.5fr 1fr;
  }
}

@media (width >= 1920px) {
  .woocommerce div.product {
    grid-template-columns: 2fr 1fr;
  }
}

/* -----  My Account Pages ----- */

.woocommerce-MyAccount-wrapper {
  display: grid;
  grid-template-columns: 1fr;
  gap: 32px;
  margin-bottom: 48px;
}

/* Navigation */
.woocommerce-MyAccount-navigation {
  margin-bottom: 24px;

  ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0;
    background: var(--color-soft-white);
    border: 1px solid var(--color-rust-100);
    border-radius: 8px;
    overflow: hidden;
  }

  li {
    margin: 0;
    border-bottom: 1px solid var(--color-rust-100);

    &:last-child {
      border-bottom: none;
    }

    &.is-active a {
      background: var(--color-rust-50);
      color: var(--color-rust-700);
      font-weight: 600;
      border-left: 3px solid var(--color-rust-600);
      padding-left: 21px;
    }
  }

  a {
    display: block;
    padding: 16px 24px;
    color: var(--color-softened-black);
    text-decoration: none;
    font-size: 15px;
    transition: all 0.2s ease;

    &:hover {
      background: var(--color-rust-50);
      color: var(--color-rust-700);
    }
  }
}

/* Content Area */
.woocommerce-MyAccount-content {
  background: var(--color-soft-white);
  border: 1px solid var(--color-rust-100);
  border-radius: 8px;
  padding: 32px;

  h2,
  h3 {
    font-family: var(--font-serif);
    color: var(--color-softened-black);
    margin-top: 0;
    margin-bottom: 16px;
  }

  h2 {
    font-size: clamp(20px, 2.5vw, 24px);
    font-weight: 600;
  }

  h3 {
    font-size: clamp(16px, 2vw, 18px);
    font-weight: 600;
  }

  p {
    line-height: 1.6;
    color: var(--color-softened-black);
    margin-bottom: 16px;
  }

  a {
    color: var(--color-rust-600);
    text-decoration: underline;
    transition: color 0.2s ease;

    &:hover {
      color: var(--color-rust-800);
    }
  }
  .woocommerce-orders-table {
    width: 100%;

    th,
    td {
      text-align: center;
      time {
        margin: 0 auto;
        display: block;
        text-align: center;
      }
    }

    th:first-of-type,
    td:first-of-type {
      text-align: left;
    }
    .woocommerce-orders-table__cell-order-actions,
    .woocommerce-orders-table__header-order-actions {
      text-align: right;
    }
    tbody {
      tr:nth-child(even) {
        background-color: rgba(0, 0, 0, 0.05);
      }

      th,
      td {
        padding: 16px 8px;
      }
    }
  }
}

/* Dashboard */
.woocommerce-MyAccount-dashboard {
  .dashboard-welcome {
    margin-bottom: 24px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--color-rust-100);

    h2 {
      margin-bottom: 8px;
    }

    .logout-link {
      font-size: 14px;
      color: var(--color-rust-600);
      margin-bottom: 0;
    }
  }

  .dashboard-description {
    p {
      font-size: 15px;
    }
  }
}

/* Forms */
.woocommerce-MyAccount-content {
  form {
    .form-row {
      margin-bottom: 20px;
    }

    label {
      display: block;
      font-family: var(--font-serif);
      font-size: 13px;
      text-transform: uppercase;
      font-weight: 600;
      color: var(--color-softened-black);
      margin-bottom: 8px;

      .required {
        color: var(--color-terracotta-600);
      }
    }

    input[type="text"],
    input[type="email"],
    input[type="password"],
    input[type="tel"],
    input[type="number"],
    select,
    textarea {
      width: 100%;
      padding: 12px 16px;
      border: 1px solid var(--color-rust-200);
      border-radius: 4px;
      font-size: 15px;
      font-family: var(--font-sans);
      color: var(--color-softened-black);
      background: var(--color-soft-white);
      transition: border-color 0.2s ease;

      &:focus {
        outline: none;
        border-color: var(--color-rust-600);
      }
    }

    button:not(.show-password-input),
    .button:not(.show-password-input) {
      display: inline-block;
      padding: 12px 24px;
      background: var(--color-rust-600);
      color: var(--color-soft-white);
      border: none;
      border-radius: 4px;
      font-size: 14px;
      font-weight: 600;
      text-transform: uppercase;
      letter-spacing: 0.05em;
      cursor: pointer;
      transition: background 0.2s ease;
      text-decoration: none;

      &:hover {
        background: var(--color-rust-700);
      }
    }

    button.show-password-input {
      width: 20px;
      height: 20px;
    }
  }
}

.products .button.product_type_variable.add_to_cart_button {
  font-size: 11px;
}

.wp-block-woocommerce-cart {
  max-width: 1400px;
  margin: 24px auto;
}

.woocommerce-checkout .container.mx-auto {
  margin: 24px auto;
}

/* ----- Checkout Page ----- */

.checkout-container {
  max-width: 1152px;
  margin-left: auto;
  margin-right: auto;
}

.woocommerce-checkout {
  .wc-block-components-radio-control__input,
  .wc-block-components-checkbox__input {
    padding: 0 !important;
  }
}

/* Order Received Page */
.woocommerce-order-received,
.woocommerce-account,
.woocommerce-view-order {
  h2 {
    font-size: clamp(15px, 2vw, 20px);
    margin-bottom: 16px;
  }

  .woocommerce-order {
    max-width: 900px;
    margin: 0 auto;
  }

  .woocommerce-thankyou-order-details {
    margin: 24px 0;
    padding-bottom: 24px;
    border-bottom: 1px solid hsl(from var(--color-softened-black) h s calc(l + 70));
  }

  .woocommerce-order-details {
    margin: 24px 0;

    table {
      width: 100%;
      th:first-of-type {
        text-align: left;
      }

      tbody tr td {
        padding: 12px 0;
      }

      th:last-of-type,
      .product-total,
      .amount,
      tfoot {
        text-align: right;
      }
      tfoot {
        border-top: 1px solid hsl(from var(--color-softened-black) h s calc(l + 70));
        th:first-of-type,
        td:first-of-type {
          padding-top: 16px;
        }
      }
    }
  }

  .woocommerce-customer-details {
    border-top: 1px solid hsl(from var(--color-softened-black) h s calc(l + 70));
    padding-top: 48px;
    margin-top: 48px;

    .woocommerce-columns {
      display: flex;
      flex-direction: column;
      gap: 24px;
    }
  }
}

.woocommerce-notice {
  padding: 8px 12px;
  border-radius: 4px;
  margin: 0 0 24px 0;
  font-weight: 700;
  &.woocommerce-notice--success {
    background-color: #c4d1ae;
    border: 2px solid hsl(from #a3b1a3 h calc(s + 20) calc(l + 10));
    color: hsl(from #a3b18a h calc(s + 10) calc(l - 40));
  }

  &.woocommerce-thankyou-order-received {
  }
}

/* Responsive Layout */
@media (width >= 768px) {
  .woocommerce-MyAccount-wrapper {
    grid-template-columns: 280px 1fr;
  }

  .woocommerce-MyAccount-navigation {
    margin-bottom: 0;
  }

  .woocommerce-order-received {
    .woocommerce-customer-details {
      .woocommerce-columns {
        flex-direction: row;
        justify-content: space-between;
        .woocommerce-column {
          flex: 1 1 50%;
        }
      }
    }
  }
}

@media (width >= 1024px) {
  .woocommerce-MyAccount-wrapper {
    grid-template-columns: 320px 1fr;
  }
}
