/* Account - default heading all pages */
#html-body.account {
  #maincontent.page-main .page-title-wrapper {
    font-family: "Roboto Condensed", Arial;
    font-size: 28px;
    font-style: normal;
    font-weight: 600;
    line-height: 118%;
    text-decoration: none;
    margin-bottom: 32px;
    display: block;
    color: var(--earth-dark);
  }

  .column.main {
    padding: 24px 16px;
  }

  .modal-inner-wrap .delivery-comment {
    font-family: var(--roboto);
    font-size: 16px;
    font-style: normal;
    font-weight: 600;
    line-height: 130%;
    margin-bottom: 4px;
  }

  .modal-inner-wrap .delivery_round_outer {
    display: flex;
    flex-direction: column;
    gap: 24px;
    margin-bottom: 24px;
  }

  @media (min-width: 1025px) {
    #maincontent.page-main .page-title-wrapper {
      font-size: 44px;
    }

    .column.main {
      padding: 0;
    }
  }
}

/* Account - layout and navigation */
#html-body.account.page-layout-2columns-left {
  #maincontent {
    padding: 0;
    width: 100%;
  }

  a.trigger::after {
    display: block;
  }

  .logout a::before {
    display: block;
  }

  .columns {
    display: flex;
  }

  .sidebar-main,
  .sidebar-additional {
    order: 1;
    padding: 0;
  }

  .column.main {
    order: 2;
  }

  #maincontent .block-collapsible-nav-title {
    border: none;
    transition: background 0.2s ease;
    display: flex;
    gap: 8px;
    align-items: center;
  }

  #maincontent .block-collapsible-nav-title::after {
    display: block;
    content: '';
    background-image: url(../images/gs-arrow-down.svg);
    background-repeat: no-repeat;
    background-size: contain;
    height: 24px;
    width: 24px;
    transition: transform 0.2s ease;
  }

  #maincontent .block-collapsible-nav-title.active::after {
    transform: rotate(-180deg);
  }

  .fieldset > .field, 
  .fieldset > .fields > .field {
    margin: 0;
  }

  @media (min-width: 1025px) {
    .sidebar-main,
    .sidebar-additional {
      width: 24%;
    }

    .column.main {
      width: 72%;
    }

    #maincontent {
      padding: 48px 16px;
    }

    .columns {
      display: block;
    }

    #maincontent .block-collapsible-nav-title {
      display: none;
    }
  }
}

/* Account - overview */
#html-body.customer-account-index {
  .addons-slider-container {
    max-width: calc(100vw - 16px - 16px);
  }

  .addons-slider-container .col-addon-button {
    margin-top: 16px;
  }

  .addons-slider-container .button-small {
    width: 100%;
  }

  .dashboard-subscription-info .gs-info-box {
    padding: 16px;
    max-width: none;
  }

  .gs-info-box-container .gs-info-button,
  .gs-info-box-container .gs-info-button a {
    width: 100%;
  }

  @media (min-width: 1025px) {
    .gs-info-box-container .gs-info-button,
    .gs-info-box-container .gs-info-button a {
      width: fit-content;
    }
  }
}

/* Account - STL settings */
#html-body.subscription-customer-settings {
  .subscription_status_box .delivery_round_outer {
    background: var(--purple-light);
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
  }

  .subscription-status-box {
    display: flex;
    align-items: center;
    gap: 8px;
  }

  .subscription-status-box::before {
    content: '';
    display: inline-block;
    background-image: url(../images/info_icon_purple.svg);
    height: 24px;
    width: 24px;
    flex-shrink: 0;
  }

  #subscription_settings,
  .subscription-pointsbundle-productlist-customersection {
    margin-bottom: 32px;
  }

  .activate_confirmation_show .modal-footer {
    flex-wrap: wrap;
  }

  .activate-actionbar.actions-toolbar a {
    width: 100%;
    margin-top: 16px;
  }

  @media (min-width: 1025px) {
    #subscription_settings,
    .subscription-pointsbundle-productlist-customersection {
      margin-bottom: 64px;
    }

    .activate-actionbar.actions-toolbar {
      display: flex;
      justify-content: flex-end;
    }
    
    .activate-actionbar.actions-toolbar a {
      width: fit-content;
      margin-top: 0;
    }
  }
}

/* Account - addons  */
#html-body.subscription-customer-addons {
  .addon_product {
    padding: 0;
  }

  .subscription-addon-heading {
    margin-bottom: 16px;
  }

  .subscription-addon-list {
    display: flex;
    flex-direction: column;
    gap: 8px;

    .field.choice {
      margin: 0;
    }

    .field_inner_addons {
      display: flex;
      padding: 16px;
      gap: 16px;
      position: relative;
      background: var(--white);
      border: none;
      width: 100%;
    }

    .gs-addon-image {
      height: 95px;
      width: 95px;
      flex-shrink: 0;
    }

    .subscription-addon-details {
      width: 100%;
    }


    .subscription-addon-weight {
      font-weight: 400;
      margin: 4px 0;
    }

    .subscription-addon-controls {
      display: flex;
      justify-content: space-between;
      align-items: center;
    }

    .addon-delivery-notice {
      position: absolute;
      right: 48px;
      top: 16px; 
      color: var(--purple);

      > * {
        color: inherit;
      }
    }

    .product_content_icon {
      position: absolute;
      top: 16px;
      right: 16px;
    }

    .product_content_icon::after {
      height: 24px;
      width: 24px;
      display: block;
      content: "";
      background: url('../images/info-outline.svg') no-repeat; 
      background-size: contain;
      cursor: pointer;
    }

    .control {
      width: 100%;

      input {
        height: 35px !important;
        width: 35px !important;
      }
    }

    .control .productQty {
      margin-right: 4px;
    }
  }

  .gs_layered_nav {
    min-width: 155px;
    height: 40px;
    font-size: 16px;
    border-color: var(--sand);
    padding: 0 0 0 10px;
  }

  .addon_bottom .primary {
    text-decoration: underline;
    color: var(--green-light);
    text-align: center;
    margin-top: 32px;
  }
}

/* ADDONS */
#html-body {
  .addon-cards-grid {
    display: grid;
    gap: 16px;
    grid-auto-rows: auto;
    grid-template-columns: 1fr 1fr;
  }

  .col-addon-item {
    padding: 8px;
    background: #fff;
    display: flex;
    flex-direction: column;
    gap: 16px;
    height: 100%;
  }

  .col-addon-image {
    position: relative;

    img {
      height: 100%;
      width: 100%;
      object-fit: cover;
    }
  }

  .icon-button {
    position: absolute;
    top: 0;
    bottom: 0;
    right: 0;
    left: 0;
    cursor: pointer;
    display: flex;
    align-items: flex-end;
    justify-content: flex-end;

    .popup_addtocart {
      position: absolute;
      inset: 0;
      width: 100%;
      height: 100%;
      opacity: 0;      
      cursor: pointer;    
      z-index: 2;         
    }

    .gs-icon-box {
      i.gs-icon-info:before {
        content: '';
        width: 24px;
        height: 24px;
        background: url(../images/info_line_icon.svg) no-repeat;
        display: block;
        margin: 8px;
      }
    }

    .gs-info-content {
      text-decoration: underline;
      font-size: 16px;
      font-family: var(--roboto);
      height: 20px;
    }
  }

  .col-addon-item {
    padding: 8px;
    background: #fff;
    display: flex;
    flex-direction: column;
    gap: 16px;
    height: 100%;
  }

  .col-addon-image,
  .gs-bundle-modal-popup .bundle-option-image {
    position: relative;
    aspect-ratio: 1 / 1;

    img,
    .gs-bundle-modal-popup .bundle-option-image img {
      height: 100%;
      width: 100%;
      object-fit: cover;
    }
  }

  .col-addon-details {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
  }

  .col-addon-content {
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    flex-grow: 1;
  }

  .col-addon-item .col-addon-content {
    .col-addon-title {
      color: #4A4235;
      font-family: "Roboto Condensed", Arial;
      font-size: 18px;
      font-style: normal;
      font-weight: 600;
      line-height: 130%;
      margin-bottom: 4px;
    }

    .col-addon-description {
      display: none;
    }

    .col-addon-weight {
      color: #4A4235;
      font-family: "Roboto Condensed", Arial;
      font-size: 18px;
      font-style: normal;
      font-weight: 400;
      line-height: 130%;
      margin-bottom: 4px;
    }

    .col-addon-price {
      color: #4A4235;
      font-family: "Roboto Condensed", Arial;
      font-size: 18px;
      font-style: normal;
      font-weight: 600;
      line-height: 130%;
      display: flex;
      flex-direction: row;
      justify-content: space-between;
      align-items: end;
      gap: 16px;
    }

    .price_per_weight {
      color: var(--gray-dark);
      font-family: var(--roboto);
      font-size: 14px;
      font-style: normal;
      font-weight: 400;
      line-height: 130%;
    }

    .col-addon-button button {
      width: 100%;
      white-space: nowrap;
      word-break: keep-all;
    }
  }

  .control .productQty {
    margin-right: 4px;
  }

  .col-addon-control {
    display: flex;
    flex-direction: column;
    gap: 16px;
    flex-grow: 1;
    justify-content: flex-end;

    button,
    input {
      &.add-addon {
        width: 100%;
        padding: 8px;

        span {
          color: #fff;
          font-family: "Roboto Condensed", Arial;
          font-size: 18px;
          font-style: normal;
          font-weight: 600;
          line-height: 130%;
          letter-spacing: 0.36px;
        }
      }

      &.add-addon.proxy-addon-btn {
        padding: 16px 32px;
      }

      &.add_to_cart_btn {
        width: 100%;
        padding: 8px;
        color: #fff;
        font-family: "Roboto Condensed", Arial;
        font-size: 18px;
        font-style: normal;
        font-weight: 600;
        line-height: 130%;
        letter-spacing: 0.36px;
        border: unset;
        height: unset;
        background: var(--green-light);
      }
    }

    .stock.unavailable {
      span {
        padding: 8px 0;
        letter-spacing: 0.36px;
        font-weight: 600;
        font-size: 18px;
        display: block;
      }
    }
  }

  .gs-product-add-popup .col-addon-control .add_to_cart_btn {
    padding: 16px;
  }

  &.subscription-customer-addons {
    .tooltip-container {
      position: absolute;
      top: -8px;
      right: 0;
    }

    .info-icon {
      opacity: 0;
      height: 50px;
      width: 50px;
    }

    .tooltip {
      min-width: unset;
      border-color: var(--purple);
    }

    .tooltip-arrow {
      right: 20px;
      border-color: var(--purple);
    }
  }

  @media (min-width: 770px) {
    .addon-cards-grid {
      grid-template-columns: 1fr 1fr;
    }

    .col-addon-item {
      padding: 16px;
    }
  }

  @media (min-width: 1025px) {
    .addon-cards-grid {
      grid-template-columns: 1fr 1fr 1fr 1fr;
    }

    &.subscription-customer-addons {
      .tooltip-container {
        right: 16px
      }

      .tooltip-arrow {
        right: 14px;
      }
    }
  }
}

/* Product info popup with ATC-functionality */
#html-body #maincontent .addon-card .col-addon-item {
  .col-addon-qty {
    display: none;
  }

  .col-addon-interval {
    display: none;
  }
}

#html-body {
  .gs-product-add-popup,
  .gs-bundle-modal-popup {
    .modal-content {
      margin: 0;
    }

    .action-close {
      padding: 0;
    }

    .col-addon-item {
      padding: 0;;
    }

    .icon-button {
      display: none;
    }

    .gs-bundle-modal .col-addon-item,
    #gs-addon-modal .gs-addons-root,
    #gs-addon-modal .addon-card {
      max-width: 100%;
      overflow-wrap: break-word;
      word-break: break-word;
    }

    .col-addon-item .col-addon-content .col-addon-title{
      font-size: 28px;
      font-weight: 600;
      line-height: 118%;
    }

    .col-addon-item .col-addon-content .col-addon-weight {
      font-weight: 600;
    }

    .col-addon-item .col-addon-content .col-addon-description {
      display: block;
      margin-top: 4px;
      margin-bottom: 16px;

      p {
        margin: 0;
      }
    }

    .col-addon-item .col-addon-content .col-addon-description,
    .col-addon-item .col-addon-content .col-addon-description > * {
      font-family: "Roboto Condensed";
      font-size: 18px;
      font-style: normal;
      font-weight: 400;
      line-height: 140%;
      text-decoration: none;
      letter-spacing: 0.36px;
    }

    .col-addon-item .col-addon-content .col-addon-price {
      font-size: 24px;
    }

    .col-addon-weight {
      min-height: 0;
    }

    .col-addon-qty {
      display: flex;
    }

    .col-addon-price-wrapper {
      display: flex;
      align-items: center;
      justify-content: space-between;
    }

    .col-addon-qty.gs-qty-control .control {
      display: flex;
      align-items: center;
      gap: 8px;
      width: unset;

      input {
        height: 35px;
        width: 35px;
        flex-shrink: 0;
      }
    }

    .col-addon-interval {
      display: block;

      label {
        font-size: 16px;
        font-weight: 400;
        font-family: var(--georgia);
        letter-spacing: normal;

        &::before {
          margin-right: 4px;
        }
      }
    }

    @media (min-width: 770px) {
      .col-addon-item {
        display: grid;
        grid-template-columns: minmax(0, 1fr) 1fr;
        gap: 24px;
      }

      .col-addon-button input {
        padding: 15px;
      }

      .col-addon-item .col-addon-content .col-addon-title,
      .modal-content .bundle-option-box .bundle-option-title {
        font-size: 44px;
        margin-right: 24px;
      }

      .modal-content .bundle-option-card .bundle-item-weight span {
        color: #4A4235;
        font-family: "Roboto Condensed", Arial;
        font-size: 18px;
        font-style: normal;
        font-weight: 600;
        line-height: 130%;
        margin-bottom: 4px;
      }

      .col-addon-item .col-addon-content .col-addon-description,
      .col-addon-item .col-addon-content .col-addon-description > * {
        font-size: 22px;
        letter-spacing: 0.44px;
      }

      .col-addon-item .col-addon-content .col-addon-price {
        font-size: 28px;
      }
    }
  }
}

/* Account - order history */
#html-body .order-history {
  display: flex;
  flex-direction: column;
  gap: 16px;

  .order-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 8px 0;
    border-bottom: 1px solid var(--gray);
  }

  .order-item-link {
    display: flex;
    justify-content: space-between;
    align-items: center;
  }


  .order-link {
    color: var(--green-light);
    display: flex;
    align-items: center;
    gap: 4px;
  }

  .order-link::after {
    background-image: url(../images/arrow-right-green.svg);
    display: block;
    content: '';
    height: 24px;
    width: 24px;
  }
}

/* Account - order history item */
#html-body.sales-order-view {
  .column.main {
    background: var(--white);  
    padding: 16px;
    margin: 16px;
    font-family: var(--georgia);
  }

  .order_outer {
    display: flex;
    flex-direction: column-reverse;
    text-transform: capitalize;
  }

  .order-status,
  .order-date {
    text-transform: inherit;

    /* include .preamble() */
    font-family: "Roboto Condensed";
    font-size: 18px;
    font-style: normal;
    font-weight: 400;
    line-height: 140%;
    text-decoration: none;
    letter-spacing: 0.36px;

    @media (min-width: 1025px) {
      font-size: 22px;
    }
  }

  .page-title-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
  }

  .page-title-wrapper::before,
  .page-title-wrapper::after {
    display: none;
  }

  .order-actions-toolbar {
    margin: 0;
  }

  .action.print {
    color: var(--green-light);

    /* include .button-text() */
    font-family: "Roboto Condensed", Arial;
    font-size: 18px;
    font-style: normal;
    font-weight: 600;
    line-height: 130%;
    letter-spacing: 0.36px;
    text-decoration-line: none;
  }

  .items.order-links {
    margin-top: 32px;

    .item {
      margin-bottom: 16px;
      float: unset;

      /* include .h3() */
      font-family: "Roboto Condensed", Arial;
      font-size: 24px;
      font-style: normal;
      font-weight: 600;
      line-height: 130%;
      text-decoration: none;

      @media (min-width: 1025px) {
        font-size: 28px;
      }
    }
  }

  .order-details-items {
    border: none;
    padding: 0;
    margin: 0;
  }

  .table-wrapper {
    border: none;
  }

  .block-title {
    border: none;
    text-transform: capitalize;
  }

  .table-order-items th {
    text-transform: capitalize;
    font-weight: 600;
    font-size: 18px;
    padding: 4px 0;
  }

  .table-order-items td {
    background: var(--white);
    padding: 4px 0;
  }

  
  .table-order-items .grand_total {
    display: none;
  }

  .item-options-container::before {
    display: none;
  }

  .order-title {
    display: none;
  }

  .block-title {
    padding: 0;
    margin-bottom: 16px;
  }

  .box-title span {
    text-transform: capitalize;
    font-weight: 600;
    margin-bottom: 8px;
    display: block;
  }

  .col.qty {
    text-align: right;
  }

  .item-options-container .col.weight {
    text-align: right;
  }

  tfoot .amount {
    text-align: right;
  }

  .item-parent .col.qty {
    text-align: left;
  }

  @media (min-width: 639px) {
    .item-parent .col.qty {
      text-align: right;
    }
  }

  @media (min-width: 1025px) {
    .items.order-links {
      margin-top: 64px;
    }
  }
}

/* Account - edit contact information */
#html-body.customer-account-edit {
  .gs-customer-account-edit {
    display: grid;
    gap: 48px;
  }

  .box-actions {
    margin: 16px 0;
  }

  .box-actions .actions {
    display: flex;
    justify-content: flex-end;
  }

  .box-actions.paused {
    background: var(--purple-light);
    color: var(--purple);
    padding: 24px;

    .reactivate-heading {
      display: flex;
      align-items: center;
      gap: 8px;
      margin-bottom: 4px;
    }

    .reactivate-heading::before {
      content: '';
      display: inline-block;
      background-image: url(../images/info_icon_purple.svg);
      height: 24px;
      width: 24px;
      flex-shrink: 0;
    }
  }

  .block-dashboard-info.active {
    order: 4;
  }

  .modal-inner-wrap {
    overflow: visible;
  }

  .field.choice {
    border: none;
    padding: 8px 0;
  }

  input + label::before {
    transition: all 0.2s ease;
  }

  input + label::after {
    display: block;
  }

  fieldset {
    display: flex;
    flex-direction: column;
    gap: 16px;
  }

  .actions-toolbar {
    display: flex;
    justify-content: flex-end;
  }

  .field-name-firstname,
  .field-name-lastname {
    margin-bottom: 0;
  }

  .form-edit-account {
    display: flex;
    flex-direction: column;
    gap: 16px;
  }

  .form-address-edit {
    display: flex;
    flex-direction: column;
    gap: 32px;
  }

  .edit-postcode {
    display: flex;
    gap: 16px;
  }

  .pay-methods-wrapper {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin: 16px 0;
  }

  .form-edit-account button.save {
    width: fit-content;
  }

  .stripe-payments-card-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
  }

  #change-payment-block .address {
    padding: 0;
  }

  #change-payment-block .invoice-message {
    color: var(--purple-light);
    background: var(--purple-light);
    border: none;
    padding: 24px;

    .invoice-message-heading {
      display: flex;
      align-items: center;
      gap: 8px;
      margin-bottom: 8px;
    }

    .invoice-message-heading::before {
      content: '';
      display: inline-block;
      background-image: url(../images/info_icon_purple.svg);
      height: 24px;
      width: 24px;
      flex-shrink: 0;
    }
  }

  .saved-payment-method-name {
    display: flex;
    align-items: center;
    gap: 8px;
  }

  .block-dashboard-info .actions,
  #invoice-actionbar {
    margin-top: 24px;
  }

  @media (min-width: 1025px) {
    fieldset {
      display: grid;
      grid-template-columns: 1fr 1fr;
      width: 100%;
      gap: 16px;
    }    

    input:hover + label::before {
      -webkit-box-shadow:inset 0px 0px 0px 2px var(--green-light);
      -moz-box-shadow:inset 0px 0px 0px 2px var(--green-light);
      box-shadow:inset 0px 0px 0px 2px var(--green-light);
    }

    .legend.h3 {
      grid-column: span 2;
    }

    .edit-postcode {
      flex-direction: column;
    }
  }
}
